ATLAS Offline Software
Functions | Variables
python.FPGATrackSimDataPrepConfig Namespace Reference

Functions

def getBaseName (flags)
 
def FPGATrackSimRawLogicCfg (flags)
 
def FPGATrackSimSpacePointsToolCfg (flags)
 
def prepareFlagsForFPGATrackSimDataPrepAlg (flags)
 
def FPGATrackSimDataPrepOutputCfg (flags)
 
def FPGAConversionAlgCfg (inputFlags, name='FPGAConversionAlg', stage='', **kwargs)
 
def FPGAClusterConverterCfg (flags)
 
def FPGAActsTrkConverterCfg (flags)
 
def WriteToAOD (flags, stage='', finalTrackParticles='')
 
def FPGATrackSimEventSelectionCfg (flags)
 
def FPGATrackSimMappingCfg (flags)
 
def FPGATrackSimReadInputCfg (flags)
 
def FPGATrackSimReadInput2Cfg (flags)
 
def FPGATrackSimHitFilteringToolCfg (flags)
 
def FPGATrackSimDataPrepAlgCfg (inputFlags)
 
def FPGATrackSimDataPrepConnectToFastTracking (flags, FinalTracks="FPGADataPrep")
 
def runDataPrepChain ()
 

Variables

 log
 

Function Documentation

◆ FPGAActsTrkConverterCfg()

def python.FPGATrackSimDataPrepConfig.FPGAActsTrkConverterCfg (   flags)

Definition at line 108 of file FPGATrackSimDataPrepConfig.py.

108 def FPGAActsTrkConverterCfg(flags):
109  result=ComponentAccumulator()
110  FPGAActsTrkConverter = CompFactory.FPGAActsTrkConverter()
111  result.setPrivateTools(FPGAActsTrkConverter)
112 
113  return result
114 
115 

◆ FPGAClusterConverterCfg()

def python.FPGATrackSimDataPrepConfig.FPGAClusterConverterCfg (   flags)

Definition at line 100 of file FPGATrackSimDataPrepConfig.py.

100 def FPGAClusterConverterCfg(flags):
101  result=ComponentAccumulator()
102  from SiLorentzAngleTool.ITkStripLorentzAngleConfig import ITkStripLorentzAngleToolCfg
103  FPGAClusterConverter = CompFactory.FPGAClusterConverter(LorentzAngleTool=result.popToolsAndMerge(ITkStripLorentzAngleToolCfg(flags)))
104  result.setPrivateTools(FPGAClusterConverter)
105 
106  return result
107 

◆ FPGAConversionAlgCfg()

def python.FPGATrackSimDataPrepConfig.FPGAConversionAlgCfg (   inputFlags,
  name = 'FPGAConversionAlg',
  stage = '',
**  kwargs 
)

Definition at line 69 of file FPGATrackSimDataPrepConfig.py.

69 def FPGAConversionAlgCfg(inputFlags, name = 'FPGAConversionAlg', stage = '', **kwargs):
70 
71  flags = prepareFlagsForFPGATrackSimDataPrepAlg(inputFlags)
72 
73  result=ComponentAccumulator()
74  from StripGeoModelXml.ITkStripGeoModelConfig import ITkStripReadoutGeometryCfg
75  result.merge(ITkStripReadoutGeometryCfg(flags))
76 
77  kwargs.setdefault("FPGATrackSimClusterKey", "FPGAClusters%s" %(stage))
78  kwargs.setdefault("FPGATrackSimHitKey", "FPGAHits%s" %(stage))
79  kwargs.setdefault("FPGATrackSimHitInRoadsKey", "FPGAHitsInRoads%s" %(stage))
80  kwargs.setdefault("FPGATrackSimRoadKey", "FPGARoads%s" %(stage))
81  kwargs.setdefault("FPGATrackSimTrackKey", "FPGATracks%s" %(stage))
82  kwargs.setdefault("xAODPixelClusterFromFPGAClusterKey", "xAODPixelClusters%sFromFPGACluster" %(stage))
83  kwargs.setdefault("xAODStripClusterFromFPGAClusterKey", "xAODStripClusters%sFromFPGACluster" %(stage))
84  kwargs.setdefault("xAODStripSpacePointFromFPGAKey", "xAODStripSpacePoints%sFromFPGA" %(stage))
85  kwargs.setdefault("xAODPixelSpacePointFromFPGAKey", "xAODPixelSpacePoints%sFromFPGA" %(stage))
86  kwargs.setdefault("xAODPixelClusterFromFPGAHitKey", "xAODPixelClusters%sFromFPGAHit" %(stage))
87  kwargs.setdefault("xAODStripClusterFromFPGAHitKey", "xAODStripClusters%sFromFPGAHit" %(stage))
88  kwargs.setdefault("ActsProtoTrackFromFPGARoadKey", "ActsProtoTracks%sFromFPGARoad" %(stage))
89  kwargs.setdefault("ActsProtoTrackFromFPGATrackKey", "ActsProtoTracks%sFromFPGATrack" %(stage))
90  kwargs.setdefault("doHits", True)
91  kwargs.setdefault("doClusters", True)
92  kwargs.setdefault("doActsTrk", False)
93  kwargs.setdefault("ClusterConverter", result.popToolsAndMerge(FPGAClusterConverterCfg(flags)))
94  kwargs.setdefault("ActsTrkConverter", result.popToolsAndMerge(FPGAActsTrkConverterCfg(flags)))
95 
96  result.addEventAlgo(CompFactory.FPGAConversionAlgorithm(name, **kwargs))
97 
98  return result
99 

◆ FPGATrackSimDataPrepAlgCfg()

def python.FPGATrackSimDataPrepConfig.FPGATrackSimDataPrepAlgCfg (   inputFlags)

Definition at line 204 of file FPGATrackSimDataPrepConfig.py.

204 def FPGATrackSimDataPrepAlgCfg(inputFlags):
205 
206  flags = prepareFlagsForFPGATrackSimDataPrepAlg(inputFlags)
207 
208  result=ComponentAccumulator()
209 
210  theFPGATrackSimDataPrepAlg=CompFactory.FPGATrackSimDataPrepAlg()
211  theFPGATrackSimDataPrepAlg.HitFiltering = flags.Trigger.FPGATrackSim.ActiveConfig.hitFiltering
212  theFPGATrackSimDataPrepAlg.writeOutputData = flags.Trigger.FPGATrackSim.ActiveConfig.writeOutputData
213  theFPGATrackSimDataPrepAlg.Clustering = flags.Trigger.FPGATrackSim.clustering
214  theFPGATrackSimDataPrepAlg.eventSelector = result.getPrimaryAndMerge(FPGATrackSimEventSelectionCfg(flags))
215  theFPGATrackSimDataPrepAlg.runOnRDO = not flags.Trigger.FPGATrackSim.wrapperFileName
216 
217  FPGATrackSimMaping = result.getPrimaryAndMerge(FPGATrackSimMappingCfg(flags))
218  theFPGATrackSimDataPrepAlg.FPGATrackSimMapping = FPGATrackSimMaping
219 
220  theFPGATrackSimDataPrepAlg.RawToLogicalHitsTool = result.getPrimaryAndMerge(FPGATrackSimRawLogicCfg(flags))
221 
222  if flags.Trigger.FPGATrackSim.wrapperFileName and flags.Trigger.FPGATrackSim.wrapperFileName is not None:
223  theFPGATrackSimDataPrepAlg.InputTool = result.getPrimaryAndMerge(FPGATrackSimReadInputCfg(flags))
224  if flags.Trigger.FPGATrackSim.wrapperFileName2 and flags.Trigger.FPGATrackSim.wrapperFileName2 is not None:
225  theFPGATrackSimDataPrepAlg.InputTool2 = result.getPrimaryAndMerge(FPGATrackSimReadInput2Cfg(flags))
226  theFPGATrackSimDataPrepAlg.SecondInputToolN = flags.Trigger.FPGATrackSim.secondInputToolN
227  theFPGATrackSimDataPrepAlg.SGInputTool = ""
228  else:
229  from ActsConfig.ActsGeometryConfig import ActsTrackingGeometryToolCfg
230  result.popToolsAndMerge(ActsTrackingGeometryToolCfg(flags))
231  theFPGATrackSimDataPrepAlg.InputTool = ""
232  theFPGATrackSimDataPrepAlg.InputTool2 = ""
233  from FPGATrackSimSGInput.FPGATrackSimSGInputConfig import FPGATrackSimSGInputToolCfg
234  theFPGATrackSimDataPrepAlg.SGInputTool = result.getPrimaryAndMerge(FPGATrackSimSGInputToolCfg(flags))
235 
236  theFPGATrackSimDataPrepAlg.SpacePointTool = result.getPrimaryAndMerge(FPGATrackSimSpacePointsToolCfg(flags))
237 
238  theFPGATrackSimDataPrepAlg.HitFilteringTool = result.getPrimaryAndMerge(FPGATrackSimHitFilteringToolCfg(flags))
239 
240  theFPGATrackSimDataPrepAlg.ClusteringTool = CompFactory.FPGATrackSimClusteringTool()
241  theFPGATrackSimDataPrepAlg.OutputTool = result.getPrimaryAndMerge(FPGATrackSimDataPrepOutputCfg(flags))
242 
243  # Create SPRoadFilterTool if spacepoints are turned on. TODO: make things configurable?
244  if flags.Trigger.FPGATrackSim.spacePoints:
245  theFPGATrackSimDataPrepAlg.Spacepoints = True
246 
247  from FPGATrackSimAlgorithms.FPGATrackSimAlgorithmConfig import FPGATrackSimLogicalHitsProcessAlgMonitoringCfg
248  theFPGATrackSimDataPrepAlg.MonTool = result.getPrimaryAndMerge(FPGATrackSimLogicalHitsProcessAlgMonitoringCfg(flags))
249 
250  result.addEventAlgo(theFPGATrackSimDataPrepAlg)
251 
252  return result
253 
254 

◆ FPGATrackSimDataPrepConnectToFastTracking()

def python.FPGATrackSimDataPrepConfig.FPGATrackSimDataPrepConnectToFastTracking (   flags,
  FinalTracks = "FPGADataPrep" 
)

Definition at line 257 of file FPGATrackSimDataPrepConfig.py.

257 def FPGATrackSimDataPrepConnectToFastTracking(flags,FinalTracks="FPGADataPrep"):
258  result = ComponentAccumulator()
259  ACTSTracks="FPGADataPrepActsTracks"
260 
261  # ACTS Seeding
262  from ActsConfig.ActsSeedingConfig import ActsStripSeedingAlgCfg, ActsPixelSeedingAlgCfg
263  result.merge(ActsStripSeedingAlgCfg(flags, name="FPGADataPrepActsStripSeedingAlg",
264  InputSpacePoints=['xAODStripSpacePoints_1stFromFPGA'],
265  OutputSeeds="FPGADataPrepActsStripSeeds",
266  OutputEstimatedTrackParameters="FPGAActsStripEstimatedTrackParams"))
267 
268  result.merge(ActsPixelSeedingAlgCfg(flags, name="FPGADataPrepActsPixelSeedingAlg",
269  InputSpacePoints=['xAODPixelSpacePoints_1stFromFPGA'],
270  OutputSeeds="FPGADataPrepActsPixelSeeds",
271  OutputEstimatedTrackParameters="FPGAActsPixelEstimatedTrackParams"))
272 
273  # ACTS Tracking
274  from ActsConfig.ActsTrackFindingConfig import ActsMainTrackFindingAlgCfg
275  result.merge(ActsMainTrackFindingAlgCfg(flags, name="FPGADataPrepActsTrackFindingAlg",
276  SeedContainerKeys=['FPGADataPrepActsPixelSeeds','FPGADataPrepActsStripSeeds'],
277  EstimatedTrackParametersKeys=['FPGAActsPixelEstimatedTrackParams','FPGAActsStripEstimatedTrackParams'],
278  UncalibratedMeasurementContainerKeys=["xAODPixelClusters_1stFromFPGACluster","xAODStripClusters_1stFromFPGACluster"],
279  ACTSTracksLocation=ACTSTracks))
280 
281  # Track to Truth association and validation
282  from ActsConfig.ActsTruthConfig import ActsTruthParticleHitCountAlgCfg, ActsPixelClusterToTruthAssociationAlgCfg,ActsStripClusterToTruthAssociationAlgCfg
283  result.merge(ActsPixelClusterToTruthAssociationAlgCfg(flags,
284  name="FPGADataPrepActsPixelClusterToTruthAssociationAlg",
285  InputTruthParticleLinks="xAODFPGATruthLinks",
286  AssociationMapOut="ITkFPGAPixelClustersToTruthParticles",
287  Measurements="xAODPixelClusters_1stFromFPGACluster"))
288 
289  result.merge(ActsStripClusterToTruthAssociationAlgCfg(flags,
290  name="FPGADataPrepActsStripClusterToTruthAssociationAlg",
291  InputTruthParticleLinks="xAODFPGATruthLinks",
292  AssociationMapOut="ITkFPGAStripClustersToTruthParticles",
293  Measurements="xAODStripClusters_1stFromFPGACluster"))
294 
295  result.merge(ActsTruthParticleHitCountAlgCfg(flags,
296  name="FPGADataPrepActsTruthParticleHitCountAlg",
297  PixelClustersToTruthAssociationMap="ITkFPGAPixelClustersToTruthParticles",
298  StripClustersToTruthAssociationMap="ITkFPGAStripClustersToTruthParticles",
299  TruthParticleHitCountsOut="FPGATruthParticleHitCounts"))
300 
301  from ActsConfig.ActsTruthConfig import ActsTrackToTruthAssociationAlgCfg, ActsTrackFindingValidationAlgCfg
302  acts_tracks=f"{flags.Tracking.ActiveConfig.extension}Tracks" if not flags.Acts.doAmbiguityResolution else f"{flags.Tracking.ActiveConfig.extension}ResolvedTracks"
303  result.merge(ActsTrackToTruthAssociationAlgCfg(flags,
304  name=f"{acts_tracks}FPGADataPrepTrackToTruthAssociationAlg",
305  PixelClustersToTruthAssociationMap="ITkFPGAPixelClustersToTruthParticles",
306  StripClustersToTruthAssociationMap="ITkFPGAStripClustersToTruthParticles",
307  ACTSTracksLocation=ACTSTracks,
308  AssociationMapOut=acts_tracks+"FPGAToTruthParticleAssociation"))
309 
310 
311  result.merge(ActsTrackFindingValidationAlgCfg(flags,
312  name=f"{acts_tracks}FPGADataPrepTrackFindingValidationAlg",
313  TrackToTruthAssociationMap=acts_tracks+"FPGAToTruthParticleAssociation",
314  TruthParticleHitCounts="FPGATruthParticleHitCounts"
315  ))
316 
317 
319  prefix = flags.Tracking.ActiveConfig.extension
320  from ActsConfig.ActsTrackFindingConfig import ActsTrackToTrackParticleCnvAlgCfg
321  result.merge(ActsTrackToTrackParticleCnvAlgCfg(flags, name=f"{prefix}FPGADataPrepActsTrackToTrackParticleCnvAlg",
322  ACTSTracksLocation=[ACTSTracks,],
323  TrackParticlesOutKey=f"{FinalTracks}TrackParticles"))
324 
325  from ActsConfig.ActsTruthConfig import ActsTrackParticleTruthDecorationAlgCfg
326  result.merge(ActsTrackParticleTruthDecorationAlgCfg(flags, name=f"{prefix}FPGADataPrepActsTrackParticleTruthDecorationAlg",
327  TrackToTruthAssociationMaps=[acts_tracks+"FPGAToTruthParticleAssociation"],
328  TrackParticleContainerName=f"{FinalTracks}TrackParticles",
329  TruthParticleHitCounts="FPGATruthParticleHitCounts",
330  ComputeTrackRecoEfficiency=True))
331 
332  return result
333 
334 

◆ FPGATrackSimDataPrepOutputCfg()

def python.FPGATrackSimDataPrepConfig.FPGATrackSimDataPrepOutputCfg (   flags)

Definition at line 57 of file FPGATrackSimDataPrepConfig.py.

58  result=ComponentAccumulator()
59  FPGATrackSimWriteOutput = CompFactory.FPGATrackSimOutputHeaderTool("FPGATrackSimWriteOutputDataPrep")
60  FPGATrackSimWriteOutput.InFileName = ["test.root"]
61  FPGATrackSimWriteOutput.OutputTreeName = "FPGATrackSimDataPrepTree"
62  # RECREATE means that that this tool opens the file.
63  # HEADER would mean that something else (e.g. THistSvc) opens it and we just add the object.
64  FPGATrackSimWriteOutput.RWstatus = "HEADER"
65  FPGATrackSimWriteOutput.THistSvc = CompFactory.THistSvc()
66  result.addPublicTool(FPGATrackSimWriteOutput, primary=True)
67  return result
68 

◆ FPGATrackSimEventSelectionCfg()

def python.FPGATrackSimDataPrepConfig.FPGATrackSimEventSelectionCfg (   flags)

Definition at line 147 of file FPGATrackSimDataPrepConfig.py.

148  result=ComponentAccumulator()
149  eventSelector = CompFactory.FPGATrackSimEventSelectionSvc()
150  eventSelector.regions = flags.Trigger.FPGATrackSim.slicesFile
151  eventSelector.regionID = flags.Trigger.FPGATrackSim.region
152  eventSelector.sampleType = flags.Trigger.FPGATrackSim.sampleType
153  eventSelector.withPU = False
154  result.addService(eventSelector, create=True, primary=True)
155  return result
156 

◆ FPGATrackSimHitFilteringToolCfg()

def python.FPGATrackSimDataPrepConfig.FPGATrackSimHitFilteringToolCfg (   flags)

Definition at line 187 of file FPGATrackSimDataPrepConfig.py.

188  result=ComponentAccumulator()
189  HitFilteringTool = CompFactory.FPGATrackSimHitFilteringTool()
190  HitFilteringTool.barrelStubDphiCut = 3.0
191  HitFilteringTool.doRandomRemoval = False
192  HitFilteringTool.doStubs = False
193  HitFilteringTool.endcapStubDphiCut = 1.5
194  HitFilteringTool.pixelClusRmFrac = 0
195  HitFilteringTool.pixelHitRmFrac = 0
196  HitFilteringTool.stripClusRmFrac = 0
197  HitFilteringTool.stripHitRmFrac = 0
198  HitFilteringTool.useNstrips = False
199  result.addPublicTool(HitFilteringTool, primary=True)
200  return result
201 
202 
203 

◆ FPGATrackSimMappingCfg()

def python.FPGATrackSimDataPrepConfig.FPGATrackSimMappingCfg (   flags)

Definition at line 157 of file FPGATrackSimDataPrepConfig.py.

157 def FPGATrackSimMappingCfg(flags):
158  result=ComponentAccumulator()
159 
160  mappingSvc = CompFactory.FPGATrackSimMappingSvc()
161  mappingSvc.mappingType = "FILE"
162  mappingSvc.rmap = flags.Trigger.FPGATrackSim.mapsDir+"/"+getBaseName(flags)+".rmap" # we need more configurability here i.e. file choice should depend on some flag
163  mappingSvc.subrmap = flags.Trigger.FPGATrackSim.mapsDir+"/"+getBaseName(flags)+".subrmap" # presumably also here we want to be able to change the slices definition file
164  mappingSvc.pmap = flags.Trigger.FPGATrackSim.mapsDir+"/"+getBaseName(flags)+".pmap"
165  mappingSvc.modulemap = flags.Trigger.FPGATrackSim.mapsDir+"/moduleidmap"
166  mappingSvc.radiiFile = flags.Trigger.FPGATrackSim.mapsDir + "/"+getBaseName(flags)+"_radii.txt"
167  mappingSvc.FakeNNonnx = flags.Trigger.FPGATrackSim.FakeNNonnxFile
168  mappingSvc.ParamNNonnx = flags.Trigger.FPGATrackSim.ParamNNonnxFile
169  mappingSvc.layerOverride = []
170  result.addService(mappingSvc, create=True, primary=True)
171  return result
172 
173 

◆ FPGATrackSimRawLogicCfg()

def python.FPGATrackSimDataPrepConfig.FPGATrackSimRawLogicCfg (   flags)

Definition at line 29 of file FPGATrackSimDataPrepConfig.py.

29 def FPGATrackSimRawLogicCfg(flags):
30  result=ComponentAccumulator()
31  FPGATrackSimRawLogic = CompFactory.FPGATrackSimRawToLogicalHitsTool()
32  FPGATrackSimRawLogic.SaveOptional = 2
33  if (flags.Trigger.FPGATrackSim.ActiveConfig.sampleType == 'skipTruth'):
34  FPGATrackSimRawLogic.SaveOptional = 1
35  FPGATrackSimRawLogic.TowersToMap = [0] # TODO TODO why is this hardcoded?
36  FPGATrackSimRawLogic.FPGATrackSimEventSelectionSvc = result.getPrimaryAndMerge(FPGATrackSimEventSelectionCfg(flags))
37  FPGATrackSimRawLogic.FPGATrackSimMappingSvc = result.getPrimaryAndMerge(FPGATrackSimMappingCfg(flags))
38  result.addPublicTool(FPGATrackSimRawLogic, primary=True)
39  return result
40 

◆ FPGATrackSimReadInput2Cfg()

def python.FPGATrackSimDataPrepConfig.FPGATrackSimReadInput2Cfg (   flags)

Definition at line 181 of file FPGATrackSimDataPrepConfig.py.

181 def FPGATrackSimReadInput2Cfg(flags):
182  result=ComponentAccumulator()
183  InputTool2 = CompFactory.FPGATrackSimReadRawRandomHitsTool(name="FPGATrackSimReadInput2", InFileName = flags.Trigger.FPGATrackSim.wrapperFileName2)
184  result.addPublicTool(InputTool2, primary=True)
185  return result
186 

◆ FPGATrackSimReadInputCfg()

def python.FPGATrackSimDataPrepConfig.FPGATrackSimReadInputCfg (   flags)

Definition at line 174 of file FPGATrackSimDataPrepConfig.py.

174 def FPGATrackSimReadInputCfg(flags):
175  result=ComponentAccumulator()
176  InputTool = CompFactory.FPGATrackSimInputHeaderTool(name="FPGATrackSimReadInput",
177  InFileName = flags.Trigger.FPGATrackSim.wrapperFileName)
178  result.addPublicTool(InputTool, primary=True)
179  return result
180 

◆ FPGATrackSimSpacePointsToolCfg()

def python.FPGATrackSimDataPrepConfig.FPGATrackSimSpacePointsToolCfg (   flags)

Definition at line 41 of file FPGATrackSimDataPrepConfig.py.

42  result=ComponentAccumulator()
43  SpacePointTool = CompFactory.FPGATrackSimSpacePointsTool()
44  SpacePointTool.Filtering = flags.Trigger.FPGATrackSim.ActiveConfig.spacePointFiltering
45  SpacePointTool.FilteringClosePoints = False
46  SpacePointTool.PhiWindow = 0.004
47  SpacePointTool.Duplication = True
48  result.addPublicTool(SpacePointTool, primary=True)
49  return result
50 
51 

◆ getBaseName()

def python.FPGATrackSimDataPrepConfig.getBaseName (   flags)

Definition at line 7 of file FPGATrackSimDataPrepConfig.py.

7 def getBaseName(flags):
8  if (not (flags.Trigger.FPGATrackSim.baseName == '')):
9  return flags.Trigger.FPGATrackSim.baseName
10  elif (flags.Trigger.FPGATrackSim.region == 0):
11  return 'eta0103phi0305'
12  elif (flags.Trigger.FPGATrackSim.region == 1):
13  return 'eta0709phi0305'
14  elif (flags.Trigger.FPGATrackSim.region == 2):
15  return 'eta1214phi0305'
16  elif (flags.Trigger.FPGATrackSim.region == 3):
17  return 'eta2022phi0305'
18  elif (flags.Trigger.FPGATrackSim.region == 4):
19  return 'eta3234phi0305'
20  elif (flags.Trigger.FPGATrackSim.region == 5):
21  return 'eta0103phi1113'
22  elif (flags.Trigger.FPGATrackSim.region == 6):
23  return 'eta0103phi1921'
24  elif (flags.Trigger.FPGATrackSim.region == 7):
25  return 'eta0103phi3436'
26  else:
27  return 'default'
28 

◆ prepareFlagsForFPGATrackSimDataPrepAlg()

def python.FPGATrackSimDataPrepConfig.prepareFlagsForFPGATrackSimDataPrepAlg (   flags)

Definition at line 52 of file FPGATrackSimDataPrepConfig.py.

53  newFlags = flags.cloneAndReplace("Trigger.FPGATrackSim.ActiveConfig", "Trigger.FPGATrackSim." + flags.Trigger.FPGATrackSim.algoTag)
54  return newFlags
55 
56 

◆ runDataPrepChain()

def python.FPGATrackSimDataPrepConfig.runDataPrepChain ( )

Definition at line 335 of file FPGATrackSimDataPrepConfig.py.

335 def runDataPrepChain():
336  from AthenaConfiguration.AllConfigFlags import initConfigFlags
337  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
338 
339 
340  FinalDataPrepTrackChainxAODTracksKeyPrefix="FPGADataPrep"
341 
342  flags = initConfigFlags()
343 
344  from AthenaConfiguration.TestDefaults import defaultGeometryTags
345  flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN4
346 
347 
349  flags.Detector.EnableCalo = False
350 
351  # ensure that the xAOD SP and cluster containers are available
352  flags.Tracking.ITkMainPass.doAthenaToActsSpacePoint=True
353  flags.Tracking.ITkMainPass.doAthenaToActsCluster=True
354 
355  flags.Acts.doRotCorrection = False
356 
357 
359  flags.Detector.EnableITkPixel=True
360  flags.Detector.EnableITkStrip=True
361 
362  flags.Tracking.ITkMainPass.doActsSeed=True
363  flags.Tracking.ITkMainPass.doActsTrack = False # when set to True it seems to be causing issues related to TrackToTruthAssociation. To be investigated...
364  flags.Tracking.doITkFastTracking=False # turn to True to enable Fast Tracking chain
365 
366 
368  from InDetTrackPerfMon.InDetTrackPerfMonFlags import initializeIDTPMConfigFlags, initializeIDTPMTrkAnaConfigFlags
369  flags = initializeIDTPMConfigFlags(flags)
370 
371  flags.PhysVal.IDTPM.outputFilePrefix = "myIDTPM_CA"
372  flags.PhysVal.IDTPM.plotsDefFileList = "InDetTrackPerfMon/PlotsDefFileList_default.txt" # default value - not needed
373  flags.PhysVal.IDTPM.plotsCommonValuesFile = "InDetTrackPerfMon/PlotsDefCommonValues.json" # default value - not needed
374  flags.PhysVal.OutputFileName = flags.PhysVal.IDTPM.outputFilePrefix + '.HIST.root' # automatically set in IDTPM config - not needed
375  flags.Output.doWriteAOD_IDTPM = True
376  flags.Output.AOD_IDTPMFileName = flags.PhysVal.IDTPM.outputFilePrefix + '.AOD_IDTPM.pool.root' # automatically set in IDTPM config - not needed
377  flags.PhysVal.IDTPM.trkAnaCfgFile = "InDetTrackPerfMon/EFTrkAnaConfig_example.json"
378 
379  flags = initializeIDTPMTrkAnaConfigFlags(flags)
380 
381  flags.PhysVal.IDTPM.TrkAnaEF.TrigTrkKey = f"{FinalDataPrepTrackChainxAODTracksKeyPrefix}TrackParticles"
382  flags.PhysVal.IDTPM.TrkAnaDoubleRatio.TrigTrkKey = f"{FinalDataPrepTrackChainxAODTracksKeyPrefix}TrackParticles"
383 
384  flags.PhysVal.doExample = False
385 
386  flags.Concurrency.NumThreads=1
387  flags.Scheduler.ShowDataDeps=True
388  flags.Debug.DumpEvtStore=False # Set to Truth to enable Event Store printouts
389  # flags.Exec.DebugStage="exec" # useful option to debug the execution of the job - we want it commented out for production
390  flags.fillFromArgs()
391  if isinstance(flags.Trigger.FPGATrackSim.wrapperFileName, str):
392  log.info("wrapperFile is string, converting to list")
393  flags.Trigger.FPGATrackSim.wrapperFileName = [flags.Trigger.FPGATrackSim.wrapperFileName]
394  flags.Input.Files = lambda f: [f.Trigger.FPGATrackSim.wrapperFileName]
395 
396  flags.lock()
397  flags = flags.cloneAndReplace("Tracking.ActiveConfig", "Tracking.MainPass", keepOriginal=True)
398  flags = flags.cloneAndReplace("Tracking.ActiveConfig", "Tracking.ITkMainPass", keepOriginal=True)
399  flags.dump()
400 
401  acc=MainServicesCfg(flags)
402  acc.addService(CompFactory.THistSvc(Output = [f"EXPERT DATAFILE='{flags.Trigger.FPGATrackSim.outputMonitorFile}', OPT='RECREATE'"]))
403  acc.addService(CompFactory.THistSvc(Output = ["FPGATRACKSIMOUTPUT DATAFILE='dataprep.root', OPT='RECREATE'"]))
404 
405 
406  if not flags.Trigger.FPGATrackSim.wrapperFileName:
407  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
408  acc.merge(PoolReadCfg(flags))
409 
410  if flags.Input.isMC:
411  from xAODTruthCnv.xAODTruthCnvConfig import GEN_AOD2xAODCfg
412  acc.merge(GEN_AOD2xAODCfg(flags))
413 
414  from JetRecConfig.JetRecoSteering import addTruthPileupJetsToOutputCfg # TO DO: check if this is indeed necessary for pileup samples
415  acc.merge(addTruthPileupJetsToOutputCfg(flags))
416 
417  if flags.Detector.EnableCalo:
418  from CaloRec.CaloRecoConfig import CaloRecoCfg
419  acc.merge(CaloRecoCfg(flags))
420 
421  if not flags.Reco.EnableTrackOverlay:
422  from InDetConfig.TrackRecoConfig import InDetTrackRecoCfg
423  acc.merge(InDetTrackRecoCfg(flags))
424 
425  if flags.Trigger.FPGATrackSim.connectToToITkTracking: # no point in running this if the seeding/tracking for FPGA SPs is off
426  from InDetConfig.ITkTrackRecoConfig import ITkTrackRecoCfg
427  acc.merge(ITkTrackRecoCfg(flags))
428 
429  # Use the imported configuration function for the data prep algorithm.
430  acc.merge(FPGATrackSimDataPrepAlgCfg(flags))
431 
432  if flags.Trigger.FPGATrackSim.doEDMConversion:
433  acc.merge(FPGAConversionAlgCfg(flags, name = 'FPGAConversionAlg_1st', stage = '_1st', doActsTrk=False, doSP = flags.Trigger.FPGATrackSim.spacePoints))
434  if flags.Trigger.FPGATrackSim.convertUnmappedHits: acc.merge(FPGAConversionAlgCfg(flags, name = 'FPGAConversionAlgUnmapped_1st', stage = 'Unmapped_1st', doClusters = False))
435 
436  if flags.Trigger.FPGATrackSim.connectToToITkTracking:
437  acc.merge(FPGATrackSimDataPrepConnectToFastTracking(flags, FinalTracks=FinalDataPrepTrackChainxAODTracksKeyPrefix))
438 
439  if flags.Trigger.FPGATrackSim.writeToAOD:
440  acc.merge(WriteToAOD(flags, stage = '_1st',))
441  if flags.Trigger.FPGATrackSim.spacePoints : acc.merge(WriteToAOD(flags,
442  stage = '_1st',
443  finalTrackParticles=f"{FinalDataPrepTrackChainxAODTracksKeyPrefix}TrackParticles"))
444 
445  # Printout for various FPGA-related objects
446  from FPGATrackSimReporting.FPGATrackSimReportingConfig import FPGATrackSimReportingCfg
447  acc.merge(FPGATrackSimReportingCfg(flags,perEventReports=True,isDataPrep=True))
448 
449  # IDTPM running
450  from InDetTrackPerfMon.InDetTrackPerfMonConfig import InDetTrackPerfMonCfg
451  acc.merge( InDetTrackPerfMonCfg(flags) )
452 
453  acc.store(open('AnalysisConfig.pkl','wb'))
454 
455  statusCode = acc.run(flags.Exec.MaxEvents)
456  assert statusCode.isSuccess() is True, "Application execution did not succeed"
457 
458 

◆ WriteToAOD()

def python.FPGATrackSimDataPrepConfig.WriteToAOD (   flags,
  stage = '',
  finalTrackParticles = '' 
)

Definition at line 116 of file FPGATrackSimDataPrepConfig.py.

116 def WriteToAOD(flags, stage = '',finalTrackParticles = ''): # store xAOD containers in AOD file
117  result = ComponentAccumulator()
118  from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
119  from OutputStreamAthenaPool.OutputStreamConfig import outputStreamName
120  from AthenaConfiguration.Enums import MetadataCategory
121 
122  result.merge( SetupMetaDataForStreamCfg( flags,"AOD",
123  createMetadata=[
124  MetadataCategory.ByteStreamMetaData,
125  MetadataCategory.LumiBlockMetaData,
126  MetadataCategory.TruthMetaData,
127  MetadataCategory.IOVMetaData,],)
128  )
129  log.info("AOD ItemList: %s", result.getEventAlgo(outputStreamName("AOD")).ItemList)
130  log.info("AOD MetadataItemList: %s", result.getEventAlgo(outputStreamName("AOD")).MetadataItemList)
131  log.info("---------- Configured AOD writing")
132 
133  from OutputStreamAthenaPool.OutputStreamConfig import addToAOD
134  toAOD = []
135  toAOD += [f"xAOD::PixelClusterContainer#xAODPixelClusters{stage}FromFPGACluster",f"xAOD::PixelClusterAuxContainer#xAODPixelClusters{stage}FromFPGAClusterAux.",
136  f"xAOD::StripClusterContainer#xAODStripClusters{stage}FromFPGACluster",f"xAOD::StripClusterAuxContainer#xAODStripClusters{stage}FromFPGAClusterAux.",
137  f"xAOD::TrackParticleContainer#{finalTrackParticles}",f"xAOD::TrackParticleAuxContainer#{finalTrackParticles}Aux.",
138  f"xAOD::SpacePointContainer#xAODPixelSpacePoints{stage}FromFPGA",f"xAOD::SpacePointAuxContainer#xAODPixelSpacePoints{stage}FromFPGAAux.-measurements",
139  f"xAOD::SpacePointContainer#xAODStripSpacePoints{stage}FromFPGA",f"xAOD::SpacePointAuxContainer#xAODStripSpacePoints{stage}FromFPGAAux.-measurements.-sctSpacePointLink",
140  ]
141 
142  result.merge(addToAOD(flags, toAOD))
143 
144  return result
145 
146 

Variable Documentation

◆ log

python.FPGATrackSimDataPrepConfig.log

Definition at line 255 of file FPGATrackSimDataPrepConfig.py.

AthenaPoolExample_WriteCond.outputStreamName
string outputStreamName
Definition: AthenaPoolExample_WriteCond.py:21
python.FPGATrackSimDataPrepConfig.WriteToAOD
def WriteToAOD(flags, stage='', finalTrackParticles='')
Definition: FPGATrackSimDataPrepConfig.py:116
python.FPGATrackSimDataPrepConfig.FPGATrackSimDataPrepAlgCfg
def FPGATrackSimDataPrepAlgCfg(inputFlags)
Definition: FPGATrackSimDataPrepConfig.py:204
python.ITkTrackRecoConfig.ITkTrackRecoCfg
ComponentAccumulator ITkTrackRecoCfg(flags)
Main ITk tracking config #####################.
Definition: ITkTrackRecoConfig.py:488
python.CaloRecoConfig.CaloRecoCfg
def CaloRecoCfg(flags, clustersname=None)
Definition: CaloRecoConfig.py:9
python.ITkStripLorentzAngleConfig.ITkStripLorentzAngleToolCfg
def ITkStripLorentzAngleToolCfg(flags, name="ITkStripLorentzAngleTool", **kwargs)
Definition: ITkStripLorentzAngleConfig.py:10
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
ActsSeedingConfig.ActsPixelSeedingAlgCfg
ComponentAccumulator ActsPixelSeedingAlgCfg(flags, str name='ActsPixelSeedingAlg', **kwargs)
Definition: ActsSeedingConfig.py:255
python.FPGATrackSimDataPrepConfig.FPGAConversionAlgCfg
def FPGAConversionAlgCfg(inputFlags, name='FPGAConversionAlg', stage='', **kwargs)
Definition: FPGATrackSimDataPrepConfig.py:69
python.FPGATrackSimDataPrepConfig.FPGATrackSimReadInput2Cfg
def FPGATrackSimReadInput2Cfg(flags)
Definition: FPGATrackSimDataPrepConfig.py:181
xAODTruthCnvConfig.GEN_AOD2xAODCfg
def GEN_AOD2xAODCfg(flags, name="GEN_AOD2xAOD", **kwargs)
Definition: xAODTruthCnvConfig.py:20
ITkStripGeoModelConfig.ITkStripReadoutGeometryCfg
def ITkStripReadoutGeometryCfg(flags)
Definition: ITkStripGeoModelConfig.py:39
ActsTruthConfig.ActsTruthParticleHitCountAlgCfg
ComponentAccumulator ActsTruthParticleHitCountAlgCfg(flags, str name='ActsTruthParticleHitCountAlg', **dict kwargs)
Definition: ActsTruthConfig.py:69
ActsTruthConfig.ActsTrackToTruthAssociationAlgCfg
ComponentAccumulator ActsTrackToTruthAssociationAlgCfg(flags, str name='ActsTracksToTruthAssociationAlg', **dict kwargs)
Definition: ActsTruthConfig.py:50
python.FPGATrackSimDataPrepConfig.FPGATrackSimSpacePointsToolCfg
def FPGATrackSimSpacePointsToolCfg(flags)
Definition: FPGATrackSimDataPrepConfig.py:41
python.FPGATrackSimDataPrepConfig.FPGAClusterConverterCfg
def FPGAClusterConverterCfg(flags)
Definition: FPGATrackSimDataPrepConfig.py:100
ActsTruthConfig.ActsPixelClusterToTruthAssociationAlgCfg
ComponentAccumulator ActsPixelClusterToTruthAssociationAlgCfg(flags, str name='ActsPixelClusterToTruthAssociationAlg', **dict kwargs)
Definition: ActsTruthConfig.py:20
python.FPGATrackSimDataPrepConfig.FPGATrackSimEventSelectionCfg
def FPGATrackSimEventSelectionCfg(flags)
Definition: FPGATrackSimDataPrepConfig.py:147
ActsSeedingConfig.ActsStripSeedingAlgCfg
ComponentAccumulator ActsStripSeedingAlgCfg(flags, str name='ActsStripSeedingAlg', **kwargs)
Definition: ActsSeedingConfig.py:319
ActsTruthConfig.ActsTrackFindingValidationAlgCfg
ComponentAccumulator ActsTrackFindingValidationAlgCfg(flags, str name='ActsTracksValidationAlg', **dict kwargs)
Definition: ActsTruthConfig.py:141
python.FPGATrackSimDataPrepConfig.getBaseName
def getBaseName(flags)
Definition: FPGATrackSimDataPrepConfig.py:7
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
python.FPGATrackSimDataPrepConfig.FPGATrackSimMappingCfg
def FPGATrackSimMappingCfg(flags)
Definition: FPGATrackSimDataPrepConfig.py:157
FPGATrackSimSGInputConfig.FPGATrackSimSGInputToolCfg
def FPGATrackSimSGInputToolCfg(flags)
Definition: FPGATrackSimSGInputConfig.py:8
ActsGeometryConfig.ActsTrackingGeometryToolCfg
ComponentAccumulator ActsTrackingGeometryToolCfg(flags, str name="ActsTrackingGeometryTool")
Definition: ActsGeometryConfig.py:100
python.FPGATrackSimDataPrepConfig.FPGATrackSimHitFilteringToolCfg
def FPGATrackSimHitFilteringToolCfg(flags)
Definition: FPGATrackSimDataPrepConfig.py:187
python.FPGATrackSimDataPrepConfig.FPGATrackSimDataPrepConnectToFastTracking
def FPGATrackSimDataPrepConnectToFastTracking(flags, FinalTracks="FPGADataPrep")
Definition: FPGATrackSimDataPrepConfig.py:257
python.JetRecoSteering.addTruthPileupJetsToOutputCfg
def addTruthPileupJetsToOutputCfg(flags, toAOD=True, toESD=True)
Definition: JetRecoSteering.py:7
python.FPGATrackSimDataPrepConfig.FPGATrackSimReadInputCfg
def FPGATrackSimReadInputCfg(flags)
Definition: FPGATrackSimDataPrepConfig.py:174
FPGATrackSimAlgorithmConfig.FPGATrackSimLogicalHitsProcessAlgMonitoringCfg
def FPGATrackSimLogicalHitsProcessAlgMonitoringCfg(flags)
Definition: FPGATrackSimAlgorithmConfig.py:246
python.TrackRecoConfig.InDetTrackRecoCfg
def InDetTrackRecoCfg(flags)
Main ID tracking config #####################.
Definition: TrackRecoConfig.py:804
Trk::open
@ open
Definition: BinningType.h:40
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
InDetTrackPerfMonFlags.initializeIDTPMConfigFlags
def initializeIDTPMConfigFlags(flags)
General config flag category for IDTPM tool job configuration.
Definition: InDetTrackPerfMonFlags.py:151
python.OutputStreamConfig.addToAOD
def addToAOD(flags, itemOrList, **kwargs)
Definition: OutputStreamConfig.py:142
ActsTrackFindingConfig.ActsMainTrackFindingAlgCfg
ComponentAccumulator ActsMainTrackFindingAlgCfg(flags, str name="ActsTrackFindingAlg", **kwargs)
Definition: ActsTrackFindingConfig.py:53
python.FPGATrackSimDataPrepConfig.runDataPrepChain
def runDataPrepChain()
Definition: FPGATrackSimDataPrepConfig.py:335
python.FPGATrackSimDataPrepConfig.FPGATrackSimRawLogicCfg
def FPGATrackSimRawLogicCfg(flags)
Definition: FPGATrackSimDataPrepConfig.py:29
DataPrepConfig.FPGATrackSimReportingCfg
def FPGATrackSimReportingCfg(flags, name='FPGATrackSimReportingAlg', **kwargs)
Definition: DataPrepConfig.py:6
InDetTrackPerfMonFlags.initializeIDTPMTrkAnaConfigFlags
def initializeIDTPMTrkAnaConfigFlags(flags)
Create flags category and corresponding set of flags.
Definition: InDetTrackPerfMonFlags.py:161
python.FPGATrackSimDataPrepConfig.FPGATrackSimDataPrepOutputCfg
def FPGATrackSimDataPrepOutputCfg(flags)
Definition: FPGATrackSimDataPrepConfig.py:57
python.FPGATrackSimDataPrepConfig.FPGAActsTrkConverterCfg
def FPGAActsTrkConverterCfg(flags)
Definition: FPGATrackSimDataPrepConfig.py:108
InfileMetaDataConfig.SetupMetaDataForStreamCfg
def SetupMetaDataForStreamCfg(flags, streamName="", AcceptAlgs=None, createMetadata=None, propagateMetadataFromInput=True, *args, **kwargs)
Definition: InfileMetaDataConfig.py:222
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69
python.FPGATrackSimDataPrepConfig.prepareFlagsForFPGATrackSimDataPrepAlg
def prepareFlagsForFPGATrackSimDataPrepAlg(flags)
Definition: FPGATrackSimDataPrepConfig.py:52
ActsTruthConfig.ActsTrackParticleTruthDecorationAlgCfg
ComponentAccumulator ActsTrackParticleTruthDecorationAlgCfg(flags, str name='ActsTrackParticleTruthDecorationAlg', **dict kwargs)
Definition: ActsTruthConfig.py:116
InDetTrackPerfMonConfig.InDetTrackPerfMonCfg
def InDetTrackPerfMonCfg(flags)
Definition: InDetTrackPerfMonConfig.py:243
ActsTruthConfig.ActsStripClusterToTruthAssociationAlgCfg
ComponentAccumulator ActsStripClusterToTruthAssociationAlgCfg(flags, str name='ActsStripClusterToTruthAssociationAlg', **dict kwargs)
Definition: ActsTruthConfig.py:35
ActsTrackFindingConfig.ActsTrackToTrackParticleCnvAlgCfg
ComponentAccumulator ActsTrackToTrackParticleCnvAlgCfg(flags, str name="ActsTrackToTrackParticleCnvAlg", **kwargs)
Definition: ActsTrackFindingConfig.py:340