ATLAS Offline Software
FPGATrackSimAnalysisConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
3 from AthenaConfiguration.ComponentFactory import CompFactory
4 from AthenaCommon.Logging import AthenaLogger
5 from PathResolver import PathResolver
6 import importlib
7 import os
8 
9 log = AthenaLogger(__name__)
10 
11 
12 from FPGATrackSimConfTools import FPGATrackSimDataPrepConfig
13 
14 def getNSubregions(filePath):
15  with open(PathResolver.FindCalibFile(filePath), 'r') as f:
16  fields = f.readline()
17  assert(fields.startswith('towers'))
18  n = fields.split()[1]
19  return int(n)
20 
21 
22 # Need to figure out if we have two output writers or somehow only one.
24  result=ComponentAccumulator()
25  FPGATrackSimWriteOutput = CompFactory.FPGATrackSimOutputHeaderTool("FPGATrackSimWriteOutput")
26  FPGATrackSimWriteOutput.InFileName = ["test.root"]
27  FPGATrackSimWriteOutput.OutputTreeName = FPGATrackSimDataPrepConfig.nameWithRegionSuffix(flags,"FPGATrackSimLogicalEventTree")
28  if not flags.Trigger.FPGATrackSim.writeAdditionalOutputData:
29  FPGATrackSimWriteOutput.EventLimit = 0
30  else:
31  FPGATrackSimWriteOutput.EventLimit = flags.Trigger.FPGATrackSim.writeOutputEventLimit
32  # RECREATE means that that this tool opens the file.
33  # HEADER would mean that something else (e.g. THistSvc) opens it and we just add the object.
34  FPGATrackSimWriteOutput.RWstatus = "HEADER"
35  FPGATrackSimWriteOutput.THistSvc = CompFactory.THistSvc()
36  result.setPrivateTools(FPGATrackSimWriteOutput)
37  return result
38 
39 def FPGATrackSimSlicingEngineCfg(flags,name="FPGATrackSimSlicingEngineTool"):
40  result = ComponentAccumulator()
41  FPGATrackSimSlicingEngineTool = CompFactory.FPGATrackSimSlicingEngineTool(FPGATrackSimDataPrepConfig.nameWithRegionSuffix(flags,name))
42  # this is the same as the layer map used by the genscan/inside out tool below.
43  FPGATrackSimSlicingEngineTool.LayerMap = os.path.join(PathResolver.FindCalibDirectory(flags.Trigger.FPGATrackSim.mapsDir),f"{FPGATrackSimDataPrepConfig.getBaseName(flags)}_lyrmap.json")
44  FPGATrackSimSlicingEngineTool.FPGATrackSimMappingSvc = result.getPrimaryAndMerge(FPGATrackSimDataPrepConfig.FPGATrackSimMappingCfg(flags))
45  # If the GNN is enabled (i.e. this is F-4xx) then we don't want to separate first vs second stage.
46  FPGATrackSimSlicingEngineTool.doSecondStage = (not flags.Trigger.FPGATrackSim.ActiveConfig.GNN)
47  FPGATrackSimSlicingEngineTool.RootOutput = flags.Trigger.FPGATrackSim.writeAdditionalOutputData
48  result.setPrivateTools(FPGATrackSimSlicingEngineTool)
49  return result
50 
51 def FPGATrackSimBankSvcCfg(flags,name="FPGATrackSimBankSvc"):
52  result=ComponentAccumulator()
53  FPGATrackSimBankSvc = CompFactory.FPGATrackSimBankSvc(FPGATrackSimDataPrepConfig.nameWithRegionSuffix(flags,name))
54  FPGATrackSimBankSvc.FPGATrackSimMappingSvc = result.getPrimaryAndMerge(FPGATrackSimDataPrepConfig.FPGATrackSimMappingCfg(flags))
55  pathBankSvc = flags.Trigger.FPGATrackSim.bankDir if flags.Trigger.FPGATrackSim.bankDir != '' else f'/eos/atlas/atlascerngroupdisk/det-htt/HTTsim/{flags.GeoModel.AtlasVersion}/21.9.16/'+FPGATrackSimDataPrepConfig.getBaseName(flags)+'/SectorBanks/'
56  pathBankSvc=PathResolver.FindCalibDirectory(pathBankSvc)
57  FPGATrackSimBankSvc.constantsNoGuess_1st = [
58  f'{pathBankSvc}corrgen_raw_8L_skipPlane0.gcon',
59  f'{pathBankSvc}corrgen_raw_8L_skipPlane1.gcon',
60  f'{pathBankSvc}corrgen_raw_8L_skipPlane2.gcon',
61  f'{pathBankSvc}corrgen_raw_8L_skipPlane3.gcon',
62  f'{pathBankSvc}corrgen_raw_8L_skipPlane4.gcon',
63  f'{pathBankSvc}corrgen_raw_8L_skipPlane5.gcon',
64  f'{pathBankSvc}corrgen_raw_8L_skipPlane6.gcon',
65  f'{pathBankSvc}corrgen_raw_8L_skipPlane7.gcon']
66  FPGATrackSimBankSvc.constantsNoGuess_2nd = [
67  f'{pathBankSvc}corrgen_raw_13L_skipPlane0.gcon',
68  f'{pathBankSvc}corrgen_raw_13L_skipPlane1.gcon',
69  f'{pathBankSvc}corrgen_raw_13L_skipPlane2.gcon',
70  f'{pathBankSvc}corrgen_raw_13L_skipPlane3.gcon',
71  f'{pathBankSvc}corrgen_raw_13L_skipPlane4.gcon',
72  f'{pathBankSvc}corrgen_raw_13L_skipPlane5.gcon',
73  f'{pathBankSvc}corrgen_raw_13L_skipPlane6.gcon',
74  f'{pathBankSvc}corrgen_raw_13L_skipPlane7.gcon']
75  layers="5L" if flags.Trigger.FPGATrackSim.ActiveConfig.genScan else "9L"
76  s2_layers = 13
77  pathMapSvc = flags.Trigger.FPGATrackSim.mapsDir if flags.Trigger.FPGATrackSim.mapsDir != '' else f'/eos/atlas/atlascerngroupdisk/det-htt/HTTsim/{flags.GeoModel.AtlasVersion}/21.9.16/'+FPGATrackSimDataPrepConfig.getBaseName(flags)+'/SectorMaps/'
78  pathMapSvc = PathResolver.FindCalibDirectory(pathMapSvc)
79  pmap_file = os.path.join(pathMapSvc, f"region{flags.Trigger.FPGATrackSim.region}.pmap")
80  with open(pmap_file) as f:
81  for line in f:
82  if 'logical_s2' in line:
83  s2_layers = int(line.strip().split()[0])
84  break
85  FPGATrackSimBankSvc.constants_1st = f'{pathBankSvc}corrgen_raw_{layers}_reg{flags.Trigger.FPGATrackSim.region}_checkGood1.gcon'
86  FPGATrackSimBankSvc.constants_2nd = f'{pathBankSvc}corrgen_raw_{s2_layers}L_reg{flags.Trigger.FPGATrackSim.region}_checkGood1.gcon'
87  FPGATrackSimBankSvc.sectorBank_1st = f'{pathBankSvc}sectorsHW_raw_{layers}_reg{flags.Trigger.FPGATrackSim.region}_checkGood1.patt'
88  FPGATrackSimBankSvc.sectorBank_2nd = f'{pathBankSvc}sectorsHW_raw_{s2_layers}L_reg{flags.Trigger.FPGATrackSim.region}_checkGood1.patt'
89  FPGATrackSimBankSvc.sectorSlices = f'{pathBankSvc}slices_{layers}_reg{flags.Trigger.FPGATrackSim.region}.root'
90  FPGATrackSimBankSvc.phiShift = flags.Trigger.FPGATrackSim.phiShift
91 
92  # These should be configurable. The tag system needs updating though.
93  FPGATrackSimBankSvc.sectorQPtBins = [-0.001, -0.0005, 0, 0.0005, 0.001]
94  FPGATrackSimBankSvc.qptAbsBinning = False
95 
96  result.addService(FPGATrackSimBankSvc, create=True, primary=True)
97  return result
98 
99 
100 def FPGATrackSimRoadUnionToolCfg(flags,name="FPGATrackSimRoadUnionTool"):
101  result=ComponentAccumulator()
102  RF = CompFactory.FPGATrackSimRoadUnionTool(FPGATrackSimDataPrepConfig.nameWithRegionSuffix(flags,name))
103 
104  xBins = flags.Trigger.FPGATrackSim.ActiveConfig.xBins
105  xBufferBins = flags.Trigger.FPGATrackSim.ActiveConfig.xBufferBins
106  yBins = flags.Trigger.FPGATrackSim.ActiveConfig.yBins
107  yBufferBins = flags.Trigger.FPGATrackSim.ActiveConfig.yBufferBins
108  yMin = flags.Trigger.FPGATrackSim.ActiveConfig.qptMin
109  yMax = flags.Trigger.FPGATrackSim.ActiveConfig.qptMax
110  xMin = flags.Trigger.FPGATrackSim.ActiveConfig.phiMin
111  xMax = flags.Trigger.FPGATrackSim.ActiveConfig.phiMax
112  if (not flags.Trigger.FPGATrackSim.oldRegionDefs):
113  phiRange = FPGATrackSimDataPrepConfig.getPhiRange(flags)
114  xMin = phiRange[0]
115  xMax = phiRange[1]
116 
117  xBuffer = (xMax - xMin) / xBins * xBufferBins
118  xMin = xMin - xBuffer
119  xMax = xMax + xBuffer
120  yBuffer = (yMax - yMin) / yBins * yBufferBins
121  yMin -= yBuffer
122  yMax += yBuffer
123  tools = []
124  houghType = flags.Trigger.FPGATrackSim.ActiveConfig.houghType
125  roadMerge = flags.Trigger.FPGATrackSim.ActiveConfig.roadMerge
126 
127 
128  FPGATrackSimMapping = result.getPrimaryAndMerge(FPGATrackSimDataPrepConfig.FPGATrackSimMappingCfg(flags))
129  for number in range(getNSubregions(FPGATrackSimMapping.subrmap)):
130  HoughTransform = CompFactory.FPGATrackSimHoughTransformTool(FPGATrackSimDataPrepConfig.nameWithRegionSuffix(flags,"FPGATrackSimHoughTransformTool")+"_" + str(number))
131  HoughTransform.FPGATrackSimEventSelectionSvc = result.getPrimaryAndMerge(FPGATrackSimDataPrepConfig.FPGATrackSimEventSelectionSvcCfg(flags))
132  HoughTransform.FPGATrackSimBankSvc = result.getPrimaryAndMerge(FPGATrackSimBankSvcCfg(flags))
133  HoughTransform.FPGATrackSimMappingSvc = FPGATrackSimMapping
134  HoughTransform.combine_layers = flags.Trigger.FPGATrackSim.ActiveConfig.combineLayers
135  HoughTransform.convSize_x = flags.Trigger.FPGATrackSim.ActiveConfig.convSizeX
136  HoughTransform.convSize_y = flags.Trigger.FPGATrackSim.ActiveConfig.convSizeY
137  HoughTransform.convolution = flags.Trigger.FPGATrackSim.ActiveConfig.convolution
138  HoughTransform.d0_max = 0
139  HoughTransform.d0_min = 0
140  HoughTransform.fieldCorrection = flags.Trigger.FPGATrackSim.ActiveConfig.fieldCorrection
141  HoughTransform.hitExtend_x = flags.Trigger.FPGATrackSim.ActiveConfig.hitExtendX
142  HoughTransform.localMaxWindowSize = flags.Trigger.FPGATrackSim.ActiveConfig.localMaxWindowSize
143  HoughTransform.nBins_x = xBins + 2 * xBufferBins
144  HoughTransform.nBins_y = yBins + 2 * yBufferBins
145  HoughTransform.phi_max = xMax
146  HoughTransform.phi_min = xMin
147  HoughTransform.qpT_max = yMax
148  HoughTransform.qpT_min = yMin
149  HoughTransform.scale = flags.Trigger.FPGATrackSim.ActiveConfig.scale
150  HoughTransform.subRegion = number
151  HoughTransform.threshold = flags.Trigger.FPGATrackSim.ActiveConfig.threshold
152  HoughTransform.traceHits = True
153  HoughTransform.IdealGeoRoads = (flags.Trigger.FPGATrackSim.ActiveConfig.IdealGeoRoads and flags.Trigger.FPGATrackSim.tracking)
154  HoughTransform.useSpacePoints = flags.Trigger.FPGATrackSim.spacePoints
155  HoughTransform.houghType = houghType
156  HoughTransform.roadMerge = roadMerge
157  if houghType=='LowResource':
158  HoughTransform.requirements = flags.Trigger.FPGATrackSim.ActiveConfig.requirements
159  if houghType=='Flexible':
160  HoughTransform.r_max=flags.Trigger.FPGATrackSim.ActiveConfig.r_max
161  HoughTransform.phi_coord_max=flags.Trigger.FPGATrackSim.ActiveConfig.phi_coord_max
162  HoughTransform.phi_range=flags.Trigger.FPGATrackSim.ActiveConfig.phi_range
163  HoughTransform.r_max_mm=flags.Trigger.FPGATrackSim.ActiveConfig.r_max_mm
164  HoughTransform.bitwise_qApt_conv=flags.Trigger.FPGATrackSim.ActiveConfig.bitwise_qApt_conv
165  HoughTransform.bitwise_phi0_conv=flags.Trigger.FPGATrackSim.ActiveConfig.bitwise_phi0_conv
166  HoughTransform.phi0_sectors=flags.Trigger.FPGATrackSim.ActiveConfig.phi0_sectors
167  HoughTransform.qApt_sectors=flags.Trigger.FPGATrackSim.ActiveConfig.qApt_sectors
168  HoughTransform.pipes_qApt=flags.Trigger.FPGATrackSim.ActiveConfig.pipes_qApt
169  HoughTransform.pipes_phi0=flags.Trigger.FPGATrackSim.ActiveConfig.pipes_phi0
170 
171  tools.append(HoughTransform)
172 
173  RF.tools = tools
174  result.addPublicTool(RF, primary=True)
175  return result
176 
177 def FPGATrackSimRoadUnionTool1DCfg(flags,name="FPGATrackSimRoadUnionTool1D"):
178  result=ComponentAccumulator()
179  tools = []
180  RF = CompFactory.FPGATrackSimRoadUnionTool(FPGATrackSimDataPrepConfig.nameWithRegionSuffix(flags,name))
181  splitpt=flags.Trigger.FPGATrackSim.Hough1D.splitpt
182  FPGATrackSimMapping = result.getPrimaryAndMerge(FPGATrackSimDataPrepConfig.FPGATrackSimMappingCfg(flags))
183  for ptstep in range(splitpt):
184  qpt_min = flags.Trigger.FPGATrackSim.Hough1D.qptMin
185  qpt_max = flags.Trigger.FPGATrackSim.Hough1D.qptMax
186  lowpt = qpt_min + (qpt_max-qpt_min)/splitpt*ptstep
187  highpt = qpt_min + (qpt_max-qpt_min)/splitpt*(ptstep+1)
188  nSlice = getNSubregions(FPGATrackSimMapping.subrmap)
189  for iSlice in range(nSlice):
190  tool = CompFactory.FPGATrackSimHough1DShiftTool(FPGATrackSimDataPrepConfig.nameWithRegionSuffix(flags,
191  "Hough1DShift" + str(iSlice)+(("_pt{}".format(ptstep)) if splitpt>1 else "")))
192  tool.subRegion = iSlice if nSlice > 1 else -1
193  xMin = flags.Trigger.FPGATrackSim.Hough1D.phiMin
194  xMax = flags.Trigger.FPGATrackSim.Hough1D.phiMax
195  if (not flags.Trigger.FPGATrackSim.oldRegionDefs):
196  phiRange = FPGATrackSimDataPrepConfig.getPhiRange(flags)
197  xMin = phiRange[0]
198  xMax = phiRange[1]
199  tool.phiMin = xMin
200  tool.phiMax = xMax
201  tool.qptMin = lowpt
202  tool.qptMax = highpt
203  tool.nBins = flags.Trigger.FPGATrackSim.Hough1D.xBins
204  tool.useDiff = True
205  tool.variableExtend = True
206  tool.drawHitMasks = False
207  tool.phiRangeCut = flags.Trigger.FPGATrackSim.Hough1D.phiRangeCut
208  tool.d0spread=-1.0 # mm
209  tool.iterStep = 0 # auto, TODO put in tag
210  tool.iterLayer = 7 # TODO put in tag
211  tool.threshold = flags.Trigger.FPGATrackSim.Hough1D.threshold[0]
212  tool.hitExtend = flags.Trigger.FPGATrackSim.Hough1D.hitExtendX
213  tool.FPGATrackSimEventSelectionSvc = result.getPrimaryAndMerge(FPGATrackSimDataPrepConfig.FPGATrackSimEventSelectionSvcCfg(flags))
214  tool.FPGATrackSimBankSvc = result.getPrimaryAndMerge(FPGATrackSimBankSvcCfg(flags))
215  tool.FPGATrackSimMappingSvc = FPGATrackSimMapping
216  tool.IdealGeoRoads = (flags.Trigger.FPGATrackSim.ActiveConfig.IdealGeoRoads and flags.Trigger.FPGATrackSim.tracking)
217  tool.useSpacePoints = flags.Trigger.FPGATrackSim.spacePoints
218 
219  tools.append(tool)
220 
221  RF.tools = tools
222  result.addPublicTool(RF, primary=True)
223  return result
224 
225 
226 
227 def FPGATrackSimRoadUnionToolGenScanCfg(flags,name="FPGATrackSimRoadUnionToolGenScan"):
228  result=ComponentAccumulator()
229 
230  print("logLevel",flags.Trigger.FPGATrackSim.loglevel)
231 
232  # read the cuts from a seperate python file specified by FPGATrackSim.GenScan.genScanCuts
233  cutset=None
234  if flags.Trigger.FPGATrackSim.oldRegionDefs:
235  toload=flags.Trigger.FPGATrackSim.GenScan.genScanCuts
236  if toload == 'FPGATrackSimGenScanCuts': # its on the newRegion default so it hasn't been set
237  toload = 'FPGATrackSimHough.FPGATrackSimGenScanCuts_incr'
238  cutset = importlib.import_module(toload).cuts[flags.Trigger.FPGATrackSim.region]
239  else:
240  # this allows the cut file defined in python to be loaded from the map directory
241  cutpath = os.path.join(
242  PathResolver.FindCalibDirectory(flags.Trigger.FPGATrackSim.mapsDir),
243  f"{flags.Trigger.FPGATrackSim.GenScan.genScanCuts}.py")
244  print("Cut File = ", cutpath)
245  spec=importlib.util.spec_from_file_location(flags.Trigger.FPGATrackSim.GenScan.genScanCuts,cutpath)
246  if spec is None:
247  print("Failed to find Cut File")
248  cutmodule = importlib.util.module_from_spec(spec)
249  spec.loader.exec_module(cutmodule)
250  cutset=cutmodule.cuts[flags.Trigger.FPGATrackSim.region]
251 
252  # make the binned hits class
253  BinnnedHits = CompFactory.FPGATrackSimBinnedHits("BinnedHits_1stStage")
254  BinnnedHits.OutputLevel=flags.Trigger.FPGATrackSim.loglevel
255  BinnnedHits.FPGATrackSimEventSelectionSvc = result.getPrimaryAndMerge(FPGATrackSimDataPrepConfig.FPGATrackSimEventSelectionSvcCfg(flags))
256 
257  # set layer map
258  if not flags.Trigger.FPGATrackSim.GenScan.layerStudy:
259  if flags.Trigger.FPGATrackSim.oldRegionDefs:
260  BinnnedHits.layerMapFile = flags.Trigger.FPGATrackSim.GenScan.layerMapFile
261  else:
262  # now assumed to be in the map directory with name = basename for region + _lyrmap.json
263  BinnnedHits.layerMapFile =os.path.join(
264  PathResolver.FindCalibDirectory(flags.Trigger.FPGATrackSim.mapsDir),
265  f"{FPGATrackSimDataPrepConfig.getBaseName(flags)}_lyrmap.json")
266 
267 
268  # make the bintool class
269  BinTool = CompFactory.FPGATrackSimBinTool("BinTool_1stStage")
270  BinTool.OutputLevel=flags.Trigger.FPGATrackSim.loglevel
271 
272  # Inputs for the BinTool
273  binsteps=[]
274  BinDesc=None
275  if (cutset["parSet"]=="PhiSlicedKeyLyrPars") :
276  BinDesc = CompFactory.FPGATrackSimKeyLayerBinDesc("KeyLayerBinDesc")
277  BinDesc.OutputLevel=flags.Trigger.FPGATrackSim.loglevel
278  BinDesc.rin=cutset["rin"]
279  BinDesc.rout=cutset["rout"]
280 
281  # parameters for key layer bindesc are :"zR1", "zR2", "phiR1", "phiR2", "xm"
282  step1 = CompFactory.FPGATrackSimBinStep("PhiBinning")
283  step1.OutputLevel=flags.Trigger.FPGATrackSim.loglevel
284  step1.parBins = [1,1,cutset["parBins"][2],cutset["parBins"][3],cutset["parBins"][4]]
285  step2 = CompFactory.FPGATrackSimBinStep("FullBinning")
286  step2.OutputLevel=flags.Trigger.FPGATrackSim.loglevel
287  step2.parBins = cutset["parBins"]
288  binsteps = [step1,step2]
289  else:
290  log.error("Unknown Binning Setup: ",cutset["parSet"])
291 
292  BinTool.BinDesc = BinDesc
293  BinTool.Steps=binsteps
294 
295 
296  # configure the padding around the nominal region
297  BinTool.d0FractionalPadding =0.05
298  BinTool.z0FractionalPadding =0.05
299  BinTool.etaFractionalPadding =0.05
300  BinTool.phiFractionalPadding =0.05
301  BinTool.qOverPtFractionalPadding =0.05
302  BinTool.parMin = cutset["parMin"]
303  BinTool.parMax = cutset["parMax"]
304  BinnnedHits.BinTool = BinTool
305 
306 
307  # make the monitoring class
308  Monitor = CompFactory.FPGATrackSimGenScanMonitoring(FPGATrackSimDataPrepConfig.nameWithRegionSuffix(flags,"GenScanMonitoring"))
309  Monitor.dir = "/GENSCAN/"
310  Monitor.THistSvc = CompFactory.THistSvc()
311  Monitor.OutputLevel=flags.Trigger.FPGATrackSim.loglevel
312  Monitor.phiScale = 10.0
313  Monitor.etaScale = 100.0
314  Monitor.drScale = 20.0
315 
316  # make the main tool
317  tool = CompFactory.FPGATrackSimGenScanTool(FPGATrackSimDataPrepConfig.nameWithRegionSuffix(flags,"GenScanTool"))
318  tool.FPGATrackSimEventSelectionSvc = result.getPrimaryAndMerge(FPGATrackSimDataPrepConfig.FPGATrackSimEventSelectionSvcCfg(flags))
319  tool.FPGATrackSimMappingSvc = result.getPrimaryAndMerge(FPGATrackSimDataPrepConfig.FPGATrackSimMappingCfg(flags))
320  tool.OutputLevel=flags.Trigger.FPGATrackSim.loglevel
321  tool.Monitoring = Monitor
322  tool.BinnedHits = BinnnedHits
323  tool.rin=cutset["rin"]
324  tool.rout=cutset["rout"]
325 
326  # For the 'track fitter' part of GenScanTool.
327  tool.inBinFiltering = flags.Trigger.FPGATrackSim.GenScan.filterInBin
328  tool.phiChi2Weight = flags.Trigger.FPGATrackSim.GenScan.phiChi2Weight
329  tool.etaChi2Weight = flags.Trigger.FPGATrackSim.GenScan.etaChi2Weight
330 
331  # configure which filers and thresholds to apply
332  tool.binFilter=flags.Trigger.FPGATrackSim.GenScan.binFilter
333  tool.reversePairDir=flags.Trigger.FPGATrackSim.GenScan.reverse
334  tool.applyPairFilter= not flags.Trigger.FPGATrackSim.GenScan.noCuts
335  tool.applyPairSetFilter= not flags.Trigger.FPGATrackSim.GenScan.noCuts
336  tool.threshold = 4
337 
338  # set cuts
339  for (cut,val) in cutset.items():
340  if cut in ["parBins","parSet","parMin","parMax"]:
341  continue
342  setattr(tool,cut,val)
343 
344  # even though we are not actually doing a Union, we need the
345  # RoadUnionTool because mapping is now there
346  RoadUnion = CompFactory.FPGATrackSimRoadUnionTool(FPGATrackSimDataPrepConfig.nameWithRegionSuffix(flags,name))
347  RoadUnion.FPGATrackSimMappingSvc = result.getPrimaryAndMerge(FPGATrackSimDataPrepConfig.FPGATrackSimMappingCfg(flags))
348  RoadUnion.tools = [tool,]
349  result.addPublicTool(RoadUnion, primary=True)
350 
351  # special configuration for studing layer definitions
352  # pass through all hits, but turn off pairing because
353  # it won't be able to run
354  if flags.Trigger.FPGATrackSim.GenScan.layerStudy:
355  RoadUnion.noHitFilter=True
356  tool.binningOnly=True
357  return result
358 
359 def FPGATrackSimRoadUnionToolGNNCfg(flags,name="FPGATrackSimRoadUnionToolGNN"):
360  result = ComponentAccumulator()
361  RF = CompFactory.FPGATrackSimRoadUnionTool(FPGATrackSimDataPrepConfig.nameWithRegionSuffix(flags,name))
362  RF.FPGATrackSimMappingSvc = result.getPrimaryAndMerge(FPGATrackSimDataPrepConfig.FPGATrackSimMappingCfg(flags))
363 
364  patternRecoTool = CompFactory.FPGATrackSimGNNPatternRecoTool(FPGATrackSimDataPrepConfig.nameWithRegionSuffix(flags,"FPGATrackSimGNNPatternRecoTool"))
365  patternRecoTool.GNNGraphHitSelector = CompFactory.FPGATrackSimGNNGraphHitSelectorTool(FPGATrackSimDataPrepConfig.nameWithRegionSuffix(flags,"FPGATrackSimGNNGraphHitSelectorTool"))
366  patternRecoTool.GNNGraphConstruction = result.popToolsAndMerge(FPGATrackSimGNNGraphConstructionToolCfg(flags))
367  patternRecoTool.GNNEdgeClassifier = result.popToolsAndMerge(FPGATrackSimGNNEdgeClassifierToolCfg(flags))
368  patternRecoTool.GNNRoadMaker = result.popToolsAndMerge(FPGATrackSimGNNRoadMakerToolCfg(flags))
369  patternRecoTool.GNNRootOutput = result.popToolsAndMerge(FPGATrackSimGNNRootOutputToolCfg(flags))
370  patternRecoTool.doGNNRootOutput = flags.Trigger.FPGATrackSim.GNN.doGNNRootOutput
371 
372  RF.tools = [patternRecoTool]
373  result.addPublicTool(RF, primary=True)
374 
375  return result
376 
377 def FPGATrackSimGNNGraphConstructionToolCfg(flags,name="FPGATrackSimGNNGraphConstructionTool"):
378  result = ComponentAccumulator()
379 
380  GNNGraphConstructionTool = CompFactory.FPGATrackSimGNNGraphConstructionTool(FPGATrackSimDataPrepConfig.nameWithRegionSuffix(flags,name))
381  GNNGraphConstructionTool.graphTool = flags.Trigger.FPGATrackSim.GNN.graphTool.value
382 
383  # Module Map Configuration
384  GNNGraphConstructionTool.moduleMapType=flags.Trigger.FPGATrackSim.GNN.moduleMapType.value
385  GNNGraphConstructionTool.moduleMapFunc=flags.Trigger.FPGATrackSim.GNN.moduleMapFunc.value
386  GNNGraphConstructionTool.moduleMapTol=flags.Trigger.FPGATrackSim.GNN.moduleMapTol
387  GNNGraphConstructionTool.moduleMapPath=PathResolver.FindCalibFile(flags.Trigger.FPGATrackSim.GNN.moduleMapPath)
388 
389  # Metric Learning Configuration
390  GNNGraphConstructionTool.metricLearningR=flags.Trigger.FPGATrackSim.GNN.metricLearningR
391  GNNGraphConstructionTool.metricLearningMaxN=flags.Trigger.FPGATrackSim.GNN.metricLearningMaxN
392 
393  from AthOnnxComps.OnnxRuntimeInferenceConfig import OnnxRuntimeInferenceToolCfg
394  from AthOnnxComps.OnnxRuntimeFlags import OnnxRuntimeType
395 
396  GNNGraphConstructionTool.MLInferenceTool = result.popToolsAndMerge(OnnxRuntimeInferenceToolCfg(
397  flags, flags.Trigger.FPGATrackSim.GNN.MLModelPath, OnnxRuntimeType.CPU))
398 
399  result.setPrivateTools(GNNGraphConstructionTool)
400 
401  return result
402 
403 def FPGATrackSimGNNEdgeClassifierToolCfg(flags,name="FPGATrackSimGNNEdgeClassifierTool"):
404  result = ComponentAccumulator()
405 
406  from AthOnnxComps.OnnxRuntimeInferenceConfig import OnnxRuntimeInferenceToolCfg
407  from AthOnnxComps.OnnxRuntimeFlags import OnnxRuntimeType
408 
409  GNNEdgeClassifierTool = CompFactory.FPGATrackSimGNNEdgeClassifierTool(FPGATrackSimDataPrepConfig.nameWithRegionSuffix(flags,name))
410  GNNEdgeClassifierTool.GNNInferenceTool = result.popToolsAndMerge(OnnxRuntimeInferenceToolCfg(
411  flags, flags.Trigger.FPGATrackSim.GNN.GNNModelPath, OnnxRuntimeType.CPU))
412 
413  result.setPrivateTools(GNNEdgeClassifierTool)
414 
415  return result
416 
417 def FPGATrackSimGNNRoadMakerToolCfg(flags,name="FPGATrackSimGNNRoadMakerTool"):
418  result = ComponentAccumulator()
419 
420  GNNRoadMakerTool = CompFactory.FPGATrackSimGNNRoadMakerTool(FPGATrackSimDataPrepConfig.nameWithRegionSuffix(flags,name))
421  GNNRoadMakerTool.roadMakerTool = flags.Trigger.FPGATrackSim.GNN.roadMakerTool.value
422  GNNRoadMakerTool.edgeScoreCut = flags.Trigger.FPGATrackSim.GNN.edgeScoreCut
423  GNNRoadMakerTool.FPGATrackSimMappingSvc = result.getPrimaryAndMerge(FPGATrackSimDataPrepConfig.FPGATrackSimMappingCfg(flags))
424 
425  result.setPrivateTools(GNNRoadMakerTool)
426 
427  return result
428 
429 def FPGATrackSimGNNRootOutputToolCfg(flags,name="FPGATrackSimGNNRootOutputTool"):
430  result = ComponentAccumulator()
431 
432  GNNRootOutputTool = CompFactory.FPGATrackSimGNNRootOutputTool(FPGATrackSimDataPrepConfig.nameWithRegionSuffix(flags,name))
433  GNNRootOutputTool.OutputRegion = str(flags.Trigger.FPGATrackSim.region)
434 
435  result.addService(CompFactory.THistSvc(Output = ["TRIGFPGATrackSimGNNOUTPUT DATAFILE='GNNRootOutput.root', OPT='RECREATE'"]))
436  result.setPrivateTools(GNNRootOutputTool)
437 
438  return result
439 
440 def FPGATrackSimDataFlowToolCfg(flags,name="FPGATrackSimDataFlowTool"):
441  result=ComponentAccumulator()
442  DataFlowTool = CompFactory.FPGATrackSimDataFlowTool(FPGATrackSimDataPrepConfig.nameWithRegionSuffix(flags,name))
443  DataFlowTool.FPGATrackSimEventSelectionSvc = result.getPrimaryAndMerge(FPGATrackSimDataPrepConfig.FPGATrackSimEventSelectionSvcCfg(flags))
444  DataFlowTool.FPGATrackSimMappingSvc = result.getPrimaryAndMerge(FPGATrackSimDataPrepConfig.FPGATrackSimMappingCfg(flags))
445  DataFlowTool.Chi2ndofCut = flags.Trigger.FPGATrackSim.ActiveConfig.chi2cut
446  DataFlowTool.THistSvc = CompFactory.THistSvc()
447  result.setPrivateTools(DataFlowTool)
448  return result
449 
450 def FPGATrackSimHoughRootOutputToolCfg(flags,name="FPGATrackSimHoughRootOutputTool"):
451  result=ComponentAccumulator()
452  HoughRootOutputTool = CompFactory.FPGATrackSimHoughRootOutputTool(FPGATrackSimDataPrepConfig.nameWithRegionSuffix(flags,name))
453  HoughRootOutputTool.FPGATrackSimEventSelectionSvc = result.getPrimaryAndMerge(FPGATrackSimDataPrepConfig.FPGATrackSimEventSelectionSvcCfg(flags))
454  HoughRootOutputTool.FPGATrackSimMappingSvc = result.getPrimaryAndMerge(FPGATrackSimDataPrepConfig.FPGATrackSimMappingCfg(flags))
455  HoughRootOutputTool.THistSvc = CompFactory.THistSvc()
456  HoughRootOutputTool.OutputRegion = str(flags.Trigger.FPGATrackSim.region)
457  result.setPrivateTools(HoughRootOutputTool)
458  return result
459 
460 def LRTRoadFinderCfg(flags,name="LRTRoadFinder"):
461 
462  result=ComponentAccumulator()
463  LRTRoadFinder =CompFactory.FPGATrackSimHoughTransform_d0phi0_Tool(FPGATrackSimDataPrepConfig.nameWithRegionSuffix(flags,name))
464  LRTRoadFinder.FPGATrackSimBankSvc = result.getPrimaryAndMerge(FPGATrackSimBankSvcCfg(flags))
465  LRTRoadFinder.FPGATrackSimMappingSvc = result.getPrimaryAndMerge(FPGATrackSimDataPrepConfig.FPGATrackSimMappingCfg(flags))
466  LRTRoadFinder.combine_layers = flags.Trigger.FPGATrackSim.ActiveConfig.lrtStraighttrackCombineLayers
467  LRTRoadFinder.convolution = flags.Trigger.FPGATrackSim.ActiveConfig.lrtStraighttrackConvolution
468  LRTRoadFinder.hitExtend_x = flags.Trigger.FPGATrackSim.ActiveConfig.lrtStraighttrackHitExtendX
469  LRTRoadFinder.scale = flags.Trigger.FPGATrackSim.ActiveConfig.scale
470  LRTRoadFinder.threshold = flags.Trigger.FPGATrackSim.ActiveConfig.lrtStraighttrackThreshold
471  result.setPrivateTools(LRTRoadFinder)
472  return result
473 
474 def NNTrackToolCfg(flags,name="FPGATrackSimNNTrackTool"):
475  result=ComponentAccumulator()
476  NNTrackTool = CompFactory.FPGATrackSimNNTrackTool(FPGATrackSimDataPrepConfig.nameWithRegionSuffix(flags,name))
477  NNTrackTool.THistSvc = CompFactory.THistSvc()
478  NNTrackTool.FPGATrackSimMappingSvc = result.getPrimaryAndMerge(FPGATrackSimDataPrepConfig.FPGATrackSimMappingCfg(flags))
479  NNTrackTool.FPGATrackSimBankSvc = result.getPrimaryAndMerge(FPGATrackSimBankSvcCfg(flags))
480  NNTrackTool.IdealGeoRoads = False
481  NNTrackTool.useSpacePoints = flags.Trigger.FPGATrackSim.spacePoints and not flags.Trigger.FPGATrackSim.ActiveConfig.genScan and not flags.Trigger.FPGATrackSim.ActiveConfig.GNN
482  NNTrackTool.SPRoadFilterTool = result.popToolsAndMerge(SPRoadFilterToolCfg(flags))
483  NNTrackTool.MinNumberOfRealHitsInATrack = 5 if flags.Trigger.FPGATrackSim.ActiveConfig.genScan else 9
484  NNTrackTool.useSectors = False
485  NNTrackTool.doGNNTracking = flags.Trigger.FPGATrackSim.GNN.doGNNTracking
486  NNTrackTool.nInputsGNN = flags.Trigger.FPGATrackSim.GNN.nInputsGNN
487  NNTrackTool.useCartesian = flags.Trigger.FPGATrackSim.NNCartesianCoordinates
488  result.setPrivateTools(NNTrackTool)
489  return result
490 
491 def FPGATrackSimTrackFitterToolCfg(flags,name="FPGATrackSimTrackFitterTool"):
492  result=ComponentAccumulator()
493  TF_1st = CompFactory.FPGATrackSimTrackFitterTool(FPGATrackSimDataPrepConfig.nameWithRegionSuffix(flags,name))
494  TF_1st.GuessHits = flags.Trigger.FPGATrackSim.ActiveConfig.guessHits
495  TF_1st.IdealCoordFitType = flags.Trigger.FPGATrackSim.ActiveConfig.idealCoordFitType
496  TF_1st.FPGATrackSimBankSvc = result.getPrimaryAndMerge(FPGATrackSimBankSvcCfg(flags))
497  TF_1st.FPGATrackSimMappingSvc = result.getPrimaryAndMerge(FPGATrackSimDataPrepConfig.FPGATrackSimMappingCfg(flags))
498  TF_1st.chi2DofRecoveryMax = flags.Trigger.FPGATrackSim.ActiveConfig.chi2DoFRecoveryMax
499  TF_1st.chi2DofRecoveryMin = flags.Trigger.FPGATrackSim.ActiveConfig.chi2DoFRecoveryMin
500  TF_1st.doMajority = flags.Trigger.FPGATrackSim.ActiveConfig.doMajority
501  TF_1st.nHits_noRecovery = flags.Trigger.FPGATrackSim.ActiveConfig.nHitsNoRecovery
502  TF_1st.DoDeltaGPhis = flags.Trigger.FPGATrackSim.ActiveConfig.doDeltaGPhis
503  TF_1st.DoMissingHitsChecks = flags.Trigger.FPGATrackSim.ActiveConfig.doMissingHitsChecks
504  TF_1st.IdealGeoRoads = (flags.Trigger.FPGATrackSim.ActiveConfig.IdealGeoRoads and flags.Trigger.FPGATrackSim.tracking)
505  TF_1st.useSpacePoints = flags.Trigger.FPGATrackSim.spacePoints and not flags.Trigger.FPGATrackSim.ActiveConfig.genScan
506  TF_1st.SPRoadFilterTool = result.popToolsAndMerge(SPRoadFilterToolCfg(flags))
507  TF_1st.fitFromRoad = flags.Trigger.FPGATrackSim.ActiveConfig.fitFromRoad
508  result.addPublicTool(TF_1st, primary=True)
509  return result
510 
511 def FPGATrackSimOverlapRemovalToolCfg(flags,name="FPGATrackSimOverlapRemovalTool"):
512  result=ComponentAccumulator()
513  OR_1st = CompFactory.FPGATrackSimOverlapRemovalTool(FPGATrackSimDataPrepConfig.nameWithRegionSuffix(flags,name))
514  OR_1st.ORAlgo = "Normal"
515  OR_1st.doFastOR = flags.Trigger.FPGATrackSim.ActiveConfig.doFastOR
516  OR_1st.NumOfHitPerGrouping = 3
517  OR_1st.FPGATrackSimMappingSvc = result.getPrimaryAndMerge(FPGATrackSimDataPrepConfig.FPGATrackSimMappingCfg(flags))
518  if flags.Trigger.FPGATrackSim.ActiveConfig.useVaryingChi2Cut and not flags.Trigger.FPGATrackSim.ActiveConfig.trackNNAnalysis2nd:
519  OR_1st.MinChi2 = getChi2Cut(flags.Trigger.FPGATrackSim.region)
520  elif flags.Trigger.FPGATrackSim.ActiveConfig.useVaryingChi2Cut and flags.Trigger.FPGATrackSim.ActiveConfig.trackNNAnalysis2nd:
521  OR_1st.MinChi2 = getChi2CutNN(flags.Trigger.FPGATrackSim.region)
522  else:
523  OR_1st.MinChi2 = flags.Trigger.FPGATrackSim.ActiveConfig.chi2cut
524  if flags.Trigger.FPGATrackSim.ActiveConfig.hough or flags.Trigger.FPGATrackSim.ActiveConfig.hough1D:
525  OR_1st.nBins_x = flags.Trigger.FPGATrackSim.ActiveConfig.xBins + 2 * flags.Trigger.FPGATrackSim.ActiveConfig.xBufferBins
526  OR_1st.nBins_y = flags.Trigger.FPGATrackSim.ActiveConfig.yBins + 2 * flags.Trigger.FPGATrackSim.ActiveConfig.yBufferBins
527  OR_1st.localMaxWindowSize = flags.Trigger.FPGATrackSim.ActiveConfig.localMaxWindowSize
528  OR_1st.roadSliceOR = flags.Trigger.FPGATrackSim.ActiveConfig.roadSliceOR
529 
530  from FPGATrackSimAlgorithms.FPGATrackSimAlgorithmConfig import FPGATrackSimOverlapRemovalToolMonitoringCfg
531  OR_1st.MonTool = result.getPrimaryAndMerge(FPGATrackSimOverlapRemovalToolMonitoringCfg(flags))
532 
533  result.addPublicTool(OR_1st, primary=True)
534  return result
535 
537  newFlags = flags.cloneAndReplace("Trigger.FPGATrackSim.ActiveConfig", "Trigger.FPGATrackSim." + flags.Trigger.FPGATrackSim.algoTag,keepOriginal=True)
538  return newFlags
539 
540 def SPRoadFilterToolCfg(flags,secondStage=False,name="FPGATrackSimSpacepointRoadFilterTool"):
541  result=ComponentAccumulator()
542  name="FPGATrackSimSpacepointRoadFilterTool_1st"
543  if secondStage:
544  name="FPGATrackSimSpacepointRoadFilterTool_2st"
545  SPRoadFilter = CompFactory.FPGATrackSimSpacepointRoadFilterTool(FPGATrackSimDataPrepConfig.nameWithRegionSuffix(flags,name))
546  SPRoadFilter.FPGATrackSimMappingSvc = result.getPrimaryAndMerge(FPGATrackSimDataPrepConfig.FPGATrackSimMappingCfg(flags))
547  SPRoadFilter.FPGATrackSimBankSvc = result.getPrimaryAndMerge(FPGATrackSimBankSvcCfg(flags))
548  SPRoadFilter.filtering = flags.Trigger.FPGATrackSim.ActiveConfig.spacePointFiltering
549  SPRoadFilter.minSpacePlusPixel = flags.Trigger.FPGATrackSim.minSpacePlusPixel
550  SPRoadFilter.isSecondStage = secondStage
551  SPRoadFilter.dropUnpairedIfSP = flags.Trigger.FPGATrackSim.dropUnpairedIfSP
552 
553  # This threshold is the number of *missing* hits allowed. For now, assume that if 1st stage this is always 1.
554  # We don't actually run this tool in the first stage anymore, so this is more to preserve backwards compatibility
555  if secondStage:
556  SPRoadFilter.threshold = flags.Trigger.FPGATrackSim.hitThreshold
557  else:
558  SPRoadFilter.threshold = 1
559 
560  SPRoadFilter.setSectors = (flags.Trigger.FPGATrackSim.ActiveConfig.IdealGeoRoads and flags.Trigger.FPGATrackSim.tracking)
561  result.setPrivateTools(SPRoadFilter)
562  return result
563 
564 def FPGATrackSimLogicalHitsProcessAlgCfg(inputFlags,name="FPGATrackSimLogicalHitsProcessAlg",**kwargs):
565 
567 
568  result=ComponentAccumulator()
569  kwargs.setdefault("name", FPGATrackSimDataPrepConfig.nameWithRegionSuffix(flags,name))
570 
571  theFPGATrackSimLogicalHitsProcessAlg=CompFactory.FPGATrackSimLogicalHitsProcessAlg(**kwargs)
572  theFPGATrackSimLogicalHitsProcessAlg.writeOutputData = flags.Trigger.FPGATrackSim.writeAdditionalOutputData
573  theFPGATrackSimLogicalHitsProcessAlg.tracking = flags.Trigger.FPGATrackSim.tracking
574  theFPGATrackSimLogicalHitsProcessAlg.SetTruthParametersForTracks = flags.Trigger.FPGATrackSim.SetTruthParametersForTracks
575  theFPGATrackSimLogicalHitsProcessAlg.doOverlapRemoval = flags.Trigger.FPGATrackSim.doOverlapRemoval
576  theFPGATrackSimLogicalHitsProcessAlg.DoMissingHitsChecks = flags.Trigger.FPGATrackSim.ActiveConfig.doMissingHitsChecks
577  theFPGATrackSimLogicalHitsProcessAlg.DoHoughRootOutput1st = flags.Trigger.FPGATrackSim.ActiveConfig.houghRootoutput1st
578  theFPGATrackSimLogicalHitsProcessAlg.NumOfHitPerGrouping = flags.Trigger.FPGATrackSim.ActiveConfig.NumOfHitPerGrouping
579  theFPGATrackSimLogicalHitsProcessAlg.DoNNTrack_1st = flags.Trigger.FPGATrackSim.ActiveConfig.trackNNAnalysis
580  theFPGATrackSimLogicalHitsProcessAlg.eventSelector = result.getPrimaryAndMerge(FPGATrackSimDataPrepConfig.FPGATrackSimEventSelectionSvcCfg(flags))
581  if flags.Trigger.FPGATrackSim.ActiveConfig.useVaryingChi2Cut and not flags.Trigger.FPGATrackSim.ActiveConfig.trackNNAnalysis2nd:
582  theFPGATrackSimLogicalHitsProcessAlg.TrackScoreCut = getChi2Cut(flags.Trigger.FPGATrackSim.region)
583  elif flags.Trigger.FPGATrackSim.ActiveConfig.useVaryingChi2Cut and flags.Trigger.FPGATrackSim.ActiveConfig.trackNNAnalysis2nd:
584  theFPGATrackSimLogicalHitsProcessAlg.TrackScoreCut = getChi2CutNN(flags.Trigger.FPGATrackSim.region)
585  else:
586  theFPGATrackSimLogicalHitsProcessAlg.TrackScoreCut = flags.Trigger.FPGATrackSim.ActiveConfig.chi2cut
587  theFPGATrackSimLogicalHitsProcessAlg.passLowestChi2TrackOnly = flags.Trigger.FPGATrackSim.ActiveConfig.passLowestChi2TrackOnly
588  theFPGATrackSimLogicalHitsProcessAlg.secondStageStrips = (not flags.Trigger.FPGATrackSim.ActiveConfig.GNN)
589  FPGATrackSimMaping = result.getPrimaryAndMerge(FPGATrackSimDataPrepConfig.FPGATrackSimMappingCfg(flags))
590  theFPGATrackSimLogicalHitsProcessAlg.FPGATrackSimMapping = FPGATrackSimMaping
591  # Adding region so we can set it for tracks, then get the bfield
592  theFPGATrackSimLogicalHitsProcessAlg.Region = flags.Trigger.FPGATrackSim.region
593  # If tracking is set to False or if we do the NN analysis, don't configure the bank service
594  if flags.Trigger.FPGATrackSim.tracking and not flags.Trigger.FPGATrackSim.ActiveConfig.trackNNAnalysis:
595  result.getPrimaryAndMerge(FPGATrackSimBankSvcCfg(flags))
596 
597  if (flags.Trigger.FPGATrackSim.ActiveConfig.hough1D):
598  theFPGATrackSimLogicalHitsProcessAlg.RoadFinder = result.getPrimaryAndMerge(FPGATrackSimRoadUnionTool1DCfg(flags))
599  elif (flags.Trigger.FPGATrackSim.ActiveConfig.genScan):
600  theFPGATrackSimLogicalHitsProcessAlg.RoadFinder = result.getPrimaryAndMerge(FPGATrackSimRoadUnionToolGenScanCfg(flags))
601  elif (flags.Trigger.FPGATrackSim.ActiveConfig.GNN):
602  theFPGATrackSimLogicalHitsProcessAlg.RoadFinder = result.getPrimaryAndMerge(FPGATrackSimRoadUnionToolGNNCfg(flags))
603  else:
604  theFPGATrackSimLogicalHitsProcessAlg.RoadFinder = result.getPrimaryAndMerge(FPGATrackSimRoadUnionToolCfg(flags))
605 
606  if (flags.Trigger.FPGATrackSim.ActiveConfig.etaPatternFilter):
607  EtaPatternFilter = CompFactory.FPGATrackSimEtaPatternFilterTool(FPGATrackSimDataPrepConfig.nameWithRegionSuffix(flags,"FPGATrackSimEtaPatternFilterTool"))
608  EtaPatternFilter.FPGATrackSimMappingSvc = FPGATrackSimMaping
609  EtaPatternFilter.threshold = flags.Trigger.FPGATrackSim.Hough1D.threshold[0]
610  EtaPatternFilter.EtaPatterns = flags.Trigger.FPGATrackSim.mapsDir+"/"+FPGATrackSimDataPrepConfig.getBaseName(flags)+".patt"
611  theFPGATrackSimLogicalHitsProcessAlg.RoadFilter = EtaPatternFilter
612  theFPGATrackSimLogicalHitsProcessAlg.FilterRoads = True
613 
614  if (flags.Trigger.FPGATrackSim.ActiveConfig.phiRoadFilter):
615  RoadFilter2 = CompFactory.FPGATrackSimPhiRoadFilterTool(FPGATrackSimDataPrepConfig.nameWithRegionSuffix(flags,"FPGATrackSimPhiRoadFilterTool"))
616  RoadFilter2.FPGATrackSimMappingSvc = FPGATrackSimMaping
617  RoadFilter2.threshold = flags.Trigger.FPGATrackSim.Hough1D.threshold[0]
618  RoadFilter2.fieldCorrection = flags.Trigger.FPGATrackSim.ActiveConfig.fieldCorrection
619 
620  windows = [flags.Trigger.FPGATrackSim.Hough1D.phifilterwindow for i in range(len(flags.Trigger.FPGATrackSim.ActiveConfig.hitExtendX))]
621  RoadFilter2.window = windows
622 
623  theFPGATrackSimLogicalHitsProcessAlg.RoadFilter2 = RoadFilter2
624  theFPGATrackSimLogicalHitsProcessAlg.FilterRoads2 = True
625 
626  theFPGATrackSimLogicalHitsProcessAlg.SlicingEngineTool = result.getPrimaryAndMerge(FPGATrackSimSlicingEngineCfg(flags))
627 
628  theFPGATrackSimLogicalHitsProcessAlg.HoughRootOutputTool = result.getPrimaryAndMerge(FPGATrackSimHoughRootOutputToolCfg(flags))
629 
630  LRTRoadFilter = CompFactory.FPGATrackSimLLPRoadFilterTool(FPGATrackSimDataPrepConfig.nameWithRegionSuffix(flags,"FPGATrackSimLLPRoadFilterTool"))
631  result.addPublicTool(LRTRoadFilter)
632  theFPGATrackSimLogicalHitsProcessAlg.LRTRoadFilter = LRTRoadFilter
633 
634  theFPGATrackSimLogicalHitsProcessAlg.LRTRoadFinder = result.getPrimaryAndMerge(LRTRoadFinderCfg(flags))
635  theFPGATrackSimLogicalHitsProcessAlg.NNTrackTool = result.getPrimaryAndMerge(NNTrackToolCfg(flags))
636 
637  theFPGATrackSimLogicalHitsProcessAlg.OutputTool = result.popToolsAndMerge(FPGATrackSimWriteOutputCfg(flags))
638  theFPGATrackSimLogicalHitsProcessAlg.TrackFitter_1st = result.getPrimaryAndMerge(FPGATrackSimTrackFitterToolCfg(flags))
639  theFPGATrackSimLogicalHitsProcessAlg.OverlapRemoval_1st = result.getPrimaryAndMerge(FPGATrackSimOverlapRemovalToolCfg(flags))
640 
641  theFPGATrackSimLogicalHitsProcessAlg.SpacePointTool = result.getPrimaryAndMerge(FPGATrackSimDataPrepConfig.FPGATrackSimSpacePointsToolCfg(flags))
642  theFPGATrackSimLogicalHitsProcessAlg.Spacepoints = flags.Trigger.FPGATrackSim.spacePoints
643 
644  if flags.Trigger.FPGATrackSim.ActiveConfig.lrt:
645  assert flags.Trigger.FPGATrackSim.ActiveConfig.lrtUseBasicHitFilter != flags.Trigger.FPGATrackSim.ActiveConfig.lrtUseMlHitFilter, 'Inconsistent LRT hit filtering setup, need either ML of Basic filtering enabled'
646  assert flags.Trigger.FPGATrackSim.ActiveConfig.lrtUseStraightTrackHT != flags.Trigger.FPGATrackSim.ActiveConfig.lrtUseDoubletHT, 'Inconsistent LRT HT setup, need either double or strightTrack enabled'
647  theFPGATrackSimLogicalHitsProcessAlg.doLRT = True
648  theFPGATrackSimLogicalHitsProcessAlg.LRTHitFiltering = (not flags.Trigger.FPGATrackSim.ActiveConfig.lrtSkipHitFiltering)
649 
650  from FPGATrackSimAlgorithms.FPGATrackSimAlgorithmConfig import FPGATrackSimLogicalHitsProcessAlgMonitoringCfg
651  theFPGATrackSimLogicalHitsProcessAlg.MonTool = result.getPrimaryAndMerge(FPGATrackSimLogicalHitsProcessAlgMonitoringCfg(flags))
652  result.addEventAlgo(theFPGATrackSimLogicalHitsProcessAlg)
653 
654  return result
655 
656 def getChi2Cut(region):
657  chi2cut_l = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 20] #from most recent run on this branch with new maps/banks, all chi2's are under 1
658  binSize = 0.2
659  side = (region >> 5) & 0x1
660  etaBin = (region >> 6) & 0x1F
661  etaRange = [round(binSize * etaBin, 1), round(binSize * (etaBin + 1), 1)] if side else [round(-binSize * (etaBin + 1), 1), round(-binSize * etaBin, 1)]
662 
663  abs_etaRange = tuple(round(abs(val), 1) for val in etaRange)
664 
665  eta_to_chi2 = {
666  (0.0, 0.2): chi2cut_l[0], (0.2, 0.4): chi2cut_l[1], (0.4, 0.6): chi2cut_l[2],
667  (0.6, 0.8): chi2cut_l[3], (0.8, 1.0): chi2cut_l[4], (1.0, 1.2): chi2cut_l[5],
668  (1.2, 1.4): chi2cut_l[6], (1.4, 1.6): chi2cut_l[7], (1.6, 1.8): chi2cut_l[8],
669  (1.8, 2.0): chi2cut_l[9], (2.0, 2.2): chi2cut_l[10], (2.2, 2.4): chi2cut_l[11],
670  (2.4, 2.6): chi2cut_l[12], (2.6, 2.8): chi2cut_l[13], (2.8, 3.0): chi2cut_l[14],
671  (3.0, 3.2): chi2cut_l[15], (3.2, 3.4): chi2cut_l[16], (3.4, 3.6): chi2cut_l[17],
672  (3.6, 3.8): chi2cut_l[18], (3.8, 4.0): chi2cut_l[19]
673  }
674 
675  return eta_to_chi2.get(abs_etaRange, 20)
676 
677 def getChi2CutNN(region):
678  chi2cut_l = [0.97,0.97,0.99,
679  0.7,0.86,0.99,
680  0.98,0.92,0.98,
681  0.95,0.93,0.4,
682  0.4,0.4,0.7,
683  0.6,0.5,0.4,
684  0.4,0.4]
685  binSize = 0.2
686  side = (region >> 5) & 0x1
687  etaBin = (region >> 6) & 0x1F
688  etaRange = [round(binSize * etaBin, 1), round(binSize * (etaBin + 1), 1)] if side else [round(-binSize * (etaBin + 1), 1), round(-binSize * etaBin, 1)]
689 
690  abs_etaRange = tuple(round(abs(val), 1) for val in etaRange)
691 
692  eta_to_chi2 = {
693  (0.0, 0.2): chi2cut_l[0], (0.2, 0.4): chi2cut_l[1], (0.4, 0.6): chi2cut_l[2],
694  (0.6, 0.8): chi2cut_l[3], (0.8, 1.0): chi2cut_l[4], (1.0, 1.2): chi2cut_l[5],
695  (1.2, 1.4): chi2cut_l[6], (1.4, 1.6): chi2cut_l[7], (1.6, 1.8): chi2cut_l[8],
696  (1.8, 2.0): chi2cut_l[9], (2.0, 2.2): chi2cut_l[10], (2.2, 2.4): chi2cut_l[11],
697  (2.4, 2.6): chi2cut_l[12], (2.6, 2.8): chi2cut_l[13], (2.8, 3.0): chi2cut_l[14],
698  (3.0, 3.2): chi2cut_l[15], (3.2, 3.4): chi2cut_l[16], (3.4, 3.6): chi2cut_l[17],
699  (3.6, 3.8): chi2cut_l[18], (3.8, 4.0): chi2cut_l[19]
700  }
701  return eta_to_chi2.get(abs_etaRange, 0.99)
702 
703 
705  # convert regex to array of regions
706  if flags.Trigger.FPGATrackSim.regionList == "": # in case of empty list just use the region set to flags.Trigger.FPGATrackSim.region
707  flags.Trigger.FPGATrackSim.regionList = [flags.Trigger.FPGATrackSim.region]
708  else: # otherwise use the regionList (this overrides the region flag)
709  from FPGATrackSimConfTools.FPGATrackSimHelperFunctions import convertRegionsExpressionToArray
710  flags.Trigger.FPGATrackSim.regionList = convertRegionsExpressionToArray(flags.Trigger.FPGATrackSim.regionList)
711  print(f"Running for regions: {flags.Trigger.FPGATrackSim.regionList}")
712 
713 if __name__ == "__main__":
714  from AthenaConfiguration.AllConfigFlags import initConfigFlags
715  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
716 
717 
718  flags = initConfigFlags()
719 
720 
722  FinalProtoTrackChainxAODTracksKey="FPGA"
723  flags.Detector.EnableCalo = False
724 
725  # ensure that the xAOD SP and cluster containers are available
726  flags.Tracking.ITkMainPass.doAthenaToActsSpacePoint=True
727  flags.Tracking.ITkMainPass.doAthenaToActsCluster=True
728  from ActsConfig.ActsCIFlags import actsLegacyWorkflowFlags
730  flags.Acts.doRotCorrection = False
731 
732 
733  flags.Concurrency.NumThreads=1
734  flags.Concurrency.NumConcurrentEvents=1
735  flags.Concurrency.NumProcs=0
736  flags.Scheduler.ShowDataDeps=True
737  flags.Scheduler.CheckDependencies=True
738  flags.Debug.DumpEvtStore=False
739 
740  # flags.Exec.DebugStage="exec" # useful option to debug the execution of the job - we want it commented out for production
741  flags.fillFromArgs()
742 
744 
745 
746  if flags.Trigger.FPGATrackSim.Hough.useVaryingChi2Cut and not flags.Trigger.FPGATrackSim.Hough.trackNNAnalysis:
747  flags.Trigger.FPGATrackSim.Hough.chi2cut = getChi2Cut(flags.Trigger.FPGATrackSim.region)
748  assert not flags.Trigger.FPGATrackSim.pipeline.startswith('F-5'),"ERROR You are trying to run an F-5* pipeline! This is not yet supported!"
749 
750  if (flags.Trigger.FPGATrackSim.pipeline.startswith('F-1')):
751  print("You are trying to run an F-100 pipeline! I am going to run the Data Prep chain for you and nothing else!")
752  FPGATrackSimDataPrepConfig.runDataPrepChain()
753  elif (flags.Trigger.FPGATrackSim.pipeline.startswith('F-2')):
754  print("You are trying to run an F-2* pipeline! I am auto-configuring the 1D bitshift for you, including eta pattern filters and phi road filters")
755  flags.Trigger.FPGATrackSim.Hough.etaPatternFilter = True
756  flags.Trigger.FPGATrackSim.Hough.phiRoadFilter = True
757  flags.Trigger.FPGATrackSim.Hough.hough1D = True
758  flags.Trigger.FPGATrackSim.Hough.hough = False
759  elif (flags.Trigger.FPGATrackSim.pipeline.startswith('F-3')):
760  print("You are trying to run an F-3* pipeline! I am auto-configuring the 2D HT for you, and disabling the eta pattern filter and phi road filter. Whether you wanted to or not")
761  flags.Trigger.FPGATrackSim.Hough.etaPatternFilter = False
762  flags.Trigger.FPGATrackSim.Hough.phiRoadFilter = False
763  flags.Trigger.FPGATrackSim.Hough.hough1D = False
764  flags.Trigger.FPGATrackSim.Hough.hough = True
765  elif (flags.Trigger.FPGATrackSim.pipeline.startswith('F-4')):
766  print("You are trying to run an F-4* pipeline! I am auto-configuring the GNN pattern recognition for you. Whether you wanted to or not")
767  flags.Trigger.FPGATrackSim.Hough.GNN = True
768  flags.Trigger.FPGATrackSim.Hough.chi2cut = 40 # All of the track candidates have chi2 values around 20 for some reason. Needs further investigation. For now move the default cut value to 40
769  elif (flags.Trigger.FPGATrackSim.pipeline.startswith('F-6')):
770  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")
771  flags.Trigger.FPGATrackSim.Hough.genScan=True
772  flags.Trigger.FPGATrackSim.spacePoints = flags.Trigger.FPGATrackSim.Hough.secondStage
773  elif (flags.Trigger.FPGATrackSim.pipeline != ""):
774  raise AssertionError("ERROR You are trying to run the pipeline " + flags.Trigger.FPGATrackSim.pipeline + " which is not yet supported!")
775 
776  if (not flags.Trigger.FPGATrackSim.pipeline.startswith('F-1')):
777 
778  flags.Tracking.writeExtendedSi_PRDInfo = not flags.Trigger.FPGATrackSim.writeOfflPRDInfo
779  splitPipeline=flags.Trigger.FPGATrackSim.pipeline.split('-')
780  trackingOption=9999999
781  if (len(splitPipeline) > 1): trackingOption=int(splitPipeline[1])
782  if (trackingOption < 9999999):
783  trackingOptionMod = (trackingOption % 100)
784  if (trackingOptionMod == 0):
785  print("You are trying to run the linearized chi2 fit as part of a pipeline! I am going to enable this for you whether you want to or not")
786  flags.Trigger.FPGATrackSim.tracking = True
787  flags.Trigger.FPGATrackSim.Hough.trackNNAnalysis = False
788  elif (trackingOptionMod == 10):
789  print("You are trying to run the second stage NN fake rejection as part of a pipeline! I am going to enable this for you whether you want to or not")
790  flags.Trigger.FPGATrackSim.tracking = True
791  flags.Trigger.FPGATrackSim.Hough.trackNNAnalysis = True
792  flags.Trigger.FPGATrackSim.Hough.trackNNAnalysis2nd = flags.Trigger.FPGATrackSim.Hough.secondStage
793  if (flags.Trigger.FPGATrackSim.pipeline.startswith('F-6')):
794  flags.Trigger.FPGATrackSim.doNNPathFinder = True
795  flags.Trigger.FPGATrackSim.doOverlapRemoval = False
796  flags.Trigger.FPGATrackSim.tracking = False
797  flags.Trigger.FPGATrackSim.Hough.trackNNAnalysis = False
798  flags.Trigger.FPGATrackSim.Hough.trackNNAnalysis2nd = flags.Trigger.FPGATrackSim.Hough.secondStage
799  else:
800  raise AssertionError("ERROR Your tracking option for the pipeline = " + str(trackingOption) + " is not yet supported!")
801 
802  if isinstance(flags.Trigger.FPGATrackSim.wrapperFileName, str):
803  log.info("wrapperFile is string, converting to list")
804  flags.Trigger.FPGATrackSim.wrapperFileName = [flags.Trigger.FPGATrackSim.wrapperFileName]
805  flags.Input.Files = lambda f: [f.Trigger.FPGATrackSim.wrapperFileName]
806 
807  if flags.Trigger.FPGATrackSim.Hough.useVaryingChi2Cut and flags.Trigger.FPGATrackSim.Hough.trackNNAnalysis:
808  flags.Trigger.FPGATrackSim.Hough.chi2cut = getChi2CutNN(flags.Trigger.FPGATrackSim.region)
809 
810  flags.lock()
811  flags.dump()
812  flags = flags.cloneAndReplace("Tracking.ActiveConfig","Tracking.MainPass")
813  acc=MainServicesCfg(flags)
814 
815  if flags.Trigger.FPGATrackSim.writeAdditionalOutputData:
816  acc.addService(CompFactory.THistSvc(Output = ["EXPERT DATAFILE='monitoring.root', OPT='RECREATE'"]))
817 
818  if (flags.Trigger.FPGATrackSim.Hough.houghRootoutput1st | flags.Trigger.FPGATrackSim.Hough.houghRootoutput2nd):
819  acc.addService(CompFactory.THistSvc(Output = ["TRIGFPGATrackSimHOUGHOUTPUT DATAFILE='HoughRootOutput.root', OPT='RECREATE'"]))
820 
821  if flags.Trigger.FPGATrackSim.Hough.writeTestOutput:
822  acc.addService(CompFactory.THistSvc(Output = ["FPGATRACKSIMOUTPUT DATAFILE='test.root', OPT='RECREATE'"]))
823 
824  if (flags.Trigger.FPGATrackSim.Hough.genScan):
825  acc.addService(CompFactory.THistSvc(Output = ["GENSCAN DATAFILE='genscan.root', OPT='RECREATE'"]))
826 
827  if not flags.Trigger.FPGATrackSim.wrapperFileName:
828  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
829  acc.merge(PoolReadCfg(flags))
830 
831  if flags.Input.isMC:
832  from xAODTruthCnv.xAODTruthCnvConfig import GEN_AOD2xAODCfg
833  acc.merge(GEN_AOD2xAODCfg(flags))
834 
835  from JetRecConfig.JetRecoSteering import addTruthPileupJetsToOutputCfg # TO DO: check if this is indeed necessary for pileup samples
836  acc.merge(addTruthPileupJetsToOutputCfg(flags))
837 
838  if flags.Detector.EnableCalo:
839  from CaloRec.CaloRecoConfig import CaloRecoCfg
840  acc.merge(CaloRecoCfg(flags))
841 
842  if flags.Tracking.recoChain:
843  from InDetConfig.TrackRecoConfig import InDetTrackRecoCfg
844  acc.merge(InDetTrackRecoCfg(flags))
845  if flags.Trigger.FPGATrackSim.writeOfflPRDInfo:
846  from InDetConfig.InDetPrepRawDataToxAODConfig import ITkActsPrepDataToxAODCfg
847  acc.merge( ITkActsPrepDataToxAODCfg( flags,
848  PixelMeasurementContainer = "ITkPixelMeasurements_offl",
849  StripMeasurementContainer = "ITkStripMeasurements_offl" ) )
850  from InDetConfig.InDetPrepRawDataToxAODConfig import TruthParticleIndexDecoratorAlgCfg
851  acc.merge( TruthParticleIndexDecoratorAlgCfg(flags) )
852  from InDetConfig.InDetPrepRawDataFormationConfig import ITkXAODToInDetClusterConversionCfg
853  acc.merge(ITkXAODToInDetClusterConversionCfg(flags))
854 
855 
856  # Configure both the dataprep and logical hits algorithms.
857  acc.merge(FPGATrackSimDataPrepConfig.FPGATrackSimDataPrepAlgCfg(flags))
858 
859  from FPGATrackSimConfTools.FPGATrackSimMultiRegionConfig import FPGATrackSimMultiRegionTrackingCfg
860  acc.merge(FPGATrackSimMultiRegionTrackingCfg(flags))
861 
862  if flags.Trigger.FPGATrackSim.doEDMConversion:
863  stage = "_2nd" if flags.Trigger.FPGATrackSim.Hough.secondStage else "_1st"
864  acc.merge(FPGATrackSimDataPrepConfig.FPGAConversionAlgCfg(flags, name = f"FPGAConversionAlg{stage}",
865  stage = f"{stage}",
866  doActsTrk=True,
867  doSP=False,
868  useRoads=not flags.Trigger.FPGATrackSim.tracking))
869 
870  from FPGATrackSimPrototrackFitter.FPGATrackSimPrototrackFitterConfig import FPGATruthDecorationCfg, FPGAProtoTrackFitCfg
871  acc.merge(FPGAProtoTrackFitCfg(flags,stage=f"{stage}",
872  useRoads=not flags.Trigger.FPGATrackSim.tracking)) # Run ACTS KF
873  acc.merge(FPGATruthDecorationCfg(flags,FinalProtoTrackChainxAODTracksKey=FinalProtoTrackChainxAODTracksKey)) # Run Truth Matching/Decoration chain
874  if flags.Trigger.FPGATrackSim.runCKF:
875  from FPGATrackSimConfTools.FPGATrackExtensionConfig import FPGATrackExtensionAlgCfg
876  acc.merge(FPGATrackExtensionAlgCfg(flags, enableTrackStatePrinter=False, name="FPGATrackExtension",
877  ProtoTracksLocation=f"ActsProtoTracks{stage}FromFPGATrack")) # run CKF track extension on FPGA tracks
878 
879  if flags.Trigger.FPGATrackSim.writeToAOD:
880  acc.merge(FPGATrackSimDataPrepConfig.WriteToAOD(flags,
881  stage = f"{stage}",
882  finalTrackParticles=f"{FinalProtoTrackChainxAODTracksKey}TrackParticles"))
883 
884  # Reporting algorithm (used for debugging - can be disabled)
885  from FPGATrackSimReporting.FPGATrackSimReportingConfig import FPGATrackSimReportingCfg
886  acc.merge(FPGATrackSimReportingCfg(flags, stage=f"{stage}",
887  perEventReports = ((flags.Trigger.FPGATrackSim.sampleType != 'skipTruth') and flags.Exec.MaxEvents<=10 ) )) # disable perEventReports for pileup samples or many events
888 
889  acc.store(open('AnalysisConfig.pkl','wb'))
890 
891  acc.foreach_component("*FPGATrackSim*").OutputLevel=flags.Trigger.FPGATrackSim.loglevel
892  if flags.Trigger.FPGATrackSim.msgLimit!=-1:
893  acc.getService("MessageSvc").debugLimit = flags.Trigger.FPGATrackSim.msgLimit
894  acc.getService("MessageSvc").infoLimit = flags.Trigger.FPGATrackSim.msgLimit
895  acc.getService("MessageSvc").verboseLimit = flags.Trigger.FPGATrackSim.msgLimit
896 
897  statusCode = acc.run(flags.Exec.MaxEvents)
898  assert statusCode.isSuccess() is True, "Application execution did not succeed"
python.FPGATrackSimAnalysisConfig.NNTrackToolCfg
def NNTrackToolCfg(flags, name="FPGATrackSimNNTrackTool")
Definition: FPGATrackSimAnalysisConfig.py:474
python.CaloRecoConfig.CaloRecoCfg
def CaloRecoCfg(flags, clustersname=None)
Definition: CaloRecoConfig.py:9
PathResolver::FindCalibFile
static std::string FindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.h:63
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
vtune_athena.format
format
Definition: vtune_athena.py:14
python.FPGATrackSimAnalysisConfig.FPGATrackSimRoadUnionTool1DCfg
def FPGATrackSimRoadUnionTool1DCfg(flags, name="FPGATrackSimRoadUnionTool1D")
Definition: FPGATrackSimAnalysisConfig.py:177
xAODTruthCnvConfig.GEN_AOD2xAODCfg
def GEN_AOD2xAODCfg(flags, name="GEN_AOD2xAOD", **kwargs)
Definition: xAODTruthCnvConfig.py:20
MuonGM::round
float round(const float toRound, const unsigned int decimals)
Definition: Mdt.cxx:27
python.FPGATrackSimAnalysisConfig.FPGATrackSimHoughRootOutputToolCfg
def FPGATrackSimHoughRootOutputToolCfg(flags, name="FPGATrackSimHoughRootOutputTool")
Definition: FPGATrackSimAnalysisConfig.py:450
python.FPGATrackSimAnalysisConfig.FPGATrackSimGNNRootOutputToolCfg
def FPGATrackSimGNNRootOutputToolCfg(flags, name="FPGATrackSimGNNRootOutputTool")
Definition: FPGATrackSimAnalysisConfig.py:429
FPGATrackSimHelperFunctions.convertRegionsExpressionToArray
def convertRegionsExpressionToArray(expression, min_value=0, max_value=1279)
Definition: FPGATrackSimHelperFunctions.py:6
python.InDetPrepRawDataToxAODConfig.TruthParticleIndexDecoratorAlgCfg
def TruthParticleIndexDecoratorAlgCfg(flags, name='TruthParticleIndexDecoratorAlg', **kwargs)
Definition: InDetPrepRawDataToxAODConfig.py:6
python.FPGATrackSimMultiRegionConfig.FPGATrackSimMultiRegionTrackingCfg
def FPGATrackSimMultiRegionTrackingCfg(flags)
Definition: FPGATrackSimMultiRegionConfig.py:6
python.FPGATrackSimAnalysisConfig.FPGATrackSimTrackFitterToolCfg
def FPGATrackSimTrackFitterToolCfg(flags, name="FPGATrackSimTrackFitterTool")
Definition: FPGATrackSimAnalysisConfig.py:491
PathResolver::FindCalibDirectory
static std::string FindCalibDirectory(const std::string &logical_file_name)
Definition: PathResolver.h:64
python.FPGATrackSimAnalysisConfig.ConfigureMultiRegionFlags
def ConfigureMultiRegionFlags(flags)
Definition: FPGATrackSimAnalysisConfig.py:704
python.FPGATrackSimAnalysisConfig.FPGATrackSimLogicalHitsProcessAlgCfg
def FPGATrackSimLogicalHitsProcessAlgCfg(inputFlags, name="FPGATrackSimLogicalHitsProcessAlg", **kwargs)
Definition: FPGATrackSimAnalysisConfig.py:564
python.FPGATrackSimAnalysisConfig.FPGATrackSimRoadUnionToolGenScanCfg
def FPGATrackSimRoadUnionToolGenScanCfg(flags, name="FPGATrackSimRoadUnionToolGenScan")
Definition: FPGATrackSimAnalysisConfig.py:227
python.FPGATrackSimAnalysisConfig.FPGATrackSimGNNEdgeClassifierToolCfg
def FPGATrackSimGNNEdgeClassifierToolCfg(flags, name="FPGATrackSimGNNEdgeClassifierTool")
Definition: FPGATrackSimAnalysisConfig.py:403
python.FPGATrackSimAnalysisConfig.getChi2Cut
def getChi2Cut(region)
Definition: FPGATrackSimAnalysisConfig.py:656
python.FPGATrackSimAnalysisConfig.FPGATrackSimDataFlowToolCfg
def FPGATrackSimDataFlowToolCfg(flags, name="FPGATrackSimDataFlowTool")
Definition: FPGATrackSimAnalysisConfig.py:440
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:312
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:194
python.FPGATrackSimAnalysisConfig.prepareFlagsForFPGATrackSimLogicalHitsProcessAlg
def prepareFlagsForFPGATrackSimLogicalHitsProcessAlg(flags)
Definition: FPGATrackSimAnalysisConfig.py:536
python.FPGATrackSimAnalysisConfig.FPGATrackSimBankSvcCfg
def FPGATrackSimBankSvcCfg(flags, name="FPGATrackSimBankSvc")
Definition: FPGATrackSimAnalysisConfig.py:51
python.InDetPrepRawDataFormationConfig.ITkXAODToInDetClusterConversionCfg
def ITkXAODToInDetClusterConversionCfg(flags, name="ITkXAODToInDetClusterConversion", **kwargs)
Definition: InDetPrepRawDataFormationConfig.py:47
python.FPGATrackSimAnalysisConfig.FPGATrackSimRoadUnionToolCfg
def FPGATrackSimRoadUnionToolCfg(flags, name="FPGATrackSimRoadUnionTool")
Definition: FPGATrackSimAnalysisConfig.py:100
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
python.InDetPrepRawDataToxAODConfig.ITkActsPrepDataToxAODCfg
ComponentAccumulator ITkActsPrepDataToxAODCfg(flags, *str PixelClusterContainer="ITkPixelClusters", str StripClusterContainer="ITkStripClusters", str PixelMeasurementContainer="ITkPixelMeasurements", str StripMeasurementContainer="ITkStripMeasurements", list[str] TrackParticles=None)
Definition: InDetPrepRawDataToxAODConfig.py:46
python.FPGATrackSimAnalysisConfig.FPGATrackSimWriteOutputCfg
def FPGATrackSimWriteOutputCfg(flags)
Definition: FPGATrackSimAnalysisConfig.py:23
python.JetRecoSteering.addTruthPileupJetsToOutputCfg
def addTruthPileupJetsToOutputCfg(flags, toAOD=True, toESD=True)
Definition: JetRecoSteering.py:7
python.OnnxRuntimeInferenceConfig.OnnxRuntimeInferenceToolCfg
def OnnxRuntimeInferenceToolCfg(flags, str model_fname=None, Optional[OnnxRuntimeType] execution_provider=None, name="OnnxRuntimeInferenceTool", **kwargs)
Definition: OnnxRuntimeInferenceConfig.py:9
python.FPGATrackSimAnalysisConfig.LRTRoadFinderCfg
def LRTRoadFinderCfg(flags, name="LRTRoadFinder")
Definition: FPGATrackSimAnalysisConfig.py:460
python.FPGATrackSimAnalysisConfig.FPGATrackSimRoadUnionToolGNNCfg
def FPGATrackSimRoadUnionToolGNNCfg(flags, name="FPGATrackSimRoadUnionToolGNN")
Definition: FPGATrackSimAnalysisConfig.py:359
FPGATrackSimPrototrackFitterConfig.FPGAProtoTrackFitCfg
def FPGAProtoTrackFitCfg(flags, name="FPGAPrototrackFitterConfig", stage='', useRoads=False, **kwargs)
Definition: FPGATrackSimPrototrackFitterConfig.py:42
FPGATrackSimAlgorithmConfig.FPGATrackSimLogicalHitsProcessAlgMonitoringCfg
def FPGATrackSimLogicalHitsProcessAlgMonitoringCfg(flags)
Definition: FPGATrackSimAlgorithmConfig.py:246
python.FPGATrackSimAnalysisConfig.getNSubregions
def getNSubregions(filePath)
Definition: FPGATrackSimAnalysisConfig.py:14
python.TrackRecoConfig.InDetTrackRecoCfg
def InDetTrackRecoCfg(flags)
Main ID tracking config #####################.
Definition: TrackRecoConfig.py:804
python.FPGATrackSimAnalysisConfig.FPGATrackSimOverlapRemovalToolCfg
def FPGATrackSimOverlapRemovalToolCfg(flags, name="FPGATrackSimOverlapRemovalTool")
Definition: FPGATrackSimAnalysisConfig.py:511
Trk::open
@ open
Definition: BinningType.h:40
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.FPGATrackExtensionConfig.FPGATrackExtensionAlgCfg
def FPGATrackExtensionAlgCfg(flags, enableTrackStatePrinter=False, **kwargs)
Definition: FPGATrackExtensionConfig.py:6
ActsCIFlags.actsLegacyWorkflowFlags
None actsLegacyWorkflowFlags(flags)
Definition: ActsCIFlags.py:6
python.FPGATrackSimAnalysisConfig.SPRoadFilterToolCfg
def SPRoadFilterToolCfg(flags, secondStage=False, name="FPGATrackSimSpacepointRoadFilterTool")
Definition: FPGATrackSimAnalysisConfig.py:540
FPGATrackSimPrototrackFitterConfig.FPGATruthDecorationCfg
def FPGATruthDecorationCfg(flags, FinalProtoTrackChainxAODTracksKey="xAODFPGAPrototracks", **kwargs)
Definition: FPGATrackSimPrototrackFitterConfig.py:58
str
Definition: BTagTrackIpAccessor.cxx:11
DataPrepConfig.FPGATrackSimReportingCfg
def FPGATrackSimReportingCfg(flags, name='FPGATrackSimReportingAlg', **kwargs)
Definition: DataPrepConfig.py:6
python.FPGATrackSimAnalysisConfig.FPGATrackSimGNNRoadMakerToolCfg
def FPGATrackSimGNNRoadMakerToolCfg(flags, name="FPGATrackSimGNNRoadMakerTool")
Definition: FPGATrackSimAnalysisConfig.py:417
python.FPGATrackSimAnalysisConfig.getChi2CutNN
def getChi2CutNN(region)
Definition: FPGATrackSimAnalysisConfig.py:677
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:71
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
python.FPGATrackSimAnalysisConfig.FPGATrackSimGNNGraphConstructionToolCfg
def FPGATrackSimGNNGraphConstructionToolCfg(flags, name="FPGATrackSimGNNGraphConstructionTool")
Definition: FPGATrackSimAnalysisConfig.py:377
FPGATrackSimAlgorithmConfig.FPGATrackSimOverlapRemovalToolMonitoringCfg
def FPGATrackSimOverlapRemovalToolMonitoringCfg(flags)
Definition: FPGATrackSimAlgorithmConfig.py:304
python.FPGATrackSimAnalysisConfig.FPGATrackSimSlicingEngineCfg
def FPGATrackSimSlicingEngineCfg(flags, name="FPGATrackSimSlicingEngineTool")
Definition: FPGATrackSimAnalysisConfig.py:39