ATLAS Offline Software
LArHVScaleConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 from AthenaConfiguration.Enums import LHCPeriod
6 
7 
8 def 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 IOVDbSvc.IOVDbSvcConfig import addFolders
17  LArHVCondAlg=CompFactory.LArHVCondAlg
18 
19  if configFlags.Input.isMC:
20  result.merge(addFolders(configFlags,["/LAR/Identifier/HVLineToElectrodeMap<tag>LARHVLineToElectrodeMap-001</tag>"], "LAR_OFL", className="AthenaAttributeList"))
21 
22  LArHVIdMappingAlg=CompFactory.LArHVIdMappingAlg
23  hvmapalg = LArHVIdMappingAlg(ReadKey="/LAR/Identifier/HVLineToElectrodeMap",WriteKey="LArHVIdMap")
24  result.addCondAlgo(hvmapalg)
25 
26  result.merge(LArBadFebCfg(configFlags))
27 
28  result.addCondAlgo(LArHVCondAlg(doHV=False, doAffectedHV=False))
29 
30  elif not configFlags.Common.isOnline:
31  result.merge(addFolders(configFlags,["/LAR/DCS/HV/BARREl/I16"], "DCS_OFL", className="CondAttrListCollection"))
32  result.merge(addFolders(configFlags,["/LAR/DCS/HV/BARREL/I8"], "DCS_OFL", className="CondAttrListCollection"))
33 
34  result.merge(addFolders(configFlags,["/LAR/IdentifierOfl/HVLineToElectrodeMap"], "LAR_OFL", className="AthenaAttributeList"))
35  result.merge(addFolders(configFlags,["/LAR/HVPathologiesOfl/Pathologies"], "LAR_OFL", className="AthenaAttributeList"))
36  if configFlags.GeoModel.Run is not LHCPeriod.Run1:
37  result.merge(addFolders(configFlags,["/LAR/HVPathologiesOfl/Rvalues"], "LAR_OFL", className="AthenaAttributeList"))
38 
39  result.merge(LArBadChannelCfg(configFlags))
40  result.merge(LArBadFebCfg(configFlags))
41 
42  LArHVIdMappingAlg=CompFactory.LArHVIdMappingAlg
43  hvmapalg = LArHVIdMappingAlg(ReadKey="/LAR/IdentifierOfl/HVLineToElectrodeMap",WriteKey="LArHVIdMap")
44  result.addCondAlgo(hvmapalg)
45 
46  LArHVPathologyDbCondAlg=CompFactory.LArHVPathologyDbCondAlg
47  hvpath = LArHVPathologyDbCondAlg(PathologyFolder="/LAR/HVPathologiesOfl/Pathologies",
48  HVMappingKey="LArHVIdMap",
49  HVPAthologyKey="LArHVPathology")
50  result.addCondAlgo(hvpath)
51 
52  from LArConfiguration.LArElecCalibDBConfig import LArElecCalibDBCfg
53  result.merge(LArElecCalibDBCfg(configFlags,["HVScaleCorr",]))
54 
55  if configFlags.GeoModel.Run is not LHCPeriod.Run1:
56  hvcond = LArHVCondAlg(HVPathologies="LArHVPathology")
57  else:
58  hvcond = LArHVCondAlg(HVPathologies="LArHVPathology",doR=False)
59 
60  hvcond.UndoOnlineHVCorr=True
61  hvcond.keyOutputCorr= "LArHVScaleCorrRecomputed"
62  result.addCondAlgo(hvcond)
63 
64  return result
65 
66 if __name__=="__main__":
67  from AthenaConfiguration.AllConfigFlags import initConfigFlags
68 
70 
71  nThreads=1
72  flags.Concurrency.NumThreads = nThreads
73  if nThreads>0:
74  flags.Scheduler.ShowDataDeps = True
75  flags.Scheduler.ShowDataFlow = True
76  flags.Scheduler.ShowControlFlow = True
77  flags.Concurrency.NumConcurrentEvents = nThreads
78 
79  flags.Input.Files = ["myESD-data.pool.root"]
80  flags.lock()
81 
82  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
83  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
84  cfg=MainServicesCfg(flags)
85  cfg.merge(PoolReadCfg(flags))
86 
87  cfg.merge( LArHVScaleCfg(flags) )
88 
89  cfg.run(10)
python.LArElecCalibDBConfig.LArElecCalibDBCfg
def LArElecCalibDBCfg(flags, condObjs)
Definition: LArElecCalibDBConfig.py:47
LArHVIdMappingAlg
Definition: LArHVIdMappingAlg.h:15
LArHVCondAlg
Definition: LArHVCondAlg.h:55
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
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
LArHVPathologyDbCondAlg
Definition: LArHVPathologyDbCondAlg.h:30
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
python.IOVDbSvcConfig.addFolders
def addFolders(flags, folderStrings, detDb=None, className=None, extensible=False, tag=None, db=None, modifiers='')
Definition: IOVDbSvcConfig.py:72
LArGMConfig.LArGMCfg
def LArGMCfg(flags)
Definition: LArGMConfig.py:8
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.LArHVScaleConfig.LArHVScaleCfg
def LArHVScaleCfg(configFlags)
Definition: LArHVScaleConfig.py:8
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69