ATLAS Offline Software
Loading...
Searching...
No Matches
LArHVScaleConfig.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
5from AthenaConfiguration.Enums import LHCPeriod
6
7
8def LArHVScaleCfg(configFlags):
9 result=ComponentAccumulator()
10
11 from LArBadChannelTool.LArBadChannelConfig import LArBadChannelCfg, LArBadFebCfg
12
13 from LArGeoAlgsNV.LArGMConfig import LArGMCfg
14 result.merge(LArGMCfg(configFlags))
15
16 from LArCabling.LArHVCablingConfig import LArHVCablingCfg
17 result.merge(LArHVCablingCfg(configFlags))
18
19 result.merge(LArBadFebCfg(configFlags))
20
21 from IOVDbSvc.IOVDbSvcConfig import addFolders
22 LArHVCondAlg=CompFactory.LArHVCondAlg
23
24 if configFlags.Input.isMC:
25 result.addCondAlgo(LArHVCondAlg(doHV=False, doAffectedHV=False))
26
27 elif not configFlags.Common.isOnline:
28 result.merge(addFolders(configFlags,["/LAR/DCS/HV/BARREl/I16"], "DCS_OFL", className="CondAttrListCollection"))
29 result.merge(addFolders(configFlags,["/LAR/DCS/HV/BARREL/I8"], "DCS_OFL", className="CondAttrListCollection"))
30
31 result.merge(addFolders(configFlags,["/LAR/HVPathologiesOfl/Pathologies"], "LAR_OFL", className="AthenaAttributeList"))
32 if configFlags.GeoModel.Run is not LHCPeriod.Run1:
33 result.merge(addFolders(configFlags,["/LAR/HVPathologiesOfl/Rvalues"], "LAR_OFL", className="AthenaAttributeList"))
34
35 result.merge(LArBadChannelCfg(configFlags))
36
37 LArHVPathologyDbCondAlg=CompFactory.LArHVPathologyDbCondAlg
38 hvpath = LArHVPathologyDbCondAlg(PathologyFolder="/LAR/HVPathologiesOfl/Pathologies",
39 HVMappingKey="LArHVIdMap",
40 HVPAthologyKey="LArHVPathology")
41 result.addCondAlgo(hvpath)
42
43 from LArConfiguration.LArElecCalibDBConfig import LArElecCalibDBCfg
44 result.merge(LArElecCalibDBCfg(configFlags,["HVScaleCorr",]))
45
46 if configFlags.GeoModel.Run is not LHCPeriod.Run1:
47 hvcond = LArHVCondAlg(HVPathologies="LArHVPathology")
48 else:
49 hvcond = LArHVCondAlg(HVPathologies="LArHVPathology",doR=False)
50
51 hvcond.UndoOnlineHVCorr=True
52 hvcond.keyOutputCorr= "LArHVScaleCorrRecomputed"
53 result.addCondAlgo(hvcond)
54
55 return result
56
57if __name__=="__main__":
58 from AthenaConfiguration.AllConfigFlags import initConfigFlags
59
60 flags=initConfigFlags()
61
62 nThreads=1
63 flags.Concurrency.NumThreads = nThreads
64 if nThreads>0:
65 flags.Scheduler.ShowDataDeps = True
66 flags.Scheduler.ShowDataFlow = True
67 flags.Scheduler.ShowControlFlow = True
68 flags.Concurrency.NumConcurrentEvents = nThreads
69
70 flags.Input.Files = ["myESD-data.pool.root"]
71 flags.lock()
72
73 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
74 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
75 cfg=MainServicesCfg(flags)
76 cfg.merge(PoolReadCfg(flags))
77
78 cfg.merge( LArHVScaleCfg(flags) )
79
80 cfg.run(10)