ATLAS Offline Software
Loading...
Searching...
No Matches
LArADC2MeVCondAlgConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4from AthenaConfiguration.ComponentFactory import CompFactory
5
7 from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg
8 from LArConfiguration.LArElecCalibDBConfig import LArElecCalibDBCfg
9 from LArGeoAlgsNV.LArGMConfig import LArGMCfg
10
11 result=ComponentAccumulator()
12 result.merge(LArOnOffIdMappingCfg(flags))
13 result.merge(LArGMCfg(flags)) #Needed for identifier helpers
14
15 theADC2MeVCondAlg=CompFactory.LArADC2MeVCondAlg(LArADC2MeVKey = 'LArADC2MeV')
16
17 if flags.Input.isMC:
18 requiredConditions=["Ramp","DAC2uA","uA2MeV","MphysOverMcal","HVScaleCorr"]
19 theADC2MeVCondAlg.LAruA2MeVKey="LAruA2MeVSym"
20 theADC2MeVCondAlg.LArDAC2uAKey="LArDAC2uASym"
21 theADC2MeVCondAlg.LArRampKey="LArRampSym"
22 theADC2MeVCondAlg.LArMphysOverMcalKey="LArMphysOverMcalSym"
23 theADC2MeVCondAlg.LArHVScaleCorrKey="LArHVScaleCorr"
24 theADC2MeVCondAlg.UseFEBGainTresholds=False
25 else: # not MC:
26 requiredConditions=["Ramp","DAC2uA","uA2MeV","MphysOverMcal","HVScaleCorr"]
27 from LArRecUtils.LArFebConfigCondAlgConfig import LArFebConfigCondAlgCfg
28 if 'COMP200' in flags.IOVDb.DatabaseInstance: # Run1 case
29 theADC2MeVCondAlg.LAruA2MeVKey="LAruA2MeVSym"
30 theADC2MeVCondAlg.LArDAC2uAKey="LArDAC2uASym"
31 result.merge(LArFebConfigCondAlgCfg(flags))
32
33 result.merge(LArElecCalibDBCfg(flags,requiredConditions))
34 result.addCondAlgo(theADC2MeVCondAlg,primary=True)
35 return result
36
37
38if __name__ == "__main__":
39 from AthenaConfiguration.AllConfigFlags import initConfigFlags
40 from AthenaConfiguration.TestDefaults import defaultTestFiles, defaultGeometryTags
41
42 print ('--- data')
43 flags1 = initConfigFlags()
44 flags1.Input.Files = defaultTestFiles.RAW_RUN2
45 flags1.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
46 flags1.lock()
47 acc1 = LArADC2MeVCondAlgCfg (flags1)
48 acc1.printCondAlgs(summariseProps=True)
49 print ('IOVDbSvc:', acc1.getService('IOVDbSvc').Folders)
50 acc1.wasMerged()
51
52 print ('--- mc')
53 flags2 = initConfigFlags()
54 flags2.Input.Files = defaultTestFiles.ESD
55 flags2.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
56 flags2.lock()
57 acc2 = LArADC2MeVCondAlgCfg (flags2)
58 acc2.printCondAlgs(summariseProps=True)
59 print ('IOVDbSvc:', acc2.getService('IOVDbSvc').Folders)
60 acc2.wasMerged()