ATLAS Offline Software
LArNoiseConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 
6 def LArNoiseCfg(flags):
7 
8  result=ComponentAccumulator()
9 
10  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
11  result.merge(PoolReadCfg(flags))
12 
13  from LArGeoAlgsNV.LArGMConfig import LArGMCfg
14  result.merge(LArGMCfg(flags))
15  from TileGeoModel.TileGMConfig import TileGMCfg
16  result.merge(TileGMCfg(flags))
17 
18  #Setup cabling
19  from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg
20  result.merge(LArOnOffIdMappingCfg(flags))
21  # setup bad chan and missing febs
22  from LArBadChannelTool.LArBadChannelConfig import LArBadChannelCfg,LArBadFebCfg
23  result.merge(LArBadChannelCfg(flags))
24  result.merge(LArBadFebCfg(flags))
25 
26  from LArCellRec.LArCollisionTimeConfig import LArCollisionTimeCfg
27  result.merge(LArCollisionTimeCfg(flags))
28 
29  from TrigDecisionTool.TrigDecisionToolConfig import TrigDecisionToolCfg
30  tdt = result.getPrimaryAndMerge(TrigDecisionToolCfg(flags))
31 
32  noiseAlg=CompFactory.LArNoiseBursts("LArNoiseBursts")
33  noiseAlg.SigmaCut = flags.LArNoise.SigmaCut
34  noiseAlg.NumberOfBunchesInFront = flags.LArNoise.NumberOfBunchesInFront
35  noiseAlg.KeepOnlyCellID = flags.LArNoise.KeepOnlyCellID
36  noiseAlg.TrigDecisionTool = tdt
37  result.addEventAlgo(noiseAlg)
38 
39  if (flags.LArNoise.outNtupLAr!=""):
40  result.addService(CompFactory.THistSvc(Output=["TTREE DATAFILE='"+flags.LArNoise.outNtupLAr+"' OPT='RECREATE'",]))
41 
42  if (flags.LArNoise.HECNoiseNtup!=""):
43  hecAlg=CompFactory.LArHECNoise("LArHECNoise")
44  hecAlg.MinDigitADC = flags.LArNoise.MinDigitADC
45  hecAlg.MaxDeltaT = flags.LArNoise.MaxDeltaT
46  from IOVDbSvc.IOVDbSvcConfig import addFolders
47  result.merge(addFolders(flags, "/LAR/ElecCalibFlat/Pedestal", "LAR_ONL", className="CondAttrListCollection", db="CONDBR2"))
48  LArPedestalCondAlg = CompFactory.getComp("LArFlatConditionsAlg<LArPedestalFlat>")
49  result.addCondAlgo(LArPedestalCondAlg(ReadKey="/LAR/ElecCalibFlat/Pedestal", WriteKey="LArPedestal"))
50 
51  result.addEventAlgo(hecAlg)
52  if result.getService("THistSvc") is not None:
53  result.getService("THistSvc").Output += ["HEC DATAFILE='"+flags.LArNoise.HECNoiseNtup+"' OPT='RECREATE'",]
54  else:
55  result.addService(CompFactory.THistSvc(Output=["HEC DATAFILE='"+flags.LArNoise.HECNoiseNtup+"' OPT='RECREATE'",]))
56 
57  return result
58 
59 def LArNoiseFromRawCfg(flags):
60 
61  result=ComponentAccumulator()
62 
63  #from LArByteStream.LArRawDataReadingConfig import LArRawDataReadingCfg
64  #result.merge(LArRawDataReadingCfg(flags))
65 
66 
73 
74  from CaloRec.CaloRecoConfig import CaloRecoCfg
75  result.merge(CaloRecoCfg(flags))
76 
77  from LumiBlockComps.BunchCrossingCondAlgConfig import BunchCrossingCondAlgCfg
78  result.merge(BunchCrossingCondAlgCfg(flags))
79 
80  from CaloTools.CaloNoiseCondAlgConfig import CaloNoiseCondAlgCfg
81  result.merge(CaloNoiseCondAlgCfg(flags,"totalNoise"))
82 
83  from LArROD.LArFebErrorSummaryMakerConfig import LArFebErrorSummaryMakerCfg
84  result.merge(LArFebErrorSummaryMakerCfg(flags))
85  result.getEventAlgo("LArFebErrorSummaryMaker").CheckAllFEB=False
86 
87  if (flags.LArNoise.outNtupLAr != "" or flags.LArNoise.HECNoiseNtup!=""):
88  from LArCellRec.LArTimeVetoAlgConfig import LArTimeVetoAlgCfg
89  result.merge(LArTimeVetoAlgCfg(flags))
90 
91  from LArCafJobs.LArSCDumperSkeleton import L1CaloMenuCfg
92  result.merge(L1CaloMenuCfg(flags))
93 
94  from TrigDecisionTool.TrigDecisionToolConfig import TrigDecisionToolCfg
95  tdt = result.getPrimaryAndMerge(TrigDecisionToolCfg(flags))
96 
97 
98  if (flags.LArNoise.outNtupLAr != ""):
99  noiseAlg=CompFactory.LArNoiseBursts("LArNoiseBursts")
100  noiseAlg.SigmaCut = flags.LArNoise.SigmaCut
101  noiseAlg.NumberOfBunchesInFront = flags.LArNoise.NumberOfBunchesInFront
102  noiseAlg.KeepOnlyCellID = flags.LArNoise.KeepOnlyCellID
103  noiseAlg.TrigDecisionTool = tdt
104  result.addEventAlgo(noiseAlg)
105 
106  result.addService(CompFactory.THistSvc(Output=["TTREE DATAFILE='"+flags.LArNoise.outNtupLAr+"' OPT='RECREATE'",]))
107 
108  if (flags.LArNoise.HECNoiseNtup!=""):
109  hecAlg=CompFactory.LArHECNoise("LArHECNoise")
110  hecAlg.MinDigitADC = flags.LArNoise.MinDigitADC
111  hecAlg.MaxDeltaT = flags.LArNoise.MaxDeltaT
112  from IOVDbSvc.IOVDbSvcConfig import addFolders
113  result.merge(addFolders(flags, "/LAR/ElecCalibFlat/Pedestal", "LAR_ONL", className="CondAttrListCollection", db="CONDBR2"))
114  LArPedestalCondAlg = CompFactory.getComp("LArFlatConditionsAlg<LArPedestalFlat>")
115  result.addCondAlgo(LArPedestalCondAlg(ReadKey="/LAR/ElecCalibFlat/Pedestal", WriteKey="LArPedestal"))
116 
117  result.addEventAlgo(hecAlg)
118  if result.getService("THistSvc") is not None:
119  result.getService("THistSvc").Output += ["HEC DATAFILE='"+flags.LArNoise.HECNoiseNtup+"' OPT='RECREATE'",]
120  else:
121  result.addService(CompFactory.THistSvc(Output=["HEC DATAFILE='"+flags.LArNoise.HECNoiseNtup+"' OPT='RECREATE'",]))
122 
123  if (flags.LArNoise.outHistLAr != ""):
124  from LArCellRec.LArNoisyROSummaryConfig import LArNoisyROSummaryCfg
125  result.merge(LArNoisyROSummaryCfg(flags))
126  from LArMonitoring.LArNoisyROMonAlg import LArNoisyROMonConfig
127  result.merge(LArNoisyROMonConfig(flags, inKey="LArNoisyROSummary"))
128 
129  return result
130 
131 
132 
133 if __name__=="__main__":
134 
135  from AthenaConfiguration.AllConfigFlags import initConfigFlags
137 
138  from LArNoiseFlags import addNoiseFlags
139  addNoiseFlags(flags)
140  #flags.Input.Files=['/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data23_cos.00457007.physics_CosmicMuons.merge.RAW._lb0043._SFO-ALL._0001.1']
141  flags.Input.Files=['/eos/atlas/atlastier0/rucio/data23_13p6TeV/express_express/00461002/data23_13p6TeV.00461002.express_express.merge.RAW/data23_13p6TeV.00461002.express_express.merge.RAW._lb0922._SFO-ALL._0001.1']
142 
143  from AthenaConfiguration.TestDefaults import defaultGeometryTags
144  flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3
145 
146  flags.Trigger.triggerConfig = 'DB'
147  flags.Trigger.doID=False
148  flags.Trigger.doMuon=False
149  flags.Trigger.doLVL1=False
150  flags.Trigger.doHLT=False
151  flags.lock()
152 
153  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
154 
155  cfg=MainServicesCfg(flags)
156  #cfg.merge(LArNoiseCfg(flags))
157  cfg.merge(LArNoiseFromRawCfg(flags))
158 
159  cfg.run(10)
python.CaloRecoConfig.CaloRecoCfg
def CaloRecoCfg(flags, clustersname=None)
Definition: CaloRecoConfig.py:9
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.LArElecCalibDBConfig.LArPedestalCondAlg
LArPedestalCondAlg
Definition: LArElecCalibDBConfig.py:26
LArSCDumperSkeleton.L1CaloMenuCfg
def L1CaloMenuCfg(flags)
Definition: LArSCDumperSkeleton.py:11
LArNoiseFlags.addNoiseFlags
def addNoiseFlags(flags)
Definition: LArNoiseFlags.py:3
python.LArBadChannelConfig.LArBadChannelCfg
def LArBadChannelCfg(configFlags, tag=None, isSC=False)
Definition: LArBadChannelConfig.py:8
python.LArBadChannelConfig.LArBadFebCfg
def LArBadFebCfg(configFlags, tag=None)
Definition: LArBadChannelConfig.py:45
python.BunchCrossingCondAlgConfig.BunchCrossingCondAlgCfg
def BunchCrossingCondAlgCfg(flags)
Definition: BunchCrossingCondAlgConfig.py:8
LArNoisyROMonAlg.LArNoisyROMonConfig
def LArNoisyROMonConfig(flags, inKey="", NoisyFEBDefStr="(>30 chan with Q>4000)", NoisyHVlineDefStr="", MNBTightFEBDefStr="", MNBTight_PsVetoFEBDefStr="", MNBLooseFEBDefStr="")
Definition: LArNoisyROMonAlg.py:5
python.LArFebErrorSummaryMakerConfig.LArFebErrorSummaryMakerCfg
def LArFebErrorSummaryMakerCfg(flags)
Definition: LArFebErrorSummaryMakerConfig.py:7
LArNoiseConfig.LArNoiseFromRawCfg
def LArNoiseFromRawCfg(flags)
Definition: LArNoiseConfig.py:59
python.CaloNoiseCondAlgConfig.CaloNoiseCondAlgCfg
def CaloNoiseCondAlgCfg(flags, noisetype="totalNoise")
Definition: CaloNoiseCondAlgConfig.py:11
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
LArTimeVetoAlgConfig.LArTimeVetoAlgCfg
def LArTimeVetoAlgCfg(flags)
Definition: LArTimeVetoAlgConfig.py:7
python.IOVDbSvcConfig.addFolders
def addFolders(flags, folderStrings, detDb=None, className=None, extensible=False, tag=None, db=None, modifiers='')
Definition: IOVDbSvcConfig.py:72
LArCablingConfig.LArOnOffIdMappingCfg
def LArOnOffIdMappingCfg(configFlags)
Definition: LArCablingConfig.py:62
LArGMConfig.LArGMCfg
def LArGMCfg(flags)
Definition: LArGMConfig.py:8
python.TriggerInterface.TrigDecisionToolCfg
def TrigDecisionToolCfg(flags)
Definition: TriggerInterface.py:14
LArNoisyROSummaryConfig.LArNoisyROSummaryCfg
def LArNoisyROSummaryCfg(configFlags, **kwargs)
Definition: LArNoisyROSummaryConfig.py:8
LArCollisionTimeConfig.LArCollisionTimeCfg
def LArCollisionTimeCfg(configFlags, cutIteration=False)
Definition: LArCollisionTimeConfig.py:8
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
LArNoiseConfig.LArNoiseCfg
def LArNoiseCfg(flags)
Definition: LArNoiseConfig.py:6
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69
TileGMConfig.TileGMCfg
def TileGMCfg(flags)
Definition: TileGMConfig.py:7