ATLAS Offline Software
FPGAStripClusteringConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2 from AthenaConfiguration.ComponentFactory import CompFactory
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaCommon.Constants import DEBUG
5 
6 def FPGADataFormatToolCfg(flags, name='FPGADataFormatTool', **kwargs):
8  kwargs.setdefault('name', name)
9  acc.setPrivateTools(CompFactory.FPGADataFormatTool(**kwargs))
10  return acc
11 
12 def StripClusteringCfg(flags, name='FPGAStripClustering', **kwargs):
13  acc = ComponentAccumulator()
14 
15  tool = acc.popToolsAndMerge(FPGADataFormatToolCfg(flags))
16 
17  kwargs.setdefault('name', name)
18  # kwargs.setdefault('xclbin', 'StripClustering.xclbin') # Path to the strip clustering xclbin
19  kwargs.setdefault('xclbin', 'F110.sw_emu.xclbin') # Path to the strip clustering xclbin
20  kwargs.setdefault('KernelName', 'processHits') # Kernel name
21  kwargs.setdefault('InputTV', '') # Input TestVector file (set as needed)
22  kwargs.setdefault('RefTV', '') # Reference TestVector file (set as needed)
23  kwargs.setdefault('FPGADataFormatTool', tool)
24 
25  acc.addEventAlgo(CompFactory.FPGAStripClustering(**kwargs))
26 
27  return acc
28 
29 if __name__ == "__main__":
30  from AthenaConfiguration.AllConfigFlags import initConfigFlags
31  from InDetConfig.ITkTrackRecoConfig import ITkTrackRecoCfg
32 
33  # Initialize flags
34  flags = initConfigFlags()
35  flags.Concurrency.NumThreads = 1
36  flags.Input.Files = [
37  "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/PhaseIIUpgrade/RDO/ATLAS-P2-RUN4-03-00-00/mc21_14TeV.900495.PG_single_muonpm_Pt10_etaFlatnp0_43.recon.RDO.e8481_s4149_r14697/RDO.33675641._000037.pool.root.1"
38  ]
39 
40  # Disable calo for this test
41  flags.Detector.EnableCalo = False
42 
43  # Ensure xAOD space point and cluster containers are available
44  flags.Tracking.ITkMainPass.doAthenaToActsSpacePoint = True
45  flags.Tracking.ITkMainPass.doAthenaToActsCluster = True
46 
47  # Acts configuration
48  flags.Acts.doRotCorrection = False
49 
50  # Enable debug-level logging
51  flags.Debug.DumpEvtStore = True
52  flags.lock()
53 
54  # Main services configuration
55  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
56  cfg = MainServicesCfg(flags)
57  cfg.getService("MessageSvc").debugLimit = 99999999
58 
59  # Pool read configuration
60  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
61  cfg.merge(PoolReadCfg(flags))
62 
63  # Add truth information for MC data
64  if flags.Input.isMC:
65  from xAODTruthCnv.xAODTruthCnvConfig import GEN_AOD2xAODCfg
66  cfg.merge(GEN_AOD2xAODCfg(flags))
67 
68  # Standard reco
69  cfg.merge(ITkTrackRecoCfg(flags))
70 
71 
72  # Add strip clustering configuration
73  kwargs = {}
74  kwargs["OutputLevel"] = DEBUG
75  acc = StripClusteringCfg(flags, **kwargs)
76  cfg.merge(acc)
77 
78  # Run the configuration for 1 event
79  cfg.run(1)
python.ITkTrackRecoConfig.ITkTrackRecoCfg
ComponentAccumulator ITkTrackRecoCfg(flags)
Main ITk tracking config #####################.
Definition: ITkTrackRecoConfig.py:511
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
xAODTruthCnvConfig.GEN_AOD2xAODCfg
def GEN_AOD2xAODCfg(flags, name="GEN_AOD2xAOD", **kwargs)
Definition: xAODTruthCnvConfig.py:20
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:312
Constants
some useful constants -------------------------------------------------—
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
FPGAStripClusteringConfig.StripClusteringCfg
def StripClusteringCfg(flags, name='FPGAStripClustering', **kwargs)
Definition: FPGAStripClusteringConfig.py:12
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:71
FPGAStripClusteringConfig.FPGADataFormatToolCfg
def FPGADataFormatToolCfg(flags, name='FPGADataFormatTool', **kwargs)
Definition: FPGAStripClusteringConfig.py:6