ATLAS Offline Software
Loading...
Searching...
No Matches
FPGAStripClusteringConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2from AthenaConfiguration.ComponentFactory import CompFactory
3from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4from AthenaCommon.Constants import DEBUG
5
6def FPGADataFormatToolCfg(flags, name='FPGADataFormatTool', **kwargs):
7 acc = ComponentAccumulator()
8 kwargs.setdefault('name', name)
9 acc.setPrivateTools(CompFactory.FPGADataFormatTool(**kwargs))
10 return acc
11
12def 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
29if __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)
StripClusteringCfg(flags, name='FPGAStripClustering', **kwargs)
FPGADataFormatToolCfg(flags, name='FPGADataFormatTool', **kwargs)