ATLAS Offline Software
ZdcNtupleConfig.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 AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
6 
7 def ZdcNtupleCfg(flags, name="AnalysisAlg", **kwargs):
9 
10  if "TrigDecisionTool" not in kwargs:
11  from TrigDecisionTool.TrigDecisionToolConfig import TrigDecisionToolCfg
12  kwargs.setdefault("TrigDecisionTool", acc.getPrimaryAndMerge(
13  TrigDecisionToolCfg(flags)))
14 
15  if "TrackSelectionTool" not in kwargs:
16  from InDetConfig.InDetTrackSelectionToolConfig import InDetTrackSelectionTool_LoosePrimary_Cfg
17  kwargs.setdefault("TrackSelectionTool", acc.getPrimaryAndMerge(
18  InDetTrackSelectionTool_LoosePrimary_Cfg(flags, maxZ0SinTheta=1.5, maxD0overSigmaD0=3)))
19 
20  alg = CompFactory.ZdcNtuple(name, **kwargs)
21 
22 
23  acc.addEventAlgo(alg)
24 
25  return acc
26 
27 if __name__ == '__main__':
28 
29  from AthenaConfiguration.AllConfigFlags import initConfigFlags
30  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
31 
32  flags = initConfigFlags()
33  flags.fillFromArgs()
34  flags.lock()
35  acc = MainServicesCfg(flags)
36  acc.merge(PoolReadCfg(flags))
37  acc.merge(ZdcNtupleCfg(flags,
38  name = "AnalysisAlg",
39  zdcConfig = "LHCf2022",
40  lhcf2022 = False,
41  lhcf2022zdc = True,
42  lhcf2022afp = False,
43  zdcOnly = False,
44  useGRL = False,
45  zdcCalib = False,
46  reprocZdc = False,
47  enableOutputTree = True,
48  enableOutputSamples = False,
49  enableTrigger = True,
50  enableTracks = True,
51  enableClusters = True,
52  writeOnlyTriggers = True))
53 
54 
55  acc.addService(CompFactory.THistSvc(Output = ["ANALYSIS DATAFILE='NTUP.root' OPT='RECREATE'"]))
56 
57  acc.printConfig(withDetails=True)
58 
59  with open("config.pkl", "wb") as f:
60  acc.store(f)
61  status = acc.run()
62  if status.isFailure():
63  import sys
64  sys.exit(-1)
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.InDetTrackSelectionToolConfig.InDetTrackSelectionTool_LoosePrimary_Cfg
def InDetTrackSelectionTool_LoosePrimary_Cfg(flags, name="InDetTrackSelectionTool_LoosePrimary", **kwargs)
Configs based on CutLevel LoosePrimary #####.
Definition: InDetTrackSelectionToolConfig.py:54
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
python.TriggerInterface.TrigDecisionToolCfg
def TrigDecisionToolCfg(flags)
Definition: TriggerInterface.py:14
Trk::open
@ open
Definition: BinningType.h:40
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
ZdcNtupleConfig.ZdcNtupleCfg
def ZdcNtupleCfg(flags, name="AnalysisAlg", **kwargs)
Definition: ZdcNtupleConfig.py:7
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69