From c4c97163728b7cf277f18c58ad72539a5fc4a0ed Mon Sep 17 00:00:00 2001 From: Atlas-Software Librarian <Atlas-Software.Librarian@cern.ch> Date: Fri, 8 Apr 2016 16:19:05 +0200 Subject: [PATCH] 'CMakeLists.txt' (TileConditions-00-09-51) * Tagging TileConditions-00-09-51. * src/TileOptFilterWeights.cxx (loadWeights): Fix coverity warning: dead code. 2016-03-15 Siarhei Harkusha <Siarhei.Harkusha@cern.ch> * python/TileCondToolConf.py: modified function getTileCondToolOfcCool to avoid to return tool for OF1 OFC if they are not available in DB * python/TileInfoConfigurator.py: modified function setupCOOLOFC to return status if the corresponding tool is configured successfully * Tagging TileConditions-00-09-50 2016-03-14 Siarhei Harkusha <Siarhei.Harkusha@cern.ch> * python/TileInfoConfigurator.py: modified function setupCOOLOFC to return OFC for OF1 and OF2 methods; removed setupCOOLOFCOF1 * python/TileCondToolConf.py: modified getTileCondToolTiming to add possibility to return online timing in offline also * python/TileCoolMgr.py: added new sources for online timing in order to get online timing in offline also * Tagging TileConditions-00-09-49 2016-03-12 Siarhei Harkusha <Siarhei.Harkusha@cern.ch> ... (Long ChangeLog diff - truncated) --- TileCalorimeter/TileConditions/CMakeLists.txt | 61 +++++++++ .../TileConditions/TileCondToolNoiseSample.h | 6 + .../TileConditions/TileCondToolOfcCool.h | 2 +- .../TileConditions/python/TileCondToolConf.py | 28 ++-- .../TileConditions/python/TileCoolMgr.py | 8 +- .../python/TileInfoConfigurator.py | 128 ++++++++++++++++-- .../share/TileConditions_jobOptions.py | 28 ++-- .../src/TileCondToolNoiseSample.cxx | 25 ++++ .../src/TileCondToolOfcCool.cxx | 11 +- .../src/TileOptFilterWeights.cxx | 2 +- 10 files changed, 261 insertions(+), 38 deletions(-) create mode 100644 TileCalorimeter/TileConditions/CMakeLists.txt diff --git a/TileCalorimeter/TileConditions/CMakeLists.txt b/TileCalorimeter/TileConditions/CMakeLists.txt new file mode 100644 index 00000000000..971ca88dd11 --- /dev/null +++ b/TileCalorimeter/TileConditions/CMakeLists.txt @@ -0,0 +1,61 @@ +################################################################################ +# Package: TileConditions +################################################################################ + +# Declare the package name: +atlas_subdir( TileConditions ) + +# Declare the package's dependencies: +atlas_depends_on_subdirs( PUBLIC + Calorimeter/CaloConditions + Calorimeter/CaloIdentifier + Control/AthenaBaseComps + Control/AthenaKernel + Control/CLIDSvc + Control/SGTools + Control/StoreGate + Database/AthenaPOOL/AthenaPoolUtilities + DetectorDescription/Identifier + GaudiKernel + TileCalorimeter/TileCalib/TileCalibBlobObjs + TileCalorimeter/TileIdentifier + PRIVATE + Calorimeter/CaloDetDescr + DetectorDescription/GeoModel/GeoModelInterfaces + TileCalorimeter/TileDetDescr + Tools/PathResolver ) + +# External dependencies: +find_package( Boost COMPONENTS filesystem thread system ) +find_package( CLHEP ) +find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess ) +find_package( ROOT COMPONENTS Matrix Core Tree MathCore Hist RIO pthread MathMore Minuit Minuit2 Physics HistPainter Rint ) + +# tag NEEDS_CORAL_BASE was not recognized in automatic conversion in cmt2cmake + +# Component(s) in the package: +atlas_add_library( TileConditionsLib + src/Tile*.cxx + PUBLIC_HEADERS TileConditions + INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} + PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} + DEFINITIONS ${CLHEP_DEFINITIONS} + LINK_LIBRARIES ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} CaloConditions CaloIdentifier AthenaBaseComps AthenaKernel SGTools AthenaPoolUtilities Identifier GaudiKernel TileCalibBlobObjs TileIdentifier StoreGateLib SGtests CaloDetDescrLib + PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} TileDetDescr PathResolver ) + +atlas_add_component( TileConditions + src/components/*.cxx + INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} + LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} CaloConditions CaloIdentifier AthenaBaseComps AthenaKernel SGTools StoreGateLib SGtests AthenaPoolUtilities Identifier GaudiKernel TileCalibBlobObjs TileIdentifier CaloDetDescrLib TileDetDescr PathResolver TileConditionsLib ) + +atlas_add_dictionary( TileConditionsDict + TileConditions/TileConditionsDict.h + TileConditions/selection.xml + INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} + LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} CaloConditions CaloIdentifier AthenaBaseComps AthenaKernel SGTools StoreGateLib SGtests AthenaPoolUtilities Identifier GaudiKernel TileCalibBlobObjs TileIdentifier CaloDetDescrLib TileDetDescr PathResolver TileConditionsLib ) + +# Install files from the package: +atlas_install_python_modules( python/*.py ) +atlas_install_joboptions( share/*.py ) +atlas_install_runtime( share/*.txt share/Tile2003.* share/Tile2004.* share/TileDefault.* share/TileNo*.* share/dleak*.dat share/dsleak*.dat share/leak*.dat share/dpulse*.dat share/pulse*.dat share/noise*.dat share/ai_lo*.dat share/ai_hi*.dat share/bi_lo*.dat share/bi_hi*.dat share/ci_lo*.dat share/ci_hi*.dat share/DCS*.dat share/BadHVChannels.dat ) + diff --git a/TileCalorimeter/TileConditions/TileConditions/TileCondToolNoiseSample.h b/TileCalorimeter/TileConditions/TileConditions/TileCondToolNoiseSample.h index a8d071b6610..015e7e3baf9 100644 --- a/TileCalorimeter/TileConditions/TileConditions/TileCondToolNoiseSample.h +++ b/TileCalorimeter/TileConditions/TileConditions/TileCondToolNoiseSample.h @@ -53,6 +53,10 @@ class TileCondToolNoiseSample: public AthAlgTool // void getAutoCorr(unsigned int drawerIdx, unsigned int channel, unsigned int adc, // std::vector<float>& vec) const; + float getOnlinePedestalDifference(unsigned int drawerIdx, unsigned int channel, unsigned int adc, + TileRawChannelUnit::UNIT onlineUnit = TileRawChannelUnit::OnlineADCcounts) const; + + float getNoise(unsigned int drawerIdx, unsigned int channel, unsigned int adc, TileRawChannelUnit::UNIT unit = TileRawChannelUnit::ADCcounts) const { return getHfn(drawerIdx, channel, adc, unit); @@ -65,7 +69,9 @@ class TileCondToolNoiseSample: public AthAlgTool //=== TileCondProxies ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_pryNoiseSample; + ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_pryOnlineNoiseSample; // ToolHandle<ITileCondProxy<TileCalibDrawerFlt> > m_pryNoiseAutoCr; + bool m_useOnlineNoise; }; #endif diff --git a/TileCalorimeter/TileConditions/TileConditions/TileCondToolOfcCool.h b/TileCalorimeter/TileConditions/TileConditions/TileCondToolOfcCool.h index 1f697b616ff..151ba2327cc 100644 --- a/TileCalorimeter/TileConditions/TileConditions/TileCondToolOfcCool.h +++ b/TileCalorimeter/TileConditions/TileConditions/TileCondToolOfcCool.h @@ -61,7 +61,7 @@ class TileCondToolOfcCool: public AthAlgTool, public ITileCondToolOfc { int m_Phamin; int m_Phamax; int m_NSamples; - + bool m_first = true; }; #endif diff --git a/TileCalorimeter/TileConditions/python/TileCondToolConf.py b/TileCalorimeter/TileConditions/python/TileCondToolConf.py index 720153cdb2b..121a46c890e 100644 --- a/TileCalorimeter/TileConditions/python/TileCondToolConf.py +++ b/TileCalorimeter/TileConditions/python/TileCondToolConf.py @@ -212,7 +212,7 @@ def getTileCondToolMuID(source = 'FILE', name = 'TileCondToolMuID', **kwargs): # #____________________________________________________________________________ -def getTileCondToolTiming(source = 'FILE', runType = 'PHY', name = 'TileCondToolTiming', **kwargs): +def getTileCondToolTiming(source = 'FILE', runType = 'PHY', online = False, name = 'TileCondToolTiming', **kwargs): if not runType in validRunTypes: raise(Exception("Invalid run type %s"%runType)) @@ -221,18 +221,20 @@ def getTileCondToolTiming(source = 'FILE', runType = 'PHY', name = 'TileCondTool #do some check for global flag here: if source='' and flag set, adopt flag tool = None if source == 'COOL': + sourcePrefix = 'onl' if online else 'ofl' + if runType == 'PHY' or runType == 'PED': tool = TileCondToolTiming(name - , ProxyAdcOffset = getTileCondProxy('COOL','Flt','oflTimeCphy','TileCondProxyCool_AdcOffset')) + , ProxyAdcOffset = getTileCondProxy('COOL','Flt', sourcePrefix + 'TimeCphy','TileCondProxyCool_AdcOffset')) if runType == 'LAS': tool = TileCondToolTiming(name - , ProxyAdcOffset = getTileCondProxy('COOL','Flt','oflTimeClas','TileCondProxyCool_AdcOffset')) + , ProxyAdcOffset = getTileCondProxy('COOL','Flt', sourcePrefix + 'TimeClas','TileCondProxyCool_AdcOffset')) if runType == 'GAPLAS': tool = TileCondToolTiming(name - , ProxyAdcOffset = getTileCondProxy('COOL','Flt','oflTimeCgapLas','TileCondProxyCool_AdcOffset')) + , ProxyAdcOffset = getTileCondProxy('COOL','Flt', sourcePrefix + 'TimeCgapLas','TileCondProxyCool_AdcOffset')) if runType == 'CIS': tool = TileCondToolTiming(name - , ProxyAdcOffset = getTileCondProxy('COOL','Flt','oflTimeCcis','TileCondProxyCool_AdcOffset')) + , ProxyAdcOffset = getTileCondProxy('COOL','Flt', sourcePrefix + 'TimeCcis','TileCondProxyCool_AdcOffset')) elif source == 'FILE': #=== create tool if runType == 'PHY' or runType == 'PED': @@ -439,14 +441,18 @@ def getTileCondToolNoiseSample(source = 'FILE', name = 'TileCondToolNoiseSample' from TileConditions.TileConditionsConf import TileCondToolNoiseSample #do some check for global flag here: if source='' and flag set, adopt flag - tool = None - if source == 'COOL': + + if isOnline or not isUsedDataBaseRun2: onlNoiseSampleProxy = None + else: onlNoiseSampleProxy = getTileCondProxy('COOL','Flt','onlNoiseAdc','TileCondProxyCool_OnlineNoiseSample') + + if source == 'COOL': #==================================================== #=== Connect COOL TileCondProxies to the tool #==================================================== tool = TileCondToolNoiseSample(name, - ProxyNoiseSample = getTileCondProxy('COOL','Flt','oflNoiseAdc','TileCondProxyCool_NoiseSample')) + ProxyNoiseSample = getTileCondProxy('COOL','Flt','oflNoiseAdc','TileCondProxyCool_NoiseSample'), + ProxyOnlineNoiseSample = onlNoiseSampleProxy) # ProxyNoiseAutoCr = getTileCondProxy('COOL','Flt','oflNoiseAcr','TileCondProxyCool_NoiseAutoCr')) else: @@ -454,7 +460,8 @@ def getTileCondToolNoiseSample(source = 'FILE', name = 'TileCondToolNoiseSample' #=== Connect FILE TileCondProxies to the tool (default) #======================================================== tool = TileCondToolNoiseSample(name, - ProxyNoiseSample = getTileCondProxy('FILE','Flt','TileDefault.ped','TileCondProxyFile_NoiseSample')) + ProxyNoiseSample = getTileCondProxy('FILE','Flt','TileDefault.ped','TileCondProxyFile_NoiseSample'), + ProxyOnlineNoiseSample = None) # ProxyNoiseAutoCr = getTileCondProxy('FILE','Flt','TileDefault.acr','TileCondProxyFile_NoiseAutoCr')) #=== set the arguments passed and return tool @@ -580,6 +587,9 @@ def getTileCondToolOfcCool(source = 'FILE', runType = 'PHY', ofcType = 'OF2', na tool = None if source == 'COOL': + # There are OFC for OF1 only in DB used in Run2 + if ofcType == 'OF1' and not isUsedDataBaseRun2: return None + from TileCoolMgr import GetTileOfcCoolSource, AddTileOfcCoolSource, tileCoolMgr proxySource = GetTileOfcCoolSource(ofcType, runType) diff --git a/TileCalorimeter/TileConditions/python/TileCoolMgr.py b/TileCalorimeter/TileConditions/python/TileCoolMgr.py index 01beedcb879..ecd176d2594 100644 --- a/TileCalorimeter/TileConditions/python/TileCoolMgr.py +++ b/TileCalorimeter/TileConditions/python/TileCoolMgr.py @@ -234,11 +234,12 @@ tileCoolMgr.addSource('onlMuID' , '/TILE/ONL01/MUID', defConnStr, "", '/TILE/O #--- noise tileCoolMgr.addSource('onlNoise1gOfni', '/TILE/ONL01/NOISE/OFNI', defConnStr, "", '/TILE/ONL01/NOISE/OFNI', 'SplitMC') + #--- status tileCoolMgr.addSource('onlStatAdc', '/TILE/ONL01/STATUS/ADC', defConnStr, "", '/TILE/ONL01/STATUS/ADC', 'SplitMC') #--- OFCs OF2 -#tileCoolMgr.addSource('onlOfcOf2Phy', '/TILE/ONL01/FILTER/OF2/PHY', defConnStr, "", '/TILE/ONL01/FILTER/OF2/PHY', 'SplitMC') +tileCoolMgr.addSource('onlOfcOf2Phy', '/TILE/ONL01/FILTER/OF2/PHY', defConnStr, "", '/TILE/ONL01/FILTER/OF2/PHY', 'SplitMC') tileCoolMgr.addSource('onlOfcOf2CisPl100', '/TILE/ONL01/FILTER/OF2/CIS', defConnStr, "", '/TILE/ONL01/FILTER/OF2/CIS', 'SplitMC') tileCoolMgr.addSource('onlOfcOf2CisPl5p2', '/TILE/ONL01/FILTER/OF2/CIS', defConnStr, "", '/TILE/ONL01/FILTER/OF2/CIS', 'SplitMC') tileCoolMgr.addSource('onlOfcOf2Las', '/TILE/ONL01/FILTER/OF2/LAS', defConnStr, "", '/TILE/ONL01/FILTER/OF2/LAS', 'SplitMC') @@ -276,13 +277,18 @@ if conddb.GetInstance() == 'CONDBR2': #--- noise tileCoolMgr.addSource('oflNoiseAdc', '/TILE/ONL01/NOISE/SAMPLE', defConnStr, "", '/TILE/OFL02/NOISE/SAMPLE', 'SplitOnline') + tileCoolMgr.addSource('onlNoiseAdc', '/TILE/ONL01/NOISE/SAMPLE', defConnStr, "", "", 'OfflineOnly') tileCoolMgr.addSource('oflNoiseAcr', '/TILE/OFL02/NOISE/AUTOCR', oflConnStr, "", "", 'OfflineOnly') #--- timing tileCoolMgr.addSource('oflTimeCphy', '/TILE/ONL01/TIME/CHANNELOFFSET/PHY', defConnStr, "", '/TILE/OFL02/TIME/CHANNELOFFSET/PHY', 'SplitOnline') + tileCoolMgr.addSource('onlTimeCphy', '/TILE/ONL01/TIME/CHANNELOFFSET/PHY', defConnStr, "", "", 'OfflineOnly') tileCoolMgr.addSource('oflTimeClas', '/TILE/ONL01/TIME/CHANNELOFFSET/LAS', defConnStr, "", '/TILE/OFL02/TIME/CHANNELOFFSET/LAS', 'SplitOnline') + tileCoolMgr.addSource('onlTimeClas', '/TILE/ONL01/TIME/CHANNELOFFSET/LAS', defConnStr, "", "", 'OfflineOnly') tileCoolMgr.addSource('oflTimeCgapLas', '/TILE/ONL01/TIME/CHANNELOFFSET/GAP/LAS', defConnStr, "", '/TILE/OFL02/TIME/CHANNELOFFSET/GAP/LAS', 'SplitOnline') + tileCoolMgr.addSource('onlTimeCgapLas', '/TILE/ONL01/TIME/CHANNELOFFSET/GAP/LAS', defConnStr, "", "", 'OfflineOnly') tileCoolMgr.addSource('oflTimeCcis', '/TILE/ONL01/TIME/CHANNELOFFSET/CIS', defConnStr, "", '/TILE/OFL02/TIME/CHANNELOFFSET/CIS', 'SplitOnline') + tileCoolMgr.addSource('onlTimeCcis', '/TILE/ONL01/TIME/CHANNELOFFSET/CIS', defConnStr, "", "", 'OfflineOnly') #--- integrator tileCoolMgr.addSource('oflIntGain', '/TILE/ONL01/INTEGRATOR', defConnStr, "", '/TILE/OFL02/INTEGRATOR', 'SplitOnline') diff --git a/TileCalorimeter/TileConditions/python/TileInfoConfigurator.py b/TileCalorimeter/TileConditions/python/TileInfoConfigurator.py index 970bda73126..09220628617 100644 --- a/TileCalorimeter/TileConditions/python/TileInfoConfigurator.py +++ b/TileCalorimeter/TileConditions/python/TileInfoConfigurator.py @@ -20,6 +20,7 @@ class _TileInfoConfigurator( TileInfoLoader ): __slots__ = { '_coolIsConfigured' : False, '_coolofcIsConfigured': False, + '_coolof1ofcIsConfigured': False, '_coolcispulseIsConfigured': False, '_coolintegratorIsConfigured': False, '_coolmuidIsConfigured': False, @@ -27,6 +28,9 @@ class _TileInfoConfigurator( TileInfoLoader ): '_coolDCSIsConfigured' : False, '_coolacrIsConfigured' : False, '_coolphypulseIsConfigured' : False, + '_coollaspulseIsConfigured' : False, + '_cooltimeIsConfigured' : False, + '_coolonlinetimeIsConfigured' : False, '_msg': None } @@ -57,7 +61,7 @@ class _TileInfoConfigurator( TileInfoLoader ): return msg #_______________________________________________________________ - def setupCOOL(self, defTag = "", dbConnection = ""): + def setupCOOL(self, defTag = "", dbConnection = "", type = "PHY"): """ Call this function to read calibration constants from the COOL DB (default is reading from text files). Input parameters: @@ -96,7 +100,7 @@ class _TileInfoConfigurator( TileInfoLoader ): self._msg.info("Changing default TileCondToolTiming configuration to COOL source") from .TileCondToolConf import getTileCondToolTiming - ToolSvc += getTileCondToolTiming('COOL') + ToolSvc += getTileCondToolTiming('COOL',type) # self._msg.info("Changing default TileCondToolPulseShape configuration to COOL source") # from .TileCondToolConf import getTileCondToolPulseShape @@ -108,6 +112,104 @@ class _TileInfoConfigurator( TileInfoLoader ): return + #_______________________________________________________________ + def setupCOOLOFC(self, defTag = "", dbConnection = "", type = "PHY", ofcType = 'OF2'): + """ + Call this function to read OFCs from Online COOL folder. + Returns if the corresponding tool is configured successfully + Input parameters: + - defTag : Tag to be added to each folder tag (NGO change this to a hierarchical tag!) + - dbConnection : The DB connection string to use [default "": auto-initialization by CondDBSetup.py] + - type Pulse type - PHY or LAS or CIS + - ofcType : Optimla filtering methods - OF1 or OF2 + """ + + name = 'TileCondToolOfcCool' + #=== prevent a second initialization + if ofcType == 'OF2': + if self._coolofcIsConfigured: + self._msg.info("setupCOOLOFC already called previously, ignoring this repeated call!") + return True + self._coolofcIsConfigured = True + elif ofcType == 'OF1': + if self._coolof1ofcIsConfigured: + self._msg.info("setupCOOLOFC for OF1 already called previously, ignoring this repeated call!") + return True + self._coolof1ofcIsConfigured = True + name = 'TileCondToolOfcCoolOF1' + else: + self._msg.info("setupCOOLOFC: not known OFC type: %s! Nothing will be done!" % ofcType) + return False + + #=== connect TileCondToolOfcCool to COOL + from AthenaCommon.AppMgr import ToolSvc + + self._msg.info("Changing default TileCondToolOfcCool configuration to COOL source") + from .TileCondToolConf import getTileCondToolOfcCool + toolOfcCool = getTileCondToolOfcCool('COOL', type, ofcType, name ) + if toolOfcCool is not None: + ToolSvc += toolOfcCool + return True + elif ofcType == 'OF1': + self._coolof1ofcIsConfigured = False + else: + self._coolofcIsConfigured = False + return False + + + + #_______________________________________________________________ + def setupCOOLTIME(self, defTag = "", dbConnection = "", type = "PHY", online = False): + """ + Call this function to read Time from COOL folder. + Input parameters: + - defTag : Tag to be added to each folder tag (NGO change this to a hierarchical tag!) + - dbConnection : The DB connection string to use [default "": auto-initialization by CondDBSetup.py] + - type Pulse type - PHY or LAS or CIS + - online : Read time from online COOL folder always + """ + + name = 'TileCondToolTiming' + #=== prevent a second initialization + if not online: + if self._cooltimeIsConfigured: + self._msg.info("setupCOOLTIME already called previously, ignoring this repeated call!") + return + self._cooltimeIsConfigured = True + else: + if self._coolonlinetimeIsConfigured: + self._msg.info("setupCOOLTIME for online already called previously, ignoring this repeated call!") + return + self._coolonlinetimeIsConfigured = True + name = 'TileCondToolOnlineTiming' + + #=== connect TileCondToolTiming to COOL + from AthenaCommon.AppMgr import ToolSvc + + self._msg.info("Changing default TileCondToolTiming configuration to COOL source") + from .TileCondToolConf import getTileCondToolTiming + ToolSvc += getTileCondToolTiming('COOL', type, online, name ) + + + + #_______________________________________________________________ + def setupCOOLPULSE(self, defTag = "", dbConnection = "", type = "PHY"): + """ + Call this function to read pulse shape from from Online COOL folder. + Input parameters: + - defTag : Tag to be added to each folder tag (NGO change this to a hierarchical tag!) + - dbConnection : The DB connection string to use [default "": auto-initialization by CondDBSetup.py] + - type Pulse type - PHY or LAS or CIS + """ + + if type=="CIS": + self.setupCOOLCISPULSE(defTag,dbConnection) + elif type=="LAS": + self.setupCOOLLASPULSE(defTag,dbConnection) + else: + self.setupCOOLPHYPULSE(defTag,dbConnection) + self.setupCOOLAutoCr(defTag,dbConnection) + #_______________________________________________________________ def setupCOOLCISPULSE(self, defTag = "", dbConnection = ""): """ @@ -134,27 +236,26 @@ class _TileInfoConfigurator( TileInfoLoader ): ToolSvc += getTileCondToolPulseShape('COOL','CISLEAK5P2','TileCondToolLeak5p2Shape') #_______________________________________________________________ - def setupCOOLOFC(self, defTag = "", dbConnection = ""): + def setupCOOLLASPULSE(self, defTag = "", dbConnection = ""): """ - Call this function to read OFCs from Online COOL folder. + Call this function to read LAS pulse shape from from Online COOL folder. Input parameters: - defTag : Tag to be added to each folder tag (NGO change this to a hierarchical tag!) - dbConnection : The DB connection string to use [default "": auto-initialization by CondDBSetup.py] """ #=== prevent a second initialization - if self._coolofcIsConfigured: - self._msg.info("setupCOOLOFC already called previously, ignoring this repeated call!") + if self._coollaspulseIsConfigured: + self._msg.info("setupCOOLLASPULSE already called previously, ignoring this repeated call!") return - self._coolofcIsConfigured = True + self._coollaspulseIsConfigured = True #=== connect TileCondToolOfcCool to COOL from AthenaCommon.AppMgr import ToolSvc - self._msg.info("Changing default TileCondToolOfcCool configuration to COOL source") - from .TileCondToolConf import getTileCondToolOfcCool - ToolSvc += getTileCondToolOfcCool('COOL') - + self._msg.info("Changing default TileCondToolPulseShape configuration to COOL source") + from .TileCondToolConf import getTileCondToolPulseShape + ToolSvc += getTileCondToolPulseShape('COOL','LAS','TileCondToolPulseShape') #_______________________________________________________________ def setupCOOLPHYPULSE(self, defTag = "", dbConnection = ""): @@ -393,6 +494,7 @@ def TileInfoConfigurator(name="TileInfoLoader", **kwargs): #=== by default COOL is not configured svc._coolIsConfigured = False svc._coolofcIsConfigured = False + svc._coolof1ofcIsConfigured = False svc._coolcispulseIsConfigured = False svc._coolintegratorIsConfigured = False svc._coolmuidIsConfigured = False @@ -400,5 +502,7 @@ def TileInfoConfigurator(name="TileInfoLoader", **kwargs): svc._coolDCSIsConfigured = False svc._coolacrIsConfigured = False svc._coolphypulseIsConfigured = False - + svc._coollaspulseIsConfigured = False + svc._cooltimeIsConfigured = False + svc._coolonlinetimeIsConfigured = False return svc diff --git a/TileCalorimeter/TileConditions/share/TileConditions_jobOptions.py b/TileCalorimeter/TileConditions/share/TileConditions_jobOptions.py index eaf5fc2ad5a..48ee6342f90 100755 --- a/TileCalorimeter/TileConditions/share/TileConditions_jobOptions.py +++ b/TileCalorimeter/TileConditions/share/TileConditions_jobOptions.py @@ -66,18 +66,28 @@ if athenaCommonFlags.isOnline(): elif TileUseCOOL: #=== setup reading from COOL DB msg.info("setting up COOL for TileCal conditions data") - tileInfoConfigurator.setupCOOL() + TileGapTiming="" + if (('TileCisRun' in dir()) and (TileCisRun) or + ('TileMonoRun' in dir()) and (TileMonoRun) or + ('TileRampRun' in dir()) and (TileRampRun)): + TilePulse="CIS" + elif ('TileLasRun' in dir()) and (TileLasRun): + TilePulse="LAS" + if ('TilePhysTiming' in dir()) and (TilePhysTiming): + TileGapTiming="GAP" + else: + TilePulse="PHY" if not 'TileUseCOOLOFC' in dir(): - #TileUseCOOLOFC=False; # don't read OFC from COOL, calculate them on the fly TileUseCOOLOFC=True; # read OFC from COOL + if not 'TileUseCOOLPULSE' in dir() or not TileUseCOOLOFC: + TileUseCOOLPULSE=True; # read pulse from COOL + + tileInfoConfigurator.setupCOOL(type=(TileGapTiming+TilePulse)) if TileUseCOOLOFC: - tileInfoConfigurator.setupCOOLOFC() - if ('TileCisRun' in dir()) and (TileCisRun and doTileFitCool): - tileInfoConfigurator.setupCOOLCISPULSE() - else: - tileInfoConfigurator.setupCOOLPHYPULSE() - tileInfoConfigurator.setupCOOLAutoCr() - + tileInfoConfigurator.setupCOOLOFC(type=TilePulse) + if TileUseCOOLPULSE: + tileInfoConfigurator.setupCOOLPULSE(type=TilePulse) + if TileUseDCS: tileInfoConfigurator.setupCOOLDCS(); else: diff --git a/TileCalorimeter/TileConditions/src/TileCondToolNoiseSample.cxx b/TileCalorimeter/TileConditions/src/TileCondToolNoiseSample.cxx index cec5d05ace7..67c9ef8a178 100644 --- a/TileCalorimeter/TileConditions/src/TileCondToolNoiseSample.cxx +++ b/TileCalorimeter/TileConditions/src/TileCondToolNoiseSample.cxx @@ -26,11 +26,14 @@ TileCondToolNoiseSample::TileCondToolNoiseSample(const std::string& type, const : AthAlgTool(type, name, parent) , m_tileToolEms("TileCondToolEmscale") , m_pryNoiseSample("TileCondProxyFile_TileCalibDrawerFlt_/TileCondProxyDefault_NoiseSample", this) + , m_pryOnlineNoiseSample("TileCondProxyFile_TileCalibDrawerFlt_/TileCondProxyDefault_NoiseSample", this) + , m_useOnlineNoise(false) // m_pryNoiseAutoCr("TileCondProxyFile_TileCalibDrawerFlt_/TileCondProxyDefault_NoiseAutoCr", this) { declareInterface<ITileCondToolNoise>(this); declareInterface<TileCondToolNoiseSample>(this); declareProperty("ProxyNoiseSample", m_pryNoiseSample); + declareProperty("ProxyOnlineNoiseSample", m_pryOnlineNoiseSample); // declareProperty("ProxyNoiseAutoCr", m_pryNoiseAutoCr ); } @@ -51,6 +54,12 @@ StatusCode TileCondToolNoiseSample::initialize() { //=== retrieve proxy CHECK( m_pryNoiseSample.retrieve() ); + m_useOnlineNoise = !(m_pryOnlineNoiseSample.empty()); + + if (m_useOnlineNoise) { + CHECK( m_pryOnlineNoiseSample.retrieve()); + } + return StatusCode::SUCCESS; } @@ -143,6 +152,22 @@ float TileCondToolNoiseSample::getHfnNorm(unsigned int drawerIdx, unsigned int c return ped; } + +float TileCondToolNoiseSample::getOnlinePedestalDifference(unsigned int drawerIdx, unsigned int channel, + unsigned int adc, TileRawChannelUnit::UNIT onlineUnit) const { + + float pedestalDifference(0.0); + + if (m_useOnlineNoise) { + float pedestal = m_pryNoiseSample->getCalibDrawer(drawerIdx)->getData(channel, adc, 0); + float onlinePedestal = m_pryOnlineNoiseSample->getCalibDrawer(drawerIdx)->getData(channel, adc, 0); + pedestalDifference = m_tileToolEms->channelCalibOnl(drawerIdx, channel, adc, (onlinePedestal - pedestal), onlineUnit); + } + + return pedestalDifference; +} + + // //____________________________________________________________________ /* diff --git a/TileCalorimeter/TileConditions/src/TileCondToolOfcCool.cxx b/TileCalorimeter/TileConditions/src/TileCondToolOfcCool.cxx index aabee458a65..50bb7a97cb2 100644 --- a/TileCalorimeter/TileConditions/src/TileCondToolOfcCool.cxx +++ b/TileCalorimeter/TileConditions/src/TileCondToolOfcCool.cxx @@ -11,7 +11,7 @@ #include "TileConditions/TileCondProxyWrapper.h" #include "TileConditions/ITileCondToolOfc.h" -static bool first = true; + // //____________________________________________________________________ static const InterfaceID IID_TileCondToolOfcCool("TileCondToolOfcCool", 1, 0); @@ -32,6 +32,7 @@ TileCondToolOfcCool::TileCondToolOfcCool(const std::string& type, const std::str , m_Phamin(0) , m_Phamax(0) , m_NSamples(0) + , m_first(true) { declareInterface<TileCondToolOfcCool>(this); declareInterface<ITileCondToolOfc>(this); @@ -80,8 +81,8 @@ const TileOfcWeightsStruct* TileCondToolOfcCool::getOfcWeights(unsigned int draw throw TileCalib::IndexOutOfRange("TileCondToolOfcCool::getOfcWeights", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); } - if (first) { - first = false; + if (m_first) { + m_first = false; m_NPhases = m_pryOfcCool->getCalibDrawer(drawerIdx)->getNPhases(); m_NFields = m_pryOfcCool->getCalibDrawer(drawerIdx)->getNFields(); m_NSamples = m_pryOfcCool->getCalibDrawer(drawerIdx)->getNSamples(); @@ -112,8 +113,8 @@ int TileCondToolOfcCool::getOfcWeights(unsigned int drawerIdx throw TileCalib::IndexOutOfRange("TileCondToolOfcCool::getOfcWeights", drawerIdx, TileCalibUtils::MAX_DRAWERIDX); } - if (first) { - first = false; + if (m_first) { + m_first = false; m_NPhases = m_pryOfcCool->getCalibDrawer(drawerIdx)->getNPhases(); m_NFields = m_pryOfcCool->getCalibDrawer(drawerIdx)->getNFields(); m_NSamples = m_pryOfcCool->getCalibDrawer(drawerIdx)->getNSamples(); diff --git a/TileCalorimeter/TileConditions/src/TileOptFilterWeights.cxx b/TileCalorimeter/TileConditions/src/TileOptFilterWeights.cxx index 82955a3ba86..008d5cd39be 100755 --- a/TileCalorimeter/TileConditions/src/TileOptFilterWeights.cxx +++ b/TileCalorimeter/TileConditions/src/TileOptFilterWeights.cxx @@ -271,7 +271,7 @@ void TileOptFilterWeights::loadWeights(MsgStream &log) if (!openfiles ) log << MSG::FATAL<<"Error opening files!!!!"<<endreq; else { - if (!openfiles ) log << MSG::ERROR<<"Non-delta weights unavailable"<<endreq; + //if (!openfiles ) log << MSG::ERROR<<"Non-delta weights unavailable"<<endreq; // log << MSG::DEBUG<<" Weights files opened"<<endreq; // while(!(ai_lo_phys->eof()||bi_lo_phys->eof()||ai_hi_phys->eof()||bi_hi_phys->eof()|| // ai_lo_cis->eof()||bi_lo_cis->eof()||ai_hi_cis->eof()||bi_hi_cis->eof())) -- GitLab