ATLAS Offline Software
Loading...
Searching...
No Matches
F600IntegrationConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.ComponentFactory import CompFactory
4from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
5
6def F600IntegrationCfg(flags, name = 'BenckmarkAlg', **kwarg):
7 acc = ComponentAccumulator()
8
9 kwarg.setdefault('bdfID', flags.FPGADataPrep.bdfID) # On the testbed
10 kwarg.setdefault('xclbin', '/eos/project/a/atlas-eftracking/FPGA_compilation/FPGA_compilation_hw/F611/kernels.hw.xclbin')
11
12 kwarg.setdefault('PixelClusterInputPath', '/eos/project/a/atlas-eftracking/TestVectors/FPGATrackSim_TVs/Test_Vectors_v0-6-3a/DataPrep_FullDet_SingleMuon/pixel_cluster_input.txt')
13 kwarg.setdefault('PixelStageOneSlicingInputPath', '/eos/project/a/atlas-eftracking/TestVectors/FPGATrackSim_TVs/Test_Vectors_v0-6-3a/DataPrep_FullDet_SingleMuon/pixelL2G_output.txt')
14 kwarg.setdefault('InsideOutInputPath', '/eos/project/a/atlas-eftracking/TestVectors/FPGATrackSim_TVs/Test_Vectors_v0-6-3a/F600_Region34_SingleMuon/slicing_PixelFirst_output.txt')
15
16# DataPrep
17 kwarg.setdefault('PixelClusteringKernelName', 'pixel_clustering_tool')
18 kwarg.setdefault('ProcessHitsKernelName', 'processHits')
19 kwarg.setdefault('PixelL2gKernelName', 'l2g_pixel_tool')
20 kwarg.setdefault('StripL2gKernelName', 'l2g_strip_tool')
21 kwarg.setdefault('PixelEdmPrepKernelName', 'PixelEDMPrep')
22 kwarg.setdefault('StripEdmPrepKernelName', 'StripEDMPrep')
23 kwarg.setdefault('PixelFirstStageInputKernelName', 'krnl_input_stage_rtl')
24 kwarg.setdefault('PixelFirstStageOutputKernelName', 'krnl_output_stage_rtl')
25
26# Slicing Engine
27 kwarg.setdefault('PixelFirstStageSlicingIPName', 'slicing_engine')
28
29# Inside Out
30 kwarg.setdefault('MemReadKernelName', 'mem_read')
31 kwarg.setdefault('MemWriteKernelName', 'mem_write')
32
33# Space Points
34 kwarg.setdefault('SpacepointKernelName', 'spacepoint_tool')
35
36# NN Pathfinder
37 kwarg.setdefault('LoaderKernelName', 'loader')
38 kwarg.setdefault('UnloaderKernelName', 'unloader')
39
40# NN Classifier
41 kwarg.setdefault('NnOverlapDecoratorKernelName', 'NNOverlapDecorator_kernel')
42
43# Duplicate Remover
44 kwarg.setdefault('RunnerKernelName', 'runner')
45
46 # Set up Cluster maker tool
47 from EFTrackingFPGAPipeline.DataPrepConfig import xAODClusterMakerCfg
48 clusterMakerTool = acc.popToolsAndMerge(xAODClusterMakerCfg(flags))
49 kwarg.setdefault('xAODClusterMaker', clusterMakerTool)
50
51 # Set up TestVectorTool
52 from EFTrackingFPGAUtility.FPGADataFormatter import FPGATestVectorToolCfg
53 testVectorTool = acc.popToolsAndMerge(FPGATestVectorToolCfg(flags))
54 kwarg.setdefault('TestVectorTool', testVectorTool)
55
56 outputTool = acc.popToolsAndMerge(FPGAOutputConversionToolCfg(flags))
57 kwarg.setdefault('OutputConversionTool', outputTool)
58
59 # Set up Chrono service
60 acc.addService(CompFactory.ChronoStatSvc(
61 PrintUserTime = True,
62 PrintSystemTime = True,
63 PrintEllapsedTime = True
64 ))
65
66 alg = CompFactory.EFTrackingFPGAIntegration.F600IntegrationAlg(**kwarg)
67 import ROOT
68 alg.OutputLevel = ROOT.MSG.DEBUG
69 acc.addEventAlgo(alg)
70
71 return acc
72
73def FPGAOutputConversionToolCfg(flags, name = 'FPGAOutputConversionTool', **kwarg):
74
75 acc = ComponentAccumulator()
76
77 kwarg.setdefault('name', name)
78 acc.setPrivateTools(CompFactory.OutputConversionTool(**kwarg))
79
80 return acc
81
82
83
84if __name__ == "__main__":
85 from AthenaConfiguration.AllConfigFlags import initConfigFlags
86 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
87
88 flags = initConfigFlags()
89
90
92 FinalProtoTrackChainxAODTracksKey="FPGA"
93 flags.Detector.EnableCalo = False
94
95 # ensure that the xAOD SP and cluster containers are available
96 flags.Tracking.ITkMainPass.doAthenaToActsSpacePoint=True
97 flags.Tracking.ITkMainPass.doAthenaToActsCluster=True
98 from ActsConfig.ActsCIFlags import actsLegacyWorkflowFlags
99 actsLegacyWorkflowFlags(flags)
100 flags.Acts.doRotCorrection = False
101
102
103 flags.Concurrency.NumThreads=1
104 #flags.Concurrency.NumProcs=0
105 flags.Scheduler.ShowDataDeps=True
106 flags.Scheduler.CheckDependencies=True
107 flags.Debug.DumpEvtStore=False
108 # single muon
109 #flags.Input.Files = ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/PhaseIIUpgrade/EFTracking/ATLAS-P2-RUN4-03-00-00/RDO/reg0_singlemu.root"]
110 # ttbar
111 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"]
112
113 flags.fillFromArgs()
114
115 if (flags.Trigger.FPGATrackSim.pipeline.startswith('F-6')):
116 print("You are trying to run an F-6* pipeline! I am auto-configuring the Inside-Out for you. Whether you wanted to or not")
117 flags.Trigger.FPGATrackSim.Hough.genScan=True
118 flags.Trigger.FPGATrackSim.spacePoints = flags.Trigger.FPGATrackSim.Hough.secondStage
119 print("You are trying to run the NN fake rejection as part of a pipeline! I am going to enable this for you whether you want to or not")
120 flags.Trigger.FPGATrackSim.tracking = True
121 flags.Trigger.FPGATrackSim.Hough.trackNNAnalysis = True
122
123 elif (flags.Trigger.FPGATrackSim.pipeline != ""):
124 raise AssertionError("ERROR You are trying to run the pipeline " + flags.Trigger.FPGATrackSim.pipeline + " which is not yet supported!")
125
126 flags.lock()
127 flags.dump()
128 flags = flags.cloneAndReplace("Tracking.ActiveConfig","Tracking.MainPass")
129 cfg=MainServicesCfg(flags)
130
131 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
132 cfg.merge(PoolReadCfg(flags))
133
134 if flags.Input.isMC:
135 from xAODTruthCnv.xAODTruthCnvConfig import GEN_AOD2xAODCfg
136 cfg.merge(GEN_AOD2xAODCfg(flags))
137
138 from JetRecConfig.JetRecoSteering import addTruthPileupJetsToOutputCfg # TO DO: check if this is indeed necessary for pileup samples
139 cfg.merge(addTruthPileupJetsToOutputCfg(flags))
140
141 if flags.Detector.EnableCalo:
142 from CaloRec.CaloRecoConfig import CaloRecoCfg
143 cfg.merge(CaloRecoCfg(flags))
144
145 if flags.Tracking.recoChain:
146 from InDetConfig.TrackRecoConfig import InDetTrackRecoCfg
147 cfg.merge(InDetTrackRecoCfg(flags))
148
149
150 # Configure both the dataprep and logical hits algorithms.
151 from InDetConfig.InDetPrepRawDataFormationConfig import ITkXAODToInDetClusterConversionCfg
152 cfg.merge(ITkXAODToInDetClusterConversionCfg(flags)) # needed for the FPGATrackSim DataPrep to work
153 from FPGATrackSimConfTools.FPGATrackSimDataPrepConfig import FPGATrackSimDataPrepAlgCfg
154 cfg.merge(FPGATrackSimDataPrepAlgCfg(flags))
155 from FPGATrackSimConfTools.FPGATrackSimMultiRegionConfig import FPGATrackSimMultiRegionTrackingCfg
156 cfg.merge(FPGATrackSimMultiRegionTrackingCfg(flags))
157
158 kwarg = {}
159 acc = F600IntegrationCfg(flags, **kwarg)
160 cfg.merge(acc)
161
162 from AthenaCommon.Constants import DEBUG
163 cfg.foreach_component("AthEventSeq/*").OutputLevel = DEBUG
164
165 cfg.printConfig(withDetails=True, summariseProps=True)
166
167 cfg.run(flags.Exec.MaxEvents)
168
void print(char *figname, TCanvas *c1)
FPGAOutputConversionToolCfg(flags, name='FPGAOutputConversionTool', **kwarg)
F600IntegrationCfg(flags, name='BenckmarkAlg', **kwarg)