ATLAS Offline Software
Loading...
Searching...
No Matches
TauToolHolder.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3
10
11from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
12from AthenaConfiguration.ComponentFactory import CompFactory
13from AthenaConfiguration.AccumulatorCache import AccumulatorCache
14from AthenaConfiguration.Enums import ProductionStep
15from AthenaCommon.SystemOfUnits import GeV, deg
16
17
19@AccumulatorCache
21 result = ComponentAccumulator()
22 _name = flags.Tau.ActiveConfig.prefix + 'JetSeedBuilder'
23
24 JetSeedBuilder = CompFactory.getComp("JetSeedBuilder")
25 JetSeedBuilder = JetSeedBuilder(name = _name)
26
27 result.setPrivateTools(JetSeedBuilder)
28 return result
29
30
32 result = ComponentAccumulator()
33 _name = flags.Tau.ActiveConfig.prefix + 'TauVertexFinder'
34
35 from InDetConfig.InDetTrackSelectionToolConfig import Tau_InDetTrackSelectionToolForTJVACfg
36 from TrackVertexAssociationTool.TrackVertexAssociationToolConfig import TauTTVAToolCfg
37
38 # Algorithm that overwrites numTrack() and charge() of tauJets in container
39 # from tauRecTools.tauRecToolsConf import TauVertexFinder
40 TauVertexFinder = CompFactory.getComp("TauVertexFinder")
41 TauVertexFinder = TauVertexFinder(name = _name,
42 UseTJVA = flags.Tau.doTJVA,
43 AssociatedTracks="GhostTrack", # OK??
44 InDetTrackSelectionToolForTJVA = result.popToolsAndMerge(Tau_InDetTrackSelectionToolForTJVACfg(flags)),
45 Key_trackPartInputContainer= flags.Tau.ActiveConfig.TrackCollection,
46 Key_vertexInputContainer = flags.Tau.ActiveConfig.VertexCollection,
47 TVATool = result.popToolsAndMerge(TauTTVAToolCfg(flags)),
48 inEleRM = flags.Tau.ActiveConfig.inTauEleRM,
49 )
50
51 result.setPrivateTools(TauVertexFinder)
52 return result
53
54
56def TauAxisCfg(flags):
57 result = ComponentAccumulator()
58 _name = flags.Tau.ActiveConfig.prefix + 'TauAxis'
59
60 TauAxisSetter = CompFactory.getComp("TauAxisSetter")
61 TauAxisSetter = TauAxisSetter( name = _name,
62 ClusterCone = 0.2,
63 VertexCorrection = flags.Tau.doVertexCorrection )
64
65 result.setPrivateTools(TauAxisSetter)
66 return result
67
68
69
71 #If reading from ESD we not create a cache of extrapolations to the calorimeter, so we should signify this by setting the cache key to a null string
72 if flags.Common.ProductionStep is ProductionStep.Reconstruction:
73 ParticleCache = "ParticleCaloExtension"
74 else:
75 ParticleCache = ""
76
77 return ParticleCache
78
79
82 result = ComponentAccumulator()
83 _name = flags.Tau.ActiveConfig.prefix + 'TauTrackFinder'
84
85 # BeamSpot Conditions
86 from BeamSpotConditions.BeamSpotConditionsConfig import BeamSpotCondAlgCfg
87 result.merge(BeamSpotCondAlgCfg(flags))
88
89 from TrackToVertex.TrackToVertexConfig import TrackToVertexCfg
90 from TrackToCalo.TrackToCaloConfig import ParticleCaloExtensionToolCfg
91 from TrkConfig.TrkVertexFitterUtilsConfig import AtlasTrackToVertexIPEstimatorCfg
92 from InDetConfig.InDetTrackSelectorToolConfig import TauRecInDetTrackSelectorToolCfg
93
94 TauTrackFinder = CompFactory.getComp("TauTrackFinder")
95 TauTrackFinder = TauTrackFinder(name = _name,
96 MaxJetDrTau = 0.2,
97 MaxJetDrWide = 0.4,
98 TrackSelectorToolTau = result.popToolsAndMerge(TauRecInDetTrackSelectorToolCfg(flags)),
99 TrackToVertexTool = result.popToolsAndMerge(TrackToVertexCfg(flags)),
100 ParticleCaloExtensionTool = result.popToolsAndMerge(ParticleCaloExtensionToolCfg(flags)),
101 tauParticleCache = getParticleCache(flags), # only returns a string
102 removeDuplicateCoreTracks = flags.Tau.RemoveDupeCoreTracks,
103 useGhostTracks = flags.Tau.useGhostTracks,
104 ghostTrackDR = flags.Tau.ghostTrackDR,
105 Key_jetContainer = (flags.Tau.ActiveConfig.SeedJetCollection if flags.Tau.useGhostTracks else ""),
106 Key_trackPartInputContainer = flags.Tau.ActiveConfig.TrackCollection,
107 Key_LargeD0TrackInputContainer = (flags.Tau.ActiveConfig.LargeD0TrackCollection if flags.Tau.associateLRT else ""),
108 TrackToVertexIPEstimator = result.popToolsAndMerge(AtlasTrackToVertexIPEstimatorCfg(flags)),
109 inEleRM = flags.Tau.ActiveConfig.inTauEleRM,
110 )
111 result.setPrivateTools(TauTrackFinder)
112 return result
113
114
117 result = ComponentAccumulator()
118 _name = flags.Tau.ActiveConfig.prefix + 'TauClusterFinder'
119
120
121 TauClusterFinder = CompFactory.getComp("TauClusterFinder")
122 TauClusterFinder = TauClusterFinder(
123 name = _name,
124 inEleRM = flags.Tau.ActiveConfig.inTauEleRM,
125 )
126
127
128 result.setPrivateTools(TauClusterFinder)
129 return result
130
131
133 result = ComponentAccumulator()
134 _name = flags.Tau.ActiveConfig.prefix + 'TauVertexedClusterDecorator'
135
136 TauVertexedClusterDecorator = CompFactory.getComp("TauVertexedClusterDecorator")
137 myTauVertexedClusterDecorator = TauVertexedClusterDecorator(name = _name,
138 SeedJet = flags.Tau.ActiveConfig.SeedJetCollection)
139
140 result.setPrivateTools(myTauVertexedClusterDecorator)
141 return result
142
143
144def TauTrackRNNCfg(flags):
145 result = ComponentAccumulator()
146 _name = flags.Tau.ActiveConfig.prefix + 'TauTrackRNNClassifier'
147
148 TrackRNN = CompFactory.tauRecTools.TrackRNN
149 _RNN = TrackRNN(name = _name + "_TrackRNN",
150 InputWeightsPath = flags.Tau.tauRNNTrackClassConfig,
151 calibFolder = flags.Tau.tauRecToolsCVMFSPath )
152
153 result.setPrivateTools(_RNN)
154 return result
155
156
158 result = ComponentAccumulator()
159 _name = flags.Tau.ActiveConfig.prefix + 'TauTrackRNNClassifier'
160
161 # create tool alg
162 TauTrackRNNClassifier = CompFactory.tauRecTools.TauTrackRNNClassifier
163
164 import cppyy
165 cppyy.load_library('libxAODTau_cDict')
166
167 _classifyLRT = True
168 if flags.Tau.associateLRT and not flags.Tau.classifyLRT:
169 _classifyLRT = False
170
171 myTauTrackClassifier = TauTrackRNNClassifier( name = _name,
172 Classifiers = [ result.popToolsAndMerge(TauTrackRNNCfg(flags)) ],
173 classifyLRT = _classifyLRT )
174
175 result.setPrivateTools(myTauTrackClassifier)
176 return result
177
178
181 result = ComponentAccumulator()
182 _name = flags.Tau.ActiveConfig.prefix +'EnergyCalibrationLC'
183
184 TauCalibrateLC = CompFactory.getComp("TauCalibrateLC")
185 TauCalibrateLC = TauCalibrateLC(name = _name,
186 calibrationFile = flags.Tau.CalibrateLCConfig,
187 Key_vertexInputContainer = flags.Tau.ActiveConfig.VertexCollection)
188
189 result.setPrivateTools(TauCalibrateLC)
190 return result
191
192
195 result = ComponentAccumulator()
196 _name = flags.Tau.ActiveConfig.prefix + 'CellVariables'
197
198 TauCellVariables = CompFactory.getComp("TauCellVariables")
199 TauCellVariables = TauCellVariables(name = _name,
200 VertexCorrection = flags.Tau.doVertexCorrection)
201
202 result.setPrivateTools(TauCellVariables)
203 return result
204
205
208 result = ComponentAccumulator()
209 _name = flags.Tau.ActiveConfig.prefix + 'TauElectronVetoVars'
210
211 from TrackToCalo.TrackToCaloConfig import ParticleCaloExtensionToolCfg
212
213 TauElectronVetoVariables = CompFactory.getComp("TauElectronVetoVariables")
214 TauElectronVetoVariables = TauElectronVetoVariables(name = _name,
215 VertexCorrection = flags.Tau.doVertexCorrection,
216 ParticleCaloExtensionTool = result.popToolsAndMerge(ParticleCaloExtensionToolCfg(flags)),
217 tauEVParticleCache = getParticleCache(flags))
218
219 result.setPrivateTools(TauElectronVetoVariables)
220 return result
221
222
225 result = ComponentAccumulator()
226 _name = flags.Tau.ActiveConfig.prefix + 'TauShotFinder'
227
228 shotPtCut_1Photon = flags.Tau.shotPtCut_1Photon
229 shotPtCut_2Photons = flags.Tau.shotPtCut_2Photons
230
231
232 from CaloClusterCorrection.StandardCellWeightCalib import getCellWeightTool
233 CaloWeightTool = getCellWeightTool(flags=flags)
234
235
236 TauShotFinder = CompFactory.getComp("TauShotFinder")
237 TauShotFinder = TauShotFinder(
238 name = _name,
239 CaloWeightTool = result.popToolsAndMerge(CaloWeightTool),
240 NCellsInEta = 5,
241 MinPtCut = shotPtCut_1Photon,
242 AutoDoubleShotCut = shotPtCut_2Photons,
243 Key_RemovedClusterInputContainer = flags.Tau.ActiveConfig.RemovedElectronClusters,
244 RemoveElectronCells = flags.Tau.ActiveConfig.RemoveElectronCells,
245 inEleRM = flags.Tau.ActiveConfig.inTauEleRM,
246 )
247
248 result.setPrivateTools(TauShotFinder)
249 return result
250
251
255 result = ComponentAccumulator()
256 _name = flags.Tau.ActiveConfig.prefix + 'Pi0ClusterFinder'
257
258 TauPi0CreateROI = CompFactory.getComp("TauPi0CreateROI")
259
260 myTauPi0CreateROI = TauPi0CreateROI(
261 name = _name,
262 Key_caloCellInputContainer = "AllCalo",
263 Key_RemovedClusterInputContainer = flags.Tau.ActiveConfig.RemovedElectronClusters,
264 inEleRM = flags.Tau.ActiveConfig.inTauEleRM,
265 RemoveElectronCells = flags.Tau.ActiveConfig.RemoveElectronCells,
266 )
267
268 result.setPrivateTools(myTauPi0CreateROI)
269 return result
270
271
274 result = ComponentAccumulator()
275 _name = flags.Tau.ActiveConfig.prefix + 'tauPi0CellContainerFinalizer'
276
277 CaloCellContainerFinalizerTool = CompFactory.getComp("CaloCellContainerFinalizerTool")
278 TauCellContainerFinalizer = CaloCellContainerFinalizerTool(name=_name)
279
280 result.setPrivateTools(TauCellContainerFinalizer)
281 return result
282
283
286
288 result = ComponentAccumulator()
289 _name = flags.Tau.ActiveConfig.prefix + 'LCClassify'
290
291 CaloLCClassificationTool = CompFactory.getComp("CaloLCClassificationTool")
292 LCClassify = CaloLCClassificationTool(_name)
293 LCClassify.ClassificationKey = "EMFracClassify"
294 LCClassify.UseSpread = False
295 LCClassify.MaxProbability = 0.5
296 # add the moments EM_PROBABILITY, HAD_WEIGHT, OOC_WEIGHT, DM_WEIGHT to the AOD:
297 LCClassify.StoreClassificationProbabilityInAOD = True
298 LCClassify.WeightingOfNegClusters = flags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
299 LCClassify.UseNormalizedEnergyDensity = True
300
301 result.setPrivateTools(LCClassify)
302 return result
303
305 result = ComponentAccumulator()
306 _name = flags.Tau.ActiveConfig.prefix + 'CaloLCWeightTool'
307
308 # Schedule total noise cond alg
309 from CaloTools.CaloNoiseCondAlgConfig import CaloNoiseCondAlgCfg
310 result.merge(CaloNoiseCondAlgCfg(flags,"totalNoise"))
311 # Schedule electronic noise cond alg (needed for LC weights)
312 result.merge(CaloNoiseCondAlgCfg(flags,"electronicNoise"))
313
314 CaloLCWeightTool = CompFactory.getComp("CaloLCWeightTool")
315 LCWeight = CaloLCWeightTool(_name)
316 LCWeight.CorrectionKey = "H1ClusterCellWeights"
317 LCWeight.SignalOverNoiseCut = 2.0
318 LCWeight.UseHadProbability = True
319
320 result.setPrivateTools(LCWeight)
321 return result
322
324 result = ComponentAccumulator()
325 _name = flags.Tau.ActiveConfig.prefix + 'CaloLCOutOfClusterTool'
326
327 CaloLCOutOfClusterTool = CompFactory.getComp("CaloLCOutOfClusterTool")
328 LCOut = CaloLCOutOfClusterTool(_name)
329 LCOut.CorrectionKey = "OOCCorrection"
330 LCOut.UseEmProbability = False
331 LCOut.UseHadProbability = True
332
333 result.setPrivateTools(LCOut)
334 return result
335
337 result = ComponentAccumulator()
338 _name = flags.Tau.ActiveConfig.prefix + 'LCOutPi0'
339
340 CaloLCOutOfClusterTool = CompFactory.getComp("CaloLCOutOfClusterTool")
341 LCOutPi0 = CaloLCOutOfClusterTool(_name)
342 LCOutPi0.CorrectionKey = "OOCPi0Correction"
343 LCOutPi0.UseEmProbability = True
344 LCOutPi0.UseHadProbability = False
345
346 result.setPrivateTools(LCOutPi0)
347 return result
348
350 result = ComponentAccumulator()
351 _name = flags.Tau.ActiveConfig.prefix + 'CaloLCDeadMaterialTool'
352
353 CaloLCDeadMaterialTool = CompFactory.getComp("CaloLCDeadMaterialTool")
354 LCDeadMaterial = CaloLCDeadMaterialTool(_name)
355 LCDeadMaterial.HadDMCoeffKey = "HadDMCoeff2"
356 LCDeadMaterial.ClusterRecoStatus = 0
357 LCDeadMaterial.WeightModeDM = 2
358 LCDeadMaterial.UseHadProbability = True
359 LCDeadMaterial.WeightingOfNegClusters = flags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
360
361 result.setPrivateTools(LCDeadMaterial)
362 return result
363
365 result = ComponentAccumulator()
366 _name = flags.Tau.ActiveConfig.prefix + 'CaloLocalCalib'
367
368 CaloClusterLocalCalib = CompFactory.getComp("CaloClusterLocalCalib")
369 LocalCalib = CaloClusterLocalCalib(_name)
370 LocalCalib.ClusterClassificationTool = [result.popToolsAndMerge(TauCaloLCClassificationCfg(flags))]
371 LocalCalib.ClusterRecoStatus = [1,2]
372 LocalCalib.LocalCalibTools = [result.popToolsAndMerge(TauCaloLCWeightCfg(flags))]
373 LocalCalib.WeightingOfNegClusters = flags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
374
375 result.setPrivateTools(LocalCalib)
376 return result
377
379 result = ComponentAccumulator()
380 _name = flags.Tau.ActiveConfig.prefix + 'OOCCalibTool'
381
382 CaloClusterLocalCalib = CompFactory.getComp("CaloClusterLocalCalib")
383 OOCCalib = CaloClusterLocalCalib (_name)
384 OOCCalib.ClusterRecoStatus = [1,2]
385 OOCCalib.LocalCalibTools = [result.popToolsAndMerge(TauCaloLCOutOfClusterCfg(flags))]
386 OOCCalib.WeightingOfNegClusters = flags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
387
388 result.setPrivateTools(OOCCalib)
389 return result
390
392 result = ComponentAccumulator()
393 _name = flags.Tau.ActiveConfig.prefix + 'DMCalib'
394
395 CaloClusterLocalCalib = CompFactory.getComp("CaloClusterLocalCalib")
396 DMCalib = CaloClusterLocalCalib(_name)
397 DMCalib.ClusterRecoStatus = [1,2]
398 DMCalib.LocalCalibTools = [result.popToolsAndMerge(TauCaloLCDeadMaterialCfg(flags))]
399 DMCalib.WeightingOfNegClusters = flags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
400
401 result.setPrivateTools(DMCalib)
402 return result
403
405 result = ComponentAccumulator()
406 _name = flags.Tau.ActiveConfig.prefix + 'OOCPi0CalibTool'
407
408 CaloClusterLocalCalib = CompFactory.getComp("CaloClusterLocalCalib")
409 OOCPi0Calib = CaloClusterLocalCalib (_name)
410 OOCPi0Calib.ClusterRecoStatus = [1,2]
411 OOCPi0Calib.LocalCalibTools = [result.popToolsAndMerge(TauCaloLCOutPi0Cfg(flags))]
412 OOCPi0Calib.WeightingOfNegClusters = flags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
413
414 result.setPrivateTools(OOCPi0Calib)
415 return result
416
418 result = ComponentAccumulator()
419 _name = flags.Tau.ActiveConfig.prefix + 'Pi0TopoClusterMaker'
420
421 # Schedule total noise cond alg
422 from CaloTools.CaloNoiseCondAlgConfig import CaloNoiseCondAlgCfg
423 result.merge(CaloNoiseCondAlgCfg(flags,"totalNoise"))
424 # Schedule electronic noise cond alg (needed for LC weights)
425 result.merge(CaloNoiseCondAlgCfg(flags,"electronicNoise"))
426
427 CaloTopoClusterMaker = CompFactory.getComp("CaloTopoClusterMaker")
428 TopoClusterForTaus = CaloTopoClusterMaker(_name)
429
430 TopoClusterForTaus.CellsName = flags.Tau.ActiveConfig.TauCommonPi0Cells
431 TopoClusterForTaus.CalorimeterNames=["LAREM"]
432 TopoClusterForTaus.SeedSamplingNames = ["PreSamplerB", "EMB1", "EMB2", "PreSamplerE", "EME1", "EME2"]
433 TopoClusterForTaus.NeighborOption = "super3D"
434 TopoClusterForTaus.RestrictHECIWandFCalNeighbors = False
435 TopoClusterForTaus.RestrictPSNeighbors = True
436 TopoClusterForTaus.CellThresholdOnEorAbsEinSigma = 0.0
437 TopoClusterForTaus.NeighborThresholdOnEorAbsEinSigma = 2.0
438 TopoClusterForTaus.SeedThresholdOnEorAbsEinSigma = 4.0
439 TopoClusterForTaus.SeedCutsInAbsE = True
440 TopoClusterForTaus.ClusterCutsInAbsEt = True
441 TopoClusterForTaus.ClusterEtorAbsEtCut = 0.5*GeV # 0.0*MeV in standard CaloCalTopoCluster JobOptions!
442 TopoClusterForTaus.TwoGaussianNoise = flags.Calo.TopoCluster.doTwoGaussianNoise
443 # timing cut on seed cell to suppress out-of-time pileup
444 TopoClusterForTaus.SeedCutsInT = flags.Calo.TopoCluster.doTimeCut
445 TopoClusterForTaus.CutOOTseed = flags.Calo.TopoCluster.extendTimeCut and flags.Calo.TopoCluster.doTimeCut
446 TopoClusterForTaus.UseTimeCutUpperLimit = flags.Calo.TopoCluster.useUpperLimitForTimeCut
447 TopoClusterForTaus.TimeCutUpperLimit = flags.Calo.TopoCluster.timeCutUpperLimit
448 TopoClusterForTaus.XTalkEM2 = flags.Calo.TopoCluster.xtalkEM2
449 TopoClusterForTaus.XTalkEM2D = flags.Calo.TopoCluster.xtalkEM2D
450 TopoClusterForTaus.XTalkEM2n = flags.Calo.TopoCluster.xtalkEM2n
451 TopoClusterForTaus.XTalkEM3 = flags.Calo.TopoCluster.xtalkEM3
452 TopoClusterForTaus.XTalkEMEta = flags.Calo.TopoCluster.xtalkEMEta
453 TopoClusterForTaus.XTalkDeltaT = flags.Calo.TopoCluster.xtalkDeltaT
454 TopoClusterForTaus.XTalk2Eratio1 = flags.Calo.TopoCluster.xtalk2Eratio1
455 TopoClusterForTaus.XTalk2Eratio2 = flags.Calo.TopoCluster.xtalk2Eratio2
456 TopoClusterForTaus.XTalk3Eratio = flags.Calo.TopoCluster.xtalk3Eratio
457 TopoClusterForTaus.XTalkEtaEratio = flags.Calo.TopoCluster.xtalkEtaEratio
458 TopoClusterForTaus.XTalk2DEratio = flags.Calo.TopoCluster.xtalk2DEratio
459
460 result.setPrivateTools(TopoClusterForTaus)
461 return result
462
464
465 result = ComponentAccumulator()
466 _name = flags.Tau.ActiveConfig.prefix + 'Pi0TopoClusterSplitter'
467
468 CaloTopoClusterSplitter = CompFactory.getComp("CaloTopoClusterSplitter")
469 TopoSplitterForTaus = CaloTopoClusterSplitter(_name)
470
471 # cells from the following samplings will be able to form local
472 # maxima. The excluded samplings are PreSamplerB, EMB1,
473 # PreSamplerE, EME1, all Tile samplings, all HEC samplings and the
474 # two rear FCal samplings.
475 TopoSplitterForTaus.SamplingNames = ["EMB2","EME2"] # Do we want to use EMB3 and EME3?
476 # cells from the following samplings will also be able to form
477 # local maxima but only if they are not overlapping in eta and phi
478 # with local maxima in previous samplings from the primary list.
479 TopoSplitterForTaus.SecondarySamplingNames = ["EMB1","EME1"]
480 TopoSplitterForTaus.ShareBorderCells = True
481 TopoSplitterForTaus.RestrictHECIWandFCalNeighbors = False
482 TopoSplitterForTaus.WeightingOfNegClusters = flags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
483
484 result.setPrivateTools(TopoSplitterForTaus)
485 return result
486
488 result = ComponentAccumulator()
489 _name = flags.Tau.ActiveConfig.prefix + 'Pi0TopoMoments'
490
491 # Schedule total noise cond alg
492 from CaloTools.CaloNoiseCondAlgConfig import CaloNoiseCondAlgCfg
493 result.merge(CaloNoiseCondAlgCfg(flags,"totalNoise"))
494 # Schedule electronic noise cond alg (needed for LC weights)
495 result.merge(CaloNoiseCondAlgCfg(flags,"electronicNoise"))
496
497 CaloClusterMomentsMaker = CompFactory.getComp("CaloClusterMomentsMaker")
498 TopoMomentsForTaus = CaloClusterMomentsMaker(_name)
499 TopoMomentsForTaus.WeightingOfNegClusters = flags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
500 TopoMomentsForTaus.MaxAxisAngle = 20*deg
501 TopoMomentsForTaus.TwoGaussianNoise = flags.Calo.TopoCluster.doTwoGaussianNoise
502 TopoMomentsForTaus.MinBadLArQuality = 4000
503 TopoMomentsForTaus.MomentsNames = ["FIRST_PHI"
504 ,"FIRST_ETA"
505 ,"SECOND_R"
506 ,"SECOND_LAMBDA"
507 ,"DELTA_PHI"
508 ,"DELTA_THETA"
509 ,"DELTA_ALPHA"
510 ,"CENTER_X"
511 ,"CENTER_Y"
512 ,"CENTER_Z"
513 ,"CENTER_MAG"
514 ,"CENTER_LAMBDA"
515 ,"LATERAL"
516 ,"LONGITUDINAL"
517 ,"ENG_FRAC_EM"
518 ,"ENG_FRAC_MAX"
519 ,"ENG_FRAC_CORE"
520 ,"FIRST_ENG_DENS"
521 ,"SECOND_ENG_DENS"
522 ,"ISOLATION"]
523
524 result.setPrivateTools(TopoMomentsForTaus)
525 return result
526
528 result = ComponentAccumulator()
529 _name = flags.Tau.ActiveConfig.prefix + 'CaloClusterBadChannelList'
530
531 CaloClusterBadChannelListCorr = CompFactory.getComp("CaloClusterBadChannelList")
532 BadChannelListCorrForTaus = CaloClusterBadChannelListCorr(_name)
533
534 result.setPrivateTools(BadChannelListCorrForTaus)
535 return result
536
537
540 result = ComponentAccumulator()
541 _name = flags.Tau.ActiveConfig.prefix + 'Pi0ClusterCreator'
542
543 # TauPi0ClusterCreator accesses cells via links only, which doesn't
544 # make a scheduler dependency. So make additional explicit dependencies
545 # on cells in the input file.
546 extraInputs = []
547 for typ, nam in [i.split('#') for i in flags.Input.TypedCollections]:
548 if typ == 'CaloCellContainer':
549 extraInputs += [('CaloCellContainer', nam)]
550
551 TauPi0ClusterCreator = CompFactory.getComp("TauPi0ClusterCreator")
552 TauPi0ClusterCreator = TauPi0ClusterCreator(name = _name,
553 ExtraInputs = extraInputs)
554
555 result.setPrivateTools(TauPi0ClusterCreator)
556 return result
557
558
561 result = ComponentAccumulator()
562 _name = flags.Tau.ActiveConfig.prefix + 'Pi0ClusterScaler'
563
564 TauPi0ClusterScaler = CompFactory.getComp("TauPi0ClusterScaler")
565 TauPi0ClusterScaler = TauPi0ClusterScaler(name = _name)
566
567 result.setPrivateTools(TauPi0ClusterScaler)
568 return result
569
570
573 result = ComponentAccumulator()
574 _name = flags.Tau.ActiveConfig.prefix + 'Pi0ScoreCalculator'
575
576 TauPi0ScoreCalculator = CompFactory.getComp("TauPi0ScoreCalculator")
577 TauPi0ScoreCalculator = TauPi0ScoreCalculator(name = _name,
578 BDTWeightFile = flags.Tau.Pi0ScoreConfig)
579
580 result.setPrivateTools(TauPi0ScoreCalculator)
581 return result
582
583
585def Pi0SelectorCfg(flags):
586 result = ComponentAccumulator()
587 _name = flags.Tau.ActiveConfig.prefix + 'Pi0Selector'
588
589 TauPi0Selector = CompFactory.getComp("TauPi0Selector")
590 TauPi0Selector = TauPi0Selector(name = _name,
591 Pi0EtCut = flags.Tau.pi0EtCuts,
592 Pi0BDTCut_1prong = flags.Tau.pi0MVACuts_1prong,
593 Pi0BDTCut_mprong = flags.Tau.pi0MVACuts_mprong)
594
595 result.setPrivateTools(TauPi0Selector)
596 return result
597
598
601 result = ComponentAccumulator()
602 _name = flags.Tau.ActiveConfig.prefix + 'TauVertexVariables'
603
604 from TrkConfig.TrkVertexFittersConfig import TauAdaptiveVertexFitterCfg
605 from TrkConfig.TrkVertexSeedFinderToolsConfig import (
606 CrossDistancesSeedFinderCfg)
607
608 TauVertexVariables = CompFactory.getComp("TauVertexVariables")
609 TauVertexVariables = TauVertexVariables( name = _name,
610 VertexFitter = result.popToolsAndMerge(TauAdaptiveVertexFitterCfg(flags)),
611 SeedFinder = result.popToolsAndMerge(CrossDistancesSeedFinderCfg(flags)) )
612
613 result.setPrivateTools(TauVertexVariables)
614 return result
615
616
619 result = ComponentAccumulator()
620 _name = flags.Tau.ActiveConfig.prefix + 'TauCommonCalcVars'
621
622 TauCommonCalcVars = CompFactory.getComp("TauCommonCalcVars")
623 TauCommonCalcVars = TauCommonCalcVars(name = _name)
624
625 result.setPrivateTools(TauCommonCalcVars)
626 return result
627
628
631 result = ComponentAccumulator()
632 _name = flags.Tau.ActiveConfig.prefix + 'TauSubstructure'
633
634 TauSubstructureVariables = CompFactory.getComp("TauSubstructureVariables")
635 TauSubstructureVariables = TauSubstructureVariables( name = _name )
636
637 result.setPrivateTools(TauSubstructureVariables)
638 return result
639
640
643 result = ComponentAccumulator()
644 _name = flags.Tau.ActiveConfig.prefix + 'MvaTESVariableDecorator'
645
646 eventShapeCollection = flags.Tau.ActiveConfig.EventShapeCollection
647 if 'EMPFlow' in flags.Tau.ActiveConfig.SeedJetCollection:
648 eventShapeCollection = "Kt4EMPFlowEventShape"
649 elif 'EMTopo' in flags.Tau.ActiveConfig.SeedJetCollection:
650 eventShapeCollection ="Kt4EMTopoOriginEventShape"
651
652 MvaTESVariableDecorator = CompFactory.getComp("MvaTESVariableDecorator")
653 MvaTESVariableDecorator = MvaTESVariableDecorator(name = _name,
654 Key_vertexInputContainer = flags.Tau.ActiveConfig.VertexCollection,
655 EventShapeKey = eventShapeCollection,
656 VertexCorrection = flags.Tau.doVertexCorrection)
657 result.setPrivateTools(MvaTESVariableDecorator)
658 return result
659
660
663 result = ComponentAccumulator()
664 _name = flags.Tau.ActiveConfig.prefix + 'MvaTESEvaluator'
665
666 MvaTESEvaluator = CompFactory.getComp("MvaTESEvaluator")
667 MvaTESEvaluator = MvaTESEvaluator(name = _name,
668 WeightFileName = flags.Tau.MvaTESConfig,
669 WeightFileName0p = flags.Tau.MvaTESConfig0p )
670
671 result.setPrivateTools(MvaTESEvaluator)
672 return result
673
675 result = ComponentAccumulator()
676 _name = flags.Tau.ActiveConfig.prefix + 'TauIDVarCalculator'
677
678 TauIDVarCalculator = CompFactory.getComp("TauIDVarCalculator")
679 myTauIDVarCalculator = TauIDVarCalculator(name=_name,
680 VertexCorrection = flags.Tau.doVertexCorrection)
681
682 result.setPrivateTools(myTauIDVarCalculator)
683 return result
684
685def TauJetRNNEvaluatorCfg(flags, applyLooseTrackSel=False):
686 result = ComponentAccumulator()
687 _name = flags.Tau.ActiveConfig.prefix + 'TauJetRNN'
688
689 TauJetRNNEvaluator = CompFactory.getComp("TauJetRNNEvaluator")
690 RNNConf = flags.Tau.TauJetRNNConfig
691 myTauJetRNNEvaluator = TauJetRNNEvaluator(name = _name,
692 NetworkFile0P = "",
693 NetworkFile1P = RNNConf[0],
694 NetworkFile2P = RNNConf[1],
695 NetworkFile3P = RNNConf[2],
696 OutputVarname = "RNNJetScore",
697 MaxTracks = 10,
698 MaxClusters = 6,
699 MaxClusterDR = 1.0,
700 ApplyLooseTrackSel = applyLooseTrackSel,
701 VertexCorrection = flags.Tau.doVertexCorrection,
702 InputLayerScalar = "scalar",
703 InputLayerTracks = "tracks",
704 InputLayerClusters = "clusters",
705 OutputLayer = "rnnid_output",
706 OutputNode = "sig_prob")
707
708 result.setPrivateTools(myTauJetRNNEvaluator)
709 return result
710
712 import PyUtils.RootUtils as ru
713 ROOT = ru.import_root()
714 import cppyy
715 cppyy.load_library('libxAODTau_cDict')
716
717 result = ComponentAccumulator()
718 _name = flags.Tau.ActiveConfig.prefix + 'TauWPDecoratorJetRNN'
719
720 TauWPDecorator = CompFactory.getComp("TauWPDecorator")
721 WPConf = flags.Tau.TauJetRNNWPConfig
722 myTauWPDecorator = TauWPDecorator( name=_name,
723 flatteningFile1Prong = WPConf[0],
724 flatteningFile2Prong = WPConf[1],
725 flatteningFile3Prong = WPConf[2],
726 CutEnumVals =
727 [ ROOT.xAOD.TauJetParameters.IsTauFlag.JetRNNSigVeryLoose,
728 ROOT.xAOD.TauJetParameters.IsTauFlag.JetRNNSigLoose,
729 ROOT.xAOD.TauJetParameters.IsTauFlag.JetRNNSigMedium,
730 ROOT.xAOD.TauJetParameters.IsTauFlag.JetRNNSigTight ],
731 SigEff1P = [0.95, 0.85, 0.75, 0.60],
732 SigEff2P = [0.95, 0.75, 0.60, 0.45],
733 SigEff3P = [0.95, 0.75, 0.60, 0.45],
734 ScoreName = "RNNJetScore",
735 NewScoreName = "RNNJetScoreSigTrans",
736 DefineWPs = True )
737
738 result.setPrivateTools(myTauWPDecorator)
739 return result
740
741def TauGNNEvaluatorCfg(flags, version=0, applyLooseTrackSel=False, applyTightTrackSel=False, tauContainerName=""):
742 result = ComponentAccumulator()
743 _name = flags.Tau.ActiveConfig.prefix + 'TauGNN_v' + str(version)
744
745 TauGNNEvaluator = CompFactory.getComp("TauGNNEvaluator")
746 GNNConf = flags.Tau.TauGNNConfig[version]
747 myTauGNNEvaluator = TauGNNEvaluator(name = _name,
748 useTRT = flags.Detector.EnableTRT,
749 NetworkFileInclusive = GNNConf,
750 OutputVarname = flags.Tau.GNTauScoreName[version],
751 OutputPTau = "GNTauProbTau",
752 OutputPJet = "GNTauProbJet",
753 MaxTracks = flags.Tau.GNTauMaxTracks[version],
754 MaxClusters = flags.Tau.GNTauMaxClusters[version],
755 MaxClusterDR = 15.0,
756 MinTauPt = flags.Tau.MinPtDAOD,
757 ApplyLooseTrackSel = applyLooseTrackSel,
758 ApplyTightTrackSel = applyTightTrackSel,
759 VertexCorrection = flags.Tau.doVertexCorrection,
760 InputLayerScalar = 'tau_vars',
761 InputLayerTracks = 'track_vars',
762 InputLayerClusters = 'cluster_vars',
763 NodeNameTau=flags.Tau.GNTauNodeNameTau,
764 NodeNameJet=flags.Tau.GNTauNodeNameJet,
765 TauContainerName = tauContainerName,
766 )
767
768 result.setPrivateTools(myTauGNNEvaluator)
769 return result
770
771def TauWPDecoratorGNNCfg(flags, version, tauContainerName=""):
772 result = ComponentAccumulator()
773 _name = flags.Tau.ActiveConfig.prefix + 'TauWPDecoratorGNN_v' + str(version)
774
775 TauWPDecorator = CompFactory.getComp("TauWPDecorator")
776 WPConf = flags.Tau.TauGNNWP[version]
777 myTauWPDecorator = TauWPDecorator(name=_name,
778 flatteningFile1Prong = WPConf[0],
779 flatteningFile2Prong = WPConf[1],
780 flatteningFile3Prong = WPConf[2],
781 TauContainerName = tauContainerName,
782 DecorWPNames = flags.Tau.GNTauDecorWPNames[version],
783 DecorWPCutEffs1P = [0.95, 0.85, 0.75, 0.60],
784 DecorWPCutEffs2P = [0.95, 0.75, 0.60, 0.45],
785 DecorWPCutEffs3P = [0.95, 0.75, 0.60, 0.45],
786 ScoreName = flags.Tau.GNTauScoreName[version],
787 NewScoreName = flags.Tau.GNTauTransScoreName[version],
788 DefineWPs = True)
789 result.setPrivateTools(myTauWPDecorator)
790 return result
791
792def TauEleRNNEvaluatorCfg(flags, applyLooseTrackSel=False):
793 result = ComponentAccumulator()
794 _name = flags.Tau.ActiveConfig.prefix + 'TauEleRNN'
795
796 TauJetRNNEvaluator = CompFactory.getComp("TauJetRNNEvaluator")
797 RNNConf = flags.Tau.TauEleRNNConfig
798 myTauEleRNNEvaluator = TauJetRNNEvaluator(name = _name,
799 useTRT = flags.Detector.EnableTRT,
800 NetworkFile1P = RNNConf[0],
801 NetworkFile3P = RNNConf[1],
802 OutputVarname = "RNNEleScore",
803 MaxTracks = 10,
804 MaxClusters = 6,
805 MaxClusterDR = 1.0,
806 ApplyLooseTrackSel = applyLooseTrackSel,
807 VertexCorrection = flags.Tau.doVertexCorrection,
808 InputLayerScalar = "scalar",
809 InputLayerTracks = "tracks",
810 InputLayerClusters = "clusters",
811 OutputLayer = "rnneveto_output",
812 OutputNode = "sig_prob")
813
814 result.setPrivateTools(myTauEleRNNEvaluator)
815 return result
816
818
819 result = ComponentAccumulator()
820
821 WPConf = flags.Tau.TauEleRNNWPConfig
822
823 from AthenaConfiguration.Enums import ProductionStep
824 # set the instance to run at derivation level
825 if flags.Common.ProductionStep is ProductionStep.Derivation:
826 _name = flags.Tau.ActiveConfig.prefix + 'TauWPDecoratorEleRNNFix_v1'
827 NewScoreName = "RNNEleScoreSigTrans_v1"
828 CutEnumVals = []
829 SigEff1P = []
830 SigEff3P = []
831 DecorWPNames = [ "EleRNNLoose_v1", "EleRNNMedium_v1", "EleRNNTight_v1" ]
832 DecorWPCutEffs1P = [0.95, 0.90, 0.85]
833 DecorWPCutEffs3P = [0.98, 0.95, 0.90]
834 else:
835 #this is the instance running in reconstruction level
836 import PyUtils.RootUtils as ru
837 ROOT = ru.import_root()
838 import cppyy
839 cppyy.load_library('libxAODTau_cDict')
840
841 _name = flags.Tau.ActiveConfig.prefix + 'TauWPDecoratorEleRNN'
842 NewScoreName = "RNNEleScoreSigTrans"
843 SigEff1P = [0.95, 0.90, 0.85]
844 SigEff3P = [0.98, 0.95, 0.90]
845 CutEnumVals = [ ROOT.xAOD.TauJetParameters.IsTauFlag.EleRNNLoose,
846 ROOT.xAOD.TauJetParameters.IsTauFlag.EleRNNMedium,
847 ROOT.xAOD.TauJetParameters.IsTauFlag.EleRNNTight ]
848 DecorWPNames = []
849 DecorWPCutEffs1P = []
850 DecorWPCutEffs3P = []
851
852 TauWPDecorator = CompFactory.getComp("TauWPDecorator")
853 myTauEleWPDecorator = TauWPDecorator( name=_name,
854 flatteningFile1Prong = WPConf[0],
855 flatteningFile3Prong = WPConf[1],
856 CutEnumVals = CutEnumVals,
857 DecorWPNames = DecorWPNames,
858 SigEff1P = SigEff1P,
859 SigEff3P = SigEff3P,
860 DecorWPCutEffs1P = DecorWPCutEffs1P,
861 DecorWPCutEffs3P = DecorWPCutEffs3P,
862 UseAbsEta = True ,
863 ScoreName = "RNNEleScore",
864 NewScoreName = NewScoreName,
865 DefineWPs = True)
866
867 result.setPrivateTools(myTauEleWPDecorator)
868 return result
869
871 result = ComponentAccumulator()
872 _name = flags.Tau.ActiveConfig.prefix + 'TauDecayModeNNClassifier'
873
874 TauDecayModeNNClassifier = CompFactory.getComp("TauDecayModeNNClassifier")
875 myTauDecayModeNNClassifier = TauDecayModeNNClassifier(name=_name,
876 WeightFile=flags.Tau.DecayModeNNClassifierConfig)
877
878 result.setPrivateTools(myTauDecayModeNNClassifier)
879 return result
880
882 result = ComponentAccumulator()
883 _name = flags.Tau.ActiveConfig.prefix + 'TauAODSelector'
884
885 TauAODSelector = CompFactory.getComp("TauAODSelector")
886 myTauAODSelector = TauAODSelector(name=_name,
887 Min0pTauPt = flags.Tau.MinPt0p,
888 MinTauPt = flags.Tau.MinPt,
889 doEarlyStopping = flags.Tau.doEarlyStopping and not flags.Output.doWriteESD)
890
891 result.setPrivateTools(myTauAODSelector)
892 return result
893
894
897 result = ComponentAccumulator()
898 _name = flags.Tau.ActiveConfig.prefix + 'TauCombinedTES'
899
900 TauCombinedTES = CompFactory.getComp("TauCombinedTES")
901 myTauCombinedTES = TauCombinedTES(name = _name,
902 WeightFileName = flags.Tau.CombinedTESConfig)
903
904 result.setPrivateTools(myTauCombinedTES)
905 return result
906
907
910 result = ComponentAccumulator()
911 _name = flags.Tau.ActiveConfig.prefix + 'MuonRemoval'
912 TauAODMuonRemovalTool = CompFactory.getComp("TauAODMuonRemovalTool")
913 myMuonRemoval = TauAODMuonRemovalTool( name = _name,
914 Key_MuonInputContainer = 'Muons',
915 doMuonTrkRm = True,
916 doMuonClsRm = True,
917 muonIDWP = 'Medium'
918 )
919 result.setPrivateTools(myMuonRemoval)
920 return result
921
922# electron excluder tool
924 result = ComponentAccumulator()
925 _name = flags.Tau.ActiveConfig.prefix + 'TauEleOverlapChecker'
926 TauEleOverlapChecker = CompFactory.getComp("TauEleOverlapChecker")
927 myTauEleOverlapChecker = TauEleOverlapChecker(
928 name = _name,
929 Key_RemovedClustersContainer = flags.Tau.ActiveConfig.RemovedElectronClusters,
930 Key_RemovedTracksContainer = flags.Tau.ActiveConfig.RemovedElectronTracks,
931 CheckingCone = flags.Tau.ActiveConfig.EleRM_CheckingConeSize,
932 )
933 result.setPrivateTools(myTauEleOverlapChecker)
934 return result
Cluster correction tool which applies local hadronic calibration w eights to the cells.
Calculate moments for CaloCluster objects.
classify clusters according to their probability to stem from an em object
dead material correction tool for local hadronic calibration
calculates out-of-cluster corrections based on cluster quantities
calculates hadronic cell weights based on cluster and cell quantities
topological cluster maker.
topological cluster splitter.
Class to build tau jet seed.
the tool meant to run at AOD level, to remove the muon found inside the TauJet.
Set Tau "Detector Axis" and "Intermediate Axis".
Implementation of tau energy scale (TES) with eta and pile-up correction.
Calculate tau calorimeter variables from cell information.
Associate the clusters used in the seed jet to the tau candidate.
Calculate variables which rely on tracks and precalculated cell/cluster information.
Tau decay mode classifier using a neural network.
Select only the tau within the removal direction.
Calculate variables sensitive on electrons.
Tool to calculate tau identification score from .onnx inputs.
This class implements a tool to calculate ID input variables and add them to the tau aux store.
Tool to calculate a tau identification score based on neural networks.
Creates Pi0 clusters (Pi0 Finder).
scale cluster energy to take care of charged pion energy
Find the cells used to create pi0 cluster.
Selectes pi0Candidates (Pi0 Finder).
Apply Et and BDT score cut to pi0s.
Calculate variables from the tau substructure.
Associate tracks to the tau candidate.
Associate a vertex (origin) to the tau candidate.
Class for calculating vertex variables.
Decorate CaloVertexedTopoCluster to the tau candidate.
Implementation of tool to decorate flattened BDT score and working points.
TauCaloTopoClusterMakerCfg(flags)
EnergyCalibrationLCCfg(flags)
Tau energy calibration.
TauAxisCfg(flags)
Tau energy calibration and tau axis direction.
TauCaloLCOutOfClusterCfg(flags)
Pi0ClusterFinderCfg(flags)
Pi0 algo Cluster finder for Pi0 algo.
TauTrackRNNClassifierCfg(flags)
TauCombinedTESCfg(flags)
TauCombinedTES.
TauVertexFinderCfg(flags)
TauCaloOOCPi0CalibCfg(flags)
TauShotFinderCfg(flags)
Photon Shot Finder.
JetSeedBuilderCfg(flags)
JetSeedBuilder.
MvaTESEvaluatorCfg(flags)
MvaTESEvaluator.
ElectronVetoVarsCfg(flags)
ele veto variables
Pi0ClusterScalerCfg(flags)
Set energy of cluster to take care of charged pion energy deposited in the ECAL.
TauTrackFinderCfg(flags)
Tau-Track Association.
TauCaloLCDeadMaterialCfg(flags)
TauSubstructureCfg(flags)
Tau Variables.
TauWPDecoratorGNNCfg(flags, version, tauContainerName="")
TauWPDecoratorJetRNNCfg(flags)
TauCaloOOCCalibCfg(flags)
TauJetRNNEvaluatorCfg(flags, applyLooseTrackSel=False)
TauCommonCalcVarsCfg(flags)
Tau Variables.
MvaTESVariableDecoratorCfg(flags)
MvaTESVariableDecorator.
TauCaloLCOutPi0Cfg(flags)
TauVertexedClusterDecoratorCfg(flags)
TauCaloLCClassificationCfg(flags)
Calo Tools.
getParticleCache(flags)
TauClusterFinderCfg(flags)
Associate the cluster in jet constituents to the tau candidate.
CellVariablesCfg(flags)
Tau cell variables calculation.
TauCaloClusterBadChannelCfg(flags)
Pi0SelectorCfg(flags)
select pi0 clusters
TauEleOverlapChecker(flags)
TauCaloDMCalibCfg(flags)
TauWPDecoratorEleRNNCfg(flags)
TauCaloLCWeightCfg(flags)
TauEleRNNEvaluatorCfg(flags, applyLooseTrackSel=False)
Pi0ClusterCreatorCfg(flags)
create Pi0 clusters
TauCaloClusterLocalCalibCfg(flags)
TauGNNEvaluatorCfg(flags, version=0, applyLooseTrackSel=False, applyTightTrackSel=False, tauContainerName="")
TauVertexVariablesCfg(flags)
Tau Vertex Variables.
TauCaloTopoClusterSplitterCfg(flags)
TauDecayModeNNClassifierCfg(flags)
TauIDVarCalculatorCfg(flags)
Pi0ScoreCalculatorCfg(flags)
calculate MVA scores of pi0 clusters
TauTrackRNNCfg(flags)
TauAODSelectorCfg(flags)
TauCellFinalizerCfg(flags)
Cell finalizer tool for BuildAlg.
TauAODMuonRemovalCfg(flags)
muon removal tool
TauCaloClusterMomentsMakerCfg(flags)