ATLAS Offline Software
HIRecConfig.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 AthenaCommon.Logging import logging
5 __log = logging.getLogger('HIRecConfig')
6 
7 
8 def HIRecCfg(flags):
9  '''Configures entire HI reconstruction'''
10  acc = ComponentAccumulator()
11 
12 
13  if flags.HeavyIon.doGlobal:
14  from HIGlobal.HIGlobalConfig import HIGlobalRecCfg
15  acc.merge(HIGlobalRecCfg(flags))
16 
17  if flags.HeavyIon.doJet:
18  from HIJetRec.HIJetRecConfigCA import HIJetRecCfg
19  acc.merge(HIJetRecCfg(flags))
20  if flags.Input.isMC:
21  from JetRecConfig.JetRecConfig import JetRecCfg
22  from JetRecConfig.JetRecoSteering import addJetsToOutputCfg
23  from JetRecConfig.StandardSmallRJets import AntiKt4Truth, AntiKt2Truth
24  jetdefs = [AntiKt4Truth,AntiKt2Truth]
25  for jd in jetdefs:
26  acc.merge(JetRecCfg(flags, jd))
27  acc.merge(addJetsToOutputCfg(flags, jetdefs, toAOD=True, toESD=False))
28 
29  if flags.HeavyIon.Egamma.doSubtractedClusters:
30  from HIJetRec.HIEgammaRecConfigCA import (
31  HIEgammaRecCfg)
32  acc.merge(HIEgammaRecCfg(flags))
33 
34  return acc
35 
36 
37 
38 if __name__ == "__main__":
39  from AthenaConfiguration.AllConfigFlags import initConfigFlags
40  from AthenaConfiguration.TestDefaults import defaultTestFiles, defaultGeometryTags
41  flags = initConfigFlags()
42 
43 # testing for Run 2:
44  # flags.Input.Files = [defaultTestFiles.d + "/RecJobTransformTests/data18_hi.00367384.physics_HardProbes.daq.RAW._lb0145._SFO-8._0001.data"]
45  # flags.IOVDb.GlobalTag = "CONDBR2-BLKPA-RUN2-09"
46  # flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
47 
48 # testing for Run 3:
49  flags.Input.Files = [defaultTestFiles.d + "/RecJobTransformTests/data22_hi/RAWFiles/data22_hi.00440101.physics_MinBias.daq.RAW/data22_hi.00440101.physics_MinBias.daq.RAW._lb0214._SFO-11._0001.data"]
50  flags.IOVDb.GlobalTag = "CONDBR2-BLKPA-2022-09"
51  flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3
52 
53 # set more flags:
54  flags.Exec.MaxEvents=5
55  flags.Exec.SkipEvents=0
56  flags.Concurrency.NumThreads=1
57  flags.Output.doWriteAOD = True
58  flags.Output.AODFileName = "myAOD.pool.root"
59  flags.Output.doWriteESD = True
60  flags.Output.ESDFileName = "myESD.pool.root"
61 
62  flags.Trigger.triggerConfig = "DB"
63 
64  from HIRecConfig.HIModeFlags import HImode
65  HImode(flags)
66 
67 # enables unit tests to switch only parts of reco such as (note the absence of spaces around equal signs):
68 
69  flags.fillFromArgs()
70 
71  flags.lock()
72 
73 
74  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
75  acc = MainServicesCfg(flags)
76 
77  from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
78  acc.merge(ByteStreamReadCfg(flags))
79  if flags.Reco.EnableBeamSpotDecoration:
80  from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoBeamSpotDecoratorAlgCfg
81  acc.merge(EventInfoBeamSpotDecoratorAlgCfg(flags))
82  if flags.HeavyIon.redoTracking:
83  from InDetConfig.TrackRecoConfig import InDetTrackRecoCfg
84  acc.merge(InDetTrackRecoCfg(flags))
85  if flags.HeavyIon.redoEgamma:
86  from egammaConfig.egammaSteeringConfig import EGammaSteeringCfg
87  acc.merge(EGammaSteeringCfg(flags))
88 
89 
90 
91  from JetRecConfig.JetRecConfig import JetRecCfg
92  from JetRecConfig.StandardSmallRJets import AntiKt4EMTopo
93  EMjet = AntiKt4EMTopo.clone()
94  EMjet.ghostdefs = ["Track"]
95  acc.merge(JetRecCfg(flags,EMjet))
96 
97  acc.merge(HIRecCfg(flags))
98 
99 
100  from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg
101  acc.merge(PoolWriteCfg(flags))
102 
103 # debug output level can be switched for particular algorithms:
104  # from AthenaCommon.Constants import DEBUG
105  # acc.foreach_component("*HISubtractedCellMakerTool*").OutputLevel=DEBUG
106  # acc.foreach_component("*HICellCopyTool*").OutputLevel=DEBUG
107 
108  acc.printConfig(withDetails=True, summariseProps=True)
109 
110  flags.dump()
111 
112 
113  import sys
114  sys.exit(acc.run().isFailure())
HIJetRecConfigCA.HIJetRecCfg
def HIJetRecCfg(flags)
Definition: HIJetRecConfigCA.py:508
HIEgammaRecConfigCA.HIEgammaRecCfg
def HIEgammaRecCfg(flags)
Definition: HIEgammaRecConfigCA.py:8
python.PoolWriteConfig.PoolWriteCfg
def PoolWriteCfg(flags)
Definition: PoolWriteConfig.py:41
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.ByteStreamConfig.ByteStreamReadCfg
def ByteStreamReadCfg(flags, type_names=None)
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:25
python.egammaSteeringConfig.EGammaSteeringCfg
def EGammaSteeringCfg(flags, name="EGammaSteering")
Definition: egammaSteeringConfig.py:15
python.JetRecConfig.JetRecCfg
def JetRecCfg(flags, jetdef, returnConfiguredDef=False)
Top level functions returning ComponentAccumulator out of JetDefinition.
Definition: JetRecConfig.py:36
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
python.HIModeFlags.HImode
def HImode(flags)
Definition: HIModeFlags.py:5
python.JetRecoSteering.addJetsToOutputCfg
def addJetsToOutputCfg(flags, jetdefs, toAOD=True, toESD=True)
Definition: JetRecoSteering.py:27
python.TrackRecoConfig.InDetTrackRecoCfg
def InDetTrackRecoCfg(flags)
Main ID tracking config #####################.
Definition: TrackRecoConfig.py:791
python.xAODEventInfoCnvConfig.EventInfoBeamSpotDecoratorAlgCfg
def EventInfoBeamSpotDecoratorAlgCfg(flags, name="EventInfoBeamSpotDecoratorAlg", eventInfoKey="EventInfo", **kwargs)
Definition: xAODEventInfoCnvConfig.py:139
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.HIRecConfig.HIRecCfg
def HIRecCfg(flags)
Definition: HIRecConfig.py:8
HIGlobalConfig.HIGlobalRecCfg
def HIGlobalRecCfg(flags)
Definition: HIGlobalConfig.py:76