1 """ComponentAccumulator configuration utilities for LArRecUtils
3 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
6 from AthenaConfiguration.ComponentFactory
import CompFactory
7 from AthenaCommon.Logging
import logging
8 from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg
9 from LArConfiguration.LArElecCalibDBConfig
import LArElecCalibDBCfg
13 """Return ComponentAccumulator with configured LArMCSymCondAlg"""
15 kwargs.setdefault(
"ReadKey",
"LArOnOffIdMap")
16 acc.addCondAlgo(CompFactory.LArMCSymCondAlg(name, **kwargs))
21 """Return ComponentAccumulator with configured LArAutoCorrNoiseCondAlg"""
23 LArAutoCorrNoiseCondAlg=CompFactory.LArAutoCorrNoiseCondAlg
28 kwargs.setdefault(
"nSampl", flags.LAr.ROD.nSamples)
35 mlog = logging.getLogger (
'LArOFCCondAlgCfg')
36 mlog.info(
" entering LArOFCCondAlgCfg")
38 kwargs.setdefault (
'isMC',
True)
39 kwargs.setdefault (
'firstSample', flags.LAr.ROD.FirstSample)
40 kwargs.setdefault (
'useHighestGainAutoCorr', flags.LAr.ROD.UseHighestGainAutoCorr)
41 kwargs.setdefault(
'Nminbias',flags.LAr.ROD.NumberOfCollisions)
42 mlog.info(
"Setup LArOFCCOndAlg Nminbias %f ", flags.LAr.ROD.NumberOfCollisions)
45 requiredConditons=[
"Shape",
"Noise",
"Pedestal"]
48 LArOFCCondAlg=CompFactory.LArOFCCondAlg
49 acc.addCondAlgo (LArOFCCondAlg (name, **kwargs))
55 mlog = logging.getLogger (
'LArOFCSCCondAlgCfg')
56 mlog.info(
" entering LArOFCSCCondAlgCfg")
58 kwargs.setdefault (
'isMC',
True)
59 kwargs.setdefault (
'isSuperCell',
True)
60 kwargs.setdefault (
'firstSample', flags.LAr.ROD.FirstSample)
61 kwargs.setdefault (
'useHighestGainAutoCorr', flags.LAr.ROD.UseHighestGainAutoCorr)
63 from LArCabling.LArCablingConfig
import LArOnOffIdMappingSCCfg
65 kwargs.setdefault(
"LArOnOffIdMappingObjKey",
'LArOnOffIdMapSC')
66 requiredConditions=[
"ShapeSC",
"PedestalSC",
"NoiseSC"]
67 from LArConfiguration.LArElecCalibDBConfig
import LArElecCalibDBMCSCCfg
69 kwargs.setdefault(
"LArShapeObjKey",
'LArShapeSC')
70 kwargs.setdefault(
"LArNoiseObjKey",
'LArNoiseSC')
71 kwargs.setdefault(
"LArPedestalObjKey",
'LArPedestalSC')
74 kwargs.setdefault(
"LArAutoCorrTotalObjKey",
'LArAutoCorrTotalSC')
75 kwargs.setdefault(
"LArOFCObjKey",
'LArOFCSC')
77 kwargs.setdefault(
'Nminbias',flags.LAr.ROD.NumberOfCollisions)
78 mlog.info(
"Setup LArOFCSCCOndAlg Nminbias %f ", flags.LAr.ROD.NumberOfCollisions)
80 acc.addCondAlgo (CompFactory.LArOFCCondAlg (name, **kwargs))
85 mlog = logging.getLogger (
'LArAutoCorrTotalCondAlgCfg')
86 mlog.info(
" entering LArAutoCorrTotalCondAlgCfg")
89 kwargs.setdefault(
'Nsamples', flags.LAr.ROD.nSamples)
90 kwargs.setdefault(
'firstSample',flags.LAr.ROD.FirstSample)
91 mlog.info(
"Nsamples %d",flags.LAr.ROD.nSamples)
92 mlog.info(
"firstSample %d",flags.LAr.ROD.FirstSample)
93 deltaBunch =
int(flags.Beam.BunchSpacing/( 25.*ns)+0.5)
94 mlog.info(
"DeltaBunch %d " , deltaBunch)
95 kwargs.setdefault(
'deltaBunch',deltaBunch)
97 if flags.LAr.ROD.NumberOfCollisions <= 0:
98 kwargs.setdefault(
"NoPileUp",
True)
99 mlog.info(
" no pileup noise in LArAutoCorrTotal ")
101 kwargs.setdefault(
"NoPileUp",
False)
106 requiredConditons=[
"Shape",
"AutoCorr",
"Noise",
"Pedestal",
"fSampl",
"MinBias"]
108 LArAutoCorrTotalCondAlg=CompFactory.LArAutoCorrTotalCondAlg
109 acc.addCondAlgo (LArAutoCorrTotalCondAlg (name, **kwargs))
114 mlog = logging.getLogger (
'LArAutoCorrTotalSCCondAlgCfg')
115 mlog.info(
" entering LArAutoCorrTotalSCCondAlgCfg")
119 kwargs.setdefault(
"LArOnOffIdMappingObjKey",
'LArOnOffIdMapSC')
121 from LArRecUtils.LArADC2MeVSCCondAlgConfig
import LArADC2MeVSCCondAlgCfg
123 kwargs.setdefault(
"LArADC2MeVObjKey",
'LArADC2MeVSC')
125 requiredConditons=[
"ShapeSC",
"AutoCorrSC",
"NoiseSC",
"PedestalSC",
"fSamplSC",
"MinBiasSC"]
126 from LArConfiguration.LArElecCalibDBConfig
import LArElecCalibDBMCSCCfg
128 kwargs.setdefault(
"LArShapeObjKey",
'LArShapeSC')
129 kwargs.setdefault(
"LArAutoCorrObjKey",
'LArAutoCorrSC')
130 kwargs.setdefault(
"LArNoiseObjKey",
'LArNoiseSC')
131 kwargs.setdefault(
"LArPedestalObjKey",
'LArPedestalSC')
132 kwargs.setdefault(
"LArfSamplObjKey",
'LArfSamplSC')
133 kwargs.setdefault(
"LArMinBiasObjKey",
'LArMinBiasSC')
135 kwargs.setdefault(
"LArAutoCorrTotalObjKey",
'LArAutoCorrTotalSC')
137 kwargs.setdefault(
"isSuperCell",
True)
138 kwargs.setdefault(
'Nsamples', flags.LAr.ROD.nSamples)
139 kwargs.setdefault(
'firstSample',flags.LAr.ROD.FirstSample)
140 mlog.info(
"Nsamples %d",flags.LAr.ROD.nSamples)
141 mlog.info(
"firstSample %d",flags.LAr.ROD.FirstSample)
142 deltaBunch =
int(flags.Beam.BunchSpacing/( 25.*ns)+0.5)
143 mlog.info(
"DeltaBunch %d " , deltaBunch)
144 kwargs.setdefault(
'deltaBunch',deltaBunch)
147 if flags.LAr.ROD.NumberOfCollisions <= 0:
148 kwargs.setdefault(
"NoPileUp",
True)
149 mlog.info(
" no pileup noise in LArAutoCorrTotal ")
151 kwargs.setdefault(
"NoPileUp",
False)
153 LArAutoCorrTotalCondAlg=CompFactory.LArAutoCorrTotalCondAlg
154 acc.addCondAlgo (LArAutoCorrTotalCondAlg (name, **kwargs))
161 from LArCabling.LArCablingConfig
import LArFebRodMappingCfg, LArOnOffIdMappingCfg
162 acc.merge (LArFebRodMappingCfg (flags))
163 acc.merge (LArOnOffIdMappingCfg (flags))
165 from CaloConditions.CaloConditionsConfig
import LArTTCellMapCfg, CaloTTIdMapCfg
169 CaloTriggerTowerService = CompFactory.CaloTriggerTowerService
172 LArRoIMapCondAlg = CompFactory.LArRoIMapCondAlg
173 acc.addCondAlgo (LArRoIMapCondAlg (name, **kwargs))
177 if __name__ ==
"__main__":
178 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
179 from AthenaConfiguration.TestDefaults
import defaultTestFiles
181 print (
'--- LArOFCCondAlg 1')
183 flags1.LAr.ROD.NumberOfCollisions=0
184 flags1.Input.Files = defaultTestFiles.RDO_RUN2
186 acc1 = LArOFCCondAlgCfg (flags1)
187 acc1.printCondAlgs(summariseProps=
True)
190 print (
'--- LArAutoCorrTotalCondAlg')
192 flags4.LAr.ROD.NumberOfCollisions=0
193 flags4.Input.Files = defaultTestFiles.RDO_RUN2
194 flags4.LAr.ROD.nSamples = 32
196 acc4 = LArAutoCorrTotalCondAlgCfg (flags4)
197 acc4.printCondAlgs(summariseProps=
True)
200 print (
'--- LArRoIMapCondAlg')
202 flags5.LAr.ROD.NumberOfCollisions=0
203 flags5.Input.Files = defaultTestFiles.RDO_RUN2
205 acc5 = LArRoIMapCondAlgCfg (flags5)
206 acc5.printCondAlgs(summariseProps=
True)