ATLAS Offline Software
Loading...
Searching...
No Matches
TauToolHolder.py
Go to the documentation of this file.
1# Copyright (C) 2002-2026 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, LHCPeriod
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 InDetTrackSelectionTool.InDetTrackSelectionToolConfig import (
36 Tau_InDetTrackSelectionToolForTJVACfg)
37 from TrackVertexAssociationTool.TrackVertexAssociationToolConfig import TauTTVAToolCfg
38
39 # Algorithm that overwrites numTrack() and charge() of tauJets in container
40 # from tauRecTools.tauRecToolsConf import TauVertexFinder
41 TauVertexFinder = CompFactory.getComp("TauVertexFinder")
42 TauVertexFinder = TauVertexFinder(name = _name,
43 UseTJVA = flags.Tau.doTJVA,
44 AssociatedTracks="GhostTrack", # OK??
45 InDetTrackSelectionToolForTJVA = result.popToolsAndMerge(Tau_InDetTrackSelectionToolForTJVACfg(flags)),
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 TrkConfig.TrkVertexFitterUtilsConfig import AtlasTrackToVertexIPEstimatorCfg
90 from InDetConfig.InDetTrackSelectorToolConfig import TauRecInDetTrackSelectorToolCfg
91
92 _LargeD0TrackInputContainer = (flags.Tau.ActiveConfig.LargeD0TrackCollection if flags.Tau.associateLRT else "")
93
94 # Manually setting for TauLRT reco
95 if flags.Tau.ActiveConfig.inTauLRT:
96 _LargeD0TrackInputContainer = flags.Tau.ActiveConfig.LargeD0TrackCollection
97
98 TauTrackFinder = CompFactory.getComp("TauTrackFinder")
99 TauTrackFinder = TauTrackFinder(name = _name,
100 MaxJetDrTau = 0.2,
101 MaxJetDrWide = 0.4,
102 TrackSelectorToolTau = result.popToolsAndMerge(TauRecInDetTrackSelectorToolCfg(flags)),
103 TrackToVertexTool = "",
104 removeDuplicateCoreTracks = flags.Tau.RemoveDupeCoreTracks,
105 useGhostTracks = flags.Tau.useGhostTracks,
106 ghostTrackDR = flags.Tau.ghostTrackDR,
107 Key_jetContainer = (flags.Tau.ActiveConfig.SeedJetCollection if flags.Tau.useGhostTracks else ""),
108 Key_trackPartInputContainer = flags.Tau.ActiveConfig.TrackCollection,
109 Key_LargeD0TrackInputContainer = _LargeD0TrackInputContainer,
110 TrackToVertexIPEstimator = result.popToolsAndMerge(AtlasTrackToVertexIPEstimatorCfg(flags)),
111 inEleRM = flags.Tau.ActiveConfig.inTauEleRM,
112 )
113 result.setPrivateTools(TauTrackFinder)
114 return result
115
116
119 result = ComponentAccumulator()
120 _name = flags.Tau.ActiveConfig.prefix + 'TauTrackCaloExtrapolator'
121
122 from TrackToCalo.TrackToCaloConfig import ParticleCaloExtensionToolCfg
123
124 from ActsConfig.ActsGeometryConfig import ActsExtrapolationToolCfg
125 from ActsConfig.ActsGeometryConfig import ActsTrackingGeometrySvcCfg
126
127 TauTrackCaloExtrapolator = CompFactory.getComp("TauTrackCaloExtrapolator")
128 TauTrackCaloExtrapolator = TauTrackCaloExtrapolator(name = _name,
129 ParticleCaloExtensionTool = result.popToolsAndMerge(ParticleCaloExtensionToolCfg(flags)),
130 tauParticleCache = getParticleCache(flags), # only returns a string
131 ExtrapOnlyChargedTracks = False if flags.GeoModel.Run <= LHCPeriod.Run3 else True,
132 ExtrapolationTool = result.popToolsAndMerge(ActsExtrapolationToolCfg(flags,MaxSteps=10000)),
133 useACTSExtrapolator = True if (flags.Tau.useACTSExtrapolator and flags.GeoModel.Run > LHCPeriod.Run3) else False,
134 )
135 result.merge(ActsTrackingGeometrySvcCfg(flags))
136 result.setPrivateTools(TauTrackCaloExtrapolator)
137 return result
138
139
140
141
144 result = ComponentAccumulator()
145 _name = flags.Tau.ActiveConfig.prefix + 'TauClusterFinder'
146
147
148 TauClusterFinder = CompFactory.getComp("TauClusterFinder")
149 TauClusterFinder = TauClusterFinder(
150 name = _name,
151 inEleRM = flags.Tau.ActiveConfig.inTauEleRM,
152 )
153
154
155 result.setPrivateTools(TauClusterFinder)
156 return result
157
158
160 result = ComponentAccumulator()
161 _name = flags.Tau.ActiveConfig.prefix + 'TauVertexedClusterDecorator'
162
163 TauVertexedClusterDecorator = CompFactory.getComp("TauVertexedClusterDecorator")
164 myTauVertexedClusterDecorator = TauVertexedClusterDecorator(name = _name,
165 SeedJet = flags.Tau.ActiveConfig.SeedJetCollection)
166
167 result.setPrivateTools(myTauVertexedClusterDecorator)
168 return result
169
170
171def TauTrackRNNCfg(flags):
172 result = ComponentAccumulator()
173 _name = flags.Tau.ActiveConfig.prefix + 'TauTrackRNNClassifier'
174
175 TrackRNN = CompFactory.tauRecTools.TrackRNN
176 _RNN = TrackRNN(name = _name + "_TrackRNN",
177 InputWeightsPath = flags.Tau.tauRNNTrackClassConfig,
178 calibFolder = flags.Tau.tauRecToolsCVMFSPath,
179 removeDuplicateChargedTracks = flags.Tau.removeDuplicateChargedTracks)
180
181 result.setPrivateTools(_RNN)
182 return result
183
184
186 result = ComponentAccumulator()
187 _name = flags.Tau.ActiveConfig.prefix + 'TauTrackRNNClassifier'
188
189 # create tool alg
190 TauTrackRNNClassifier = CompFactory.tauRecTools.TauTrackRNNClassifier
191
192 import cppyy
193 cppyy.load_library('libxAODTau_cDict')
194
195 _classifyLRT = True
196 _classifyLRTWithDedicated = flags.Tau.classifyLRTWithDedicated
197 if flags.Tau.associateLRT and not flags.Tau.classifyLRT:
198 _classifyLRT = False
199
200 # Manually setting for TauLRT reco
201 if flags.Tau.ActiveConfig.inTauLRT:
202 _classifyLRT = True
203 _classifyLRTWithDedicated = True
204
205
206 myTauTrackClassifier = TauTrackRNNClassifier( name = _name,
207 Classifiers = [ result.popToolsAndMerge(TauTrackRNNCfg(flags)) ],
208 classifyLRT = _classifyLRT,
209 classifyLRTWithDedicated = _classifyLRTWithDedicated)
210
211 result.setPrivateTools(myTauTrackClassifier)
212 return result
213
214
216def EnergyCalibrationLCCfg(flags, force_zero_mass=False):
217 result = ComponentAccumulator()
218 _name = flags.Tau.ActiveConfig.prefix +'EnergyCalibrationLC'
219
220 TauCalibrateLC = CompFactory.getComp("TauCalibrateLC")
221 TauCalibrateLC = TauCalibrateLC(name = _name,
222 calibrationFile = flags.Tau.CalibrateLCConfig,
223 ForceZeroMass = force_zero_mass,
224 Key_vertexInputContainer = flags.Tau.ActiveConfig.VertexCollection)
225
226 result.setPrivateTools(TauCalibrateLC)
227 return result
228
229
232 result = ComponentAccumulator()
233 _name = flags.Tau.ActiveConfig.prefix + 'CellVariables'
234
235 TauCellVariables = CompFactory.getComp("TauCellVariables")
236 TauCellVariables = TauCellVariables(name = _name,
237 VertexCorrection = flags.Tau.doVertexCorrection)
238
239 result.setPrivateTools(TauCellVariables)
240 return result
241
242
245 result = ComponentAccumulator()
246 _name = flags.Tau.ActiveConfig.prefix + 'TauElectronVetoVars'
247
248 from TrackToCalo.TrackToCaloConfig import ParticleCaloExtensionToolCfg
249
250 from ActsConfig.ActsGeometryConfig import ActsExtrapolationToolCfg
251 from ActsConfig.ActsGeometryConfig import ActsTrackingGeometrySvcCfg
252
253 TauElectronVetoVariables = CompFactory.getComp("TauElectronVetoVariables")
254 TauElectronVetoVariables = TauElectronVetoVariables(name = _name,
255 VertexCorrection = flags.Tau.doVertexCorrection,
256 ParticleCaloExtensionTool = result.popToolsAndMerge(ParticleCaloExtensionToolCfg(flags)),
257 tauEVParticleCache = getParticleCache(flags),
258 ExtrapolationTool = result.popToolsAndMerge(ActsExtrapolationToolCfg(flags,MaxSteps=10000)),
259 useACTSExtrapolator = False,)
260 result.merge(ActsTrackingGeometrySvcCfg(flags))
261 result.setPrivateTools(TauElectronVetoVariables)
262 return result
263
264
267 result = ComponentAccumulator()
268 _name = flags.Tau.ActiveConfig.prefix + 'TauShotFinder'
269
270 shotPtCut_1Photon = flags.Tau.shotPtCut_1Photon
271 shotPtCut_2Photons = flags.Tau.shotPtCut_2Photons
272
273
274 from CaloClusterCorrection.StandardCellWeightCalib import getCellWeightTool
275 CaloWeightTool = getCellWeightTool(flags=flags)
276
277
278 TauShotFinder = CompFactory.getComp("TauShotFinder")
279 TauShotFinder = TauShotFinder(
280 name = _name,
281 CaloWeightTool = result.popToolsAndMerge(CaloWeightTool),
282 NCellsInEta = 5,
283 MinPtCut = shotPtCut_1Photon,
284 AutoDoubleShotCut = shotPtCut_2Photons,
285 Key_RemovedClusterInputContainer = flags.Tau.ActiveConfig.RemovedElectronClusters,
286 RemoveElectronCells = flags.Tau.ActiveConfig.RemoveElectronCells,
287 inEleRM = flags.Tau.ActiveConfig.inTauEleRM,
288 )
289
290 result.setPrivateTools(TauShotFinder)
291 return result
292
293
297 result = ComponentAccumulator()
298 _name = flags.Tau.ActiveConfig.prefix + 'Pi0ClusterFinder'
299
300 TauPi0CreateROI = CompFactory.getComp("TauPi0CreateROI")
301
302 myTauPi0CreateROI = TauPi0CreateROI(
303 name = _name,
304 Key_caloCellInputContainer = "AllCalo",
305 Key_RemovedClusterInputContainer = flags.Tau.ActiveConfig.RemovedElectronClusters,
306 inEleRM = flags.Tau.ActiveConfig.inTauEleRM,
307 RemoveElectronCells = flags.Tau.ActiveConfig.RemoveElectronCells,
308 )
309
310 result.setPrivateTools(myTauPi0CreateROI)
311 return result
312
313
316 result = ComponentAccumulator()
317 _name = flags.Tau.ActiveConfig.prefix + 'tauPi0CellContainerFinalizer'
318
319 CaloCellContainerFinalizerTool = CompFactory.getComp("CaloCellContainerFinalizerTool")
320 TauCellContainerFinalizer = CaloCellContainerFinalizerTool(name=_name)
321
322 result.setPrivateTools(TauCellContainerFinalizer)
323 return result
324
325
328
330 result = ComponentAccumulator()
331 _name = flags.Tau.ActiveConfig.prefix + 'LCClassify'
332
333 CaloLCClassificationTool = CompFactory.getComp("CaloLCClassificationTool")
334 LCClassify = CaloLCClassificationTool(_name)
335 LCClassify.ClassificationKey = "EMFracClassify"
336 LCClassify.UseSpread = False
337 LCClassify.MaxProbability = 0.5
338 # add the moments EM_PROBABILITY, HAD_WEIGHT, OOC_WEIGHT, DM_WEIGHT to the AOD:
339 LCClassify.StoreClassificationProbabilityInAOD = True
340 LCClassify.WeightingOfNegClusters = flags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
341 LCClassify.UseNormalizedEnergyDensity = True
342
343 result.setPrivateTools(LCClassify)
344 return result
345
347 result = ComponentAccumulator()
348 _name = flags.Tau.ActiveConfig.prefix + 'CaloLCWeightTool'
349
350 # Schedule total noise cond alg
351 from CaloTools.CaloNoiseCondAlgConfig import CaloNoiseCondAlgCfg
352 result.merge(CaloNoiseCondAlgCfg(flags,"totalNoise"))
353 # Schedule electronic noise cond alg (needed for LC weights)
354 result.merge(CaloNoiseCondAlgCfg(flags,"electronicNoise"))
355
356 CaloLCWeightTool = CompFactory.getComp("CaloLCWeightTool")
357 LCWeight = CaloLCWeightTool(_name)
358 LCWeight.CorrectionKey = "H1ClusterCellWeights"
359 LCWeight.SignalOverNoiseCut = 2.0
360 LCWeight.UseHadProbability = True
361
362 result.setPrivateTools(LCWeight)
363 return result
364
366 result = ComponentAccumulator()
367 _name = flags.Tau.ActiveConfig.prefix + 'CaloLCOutOfClusterTool'
368
369 CaloLCOutOfClusterTool = CompFactory.getComp("CaloLCOutOfClusterTool")
370 LCOut = CaloLCOutOfClusterTool(_name)
371 LCOut.CorrectionKey = "OOCCorrection"
372 LCOut.UseEmProbability = False
373 LCOut.UseHadProbability = True
374
375 result.setPrivateTools(LCOut)
376 return result
377
379 result = ComponentAccumulator()
380 _name = flags.Tau.ActiveConfig.prefix + 'LCOutPi0'
381
382 CaloLCOutOfClusterTool = CompFactory.getComp("CaloLCOutOfClusterTool")
383 LCOutPi0 = CaloLCOutOfClusterTool(_name)
384 LCOutPi0.CorrectionKey = "OOCPi0Correction"
385 LCOutPi0.UseEmProbability = True
386 LCOutPi0.UseHadProbability = False
387
388 result.setPrivateTools(LCOutPi0)
389 return result
390
392 result = ComponentAccumulator()
393 _name = flags.Tau.ActiveConfig.prefix + 'CaloLCDeadMaterialTool'
394
395 CaloLCDeadMaterialTool = CompFactory.getComp("CaloLCDeadMaterialTool")
396 LCDeadMaterial = CaloLCDeadMaterialTool(_name)
397 LCDeadMaterial.HadDMCoeffKey = "HadDMCoeff2"
398 LCDeadMaterial.ClusterRecoStatus = 0
399 LCDeadMaterial.WeightModeDM = 2
400 LCDeadMaterial.UseHadProbability = True
401 LCDeadMaterial.WeightingOfNegClusters = flags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
402
403 result.setPrivateTools(LCDeadMaterial)
404 return result
405
407 result = ComponentAccumulator()
408 _name = flags.Tau.ActiveConfig.prefix + 'CaloLocalCalib'
409
410 CaloClusterLocalCalib = CompFactory.getComp("CaloClusterLocalCalib")
411 LocalCalib = CaloClusterLocalCalib(_name)
412 LocalCalib.ClusterClassificationTool = [result.popToolsAndMerge(TauCaloLCClassificationCfg(flags))]
413 LocalCalib.ClusterRecoStatus = [1,2]
414 LocalCalib.LocalCalibTools = [result.popToolsAndMerge(TauCaloLCWeightCfg(flags))]
415 LocalCalib.WeightingOfNegClusters = flags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
416
417 result.setPrivateTools(LocalCalib)
418 return result
419
421 result = ComponentAccumulator()
422 _name = flags.Tau.ActiveConfig.prefix + 'OOCCalibTool'
423
424 CaloClusterLocalCalib = CompFactory.getComp("CaloClusterLocalCalib")
425 OOCCalib = CaloClusterLocalCalib (_name)
426 OOCCalib.ClusterRecoStatus = [1,2]
427 OOCCalib.LocalCalibTools = [result.popToolsAndMerge(TauCaloLCOutOfClusterCfg(flags))]
428 OOCCalib.WeightingOfNegClusters = flags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
429
430 result.setPrivateTools(OOCCalib)
431 return result
432
434 result = ComponentAccumulator()
435 _name = flags.Tau.ActiveConfig.prefix + 'DMCalib'
436
437 CaloClusterLocalCalib = CompFactory.getComp("CaloClusterLocalCalib")
438 DMCalib = CaloClusterLocalCalib(_name)
439 DMCalib.ClusterRecoStatus = [1,2]
440 DMCalib.LocalCalibTools = [result.popToolsAndMerge(TauCaloLCDeadMaterialCfg(flags))]
441 DMCalib.WeightingOfNegClusters = flags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
442
443 result.setPrivateTools(DMCalib)
444 return result
445
447 result = ComponentAccumulator()
448 _name = flags.Tau.ActiveConfig.prefix + 'OOCPi0CalibTool'
449
450 CaloClusterLocalCalib = CompFactory.getComp("CaloClusterLocalCalib")
451 OOCPi0Calib = CaloClusterLocalCalib (_name)
452 OOCPi0Calib.ClusterRecoStatus = [1,2]
453 OOCPi0Calib.LocalCalibTools = [result.popToolsAndMerge(TauCaloLCOutPi0Cfg(flags))]
454 OOCPi0Calib.WeightingOfNegClusters = flags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
455
456 result.setPrivateTools(OOCPi0Calib)
457 return result
458
460 result = ComponentAccumulator()
461 _name = flags.Tau.ActiveConfig.prefix + 'Pi0TopoClusterMaker'
462
463 # Schedule total noise cond alg
464 from CaloTools.CaloNoiseCondAlgConfig import CaloNoiseCondAlgCfg
465 result.merge(CaloNoiseCondAlgCfg(flags,"totalNoise"))
466 # Schedule electronic noise cond alg (needed for LC weights)
467 result.merge(CaloNoiseCondAlgCfg(flags,"electronicNoise"))
468
469 CaloTopoClusterMaker = CompFactory.getComp("CaloTopoClusterMaker")
470 TopoClusterForTaus = CaloTopoClusterMaker(_name)
471
472 TopoClusterForTaus.CellsName = flags.Tau.ActiveConfig.TauCommonPi0Cells
473 TopoClusterForTaus.CalorimeterNames=["LAREM"]
474 TopoClusterForTaus.SeedSamplingNames = ["PreSamplerB", "EMB1", "EMB2", "PreSamplerE", "EME1", "EME2"]
475 TopoClusterForTaus.NeighborOption = "super3D"
476 TopoClusterForTaus.RestrictHECIWandFCalNeighbors = False
477 TopoClusterForTaus.RestrictPSNeighbors = True
478 TopoClusterForTaus.CellThresholdOnEorAbsEinSigma = 0.0
479 TopoClusterForTaus.NeighborThresholdOnEorAbsEinSigma = 2.0
480 TopoClusterForTaus.SeedThresholdOnEorAbsEinSigma = 4.0
481 TopoClusterForTaus.SeedCutsInAbsE = True
482 TopoClusterForTaus.ClusterCutsInAbsEt = True
483 TopoClusterForTaus.ClusterEtorAbsEtCut = 0.5*GeV # 0.0*MeV in standard CaloCalTopoCluster JobOptions!
484 TopoClusterForTaus.TwoGaussianNoise = flags.Calo.TopoCluster.doTwoGaussianNoise
485 # timing cut on seed cell to suppress out-of-time pileup
486 TopoClusterForTaus.SeedCutsInT = flags.Calo.TopoCluster.doTimeCut
487 TopoClusterForTaus.CutOOTseed = flags.Calo.TopoCluster.extendTimeCut and flags.Calo.TopoCluster.doTimeCut
488 TopoClusterForTaus.UseTimeCutUpperLimit = flags.Calo.TopoCluster.useUpperLimitForTimeCut
489 TopoClusterForTaus.TimeCutUpperLimit = flags.Calo.TopoCluster.timeCutUpperLimit
490 TopoClusterForTaus.XTalkEM2 = flags.Calo.TopoCluster.xtalkEM2
491 TopoClusterForTaus.XTalkEM2D = flags.Calo.TopoCluster.xtalkEM2D
492 TopoClusterForTaus.XTalkEM2n = flags.Calo.TopoCluster.xtalkEM2n
493 TopoClusterForTaus.XTalkEM3 = flags.Calo.TopoCluster.xtalkEM3
494 TopoClusterForTaus.XTalkEMEta = flags.Calo.TopoCluster.xtalkEMEta
495 TopoClusterForTaus.XTalkDeltaT = flags.Calo.TopoCluster.xtalkDeltaT
496 TopoClusterForTaus.XTalk2Eratio1 = flags.Calo.TopoCluster.xtalk2Eratio1
497 TopoClusterForTaus.XTalk2Eratio2 = flags.Calo.TopoCluster.xtalk2Eratio2
498 TopoClusterForTaus.XTalk3Eratio = flags.Calo.TopoCluster.xtalk3Eratio
499 TopoClusterForTaus.XTalkEtaEratio = flags.Calo.TopoCluster.xtalkEtaEratio
500 TopoClusterForTaus.XTalk2DEratio = flags.Calo.TopoCluster.xtalk2DEratio
501
502 result.setPrivateTools(TopoClusterForTaus)
503 return result
504
506
507 result = ComponentAccumulator()
508 _name = flags.Tau.ActiveConfig.prefix + 'Pi0TopoClusterSplitter'
509
510 CaloTopoClusterSplitter = CompFactory.getComp("CaloTopoClusterSplitter")
511 TopoSplitterForTaus = CaloTopoClusterSplitter(_name)
512
513 # cells from the following samplings will be able to form local
514 # maxima. The excluded samplings are PreSamplerB, EMB1,
515 # PreSamplerE, EME1, all Tile samplings, all HEC samplings and the
516 # two rear FCal samplings.
517 TopoSplitterForTaus.SamplingNames = ["EMB2","EME2"] # Do we want to use EMB3 and EME3?
518 # cells from the following samplings will also be able to form
519 # local maxima but only if they are not overlapping in eta and phi
520 # with local maxima in previous samplings from the primary list.
521 TopoSplitterForTaus.SecondarySamplingNames = ["EMB1","EME1"]
522 TopoSplitterForTaus.ShareBorderCells = True
523 TopoSplitterForTaus.RestrictHECIWandFCalNeighbors = False
524 TopoSplitterForTaus.WeightingOfNegClusters = flags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
525
526 result.setPrivateTools(TopoSplitterForTaus)
527 return result
528
530 result = ComponentAccumulator()
531 _name = flags.Tau.ActiveConfig.prefix + 'Pi0TopoMoments'
532
533 # Schedule total noise cond alg
534 from CaloTools.CaloNoiseCondAlgConfig import CaloNoiseCondAlgCfg
535 result.merge(CaloNoiseCondAlgCfg(flags,"totalNoise"))
536 # Schedule electronic noise cond alg (needed for LC weights)
537 result.merge(CaloNoiseCondAlgCfg(flags,"electronicNoise"))
538
539 CaloClusterMomentsMaker = CompFactory.getComp("CaloClusterMomentsMaker")
540 TopoMomentsForTaus = CaloClusterMomentsMaker(_name)
541 TopoMomentsForTaus.WeightingOfNegClusters = flags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
542 TopoMomentsForTaus.MaxAxisAngle = 20*deg
543 TopoMomentsForTaus.TwoGaussianNoise = flags.Calo.TopoCluster.doTwoGaussianNoise
544 TopoMomentsForTaus.MinBadLArQuality = 4000
545 TopoMomentsForTaus.MomentsNames = ["FIRST_PHI"
546 ,"FIRST_ETA"
547 ,"SECOND_R"
548 ,"SECOND_LAMBDA"
549 ,"DELTA_PHI"
550 ,"DELTA_THETA"
551 ,"DELTA_ALPHA"
552 ,"CENTER_X"
553 ,"CENTER_Y"
554 ,"CENTER_Z"
555 ,"CENTER_MAG"
556 ,"CENTER_LAMBDA"
557 ,"LATERAL"
558 ,"LONGITUDINAL"
559 ,"ENG_FRAC_EM"
560 ,"ENG_FRAC_MAX"
561 ,"ENG_FRAC_CORE"
562 ,"FIRST_ENG_DENS"
563 ,"SECOND_ENG_DENS"
564 ,"ISOLATION"]
565
566 result.setPrivateTools(TopoMomentsForTaus)
567 return result
568
570 result = ComponentAccumulator()
571 _name = flags.Tau.ActiveConfig.prefix + 'CaloClusterBadChannelList'
572
573 CaloClusterBadChannelListCorr = CompFactory.getComp("CaloClusterBadChannelList")
574 BadChannelListCorrForTaus = CaloClusterBadChannelListCorr(_name)
575
576 result.setPrivateTools(BadChannelListCorrForTaus)
577 return result
578
579
582 result = ComponentAccumulator()
583 _name = flags.Tau.ActiveConfig.prefix + 'Pi0ClusterCreator'
584
585 # TauPi0ClusterCreator accesses cells via links only, which doesn't
586 # make a scheduler dependency. So make additional explicit dependencies
587 # on cells in the input file.
588 extraInputs = []
589 for typ, nam in [i.split('#') for i in flags.Input.TypedCollections]:
590 if typ == 'CaloCellContainer':
591 extraInputs += [('CaloCellContainer', nam)]
592
593 TauPi0ClusterCreator = CompFactory.getComp("TauPi0ClusterCreator")
594 TauPi0ClusterCreator = TauPi0ClusterCreator(name = _name,
595 ExtraInputs = extraInputs,
596 RecoFromAOD = flags.Common.ProductionStep is ProductionStep.Derivation)
597
598 result.setPrivateTools(TauPi0ClusterCreator)
599 return result
600
601
604 result = ComponentAccumulator()
605 _name = flags.Tau.ActiveConfig.prefix + 'Pi0ClusterScaler'
606
607 TauPi0ClusterScaler = CompFactory.getComp("TauPi0ClusterScaler")
608 TauPi0ClusterScaler = TauPi0ClusterScaler(name = _name,
609 MinNeutralPFOPt = flags.Tau.MinNeutralPFOPt)
610
611 result.setPrivateTools(TauPi0ClusterScaler)
612 return result
613
614
617 result = ComponentAccumulator()
618 _name = flags.Tau.ActiveConfig.prefix + 'Pi0ScoreCalculator'
619
620 TauPi0ScoreCalculator = CompFactory.getComp("TauPi0ScoreCalculator")
621 TauPi0ScoreCalculator = TauPi0ScoreCalculator(name = _name,
622 BDTWeightFile = flags.Tau.Pi0ScoreConfig)
623
624 result.setPrivateTools(TauPi0ScoreCalculator)
625 return result
626
627
629def Pi0SelectorCfg(flags):
630 result = ComponentAccumulator()
631 _name = flags.Tau.ActiveConfig.prefix + 'Pi0Selector'
632
633 TauPi0Selector = CompFactory.getComp("TauPi0Selector")
634 TauPi0Selector = TauPi0Selector(name = _name,
635 Pi0EtCut = flags.Tau.pi0EtCuts,
636 Pi0BDTCut_1prong = flags.Tau.pi0MVACuts_1prong,
637 Pi0BDTCut_mprong = flags.Tau.pi0MVACuts_mprong)
638
639 result.setPrivateTools(TauPi0Selector)
640 return result
641
642
645 result = ComponentAccumulator()
646 _name = flags.Tau.ActiveConfig.prefix + 'TauVertexVariables'
647
648 from TrkConfig.TrkVertexFittersConfig import TauAdaptiveVertexFitterCfg
649 from TrkConfig.TrkVertexSeedFinderToolsConfig import (
650 CrossDistancesSeedFinderCfg)
651
652 TauVertexVariables = CompFactory.getComp("TauVertexVariables")
653 TauVertexVariables = TauVertexVariables( name = _name,
654 VertexFitter = result.popToolsAndMerge(TauAdaptiveVertexFitterCfg(flags)),
655 SeedFinder = result.popToolsAndMerge(CrossDistancesSeedFinderCfg(flags)) )
656
657 result.setPrivateTools(TauVertexVariables)
658 return result
659
660
663 result = ComponentAccumulator()
664 _name = flags.Tau.ActiveConfig.prefix + 'TauCommonCalcVars'
665
666 TauCommonCalcVars = CompFactory.getComp("TauCommonCalcVars")
667 TauCommonCalcVars = TauCommonCalcVars(name = _name,
668 doRun4 = flags.GeoModel.Run > LHCPeriod.Run3)
669
670 result.setPrivateTools(TauCommonCalcVars)
671 return result
672
673
676 result = ComponentAccumulator()
677 _name = flags.Tau.ActiveConfig.prefix + 'TauSubstructure'
678
679 TauSubstructureVariables = CompFactory.getComp("TauSubstructureVariables")
680 TauSubstructureVariables = TauSubstructureVariables( name = _name,
681 doRun4 = flags.GeoModel.Run > LHCPeriod.Run3)
682
683 result.setPrivateTools(TauSubstructureVariables)
684 return result
685
686
689 result = ComponentAccumulator()
690 _name = flags.Tau.ActiveConfig.prefix + 'MvaTESVariableDecorator'
691
692 eventShapeCollection = flags.Tau.ActiveConfig.EventShapeCollection
693 if 'EMPFlow' in flags.Tau.ActiveConfig.SeedJetCollection:
694 eventShapeCollection = "Kt4EMPFlowEventShape"
695 elif 'EMTopo' in flags.Tau.ActiveConfig.SeedJetCollection:
696 eventShapeCollection ="Kt4EMTopoOriginEventShape"
697
698 MvaTESVariableDecorator = CompFactory.getComp("MvaTESVariableDecorator")
699 MvaTESVariableDecorator = MvaTESVariableDecorator(name = _name,
700 Key_vertexInputContainer = flags.Tau.ActiveConfig.VertexCollection,
701 EventShapeKey = eventShapeCollection,
702 VertexCorrection = flags.Tau.doVertexCorrection,
703 SeedJet = flags.Tau.ActiveConfig.SeedJetCollection)
704 result.setPrivateTools(MvaTESVariableDecorator)
705 return result
706
707
710 result = ComponentAccumulator()
711 _name = flags.Tau.ActiveConfig.prefix + 'MvaTESEvaluator'
712
713 MvaTESEvaluator = CompFactory.getComp("MvaTESEvaluator")
714 MvaTESEvaluator = MvaTESEvaluator(name = _name,
715 WeightFileName = flags.Tau.MvaTESConfig,
716 WeightFileName0p = flags.Tau.MvaTESConfig0p )
717
718 result.setPrivateTools(MvaTESEvaluator)
719 return result
720
722 result = ComponentAccumulator()
723 _name = flags.Tau.ActiveConfig.prefix + 'TauIDVarCalculator'
724
725 TauIDVarCalculator = CompFactory.getComp("TauIDVarCalculator")
726 myTauIDVarCalculator = TauIDVarCalculator(name=_name,
727 VertexCorrection = flags.Tau.doVertexCorrection,
728 doRun4 = flags.GeoModel.Run > LHCPeriod.Run3)
729
730 result.setPrivateTools(myTauIDVarCalculator)
731 return result
732
733def TauJetRNNEvaluatorCfg(flags, applyLooseTrackSel=False):
734 result = ComponentAccumulator()
735 _name = flags.Tau.ActiveConfig.prefix + 'TauJetRNN'
736
737 TauJetRNNEvaluator = CompFactory.getComp("TauJetRNNEvaluator")
738 RNNConf = flags.Tau.TauJetRNNConfig
739 myTauJetRNNEvaluator = TauJetRNNEvaluator(name = _name,
740 NetworkFile0P = "",
741 NetworkFile1P = RNNConf[0],
742 NetworkFile2P = RNNConf[1],
743 NetworkFile3P = RNNConf[2],
744 OutputVarname = "RNNJetScore",
745 MaxTracks = 10,
746 MaxClusters = 6,
747 MaxClusterDR = 1.0,
748 ApplyLooseTrackSel = applyLooseTrackSel,
749 VertexCorrection = flags.Tau.doVertexCorrection,
750 InputLayerScalar = "scalar",
751 InputLayerTracks = "tracks",
752 InputLayerClusters = "clusters",
753 OutputLayer = "rnnid_output",
754 OutputNode = "sig_prob")
755
756 result.setPrivateTools(myTauJetRNNEvaluator)
757 return result
758
760 import PyUtils.RootUtils as ru
761 ROOT = ru.import_root()
762 import cppyy
763 cppyy.load_library('libxAODTau_cDict')
764
765 result = ComponentAccumulator()
766 _name = flags.Tau.ActiveConfig.prefix + 'TauWPDecoratorJetRNN'
767
768 TauWPDecorator = CompFactory.getComp("TauWPDecorator")
769 WPConf = flags.Tau.TauJetRNNWPConfig
770 myTauWPDecorator = TauWPDecorator( name=_name,
771 flatteningFile1Prong = WPConf[0],
772 flatteningFile2Prong = WPConf[1],
773 flatteningFile3Prong = WPConf[2],
774 CutEnumVals =
775 [ ROOT.xAOD.TauJetParameters.IsTauFlag.JetRNNSigVeryLoose,
776 ROOT.xAOD.TauJetParameters.IsTauFlag.JetRNNSigLoose,
777 ROOT.xAOD.TauJetParameters.IsTauFlag.JetRNNSigMedium,
778 ROOT.xAOD.TauJetParameters.IsTauFlag.JetRNNSigTight ],
779 SigEff1P = [0.95, 0.85, 0.75, 0.60],
780 SigEff2P = [0.95, 0.75, 0.60, 0.45],
781 SigEff3P = [0.95, 0.75, 0.60, 0.45],
782 ScoreName = "RNNJetScore",
783 NewScoreName = "RNNJetScoreSigTrans",
784 DefineWPs = True )
785
786 result.setPrivateTools(myTauWPDecorator)
787 return result
788
789def TauGNNEvaluatorCfg(flags, version=0, applyLooseTrackSel=False, applyTightTrackSel=False, tauContainerName=""):
790 result = ComponentAccumulator()
791 _name = flags.Tau.ActiveConfig.prefix + 'TauGNN_v' + str(version)
792
793 TauGNNEvaluator = CompFactory.getComp("TauGNNEvaluator")
794 GNNConf = flags.Tau.TauGNNConfig[version]
795 myTauGNNEvaluator = TauGNNEvaluator(name = _name,
796 useTRT = flags.Detector.EnableTRT,
797 NetworkFileInclusive = GNNConf,
798 OutputVarname = flags.Tau.GNTauScoreName[version],
799 OutputPTau = "GNTauProbTau",
800 OutputPJet = "GNTauProbJet",
801 MaxTracks = flags.Tau.GNTauMaxTracks[version],
802 MaxClusters = flags.Tau.GNTauMaxClusters[version],
803 MaxClusterDR = 15.0,
804 MinTauPt = flags.Tau.MinPtDAOD,
805 ApplyLooseTrackSel = applyLooseTrackSel,
806 ApplyTightTrackSel = applyTightTrackSel,
807 VertexCorrection = flags.Tau.doVertexCorrection,
808 InputLayerScalar = 'tau_vars',
809 InputLayerTracks = 'track_vars',
810 InputLayerClusters = 'cluster_vars',
811 NodeNameTau=flags.Tau.GNTauNodeNameTau,
812 NodeNameJet=flags.Tau.GNTauNodeNameJet,
813 TauContainerName = tauContainerName,
814 )
815
816 result.setPrivateTools(myTauGNNEvaluator)
817 return result
818
820 """Names of the decorations TausRUs writes on the tau, all of them floats."""
821 names = [
822 "TausRUsTauIDScore",
823 "TausRUsEleRejScore",
824 "TausRUsDecayMode",
825 "TausRUsTauCharge",
826 ]
827 # The class counts must match 'num_classes' in the model metadata
828 names += [f"TausRUsDecayModeScore{i}" for i in range(5)]
829 names += [f"TausRUs{particle}P4_{component}"
830 for particle in ("Tau", "ChargedPion", "NeutralPion")
831 for component in ("pt", "eta", "phi", "m")]
832 names += [f"TausRUsVertex_{coordinate}" for coordinate in ("x", "y", "z")]
833 return names
834
836 """Decorations TausRUs writes on each of the tau's xAOD::TauTrack."""
837 return ["TausRUsTrackClass"] + [f"TausRUsTrackScore{i}" for i in range(4)]
838
839def TausRUsEvaluatorCfg(flags, name="", tauContainerName="", tauTrackContainerName=""):
840 """TausRUs multi-output tau network."""
841
842 result = ComponentAccumulator()
843 _name = name or flags.Tau.ActiveConfig.prefix + 'TausRUs'
844
845 if flags.Tau.TausRUsUseTriton:
846 from AthTritonComps.TritonToolConfig import TritonToolCfg
847 inferenceTool = result.popToolsAndMerge(TritonToolCfg(
848 flags,
849 model_name = flags.Tau.TausRUsTritonModel,
850 url = flags.Tau.TausRUsTritonUrl,
851 port = flags.Tau.TausRUsTritonPort,
852 name = _name + '_TritonTool'))
853 else:
854 from AthOnnxComps.OnnxRuntimeInferenceConfig import OnnxRuntimeInferenceToolCfg
855 inferenceTool = result.popToolsAndMerge(OnnxRuntimeInferenceToolCfg(
856 flags,
857 flags.Tau.TausRUsModelFile,
858 name = _name + '_ORTTool'))
859
860 TausRUsEvaluator = CompFactory.getComp("TausRUsEvaluator")
861 result.setPrivateTools(TausRUsEvaluator(
862 name = _name,
863 InferenceTool = inferenceTool,
864 ModelFile = flags.Tau.TausRUsModelFile,
865 MinTauPt = flags.Tau.TausRUsMinPt,
866 TauContainerName = tauContainerName,
867 TauTrackContainerName = tauTrackContainerName))
868 return result
869
870def TauWPDecoratorGNNCfg(flags, version, tauContainerName=""):
871 result = ComponentAccumulator()
872 _name = flags.Tau.ActiveConfig.prefix + 'TauWPDecoratorGNN_v' + str(version)
873
874 TauWPDecorator = CompFactory.getComp("TauWPDecorator")
875 WPConf = flags.Tau.TauGNNWP[version]
876 myTauWPDecorator = TauWPDecorator(name=_name,
877 flatteningFile1Prong = WPConf[0],
878 flatteningFile2Prong = WPConf[1],
879 flatteningFile3Prong = WPConf[2],
880 TauContainerName = tauContainerName,
881 DecorWPNames = flags.Tau.GNTauDecorWPNames[version],
882 DecorWPCutEffs1P = [0.95, 0.85, 0.75, 0.60],
883 DecorWPCutEffs2P = [0.95, 0.75, 0.60, 0.45],
884 DecorWPCutEffs3P = [0.95, 0.75, 0.60, 0.45],
885 ScoreName = flags.Tau.GNTauScoreName[version],
886 NewScoreName = flags.Tau.GNTauTransScoreName[version],
887 DefineWPs = True)
888 result.setPrivateTools(myTauWPDecorator)
889 return result
890
891def TauGNNeVetoEvaluatorCfg(flags, applyLooseTrackSel=False, applyTightTrackSel=False, tauContainerName=""):
892 result = ComponentAccumulator()
893 _name = flags.Tau.ActiveConfig.prefix + 'TauGNNeVeto'
894
895 TauGNNEvaluator = CompFactory.getComp("TauGNNEvaluator")
896 myTauGNNeVetoEvaluator = TauGNNEvaluator(name = _name,
897 useTRT = flags.Detector.EnableTRT,
898 NetworkFileInclusive = flags.Tau.TauGNNeVetoConfig[0],
899 OutputDiscriminant = flags.Tau.TauGNNeVetoOutputDiscriminant_NeglogPJet_True,
900 OutputVarname = flags.Tau.TauGNNeVetoScoreName,
901 OutputPTau = "GNNeVetoProbTau",
902 OutputPJet = "GNNeVetoProbJet",
903 MaxTracks = flags.Tau.TauGNNeVetoMaxTracks[0],
904 MaxClusters = flags.Tau.TauGNNeVetoMaxClusters[0],
905 MaxClusterDR = 15.0,
906 MinTauPt = flags.Tau.MinPtDAOD,
907 ApplyLooseTrackSel = applyLooseTrackSel,
908 ApplyTightTrackSel = applyTightTrackSel,
909 VertexCorrection = flags.Tau.doVertexCorrection,
910 InputLayerScalar = 'jet_var',
911 InputLayerTracks = 'tracks_r22default_sd0sort',
912 InputLayerClusters = 'cells_var',
913 NodeNameTau=flags.Tau.TauGNNeVetoNodeNameTau,
914 NodeNameJet=flags.Tau.TauGNNeVetoNodeNameJet,
915 TauContainerName = tauContainerName,
916 )
917
918 result.setPrivateTools(myTauGNNeVetoEvaluator)
919 return result
920
921
922def TauGNNeVetoWPDecoratorCfg(flags, tauContainerName=""):
923 result = ComponentAccumulator()
924 _name = flags.Tau.ActiveConfig.prefix + 'TauWPDecoratorGNNeVeto'
925
926 TauWPDecorator = CompFactory.getComp("TauWPDecorator")
927 WPConf = flags.Tau.TauGNNeVetoWP
928 myTauWPDecorator = TauWPDecorator(name=_name,
929 flatteningFile1Prong = WPConf[0],
930 flatteningFile2Prong = WPConf[1],
931 flatteningFile3Prong = WPConf[2],
932 TauContainerName = tauContainerName,
933 DecorWPNames = flags.Tau.TauGNNeVetoDecorWPNames,
934 DecorWPCutEffs1P = [0.95, 0.90, 0.85],
935 DecorWPCutEffs2P = [0.95, 0.90, 0.85],
936 DecorWPCutEffs3P = [0.98, 0.95, 0.90],
937 UseAbsEta = False, # Now for the eVeto algorithm we derive a flattening with respect to mu.
938 ScoreBounds = [-0.01, 14.01],
939 ScoreName = flags.Tau.TauGNNeVetoScoreName,
940 NewScoreName = flags.Tau.TauGNNeVetoTransScoreName,
941 DefineWPs = True)
942 result.setPrivateTools(myTauWPDecorator)
943 return result
944
945def TauGNNDisplacedEvaluatorCfg(flags, tauContainerName=""):
946 # Displaced TauGNNEvaluator tool setup
947 result = ComponentAccumulator()
948
949 TauGNNEvaluator = CompFactory.TauGNNEvaluator(
950 name = flags.Tau.ActiveConfig.prefix + 'TauDisplacedGNN',
951 NetworkFileInclusive = flags.Tau.TauDisplacedGNNConfig[0],
952 OutputVarname = "GNdTauScore",
953 OutputPTau = "GNdTauProbTau",
954 OutputPJet = "GNdTauProbJet",
955 MaxClusterDR = 15.0,
956 MinTauPt = flags.Tau.MinPtDAOD,
957 VertexCorrection = flags.Tau.doVertexCorrection,
958 NodeNameTau="GNdTauv3_pb",
959 NodeNameJet="GNdTauv3_pu",
960 TauContainerName = tauContainerName,
961 )
962 result.setPrivateTools(TauGNNEvaluator)
963 return result
964
965def TauEleRNNEvaluatorCfg(flags, applyLooseTrackSel=False):
966 result = ComponentAccumulator()
967 _name = flags.Tau.ActiveConfig.prefix + 'TauEleRNN'
968
969 TauJetRNNEvaluator = CompFactory.getComp("TauJetRNNEvaluator")
970 RNNConf = flags.Tau.TauEleRNNConfig
971 myTauEleRNNEvaluator = TauJetRNNEvaluator(name = _name,
972 useTRT = flags.Detector.EnableTRT,
973 NetworkFile1P = RNNConf[0],
974 NetworkFile3P = RNNConf[1],
975 OutputVarname = "RNNEleScore",
976 MaxTracks = 10,
977 MaxClusters = 6,
978 MaxClusterDR = 1.0,
979 ApplyLooseTrackSel = applyLooseTrackSel,
980 VertexCorrection = flags.Tau.doVertexCorrection,
981 InputLayerScalar = "scalar",
982 InputLayerTracks = "tracks",
983 InputLayerClusters = "clusters",
984 OutputLayer = "rnneveto_output",
985 OutputNode = "sig_prob")
986
987 result.setPrivateTools(myTauEleRNNEvaluator)
988 return result
989
991
992 result = ComponentAccumulator()
993
994 WPConf = flags.Tau.TauEleRNNWPConfig
995
996 from AthenaConfiguration.Enums import ProductionStep
997 # set the instance to run at derivation level
998 if flags.Common.ProductionStep is ProductionStep.Derivation:
999 _name = flags.Tau.ActiveConfig.prefix + 'TauWPDecoratorEleRNNFix_v1'
1000 NewScoreName = "RNNEleScoreSigTrans_v1"
1001 CutEnumVals = []
1002 SigEff1P = []
1003 SigEff3P = []
1004 DecorWPNames = [ "EleRNNLoose_v1", "EleRNNMedium_v1", "EleRNNTight_v1" ]
1005 DecorWPCutEffs1P = [0.95, 0.90, 0.85]
1006 DecorWPCutEffs3P = [0.98, 0.95, 0.90]
1007 else:
1008 #this is the instance running in reconstruction level
1009 import PyUtils.RootUtils as ru
1010 ROOT = ru.import_root()
1011 import cppyy
1012 cppyy.load_library('libxAODTau_cDict')
1013
1014 _name = flags.Tau.ActiveConfig.prefix + 'TauWPDecoratorEleRNN'
1015 NewScoreName = "RNNEleScoreSigTrans"
1016 SigEff1P = [0.95, 0.90, 0.85]
1017 SigEff3P = [0.98, 0.95, 0.90]
1018 CutEnumVals = [ ROOT.xAOD.TauJetParameters.IsTauFlag.EleRNNLoose,
1019 ROOT.xAOD.TauJetParameters.IsTauFlag.EleRNNMedium,
1020 ROOT.xAOD.TauJetParameters.IsTauFlag.EleRNNTight ]
1021 DecorWPNames = []
1022 DecorWPCutEffs1P = []
1023 DecorWPCutEffs3P = []
1024
1025 TauWPDecorator = CompFactory.getComp("TauWPDecorator")
1026 myTauEleWPDecorator = TauWPDecorator( name=_name,
1027 flatteningFile1Prong = WPConf[0],
1028 flatteningFile3Prong = WPConf[1],
1029 CutEnumVals = CutEnumVals,
1030 DecorWPNames = DecorWPNames,
1031 SigEff1P = SigEff1P,
1032 SigEff3P = SigEff3P,
1033 DecorWPCutEffs1P = DecorWPCutEffs1P,
1034 DecorWPCutEffs3P = DecorWPCutEffs3P,
1035 UseAbsEta = True ,
1036 ScoreName = "RNNEleScore",
1037 NewScoreName = NewScoreName,
1038 DefineWPs = True)
1039
1040 result.setPrivateTools(myTauEleWPDecorator)
1041 return result
1042
1044 result = ComponentAccumulator()
1045 _name = flags.Tau.ActiveConfig.prefix + 'TauDecayModeNNClassifier'
1046
1047 TauDecayModeNNClassifier = CompFactory.getComp("TauDecayModeNNClassifier")
1048 myTauDecayModeNNClassifier = TauDecayModeNNClassifier(name=_name,
1049 WeightFile=flags.Tau.DecayModeNNClassifierConfig)
1050
1051 result.setPrivateTools(myTauDecayModeNNClassifier)
1052 return result
1053
1055 result = ComponentAccumulator()
1056 _name = flags.Tau.ActiveConfig.prefix + 'TauAODSelector'
1057
1058 TauAODSelector = CompFactory.getComp("TauAODSelector")
1059 myTauAODSelector = TauAODSelector(name=_name,
1060 Min0pTauPt = flags.Tau.MinPt0p,
1061 MinTauPt = flags.Tau.MinPt,
1062 doEarlyStopping = flags.Tau.doEarlyStopping and not flags.Output.doWriteESD)
1063
1064 result.setPrivateTools(myTauAODSelector)
1065 return result
1066
1067
1069def TauCombinedTESCfg(flags, **kwargs):
1070 result = ComponentAccumulator()
1071 _name = flags.Tau.ActiveConfig.prefix + 'TauCombinedTES'
1072 kwargs.setdefault("WeightFileName", flags.Tau.CombinedTESConfig)
1073
1074 TauCombinedTES = CompFactory.getComp("TauCombinedTES")
1075 myTauCombinedTES = TauCombinedTES(name = _name, **kwargs)
1076
1077 result.setPrivateTools(myTauCombinedTES)
1078 return result
1079
1080
1083 result = ComponentAccumulator()
1084 _name = flags.Tau.ActiveConfig.prefix + 'MuonRemoval'
1085 TauAODMuonRemovalTool = CompFactory.getComp("TauAODMuonRemovalTool")
1086 myMuonRemoval = TauAODMuonRemovalTool( name = _name,
1087 Key_MuonInputContainer = 'Muons',
1088 doMuonTrkRm = True,
1089 doMuonClsRm = True,
1090 muonIDWP = 'Medium'
1091 )
1092 result.setPrivateTools(myMuonRemoval)
1093 return result
1094
1095# electron excluder tool
1097 result = ComponentAccumulator()
1098 _name = flags.Tau.ActiveConfig.prefix + 'TauEleOverlapChecker'
1099 TauEleOverlapChecker = CompFactory.getComp("TauEleOverlapChecker")
1100 myTauEleOverlapChecker = TauEleOverlapChecker(
1101 name = _name,
1102 Key_RemovedClustersContainer = flags.Tau.ActiveConfig.RemovedElectronClusters,
1103 Key_RemovedTracksContainer = flags.Tau.ActiveConfig.RemovedElectronTracks,
1104 CheckingCone = flags.Tau.ActiveConfig.EleRM_CheckingConeSize,
1105 )
1106 result.setPrivateTools(myTauEleOverlapChecker)
1107 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.
Tau Tracks to Calo extrapolation.
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.
Evaluates the TausRUs network and decorates its predictions on the tau and on its tracks.
TauCaloTopoClusterSplitterCfg(flags)
TauCaloTopoClusterMakerCfg(flags)
TauSubstructureCfg(flags)
Tau Variables.
Pi0ScoreCalculatorCfg(flags)
calculate MVA scores of pi0 clusters
Pi0SelectorCfg(flags)
select pi0 clusters
TausRUsEvaluatorCfg(flags, name="", tauContainerName="", tauTrackContainerName="")
TauGNNeVetoWPDecoratorCfg(flags, tauContainerName="")
TauDecayModeNNClassifierCfg(flags)
TauEleRNNEvaluatorCfg(flags, applyLooseTrackSel=False)
TauCaloOOCCalibCfg(flags)
TauTrackFinderCfg(flags)
Tau-Track Association.
TauGNNDisplacedEvaluatorCfg(flags, tauContainerName="")
TauEleOverlapChecker(flags)
TauCaloLCDeadMaterialCfg(flags)
TauVertexFinderCfg(flags)
TauCommonCalcVarsCfg(flags)
Tau Variables.
JetSeedBuilderCfg(flags)
JetSeedBuilder.
TauCaloOOCPi0CalibCfg(flags)
TauCaloDMCalibCfg(flags)
TauCaloClusterLocalCalibCfg(flags)
TauClusterFinderCfg(flags)
Associate the cluster in jet constituents to the tau candidate.
CellVariablesCfg(flags)
Tau cell variables calculation.
MvaTESVariableDecoratorCfg(flags)
MvaTESVariableDecorator.
TauWPDecoratorGNNCfg(flags, version, tauContainerName="")
TauShotFinderCfg(flags)
Photon Shot Finder.
ElectronVetoVarsCfg(flags)
ele veto variables
TauCaloLCWeightCfg(flags)
TauVertexedClusterDecoratorCfg(flags)
TauAODMuonRemovalCfg(flags)
muon removal tool
TauWPDecoratorEleRNNCfg(flags)
TauCaloLCOutOfClusterCfg(flags)
TauVertexVariablesCfg(flags)
Tau Vertex Variables.
Pi0ClusterFinderCfg(flags)
Pi0 algo Cluster finder for Pi0 algo.
TauCombinedTESCfg(flags, **kwargs)
TauCombinedTES.
Pi0ClusterScalerCfg(flags)
Set energy of cluster to take care of charged pion energy deposited in the ECAL.
TauCaloLCOutPi0Cfg(flags)
TauTrackCaloExtrapolatorCfg(flags)
Tau-Track Calo Extrapolator.
TauTrackRNNCfg(flags)
getParticleCache(flags)
TauWPDecoratorJetRNNCfg(flags)
Pi0ClusterCreatorCfg(flags)
create Pi0 clusters
TauCaloClusterBadChannelCfg(flags)
TauTrackRNNClassifierCfg(flags)
TauIDVarCalculatorCfg(flags)
TauAxisCfg(flags)
Tau energy calibration and tau axis direction.
MvaTESEvaluatorCfg(flags)
MvaTESEvaluator.
TauJetRNNEvaluatorCfg(flags, applyLooseTrackSel=False)
TauCaloClusterMomentsMakerCfg(flags)
TauGNNEvaluatorCfg(flags, version=0, applyLooseTrackSel=False, applyTightTrackSel=False, tauContainerName="")
TauGNNeVetoEvaluatorCfg(flags, applyLooseTrackSel=False, applyTightTrackSel=False, tauContainerName="")
TauAODSelectorCfg(flags)
TauCellFinalizerCfg(flags)
Cell finalizer tool for BuildAlg.
EnergyCalibrationLCCfg(flags, force_zero_mass=False)
Tau energy calibration.
TauCaloLCClassificationCfg(flags)
Calo Tools.