Skip to content
Snippets Groups Projects
Commit b366ff75 authored by Walter Lampl's avatar Walter Lampl Committed by Tadej Novak
Browse files

More fixes for code & config used in LAr Electronic Calibration

LArCalib_PileUpAutoCorrConfig.py: Adjust number of samples, set number of min-bias collisions as needed
parent 5c4cb9b2
No related branches found
No related tags found
No related merge requests found
Showing
with 42 additions and 16 deletions
...@@ -44,10 +44,10 @@ class LArAutoCorrDecoderTool: ...@@ -44,10 +44,10 @@ class LArAutoCorrDecoderTool:
private: private:
//Properties: //Properties:
Gaudi::Property<unsigned> m_decodemode{"DecodeMode",0}; Gaudi::Property<unsigned> m_decodemode{this,"DecodeMode",0};
Gaudi::Property<bool> m_alwaysHighGain{"UseAlwaysHighGain",false}; Gaudi::Property<bool> m_alwaysHighGain{this,"UseAlwaysHighGain",false};
Gaudi::Property<bool> m_isSC{"isSC",false}; Gaudi::Property<bool> m_isSC{this,"isSC",false};
Gaudi::Property<std::string> m_keyAutoCorr{"KeyAutoCorr","LArAutoCorr"}; Gaudi::Property<std::string> m_keyAutoCorr{this,"KeyAutoCorr","LArAutoCorr"};
const Eigen::MatrixXd ACDiagonal( const HWIdentifier& CellID, int gain, unsigned nSamples) const; const Eigen::MatrixXd ACDiagonal( const HWIdentifier& CellID, int gain, unsigned nSamples) const;
const Eigen::MatrixXd ACPhysics( const HWIdentifier& CellID, int gain, unsigned nSamples) const; const Eigen::MatrixXd ACPhysics( const HWIdentifier& CellID, int gain, unsigned nSamples) const;
......
...@@ -128,13 +128,15 @@ def LArDelay_OFCCaliCfg(flags): ...@@ -128,13 +128,15 @@ def LArDelay_OFCCaliCfg(flags):
NtupleName = "CALIWAVE", NtupleName = "CALIWAVE",
AddFEBTempInfo = False, AddFEBTempInfo = False,
SaveDerivedInfo = True, SaveDerivedInfo = True,
ApplyCorrection = True ApplyCorrection = True,
OffId=True
)) ))
if rootfile2 == "": if rootfile2 == "":
result.addEventAlgo(CompFactory.LArOFC2Ntuple(ContainerKey = "LArOFC", result.addEventAlgo(CompFactory.LArOFC2Ntuple(ContainerKey = "LArOFC",
AddFEBTempInfo = False AddFEBTempInfo = False,
)) OffId=True
))
import os import os
if os.path.exists(rootfile): if os.path.exists(rootfile):
...@@ -183,6 +185,9 @@ def LArDelay_OFCCaliCfg(flags): ...@@ -183,6 +185,9 @@ def LArDelay_OFCCaliCfg(flags):
result.getService("IOVDbSvc").DBInstance="" result.getService("IOVDbSvc").DBInstance=""
from PerfMonComps.PerfMonCompsConfig import PerfMonMTSvcCfg
result.merge(PerfMonMTSvcCfg(flags))
return result return result
......
...@@ -145,6 +145,10 @@ def LArOFCPhysCfg(flags): ...@@ -145,6 +145,10 @@ def LArOFCPhysCfg(flags):
FirstEvent = 1, FirstEvent = 1,
InitialTimeStamp = 0, InitialTimeStamp = 0,
TimeStampInterval = 1)) TimeStampInterval = 1))
from PerfMonComps.PerfMonCompsConfig import PerfMonMTSvcCfg
result.merge(PerfMonMTSvcCfg(flags))
return result return result
......
...@@ -198,6 +198,10 @@ def LArPedestalAutoCorrCfg(flags): ...@@ -198,6 +198,10 @@ def LArPedestalAutoCorrCfg(flags):
result.getService("IOVDbSvc").DBInstance="" result.getService("IOVDbSvc").DBInstance=""
from PerfMonComps.PerfMonCompsConfig import PerfMonMTSvcCfg
result.merge(PerfMonMTSvcCfg(flags))
return result return result
......
...@@ -134,6 +134,9 @@ def LArPhysWavePredictionCfg(flags): ...@@ -134,6 +134,9 @@ def LArPhysWavePredictionCfg(flags):
InitialTimeStamp = 0, InitialTimeStamp = 0,
TimeStampInterval = 1)) TimeStampInterval = 1))
from PerfMonComps.PerfMonCompsConfig import PerfMonMTSvcCfg
result.merge(PerfMonMTSvcCfg(flags))
return result return result
......
...@@ -52,8 +52,7 @@ def LArPileUpAutoCorrCfg(flags): ...@@ -52,8 +52,7 @@ def LArPileUpAutoCorrCfg(flags):
result.merge(LArElecCalibDbCfg(flags,requiredConditions)) result.merge(LArElecCalibDbCfg(flags,requiredConditions))
result.addCondAlgo(CompFactory.LArADC2MeVCondAlg(UseFEBGainTresholds=False)) result.addCondAlgo(CompFactory.LArADC2MeVCondAlg(UseFEBGainTresholds=False))
theLArAutoCorrTotalCondAlg=CompFactory.LArAutoCorrTotalCondAlg() theLArAutoCorrTotalCondAlg=CompFactory.LArAutoCorrTotalCondAlg()
theLArAutoCorrTotalCondAlg.Nminbias=nColl theLArAutoCorrTotalCondAlg.Nsamples=5 #Hardcoded ...
theLArAutoCorrTotalCondAlg.Nsamples=flags.LArCalib.OFC.Nsamples
from AthenaCommon.SystemOfUnits import ns from AthenaCommon.SystemOfUnits import ns
theLArAutoCorrTotalCondAlg.deltaBunch=int(flags.Beam.BunchSpacing/( 25.*ns)+0.5) theLArAutoCorrTotalCondAlg.deltaBunch=int(flags.Beam.BunchSpacing/( 25.*ns)+0.5)
theLArAutoCorrTotalCondAlg.isSuperCell=flags.LArCalib.isSC theLArAutoCorrTotalCondAlg.isSuperCell=flags.LArCalib.isSC
...@@ -62,13 +61,14 @@ def LArPileUpAutoCorrCfg(flags): ...@@ -62,13 +61,14 @@ def LArPileUpAutoCorrCfg(flags):
theLArAutoCorrTotalCondAlg.LArAutoCorrTotalObjKey="LArPhysAutoCorr" theLArAutoCorrTotalCondAlg.LArAutoCorrTotalObjKey="LArPhysAutoCorr"
result.addCondAlgo(theLArAutoCorrTotalCondAlg) result.addCondAlgo(theLArAutoCorrTotalCondAlg)
result.addEventAlgo(CompFactory.LArAutoCorrAlgToDB(NMinbias=nColl)) result.addEventAlgo(CompFactory.LArAutoCorrAlgToDB(GroupingType=flags.LArCalib.GroupingType,
NMinbias=nColl))
#Ntuple writing #Ntuple writing
rootfile=flags.LArCalib.Output.ROOTFile rootfile=flags.LArCalib.Output.ROOTFile
if rootfile != "": if rootfile != "":
result.addEventAlgo(CompFactory.LArAutoCorr2Ntuple(ContainerKey="LArPhysAutoCorr")) result.addEventAlgo(CompFactory.LArAutoCorr2Ntuple(ContainerKey="LArPhysAutoCorr",OffId=True))
import os import os
if os.path.exists(rootfile): if os.path.exists(rootfile):
os.remove(rootfile) os.remove(rootfile)
...@@ -100,6 +100,10 @@ def LArPileUpAutoCorrCfg(flags): ...@@ -100,6 +100,10 @@ def LArPileUpAutoCorrCfg(flags):
InitialTimeStamp = 0, InitialTimeStamp = 0,
TimeStampInterval = 1)) TimeStampInterval = 1))
from PerfMonComps.PerfMonCompsConfig import PerfMonMTSvcCfg
result.merge(PerfMonMTSvcCfg(flags))
return result return result
......
...@@ -29,8 +29,6 @@ def LArRTMParamsCfg(flags): ...@@ -29,8 +29,6 @@ def LArRTMParamsCfg(flags):
LArRTMParamExtractor = CompFactory.LArRTMParamExtractor() LArRTMParamExtractor = CompFactory.LArRTMParamExtractor()
LArRTMParamExtractor.useTBB=True
LArRTMParamExtractor.KeyList = ["LArCaliWave"] LArRTMParamExtractor.KeyList = ["LArCaliWave"]
LArRTMParamExtractor.TestMode = False LArRTMParamExtractor.TestMode = False
LArRTMParamExtractor.GroupingType = flags.LArCalib.GroupingType LArRTMParamExtractor.GroupingType = flags.LArCalib.GroupingType
...@@ -121,6 +119,9 @@ def LArRTMParamsCfg(flags): ...@@ -121,6 +119,9 @@ def LArRTMParamsCfg(flags):
InitialTimeStamp = 0, InitialTimeStamp = 0,
TimeStampInterval = 1)) TimeStampInterval = 1))
from PerfMonComps.PerfMonCompsConfig import PerfMonMTSvcCfg
result.merge(PerfMonMTSvcCfg(flags))
return result return result
if __name__ == "__main__": if __name__ == "__main__":
......
...@@ -133,6 +133,10 @@ def LArRampCfg(flags): ...@@ -133,6 +133,10 @@ def LArRampCfg(flags):
result.setAppProperty("HistogramPersistency","ROOT") result.setAppProperty("HistogramPersistency","ROOT")
pass # end if ROOT ntuple writing pass # end if ROOT ntuple writing
from PerfMonComps.PerfMonCompsConfig import PerfMonMTSvcCfg
result.merge(PerfMonMTSvcCfg(flags))
return result return result
......
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
from PyCool import cool from PyCool import cool
from AthenaCommon.Logging import logging
class FolderTagResolver: class FolderTagResolver:
...@@ -11,6 +11,7 @@ class FolderTagResolver: ...@@ -11,6 +11,7 @@ class FolderTagResolver:
def __init__(self,dbname="COOLOFL_LAR/CONDBR2"): def __init__(self,dbname="COOLOFL_LAR/CONDBR2"):
dbSvc = cool.DatabaseSvcFactory.databaseService() dbSvc = cool.DatabaseSvcFactory.databaseService()
self._db = dbSvc.openDatabase(dbname) self._db = dbSvc.openDatabase(dbname)
self._msg=logging.getLogger('FolderTagResolver')
return return
def __del__(self): def __del__(self):
...@@ -21,12 +22,12 @@ class FolderTagResolver: ...@@ -21,12 +22,12 @@ class FolderTagResolver:
if globalTag is None: if globalTag is None:
globalTag=self.__class__._globalTag globalTag=self.__class__._globalTag
print ("globalTag=",globalTag) self._msg.info("Looking up folder level tag for %s using globalTag %s",foldername,globalTag)
try: try:
folder=self._db.getFolder(foldername) folder=self._db.getFolder(foldername)
return folder.resolveTag(globalTag) return folder.resolveTag(globalTag)
except Exception as e: except Exception as e:
print ("Could not resolve tag",globalTag) self._msg.error("Could not resolve tag %s for folder %s in database %s",globalTag,foldername,self._db.databaseId())
print (e) print (e)
# new folder, should "create a tag" # new folder, should "create a tag"
return ''.join(foldername.split('/')) + '-RUN2-UPD3-00' return ''.join(foldername.split('/')) + '-RUN2-UPD3-00'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment