ATLAS Offline Software
InDetToolsConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 # ==============================================================================
4 # Provides configs for the tools used for building/thinning tracking related
5 # object containers and decorations in the DAODs
6 # ==============================================================================
7 
8 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
9 from AthenaConfiguration.ComponentFactory import CompFactory
10 from AthenaConfiguration.Enums import BeamType
11 from AthenaCommon.Constants import INFO
12 
13 # Track collection merger
14 def InDetLRTMergeCfg(flags, name="InDetLRTMerge", **kwargs):
15  acc = ComponentAccumulator()
16  alg = CompFactory.CP.TrackParticleMergerAlg(name, **kwargs)
17  kwargs.setdefault("InputTrackParticleLocations",
18  ["InDetTrackParticles", "InDetLargeD0TrackParticles"])
19  kwargs.setdefault("OutputTrackParticleLocation",
20  "InDetWithLRTTrackParticles")
21  kwargs.setdefault("CreateViewCollection", True)
22  acc.addEventAlgo(alg, primary=True)
23  return acc
24 
25 # Used in vertex fit track decorator
26 
27 
29  flags, name="UsedInVertexFitTrackDecorator", **kwargs):
30  """Configure the UsedInVertexFitTrackDecorator"""
31  acc = ComponentAccumulator()
32 
33  if "UsedInFitDecoratorTool" not in kwargs:
34  from InDetConfig.InDetUsedInFitTrackDecoratorToolConfig import (
35  InDetUsedInFitTrackDecoratorToolCfg)
36  kwargs.setdefault("UsedInFitDecoratorTool", acc.popToolsAndMerge(
38 
39  acc.addPublicTool(
40  CompFactory.DerivationFramework.UsedInVertexFitTrackDecorator(
41  name, **kwargs), primary=True)
42  return acc
43 
44 
45 
46 def HardScatterVertexDecoratorCfg(flags, name = "DFCommonHSDecorator", **kwargs):
47  """Configure the hard process vertex decorator"""
48  acc = ComponentAccumulator()
49  from InDetConfig.InDetHardScatterSelectionToolConfig import InDetHardScatterSelectionToolCfg
50  kwargs.setdefault("HardScatterSelectionTool", acc.getPrimaryAndMerge(InDetHardScatterSelectionToolCfg(flags, name = "HSSelectionTool",
51  ReturnDeco = False)))
52  kwargs.setdefault("VertexContainerName", "PrimaryVertices")
53  kwargs.setdefault("HardScatterDecoName", "hardScatterVertexLink")
54  the_tool = CompFactory.DerivationFramework.HardScatterVertexDecorator(name = "HardScatterDecorTool", **kwargs)
55  acc.addPublicTool(the_tool, primary=True)
56  the_alg = CompFactory.DerivationFramework.CommonAugmentation(name, AugmentationTools=[the_tool])
57  acc.addEventAlgo(the_alg)
58  return acc
59 
60 # TrackStateOnSurface decorator
61 
62 def TrackStateOnSurfaceDecoratorCfg(flags, name, **kwargs):
63  """Configure the TSOS decorator"""
64  acc = ComponentAccumulator()
65 
66  # To produce SCT_DetectorElementCollection
67  from SCT_GeoModel.SCT_GeoModelConfig import SCT_ReadoutGeometryCfg
68  acc.merge(SCT_ReadoutGeometryCfg(flags))
69 
70  kwargs.setdefault("DecorationPrefix", "notSet")
71 
72  if "TrackExtrapolator" not in kwargs:
73  from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg
74  kwargs.setdefault("TrackExtrapolator", acc.addPublicTool(
75  acc.popToolsAndMerge(AtlasExtrapolatorCfg(flags))))
76 
77  if "HoleSearch" not in kwargs:
78  from InDetConfig.InDetTrackHoleSearchConfig import (
79  InDetTrackHoleSearchToolCfg)
80  kwargs.setdefault("HoleSearch", acc.addPublicTool(
81  acc.popToolsAndMerge(InDetTrackHoleSearchToolCfg(flags))))
82 
83  if "ResidualPullCalculator" not in kwargs:
84  from TrkConfig.TrkResidualPullCalculatorConfig import (
85  ResidualPullCalculatorCfg)
86  kwargs.setdefault("ResidualPullCalculator", acc.addPublicTool(
87  acc.popToolsAndMerge(ResidualPullCalculatorCfg(flags))))
88 
89  kwargs.setdefault("IsSimulation", flags.Input.isMC)
90  kwargs.setdefault("StorePixel", flags.Tracking.writeExtendedSi_PRDInfo)
91  kwargs.setdefault("StoreSCT", flags.Tracking.writeExtendedSi_PRDInfo)
92  kwargs.setdefault("StoreTRT", flags.Tracking.writeExtendedTRT_PRDInfo)
93  kwargs.setdefault("AddExtraEventInfo", flags.Beam.Type is BeamType.Cosmics)
94 
95  if kwargs["StoreTRT"] and "TRT_ToT_dEdx" not in kwargs:
96  from InDetConfig.TRT_ElectronPidToolsConfig import TRT_dEdxToolCfg
97  kwargs.setdefault("TRT_ToT_dEdx", acc.addPublicTool(acc.popToolsAndMerge(TRT_dEdxToolCfg(flags))))
98 
99  kwargs.setdefault("DecorationPrefix", "")
100  kwargs.setdefault("PRDtoTrackMap", "PRDtoTrackMapMerge_CombinedInDetTracks")
101 
102  acc.addPublicTool(
103  CompFactory.DerivationFramework.TrackStateOnSurfaceDecorator(
104  name, **kwargs), primary=True)
105  return acc
106 
107 def TSOS_CommonKernelCfg(flags, name="TSOS_CommonKernel",
108  listOfExtensions=[]):
109  acc = ComponentAccumulator()
110 
111  listOfAugmTools = []
112  for extension in listOfExtensions:
113  # Fix inconsistency in naming convention for R3LargeD0
114  if extension == "R3LargeD0":
115  extension = "LargeD0"
116  TrackStateOnSurfaceDecorator = acc.getPrimaryAndMerge(
118  flags, name = f"{extension}TrackStateOnSurfaceDecorator",
119  ContainerName = f"InDet{extension}TrackParticles",
120  PixelMsosName = f"{extension}PixelMSOSs",
121  SctMsosName = f"{extension}SCT_MSOSs",
122  TrtMsosName = f"{extension}TRT_MSOSs"))
123  TrackStateOnSurfaceDecorator.DecorationPrefix = "Reco_"
124  listOfAugmTools.append(TrackStateOnSurfaceDecorator)
125 
126  acc.addEventAlgo(CompFactory.DerivationFramework.CommonAugmentation(
127  name, AugmentationTools=listOfAugmTools))
128  return acc
129 
131  flags, name="DFTrackStateOnSurfaceDecorator", **kwargs):
132  kwargs.setdefault("StorePixel", flags.InDet.DAODStorePixel)
133  kwargs.setdefault("StoreSCT", flags.InDet.DAODStoreSCT)
134  kwargs.setdefault("StoreTRT", flags.InDet.DAODStoreTRT)
135  # never decorate EventInfo with TRTPhase, doubt this is useful for IDTIDE
136  kwargs.setdefault("AddExtraEventInfo", flags.InDet.DAODStoreExtra and flags.Beam.Type is BeamType.Cosmics)
137  kwargs.setdefault("DecorationPrefix", "")
138  kwargs.setdefault("PRDtoTrackMap", "")
139  kwargs.setdefault("OutputLevel", INFO)
140  return TrackStateOnSurfaceDecoratorCfg(flags, name, **kwargs)
141 
142 def DFInDetTSOSKernelCfg(flags, name='DFInDetTSOSKernel'):
143  acc = ComponentAccumulator()
144 
145  # ====================================================================
146  # AUGMENTATION TOOLS
147  # ====================================================================
148  tsos_augmentationTools = []
149 
150  DFTSOS = acc.getPrimaryAndMerge(DFTrackStateOnSurfaceDecoratorCfg(flags))
151  tsos_augmentationTools.append(DFTSOS)
152 
153  # shared between IDTIDE and IDTRKVALID
154  acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(
155  name,
156  AugmentationTools=tsos_augmentationTools,
157  ThinningTools=[],
158  OutputLevel=INFO))
159  return acc
160 
162  flags, name="ObserverTrackStateOnSurfaceDecorator", **kwargs):
163  kwargs.setdefault("ContainerName", "InDetObservedTrackParticles")
164  kwargs.setdefault("DecorationPrefix", "ObservedTrack_")
165  kwargs.setdefault("PixelMsosName", "ObservedTrack_Pixel_MSOSs")
166  kwargs.setdefault("SctMsosName", "ObservedTrack_SCT_MSOSs")
167  kwargs.setdefault("TrtMsosName", "ObservedTrack_TRT_MSOSs")
168  kwargs.setdefault("AddPRD", True)
169  kwargs.setdefault("StoreHoles", False)
170  return TrackStateOnSurfaceDecoratorCfg(flags, name, **kwargs)
171 
172 def ObserverTSOS_CommonKernelCfg(flags, name="ObserverTSOS_CommonKernel"):
173  acc = ComponentAccumulator()
174  ObserverTrackStateOnSurfaceDecorator = acc.getPrimaryAndMerge(
176  acc.addEventAlgo(CompFactory.DerivationFramework.CommonAugmentation(
177  name, AugmentationTools=[ObserverTrackStateOnSurfaceDecorator]))
178  return acc
179 
181  flags, name="PseudoTrackStateOnSurfaceDecorator", **kwargs):
182  kwargs.setdefault("ContainerName", "InDetPseudoTrackParticles")
183  kwargs.setdefault("DecorationPrefix", "Pseudo_")
184  kwargs.setdefault("PixelMsosName", "Pseudo_Pixel_MSOSs")
185  kwargs.setdefault("SctMsosName", "Pseudo_SCT_MSOSs")
186  kwargs.setdefault("TrtMsosName", "Pseudo_TRT_MSOSs")
187  kwargs.setdefault("AddPRD", True)
188  kwargs.setdefault("StoreHoles", False)
189  return TrackStateOnSurfaceDecoratorCfg(flags, name, **kwargs)
190 
191 def PseudoTSOS_CommonKernelCfg(flags, name="PseudoTSOS_CommonKernel"):
192  acc = ComponentAccumulator()
193  PseudoTrackStateOnSurfaceDecorator = acc.getPrimaryAndMerge(
195  acc.addEventAlgo(CompFactory.DerivationFramework.CommonAugmentation(
196  name, AugmentationTools=[PseudoTrackStateOnSurfaceDecorator]))
197  return acc
198 
200  flags, name="SiSPSeedsTrackStateOnSurfaceDecorator", **kwargs):
201  kwargs.setdefault("ContainerName", "SiSPSeedSegmentsTrackParticles")
202  kwargs.setdefault("DecorationPrefix", "Reco_")
203  kwargs.setdefault("PixelMsosName", "SiSPSeedSegments_PixelMSOSs")
204  kwargs.setdefault("SctMsosName", "SiSPSeedSegments_SCT_MSOSs")
205  kwargs.setdefault("TrtMsosName", "SiSPSeedSegments_TRT_MSOSs")
206  kwargs.setdefault("AddPRD", True)
207  kwargs.setdefault("StoreHoles", False)
208  return TrackStateOnSurfaceDecoratorCfg(flags, name, **kwargs)
209 
210 def SiSPSeedsTSOS_CommonKernelCfg(flags, name="SiSPSeedsTSOS_CommonKernel",
211  listOfExtensions=[]):
212  acc = ComponentAccumulator()
213 
214  listOfAugmTools = []
215  for extension in listOfExtensions:
216  SiSPSeedsTrackStateOnSurfaceDecorator = acc.getPrimaryAndMerge(
218  flags, name = f"SiSPSeeds{extension}TrackStateOnSurfaceDecorator",
219  ContainerName = f"SiSPSeedSegments{extension}TrackParticles",
220  PixelMsosName = f"SiSPSeedSegments{extension}_PixelMSOSs",
221  SctMsosName = f"SiSPSeedSegments{extension}_SCT_MSOSs",
222  TrtMsosName = f"SiSPSeedSegments{extension}_TRT_MSOSs"))
223  listOfAugmTools.append(SiSPSeedsTrackStateOnSurfaceDecorator)
224 
225  acc.addEventAlgo(CompFactory.DerivationFramework.CommonAugmentation(
226  name, AugmentationTools=listOfAugmTools))
227  return acc
228 
230  flags, name="SiSPTrackStateOnSurfaceDecorator", **kwargs):
231  kwargs.setdefault("ContainerName", "SiSPSeededTracksTrackParticles")
232  kwargs.setdefault("DecorationPrefix", "Reco_")
233  kwargs.setdefault("PixelMsosName", "SiSP_PixelMSOSs")
234  kwargs.setdefault("SctMsosName", "SiSP_SCT_MSOSs")
235  kwargs.setdefault("TrtMsosName", "SiSP_TRT_MSOSs")
236  kwargs.setdefault("AddPRD", True)
237  kwargs.setdefault("StoreHoles", False)
238  return TrackStateOnSurfaceDecoratorCfg(flags, name, **kwargs)
239 
240 def SiSPTSOS_CommonKernelCfg(flags, name="SiSPTSOS_CommonKernel",
241  listOfExtensions=[]):
242  acc = ComponentAccumulator()
243 
244  listOfAugmTools = []
245  for extension in listOfExtensions:
246  SiSPTrackStateOnSurfaceDecorator = acc.getPrimaryAndMerge(
248  flags, name = f"SiSP{extension}TrackStateOnSurfaceDecorator",
249  ContainerName = f"SiSPSeededTracks{extension}TrackParticles",
250  PixelMsosName = f"SiSP{extension}_PixelMSOSs",
251  SctMsosName = f"SiSP{extension}_SCT_MSOSs",
252  TrtMsosName = f"SiSP{extension}_TRT_MSOSs"))
253  listOfAugmTools.append(SiSPTrackStateOnSurfaceDecorator)
254 
255  acc.addEventAlgo(CompFactory.DerivationFramework.CommonAugmentation(
256  name, AugmentationTools=listOfAugmTools))
257  return acc
258 
260  flags, name="GSFTrackStateOnSurfaceDecorator", **kwargs):
261  kwargs.setdefault("ContainerName", "GSFTrackParticles")
262  kwargs.setdefault("DecorationPrefix", "GSF_")
263  kwargs.setdefault("PixelMsosName", "GSF_Pixel_MSOSs")
264  kwargs.setdefault("SctMsosName", "GSF_SCT_MSOSs")
265  kwargs.setdefault("TrtMsosName", "GSF_TRT_MSOSs")
266  kwargs.setdefault("PRDtoTrackMap", "")
267  return TrackStateOnSurfaceDecoratorCfg(flags, name, **kwargs)
268 
269 def GSFTSOS_CommonKernelCfg(flags, name="GSFTSOS_CommonKernel"):
270  if flags.Detector.GeometryITk:
271  return ITkGSFTSOS_CommonKernelCfg(flags)
272  acc = ComponentAccumulator()
273  GSFTrackStateOnSurfaceDecorator = acc.getPrimaryAndMerge(
275  acc.addEventAlgo(CompFactory.DerivationFramework.CommonAugmentation(
276  name, AugmentationTools=[GSFTrackStateOnSurfaceDecorator]))
277  return acc
278 
280  flags, name="TrackStateOnSurfaceDecorator", **kwargs):
281  """Configure the TSOS decorator"""
282  # To produce ITkStripDetectorElementCollection
283  from StripGeoModelXml.ITkStripGeoModelConfig import (
284  ITkStripReadoutGeometryCfg)
285  acc = ITkStripReadoutGeometryCfg(flags)
286 
287  from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg
288  kwargs.setdefault("TrackExtrapolator", acc.addPublicTool(acc.popToolsAndMerge(AtlasExtrapolatorCfg(flags))))
289 
290  from InDetConfig.InDetTrackHoleSearchConfig import (
291  ITkTrackHoleSearchToolCfg)
292  kwargs.setdefault("HoleSearch", acc.addPublicTool(acc.popToolsAndMerge(ITkTrackHoleSearchToolCfg(flags))))
293 
294  from TrkConfig.TrkResidualPullCalculatorConfig import (
295  ResidualPullCalculatorCfg)
296  kwargs.setdefault("ResidualPullCalculator", acc.addPublicTool(
297  acc.popToolsAndMerge(ResidualPullCalculatorCfg(flags))))
298 
299  kwargs.setdefault("DecorationPrefix", "")
300  kwargs.setdefault("PixelMapName", "ITkPixelClustersOffsets")
301  kwargs.setdefault("SctMapName", "ITkStripClustersOffsets")
302  kwargs.setdefault("PixelClustersName", "ITkPixelClusters")
303  kwargs.setdefault("SctClustersName", "ITkStripClusters")
304  kwargs.setdefault("PRDtoTrackMap", "ITkPRDtoTrackMapMerge_CombinedITkTracks")
305  kwargs.setdefault("PixelMsosName", "ITkPixelMSOSs")
306  kwargs.setdefault("SctMsosName", "ITkStripMSOSs")
307  kwargs.setdefault("SCTDetEleCollKey", "ITkStripDetectorElementCollection")
308 
309  acc.addPublicTool(
310  CompFactory.DerivationFramework.TrackStateOnSurfaceDecorator(
311  name, **kwargs), primary=True)
312  return acc
313 
314 def ITkTSOS_CommonKernelCfg(flags, name="ITkTSOS_CommonKernel"):
315  acc = ComponentAccumulator()
316  ITkTrackStateOnSurfaceDecorator = acc.getPrimaryAndMerge(
318  acc.addEventAlgo(CompFactory.DerivationFramework.CommonAugmentation(
319  name, AugmentationTools=[ITkTrackStateOnSurfaceDecorator]))
320  return acc
321 
323  flags, name="DFITkTrackStateOnSurfaceDecorator", **kwargs):
324  kwargs.setdefault("StorePixel", flags.ITk.DAODStorePixel)
325  kwargs.setdefault("StoreSCT", flags.ITk.DAODStoreStrip)
326  kwargs.setdefault("DecorationPrefix", "")
327  kwargs.setdefault("PRDtoTrackMap", "")
328  kwargs.setdefault("OutputLevel", INFO)
329  return ITkTrackStateOnSurfaceDecoratorCfg(flags, name, **kwargs)
330 
331 def DFITkTSOSKernelCfg(flags, name='DFITkTSOSKernel'):
332  acc = ComponentAccumulator()
333 
334  # ====================================================================
335  # AUGMENTATION TOOLS
336  # ====================================================================
337  tsos_augmentationTools = []
338 
339  DFTSOS = acc.getPrimaryAndMerge(DFITkTrackStateOnSurfaceDecoratorCfg(flags))
340  tsos_augmentationTools.append(DFTSOS)
341 
342  # shared between IDTIDE and IDTRKVALID
343  acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(
344  name,
345  AugmentationTools=tsos_augmentationTools,
346  ThinningTools=[],
347  OutputLevel=INFO))
348  return acc
349 
351  flags, name="SiSPTrackStateOnSurfaceDecorator", **kwargs):
352  kwargs.setdefault("ContainerName", "SiSPSeededTracksTrackParticles")
353  kwargs.setdefault("DecorationPrefix", "SiSP_")
354  kwargs.setdefault("PixelMsosName", "SiSP_ITkPixel_MSOSs")
355  kwargs.setdefault("SctMsosName", "SiSP_ITkStrip_MSOSs")
356  kwargs.setdefault("AddPRD", True)
357  kwargs.setdefault("StoreHoles", False)
358  return ITkTrackStateOnSurfaceDecoratorCfg(flags, name, **kwargs)
359 
360 def ITkSiSPTSOS_CommonKernelCfg(flags, name="ITkSiSPTSOS_CommonKernel",
361  listOfExtensions=[]):
362  acc = ComponentAccumulator()
363  listOfAugmTools = []
364  for extension in listOfExtensions:
365  ITkSiSPTrackStateOnSurfaceDecorator = acc.getPrimaryAndMerge(
367  flags, name = f"SiSP{extension}TrackStateOnSurfaceDecorator",
368  ContainerName = f"SiSPSeededTracks{extension}TrackParticles",
369  PixelMsosName = f"SiSP{extension}_ITkPixel_MSOSs",
370  SctMsosName = f"SiSP{extension}_ITkStrip_MSOSs"))
371  listOfAugmTools.append(ITkSiSPTrackStateOnSurfaceDecorator)
372 
373  acc.addEventAlgo(CompFactory.DerivationFramework.CommonAugmentation(
374  name, AugmentationTools=listOfAugmTools))
375  return acc
376 
378  flags, name="ITkGSFTrackStateOnSurfaceDecorator", **kwargs):
379  kwargs.setdefault("ContainerName", "GSFTrackParticles")
380  kwargs.setdefault("DecorationPrefix", "GSF_")
381  kwargs.setdefault("PixelMsosName", "GSF_ITkPixel_MSOSs")
382  kwargs.setdefault("SctMsosName", "GSF_ITkStrip_MSOSs")
383  kwargs.setdefault("TrtMsosName", "")
384  kwargs.setdefault("PRDtoTrackMap", "")
385  kwargs.setdefault("AddExtraEventInfo", flags.Beam.Type is BeamType.Cosmics)
386  return ITkTrackStateOnSurfaceDecoratorCfg(flags, name, **kwargs)
387 
388 def ITkGSFTSOS_CommonKernelCfg(flags, name="ITkGSFTSOS_CommonKernel"):
389  acc = ComponentAccumulator()
390  GSFTrackStateOnSurfaceDecorator = acc.getPrimaryAndMerge(
392  acc.addEventAlgo(CompFactory.DerivationFramework.CommonAugmentation(
393  name, AugmentationTools=[GSFTrackStateOnSurfaceDecorator]))
394  return acc
395 
396 # Expression of Z0 at the primary vertex
397 
398 
399 def TrackParametersAtPVCfg(flags, name, **kwargs):
400  """Configure the TrackParametersAtPV tool"""
401  acc = ComponentAccumulator()
402  acc.addPublicTool(CompFactory.DerivationFramework.TrackParametersAtPV(
403  name, **kwargs), primary=True)
404  return acc
405 
406 # Pseudotrack selector
407 
408 
409 def PseudoTrackSelectorCfg(flags, name, **kwargs):
410  """Configure the pseudotrack selector"""
411  acc = ComponentAccumulator()
412 
413  if "trackTruthOriginTool" not in kwargs:
414  from InDetTrackSystematicsTools.InDetTrackSystematicsToolsConfig import InDetTrackTruthOriginToolCfg
415  kwargs.setdefault("trackTruthOriginTool", acc.popToolsAndMerge(
417 
418  acc.addPublicTool(
419  CompFactory.DerivationFramework.PseudoTrackSelector(
420  name, **kwargs), primary=True)
421  return acc
422 
423 # Tool for decorating tracks with the outcome of the track selector tool
424 
425 
427  flags, name, CutLevel="TightPrimary", **kwargs):
428  """Configure the InDetTrackSelectionToolWrapper"""
429  acc = ComponentAccumulator()
430 
431  if "TrackSelectionTool" not in kwargs:
432  from InDetConfig.InDetTrackSelectionToolConfig import (
433  InDetTrackSelectionToolCfg)
434  kwargs.setdefault("TrackSelectionTool", acc.popToolsAndMerge(
436  flags, name="InDetTrackSelectionTool_"+CutLevel,
437  CutLevel=CutLevel)))
438 
439  acc.addPublicTool(
440  CompFactory.DerivationFramework.InDetTrackSelectionToolWrapper(
441  name, **kwargs), primary=True)
442  return acc
443 
444 # Tool for decorating the track and calo isolation
445 
446 
447 def IsolationTrackDecoratorCfg(flags, name, **kwargs):
448  """Confiure the isolation track decorator tool"""
449  acc = ComponentAccumulator()
450  IsolationTrackDecorator = CompFactory.DerivationFramework.IsolationTrackDecorator
451  acc.addPublicTool(IsolationTrackDecorator(name, **kwargs),
452  primary = True)
453  return acc
454 
455 # Tool for thinning TrackParticle containers via string selection
456 
457 
458 def TrackParticleThinningCfg(flags, name, **kwargs):
459  """Configure the TrackParticleThining tool"""
460  if flags.Detector.GeometryITk:
461  return ITkTrackParticleThinningCfg(flags, name, **kwargs)
462 
463  # To produce SCT_DetectorElementCollection
464  from SCT_GeoModel.SCT_GeoModelConfig import SCT_ReadoutGeometryCfg
465  acc = SCT_ReadoutGeometryCfg(flags)
466 
467  acc.addPublicTool(CompFactory.DerivationFramework.TrackParticleThinning(
468  name, **kwargs), primary=True)
469  return acc
470 
471 def IDTIDEThinningToolCfg(flags, name="IDTIDEThinningTool", **kwargs):
472  if not flags.Detector.EnablePixel:
473  kwargs.setdefault("InDetTrackStatesPixKey", "")
474  kwargs.setdefault("InDetTrackMeasurementsPixKey", "")
475  if not flags.Detector.EnableSCT:
476  kwargs.setdefault("InDetTrackStatesSctKey", "")
477  kwargs.setdefault("InDetTrackMeasurementsSctKey", "")
478  if not flags.Detector.EnableTRT:
479  kwargs.setdefault("InDetTrackStatesTrtKey", "")
480  kwargs.setdefault("InDetTrackMeasurementsTrtKey", "")
481 
482  kwargs.setdefault("SelectionString", "abs(IDTIDEInDetTrackZ0AtPV) < 5.0")
483  # If true, Complains about missing PixelMSOSs
484  kwargs.setdefault("ThinHitsOnTrack", False)
485 
486  from DerivationFrameworkInDet.InDetToolsConfig import (
487  TrackParticleThinningCfg)
488  return TrackParticleThinningCfg(flags, name, **kwargs)
489 
490 def ITkTrackParticleThinningCfg(flags, name, **kwargs):
491  """Configure the TrackParticleThining tool"""
492  # To produce ITkStripDetectorElementCollection
493  from StripGeoModelXml.ITkStripGeoModelConfig import (
494  ITkStripReadoutGeometryCfg)
495  acc = ITkStripReadoutGeometryCfg(flags)
496 
497  kwargs.setdefault("InDetTrackStatesPixKey", "ITkPixelMSOSs")
498  kwargs.setdefault("InDetTrackMeasurementsPixKey", "ITkPixelClusters")
499  kwargs.setdefault("InDetTrackStatesSctKey", "ITkStripMSOSs")
500  kwargs.setdefault("InDetTrackMeasurementsSctKey", "ITkStripClusters")
501  kwargs.setdefault("InDetTrackStatesTrtKey", "")
502  kwargs.setdefault("InDetTrackMeasurementsTrtKey", "")
503  kwargs.setdefault("SCTDetEleCollKey", "ITkStripDetectorElementCollection")
504 
505  acc.addPublicTool(CompFactory.DerivationFramework.TrackParticleThinning(
506  name, **kwargs), primary=True)
507  return acc
508 
509 def ITkTIDEThinningToolCfg(flags, name="ITkTIDEThinningTool", **kwargs):
510  if not flags.Detector.EnableITkPixel:
511  kwargs.setdefault("InDetTrackStatesPixKey", "")
512  kwargs.setdefault("InDetTrackMeasurementsPixKey", "")
513  if not flags.Detector.EnableITkStrip:
514  kwargs.setdefault("InDetTrackStatesSctKey", "")
515  kwargs.setdefault("InDetTrackMeasurementsSctKey", "")
516 
517  kwargs.setdefault("SelectionString", "abs(IDTIDEInDetTrackZ0AtPV) < 5.0")
518  # If true, Complains about missing PixelMSOSs
519  kwargs.setdefault("ThinHitsOnTrack", False)
520 
521  from DerivationFrameworkInDet.InDetToolsConfig import (
522  ITkTrackParticleThinningCfg)
523  return ITkTrackParticleThinningCfg(flags, name, **kwargs)
524 
525 # Tool for thinning TrackParticles that aren't associated with muons
526 
527 
528 def MuonTrackParticleThinningCfg(flags, name, **kwargs):
529  """Configure the MuonTrackParticleThinning tool"""
530  acc = ComponentAccumulator()
531  acc.addPublicTool(
532  CompFactory.DerivationFramework.MuonTrackParticleThinning(
533  name, **kwargs), primary=True)
534  return acc
535 
536 # Tool for thinning TrackParticles that aren't associated with taus
537 
538 
539 def TauTrackParticleThinningCfg(flags, name, **kwargs):
540  """Configure the TauTrackParticleThinning tool"""
541  acc = ComponentAccumulator()
542  acc.addPublicTool(CompFactory.DerivationFramework.TauTrackParticleThinning(
543  name, **kwargs), primary=True)
544  return acc
545 
546 # Tool for thinning TrackParticles that aren't associated high-pt di-taus
547 
548 
549 def DiTauTrackParticleThinningCfg(flags, name, **kwargs):
550  """Configure the DiTauTrackParticleThinning tool"""
551  acc = ComponentAccumulator()
552  acc.addPublicTool(
553  CompFactory.DerivationFramework.DiTauTrackParticleThinning(
554  name, **kwargs), primary=True)
555  return acc
556 
557 # Tool for thinning TrackParticles that are associated with jets
558 
559 
560 def JetTrackParticleThinningCfg(flags, name, **kwargs):
561  """Configure the JetTrackParticleThinning tool"""
562  acc = ComponentAccumulator()
563  acc.addPublicTool(CompFactory.DerivationFramework.JetTrackParticleThinning(
564  name, **kwargs), primary=True)
565  return acc
566 
567 
568 def TauJetLepRMParticleThinningCfg(flags, name, **kwargs):
569  """Configure the DiTauTrackParticleThinning tool"""
570  acc = ComponentAccumulator()
571  acc.addPublicTool(
572  CompFactory.DerivationFramework.TauJets_LepRMParticleThinning(
573  name, **kwargs), primary=True)
574  return acc
575 
576 # Tool for thinning TrackParticles that aren't associated with egamma objects
577 
578 
579 def EgammaTrackParticleThinningCfg(flags, name, **kwargs):
580  """Configure the EgammaTrackParticleThinning tool"""
581  acc = ComponentAccumulator()
582  acc.addPublicTool(
583  CompFactory.DerivationFramework.EgammaTrackParticleThinning(
584  name, **kwargs), primary=True)
585  return acc
586 
587 # Track to vertex wrapper
588 
589 
590 def TrackToVertexWrapperCfg(flags, name, **kwargs):
591  """Configure the TrackToVertexWrapper tool"""
592  acc = ComponentAccumulator()
593 
594  if "TrackToVertexIPEstimator" not in kwargs:
595  from TrkConfig.TrkVertexFitterUtilsConfig import (
596  TrackToVertexIPEstimatorCfg)
597  kwargs.setdefault("TrackToVertexIPEstimator", acc.popToolsAndMerge(
599 
600  kwargs.setdefault("ContainerName", "InDetTrackParticles")
601 
602  acc.addPublicTool(CompFactory.DerivationFramework.TrackToVertexWrapper(
603  name, **kwargs), primary=True)
604  return acc
605 
606 
607 def IDTIDETruthThinningToolCfg(flags, name="IDTIDETruthThinningTool", **kwargs):
608  kwargs.setdefault("WritePartons", True)
609  kwargs.setdefault("WriteHadrons", True)
610  kwargs.setdefault("WriteBHadrons", True)
611  kwargs.setdefault("WriteGeant", True)
612  kwargs.setdefault("GeantPhotonPtThresh", 20000)
613  kwargs.setdefault("WriteTauHad", True)
614  kwargs.setdefault("PartonPtThresh", -1.0)
615  kwargs.setdefault("WriteBSM", True)
616  kwargs.setdefault("WriteBosons", True)
617  kwargs.setdefault("WriteBosonProducts", True)
618  kwargs.setdefault("WriteBSMProducts", True)
619  kwargs.setdefault("WriteTopAndDecays", True)
620  kwargs.setdefault("WriteEverything", True)
621  kwargs.setdefault("WriteAllLeptons", True)
622  kwargs.setdefault("WriteLeptonsNotFromHadrons", True)
623  kwargs.setdefault("WriteNotPhysical", True)
624  kwargs.setdefault("WriteFirstN", -1)
625  kwargs.setdefault("PreserveAncestors", True)
626  kwargs.setdefault("PreserveGeneratorDescendants", True)
627 
628  from DerivationFrameworkMCTruth.TruthDerivationToolsConfig import (
629  MenuTruthThinningCfg)
630  return MenuTruthThinningCfg(flags, name, **kwargs)
631 
633  flags, name="IDTRKVALIDTruthThinningTool", **kwargs):
634 
635  kwargs.setdefault("WriteEverything", True)
636  kwargs.setdefault("WriteFirstN", -1)
637  kwargs.setdefault("PreserveAncestors", True)
638  kwargs.setdefault("PreserveGeneratorDescendants", True)
639 
640  from DerivationFrameworkMCTruth.TruthDerivationToolsConfig import (
641  MenuTruthThinningCfg)
642  return MenuTruthThinningCfg(flags, name, **kwargs)
643 
645  flags, name="EventInfoBSErrDecorator", **kwargs):
646  acc = ComponentAccumulator()
647  acc.addPublicTool(CompFactory.DerivationFramework.EventInfoBSErrDecorator(
648  name, **kwargs), primary=True)
649  return acc
650 
652  flags, name="UnassociatedHitsGetterTool", **kwargs):
653  acc = ComponentAccumulator()
654 
655  if "AssociationTool" not in kwargs:
656  from InDetConfig.InDetAssociationToolsConfig import (
657  InDetPRDtoTrackMapToolGangedPixelsCfg)
658  kwargs.setdefault("AssociationTool", acc.popToolsAndMerge(
660 
661  acc.setPrivateTools(
662  CompFactory.DerivationFramework.UnassociatedHitsGetterTool(name, **kwargs))
663  return acc
664 
666  flags, name="UnassociatedHitsDecorator", **kwargs):
667  acc = ComponentAccumulator()
668 
669  if "UnassociatedHitsGetter" not in kwargs:
670  from DerivationFrameworkInDet.InDetToolsConfig import (
671  UnassociatedHitsGetterToolCfg)
672  kwargs.setdefault("UnassociatedHitsGetter", acc.popToolsAndMerge(
674 
675  acc.addPublicTool(CompFactory.DerivationFramework.UnassociatedHitsDecorator(
676  name, **kwargs), primary=True)
677  return acc
python.InDetHardScatterSelectionToolConfig.InDetHardScatterSelectionToolCfg
def InDetHardScatterSelectionToolCfg(flags, name="InDetHardScatterSelectionTool", **kwargs)
Definition: InDetHardScatterSelectionToolConfig.py:7
python.TRT_ElectronPidToolsConfig.TRT_dEdxToolCfg
def TRT_dEdxToolCfg(flags, name="TRT_dEdxTool", **kwargs)
Definition: TRT_ElectronPidToolsConfig.py:68
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.InDetToolsConfig.InDetTrackSelectionToolWrapperCfg
def InDetTrackSelectionToolWrapperCfg(flags, name, CutLevel="TightPrimary", **kwargs)
Definition: InDetToolsConfig.py:426
python.InDetToolsConfig.ObserverTrackStateOnSurfaceDecoratorCfg
def ObserverTrackStateOnSurfaceDecoratorCfg(flags, name="ObserverTrackStateOnSurfaceDecorator", **kwargs)
Definition: InDetToolsConfig.py:161
python.InDetToolsConfig.TauJetLepRMParticleThinningCfg
def TauJetLepRMParticleThinningCfg(flags, name, **kwargs)
Definition: InDetToolsConfig.py:568
ITkStripGeoModelConfig.ITkStripReadoutGeometryCfg
def ITkStripReadoutGeometryCfg(flags)
Definition: ITkStripGeoModelConfig.py:39
python.TruthDerivationToolsConfig.MenuTruthThinningCfg
def MenuTruthThinningCfg(flags, name, **kwargs)
Definition: TruthDerivationToolsConfig.py:369
python.InDetToolsConfig.TrackParametersAtPVCfg
def TrackParametersAtPVCfg(flags, name, **kwargs)
Definition: InDetToolsConfig.py:399
python.InDetToolsConfig.ITkTSOS_CommonKernelCfg
def ITkTSOS_CommonKernelCfg(flags, name="ITkTSOS_CommonKernel")
Definition: InDetToolsConfig.py:314
python.TrkVertexFitterUtilsConfig.TrackToVertexIPEstimatorCfg
def TrackToVertexIPEstimatorCfg(flags, name='TrackToVertexIPEstimator', **kwargs)
Definition: TrkVertexFitterUtilsConfig.py:48
python.InDetToolsConfig.TrackParticleThinningCfg
def TrackParticleThinningCfg(flags, name, **kwargs)
Definition: InDetToolsConfig.py:458
python.InDetToolsConfig.UnassociatedHitsGetterToolCfg
def UnassociatedHitsGetterToolCfg(flags, name="UnassociatedHitsGetterTool", **kwargs)
Definition: InDetToolsConfig.py:651
python.InDetToolsConfig.DFInDetTSOSKernelCfg
def DFInDetTSOSKernelCfg(flags, name='DFInDetTSOSKernel')
Definition: InDetToolsConfig.py:142
python.InDetToolsConfig.DiTauTrackParticleThinningCfg
def DiTauTrackParticleThinningCfg(flags, name, **kwargs)
Definition: InDetToolsConfig.py:549
python.InDetTrackSelectionToolConfig.InDetTrackSelectionToolCfg
def InDetTrackSelectionToolCfg(flags, name="InDetTrackSelectionTool", **kwargs)
Definition: InDetTrackSelectionToolConfig.py:7
python.AtlasExtrapolatorConfig.AtlasExtrapolatorCfg
def AtlasExtrapolatorCfg(flags, name='AtlasExtrapolator')
Definition: AtlasExtrapolatorConfig.py:63
python.InDetToolsConfig.UnassociatedHitsDecoratorCfg
def UnassociatedHitsDecoratorCfg(flags, name="UnassociatedHitsDecorator", **kwargs)
Definition: InDetToolsConfig.py:665
python.InDetToolsConfig.ITkSiSPTSOS_CommonKernelCfg
def ITkSiSPTSOS_CommonKernelCfg(flags, name="ITkSiSPTSOS_CommonKernel", listOfExtensions=[])
Definition: InDetToolsConfig.py:360
python.InDetToolsConfig.SiSPSeedsTrackStateOnSurfaceDecoratorCfg
def SiSPSeedsTrackStateOnSurfaceDecoratorCfg(flags, name="SiSPSeedsTrackStateOnSurfaceDecorator", **kwargs)
Definition: InDetToolsConfig.py:199
python.InDetToolsConfig.ITkTrackStateOnSurfaceDecoratorCfg
def ITkTrackStateOnSurfaceDecoratorCfg(flags, name="TrackStateOnSurfaceDecorator", **kwargs)
Definition: InDetToolsConfig.py:279
python.InDetToolsConfig.TrackToVertexWrapperCfg
def TrackToVertexWrapperCfg(flags, name, **kwargs)
Definition: InDetToolsConfig.py:590
python.InDetToolsConfig.GSFTSOS_CommonKernelCfg
def GSFTSOS_CommonKernelCfg(flags, name="GSFTSOS_CommonKernel")
Definition: InDetToolsConfig.py:269
python.InDetToolsConfig.IDTIDEThinningToolCfg
def IDTIDEThinningToolCfg(flags, name="IDTIDEThinningTool", **kwargs)
Definition: InDetToolsConfig.py:471
python.InDetAssociationToolsConfig.InDetPRDtoTrackMapToolGangedPixelsCfg
def InDetPRDtoTrackMapToolGangedPixelsCfg(flags, name='PRDtoTrackMapToolGangedPixels', **kwargs)
Definition: InDetAssociationToolsConfig.py:29
SCT_GeoModelConfig.SCT_ReadoutGeometryCfg
def SCT_ReadoutGeometryCfg(flags)
Definition: SCT_GeoModelConfig.py:51
python.InDetToolsConfig.ObserverTSOS_CommonKernelCfg
def ObserverTSOS_CommonKernelCfg(flags, name="ObserverTSOS_CommonKernel")
Definition: InDetToolsConfig.py:172
Constants
some useful constants -------------------------------------------------—
python.InDetToolsConfig.DFTrackStateOnSurfaceDecoratorCfg
def DFTrackStateOnSurfaceDecoratorCfg(flags, name="DFTrackStateOnSurfaceDecorator", **kwargs)
Definition: InDetToolsConfig.py:130
python.InDetToolsConfig.UsedInVertexFitTrackDecoratorCfg
def UsedInVertexFitTrackDecoratorCfg(flags, name="UsedInVertexFitTrackDecorator", **kwargs)
Definition: InDetToolsConfig.py:28
python.InDetToolsConfig.PseudoTSOS_CommonKernelCfg
def PseudoTSOS_CommonKernelCfg(flags, name="PseudoTSOS_CommonKernel")
Definition: InDetToolsConfig.py:191
python.InDetToolsConfig.EventInfoBSErrDecoratorCfg
def EventInfoBSErrDecoratorCfg(flags, name="EventInfoBSErrDecorator", **kwargs)
Definition: InDetToolsConfig.py:644
python.InDetToolsConfig.IDTRKVALIDTruthThinningToolCfg
def IDTRKVALIDTruthThinningToolCfg(flags, name="IDTRKVALIDTruthThinningTool", **kwargs)
Definition: InDetToolsConfig.py:632
python.InDetToolsConfig.JetTrackParticleThinningCfg
def JetTrackParticleThinningCfg(flags, name, **kwargs)
Definition: InDetToolsConfig.py:560
python.InDetToolsConfig.MuonTrackParticleThinningCfg
def MuonTrackParticleThinningCfg(flags, name, **kwargs)
Definition: InDetToolsConfig.py:528
python.InDetToolsConfig.TauTrackParticleThinningCfg
def TauTrackParticleThinningCfg(flags, name, **kwargs)
Definition: InDetToolsConfig.py:539
python.InDetToolsConfig.DFITkTrackStateOnSurfaceDecoratorCfg
def DFITkTrackStateOnSurfaceDecoratorCfg(flags, name="DFITkTrackStateOnSurfaceDecorator", **kwargs)
Definition: InDetToolsConfig.py:322
python.InDetToolsConfig.ITkTrackParticleThinningCfg
def ITkTrackParticleThinningCfg(flags, name, **kwargs)
Definition: InDetToolsConfig.py:490
python.InDetTrackHoleSearchConfig.ITkTrackHoleSearchToolCfg
def ITkTrackHoleSearchToolCfg(flags, name='ITkHoleSearchTool', **kwargs)
Definition: InDetTrackHoleSearchConfig.py:56
python.InDetToolsConfig.ITkGSFTrackStateOnSurfaceDecoratorCfg
def ITkGSFTrackStateOnSurfaceDecoratorCfg(flags, name="ITkGSFTrackStateOnSurfaceDecorator", **kwargs)
Definition: InDetToolsConfig.py:377
python.InDetToolsConfig.TrackStateOnSurfaceDecoratorCfg
def TrackStateOnSurfaceDecoratorCfg(flags, name, **kwargs)
Definition: InDetToolsConfig.py:62
python.InDetToolsConfig.HardScatterVertexDecoratorCfg
def HardScatterVertexDecoratorCfg(flags, name="DFCommonHSDecorator", **kwargs)
Definition: InDetToolsConfig.py:46
python.InDetToolsConfig.PseudoTrackSelectorCfg
def PseudoTrackSelectorCfg(flags, name, **kwargs)
Definition: InDetToolsConfig.py:409
python.InDetToolsConfig.ITkTIDEThinningToolCfg
def ITkTIDEThinningToolCfg(flags, name="ITkTIDEThinningTool", **kwargs)
Definition: InDetToolsConfig.py:509
python.InDetToolsConfig.GSFTrackStateOnSurfaceDecoratorCfg
def GSFTrackStateOnSurfaceDecoratorCfg(flags, name="GSFTrackStateOnSurfaceDecorator", **kwargs)
Definition: InDetToolsConfig.py:259
python.InDetToolsConfig.SiSPTrackStateOnSurfaceDecoratorCfg
def SiSPTrackStateOnSurfaceDecoratorCfg(flags, name="SiSPTrackStateOnSurfaceDecorator", **kwargs)
Definition: InDetToolsConfig.py:229
python.InDetToolsConfig.IDTIDETruthThinningToolCfg
def IDTIDETruthThinningToolCfg(flags, name="IDTIDETruthThinningTool", **kwargs)
Definition: InDetToolsConfig.py:607
python.InDetToolsConfig.InDetLRTMergeCfg
def InDetLRTMergeCfg(flags, name="InDetLRTMerge", **kwargs)
Definition: InDetToolsConfig.py:14
python.InDetToolsConfig.EgammaTrackParticleThinningCfg
def EgammaTrackParticleThinningCfg(flags, name, **kwargs)
Definition: InDetToolsConfig.py:579
python.InDetTrackHoleSearchConfig.InDetTrackHoleSearchToolCfg
def InDetTrackHoleSearchToolCfg(flags, name='InDetHoleSearchTool', **kwargs)
Definition: InDetTrackHoleSearchConfig.py:8
python.InDetToolsConfig.PseudoTrackStateOnSurfaceDecoratorCfg
def PseudoTrackStateOnSurfaceDecoratorCfg(flags, name="PseudoTrackStateOnSurfaceDecorator", **kwargs)
Definition: InDetToolsConfig.py:180
python.InDetToolsConfig.TSOS_CommonKernelCfg
def TSOS_CommonKernelCfg(flags, name="TSOS_CommonKernel", listOfExtensions=[])
Definition: InDetToolsConfig.py:107
python.InDetToolsConfig.DFITkTSOSKernelCfg
def DFITkTSOSKernelCfg(flags, name='DFITkTSOSKernel')
Definition: InDetToolsConfig.py:331
python.InDetToolsConfig.ITkSiSPTrackStateOnSurfaceDecoratorCfg
def ITkSiSPTrackStateOnSurfaceDecoratorCfg(flags, name="SiSPTrackStateOnSurfaceDecorator", **kwargs)
Definition: InDetToolsConfig.py:350
python.TrkResidualPullCalculatorConfig.ResidualPullCalculatorCfg
def ResidualPullCalculatorCfg(flags, name='ResidualPullCalculator', **kwargs)
Definition: TrkResidualPullCalculatorConfig.py:6
python.InDetToolsConfig.SiSPSeedsTSOS_CommonKernelCfg
def SiSPSeedsTSOS_CommonKernelCfg(flags, name="SiSPSeedsTSOS_CommonKernel", listOfExtensions=[])
Definition: InDetToolsConfig.py:210
python.InDetToolsConfig.ITkGSFTSOS_CommonKernelCfg
def ITkGSFTSOS_CommonKernelCfg(flags, name="ITkGSFTSOS_CommonKernel")
Definition: InDetToolsConfig.py:388
python.InDetToolsConfig.SiSPTSOS_CommonKernelCfg
def SiSPTSOS_CommonKernelCfg(flags, name="SiSPTSOS_CommonKernel", listOfExtensions=[])
Definition: InDetToolsConfig.py:240
python.InDetToolsConfig.IsolationTrackDecoratorCfg
def IsolationTrackDecoratorCfg(flags, name, **kwargs)
Definition: InDetToolsConfig.py:447
InDetTrackSystematicsToolsConfig.InDetTrackTruthOriginToolCfg
def InDetTrackTruthOriginToolCfg(flags, name="InDetTrackTruthOriginTool", **kwargs)
Definition: InDetTrackSystematicsToolsConfig.py:6
python.InDetUsedInFitTrackDecoratorToolConfig.InDetUsedInFitTrackDecoratorToolCfg
def InDetUsedInFitTrackDecoratorToolCfg(flags, name="InDetUsedInFitTrackDecoratorTool", **kwargs)
Definition: InDetUsedInFitTrackDecoratorToolConfig.py:7