ATLAS Offline Software
ActsHGTD_single_pad_clusterization_test.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 
4 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
5 from AthenaConfiguration.ComponentFactory import CompFactory
6 import argparse
7 
8 if __name__ == "__main__":
9 
10  parser = argparse.ArgumentParser(description="Run reconstruction script with specified configuration.")
11  parser.add_argument("--mode", choices=["legacy", "xAOD"], required=True, help="Specify the reconstruction mode.")
12  args = parser.parse_args()
13 
14  from AthenaConfiguration.AllConfigFlags import initConfigFlags
15  flags = initConfigFlags()
16 
17  flags.Input.Files = ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/PhaseIIUpgrade/RDO/ATLAS-P2-RUN4-03-00-00/mc21_14TeV.601229.PhPy8EG_A14_ttbar_hdamp258p75_SingleLep.recon.RDO.e8481_s4149_r14700/RDO.33629020._000047.pool.root.1"]
18  flags.Exec.MaxEvents = -1
19 
20  output_suffix = "_legacy" if args.mode == "legacy" else "_xAOD"
21  flags.Output.HISTFileName = f"ActsMonitoringOutput{output_suffix}.root"
22  flags.DQ.useTrigger = False
23 
24  flags.Acts.doMonitoring = True
25  flags.HGTD.doMonitoring = True
26 
27  flags.lock()
28  flags.dump()
29 
30  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
31  acc = MainServicesCfg(flags)
32 
33  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
34  acc.merge(PoolReadCfg(flags))
35 
36  if args.mode == "legacy":
37  from HGTD_Config.HGTD_PrepRawDataFormationConfig import PadClusterizationCfg
38  acc.merge(PadClusterizationCfg(flags))
39 
40  # Add edm converter
41  from InDetConfig.InDetPrepRawDataFormationConfig import HGTDInDetToXAODClusterConversionCfg
42  acc.merge(HGTDInDetToXAODClusterConversionCfg(flags))
43 
44  elif args.mode == "xAOD":
45  from ActsConfig.ActsClusterizationConfig import ActsHgtdClusterizationAlgCfg
46  acc.merge(ActsHgtdClusterizationAlgCfg(flags))
47 
48  else :
49  raise ValueError("Invalid mode selected. Please select either 'legacy' or 'xAOD'.")
50 
51  from ActsConfig.ActsAnalysisConfig import ActsHgtdClusterAnalysisAlgCfg
52  acc.merge(ActsHgtdClusterAnalysisAlgCfg(flags))
53 
54  acc.printConfig(withDetails = True, summariseProps = True)
55  acc.run()
ActsClusterizationConfig.ActsHgtdClusterizationAlgCfg
ComponentAccumulator ActsHgtdClusterizationAlgCfg(flags, str name="ActsHgtdClusterizationAlg", **kwargs)
Definition: ActsClusterizationConfig.py:22
ActsAnalysisConfig.ActsHgtdClusterAnalysisAlgCfg
ComponentAccumulator ActsHgtdClusterAnalysisAlgCfg(flags, str name="ActsHgtdClusterAnalysisAlg", **kwargs)
Definition: ActsAnalysisConfig.py:106
python.HGTD_PrepRawDataFormationConfig.PadClusterizationCfg
def PadClusterizationCfg(flags, name="PadClusterizationAlg", **kwargs)
Definition: HGTD_PrepRawDataFormationConfig.py:25
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69
python.InDetPrepRawDataFormationConfig.HGTDInDetToXAODClusterConversionCfg
def HGTDInDetToXAODClusterConversionCfg(flags, name="HGTDInDetToXAODClusterConversion", **kwargs)
Definition: InDetPrepRawDataFormationConfig.py:26