11 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
12 from AthenaConfiguration.ComponentFactory
import CompFactory
20 """Configure the TruthCollectionMaker tool"""
22 acc.addPublicTool(CompFactory.DerivationFramework.TruthCollectionMaker(name = name,**kwargs),
28 """Muon truth collection maker"""
30 name =
"DFCommonTruthMuonTool",
31 OutputCollectionName =
"TruthMuons",
32 KeepNavigationInfo =
False,
33 ParticleSelectionString =
"(abs(TruthParticles.pdgId) == 13) && TruthParticles.isGenStable")
37 """Charm truth collection maker"""
41 OutputCollectionName =
"TruthCharm",
42 KeepNavigationInfo =
False,
43 ParticleSelectionString =
"(abs(TruthParticles.pdgId) == 4)",
48 """Electron truth collection maker"""
50 name =
"DFCommonTruthElectronTool",
51 OutputCollectionName =
"TruthElectrons",
52 KeepNavigationInfo =
False,
53 ParticleSelectionString =
"(abs(TruthParticles.pdgId) == 11) && TruthParticles.isGenStable")
57 """Photon truth collection maker (Currently unused?)"""
59 name =
"DFCommonTruthPhotonTool",
60 OutputCollectionName =
"TruthPhotons",
61 KeepNavigationInfo =
False,
62 ParticleSelectionString =
"(abs(TruthParticles.pdgId) == 22) && TruthParticles.isGenStable")
67 """Tool for making TruthPhotons from sim samples"""
69 name =
"DFCommonTruthPhotonToolSim",
70 OutputCollectionName =
"TruthPhotons",
71 KeepNavigationInfo =
False,
72 ParticleSelectionString =
"(abs(TruthParticles.pdgId) == 22) && TruthParticles.isGenStable && ((TruthParticles.classifierParticleOrigin != 42 && TruthParticles.classifierParticleOrigin !=23) || (TruthParticles.pt > 20.0*GeV))")
76 """Neutrino truth collection maker"""
77 neutrinoexpression =
"(TruthParticles.isNeutrino && TruthParticles.isGenStable)"
79 name =
"DFCommonTruthNeutrinoTool",
80 OutputCollectionName =
"TruthNeutrinos",
81 KeepNavigationInfo =
False,
82 ParticleSelectionString = neutrinoexpression)
86 """B-quark truth collection maker"""
88 name =
"DFCommonTruthBottomTool",
89 OutputCollectionName =
"TruthBottom",
90 KeepNavigationInfo =
False,
91 ParticleSelectionString =
"(abs(TruthParticles.pdgId) == 5)",
96 """Top-quark truth collection maker"""
98 name =
"DFCommonTruthTopTool",
99 OutputCollectionName =
"TruthTop",
100 KeepNavigationInfo =
False,
101 ParticleSelectionString =
"(abs(TruthParticles.pdgId) == 6)",
106 """Gauge bosons and Higgs truth collection maker"""
108 name =
"DFCommonTruthBosonTool",
109 OutputCollectionName =
"TruthBoson",
110 KeepNavigationInfo =
False,
111 ParticleSelectionString =
"(abs(TruthParticles.pdgId) == 23 || abs(TruthParticles.pdgId) == 24 || abs(TruthParticles.pdgId) == 25)",
117 """BSM particles truth collection maker"""
119 name =
"DFCommonTruthBSMTool",
120 OutputCollectionName =
"TruthBSM",
121 KeepNavigationInfo =
False,
122 ParticleSelectionString =
"(TruthParticles.isBSM)",
127 """Forward proton truth collection maker"""
128 beam_energy = flags.Beam.Energy
130 name =
"DFCommonTruthForwardProtonTool",
131 OutputCollectionName =
"TruthForwardProtons",
132 KeepNavigationInfo =
False,
133 ParticleSelectionString =
"(TruthParticles.isStable) && (abs(TruthParticles.pdgId)==2212) && (TruthParticles.e>0.8*"+
str(beam_energy)+
")",
141 """Configure the truth D2 decorator tool"""
143 TruthD2Decorator = CompFactory.DerivationFramework.TruthD2Decorator
144 acc.addPublicTool(TruthD2Decorator(name, **kwargs), primary =
True)
149 """Configure the TruthClassificationDecorator tool"""
151 TruthClassificationDecorator = CompFactory.DerivationFramework.TruthClassificationDecorator
152 acc.addPublicTool(TruthClassificationDecorator(name = name, **kwargs),
158 """Config the MuonTruthClassifierFallback tool"""
161 if "MCTruthClassifierTool" not in kwargs:
162 from MCTruthClassifier.MCTruthClassifierConfig
import (
163 MCTruthClassifierCfg)
164 kwargs.setdefault(
"MCTruthClassifierTool", acc.popToolsAndMerge(
167 MuonTruthClassifierFallback = CompFactory.DerivationFramework.MuonTruthClassifierFallback
168 acc.addPublicTool(MuonTruthClassifierFallback(name = name, **kwargs),
174 """Configure the TruthDressingTool"""
176 TruthDressingTool = CompFactory.DerivationFramework.TruthDressingTool
177 acc.addPublicTool(TruthDressingTool( name = name, **kwargs),
183 """Configure the truth isolation tool"""
185 TruthIsolationTool = CompFactory.DerivationFramework.TruthIsolationTool
192 """Configure the MuonTruthIsolationTool"""
194 acc.addEventAlgo(CompFactory.DerivationFramework.MuonTruthIsolationDecorAlg(name = name, **kwargs),
200 """Configure the quark/gluon decoration tool"""
202 TruthQGDecorationTool = CompFactory.DerivationFramework.TruthQGDecorationTool
203 acc.addPublicTool(TruthQGDecorationTool(name = name, **kwargs),
209 """Congigure the truth navigation decorator tool"""
211 TruthNavigationDecorator = CompFactory.DerivationFramework.TruthNavigationDecorator
212 acc.addPublicTool(TruthNavigationDecorator(name = name, **kwargs),
218 """Configure the truth decay collection maker"""
220 TruthDecayCollectionMaker = CompFactory.DerivationFramework.TruthDecayCollectionMaker
221 acc.addPublicTool(TruthDecayCollectionMaker(name = name, **kwargs),
227 """Configure the truth Born lepton collection tool"""
229 TruthBornLeptonCollectionMaker = CompFactory.DerivationFramework.TruthBornLeptonCollectionMaker
230 acc.addPublicTool(TruthBornLeptonCollectionMaker(name = name, **kwargs),
236 """Add a mini-collection for the hard scatter and N subsequent generations"""
243 """dress the main truth collection with the classification"""
244 from MCTruthClassifier.MCTruthClassifierConfig
import DFCommonMCTruthClassifierCfg
246 DFCommonTruthClassifier = accMCTC.getPrimary()
248 name =
"DFCommonTruthClassificationTool",
249 ParticlesKey =
"TruthParticles",
250 MCTruthClassifier = DFCommonTruthClassifier)
257 """get the hadron origin classification"""
259 HadronOriginClassifier = CompFactory.DerivationFramework.HadronOriginClassifier
260 kwargs.setdfault(
"DSID", flags.Input.MCChannelNumber)
261 acc.addPublicTool(HadronOriginClassifier(name = name, **kwargs),
267 """decorate with the hadron origin classification"""
269 if not hasattr(kwargs,
"ToolName"):
271 name=
"DFCommonHadronOriginClassifier")))
272 acc.addPublicTool(CompFactory.DerivationFramework.HadronOriginDecorator
273 (name = name, **kwargs),
280 """Configure the electron truth dressing tool"""
282 name =
"DFCommonTruthElectronDressingTool",
283 dressParticlesKey =
"TruthElectrons",
284 usePhotonsFromHadrons =
False,
285 dressingConeSize = 0.1,
286 particleIDsToDress = [11],
287 decorationName = decorationName+
"_e")
291 """Configure the muon truth dressing tool"""
293 name =
"DFCommonTruthMuonDressingTool",
294 dressParticlesKey =
"TruthMuons",
295 usePhotonsFromHadrons =
False,
296 dressingConeSize = 0.1,
297 particleIDsToDress = [13],
298 decorationName = decorationName+
"_mu")
302 """Configure the tau truth dressing tool"""
304 name =
"DFCommonTruthTauDressingTool",
305 dressParticlesKey =
"TruthTaus",
306 usePhotonsFromHadrons =
False,
307 dressingConeSize = 0.2,
308 particleIDsToDress = [15],
309 decoratePhotons =
False)
313 """Configure the electron isolation tool, cone=0.2"""
315 name =
"DFCommonTruthElectronIsolationTool1",
316 isoParticlesKey =
"TruthElectrons",
317 allParticlesKey =
"TruthParticles",
318 particleIDsToCalculate = [11],
319 IsolationConeSizes = [0.2],
320 IsolationVarNamePrefix =
'etcone',
321 ChargedParticlesOnly =
False)
325 """Configure the electron isolation tool, cone=0.3"""
327 name =
"DFCommonTruthElectronIsolationTool2",
328 isoParticlesKey =
"TruthElectrons",
329 allParticlesKey =
"TruthParticles",
330 particleIDsToCalculate = [11],
331 IsolationConeSizes = [0.3],
332 IsolationVarNamePrefix =
'ptcone',
333 ChargedParticlesOnly =
True)
337 """Configure the muon isolation tool, cone=0.2"""
339 name =
"DFCommonTruthMuonIsolationTool1",
340 isoParticlesKey =
"TruthMuons",
341 allParticlesKey =
"TruthParticles",
342 particleIDsToCalculate = [13],
343 IsolationConeSizes = [0.2],
344 IsolationVarNamePrefix =
'etcone',
345 ChargedParticlesOnly =
False)
349 """Configure the muon isolation tool, cone=0.3"""
351 name =
"DFCommonTruthMuonIsolationTool2",
352 isoParticlesKey =
"TruthMuons",
353 allParticlesKey =
"TruthParticles",
354 particleIDsToCalculate = [13],
355 IsolationConeSizes = [0.3],
356 IsolationVarNamePrefix =
'ptcone',
357 ChargedParticlesOnly =
True)
361 """Configure the photon isolation tool, etcone"""
363 name =
"DFCommonTruthPhotonIsolationTool1",
364 isoParticlesKey =
"TruthPhotons",
365 allParticlesKey =
"TruthParticles",
366 particleIDsToCalculate = [22],
367 IsolationConeSizes = [0.2],
368 IsolationVarNamePrefix =
'etcone',
369 ChargedParticlesOnly =
False)
373 """Configure the photon isolation tool, ptcone"""
375 name =
"DFCommonTruthPhotonIsolationTool2",
376 isoParticlesKey =
"TruthPhotons",
377 allParticlesKey =
"TruthParticles",
378 particleIDsToCalculate = [22],
379 IsolationConeSizes = [0.2],
380 IsolationVarNamePrefix =
'ptcone',
381 ChargedParticlesOnly =
True)
385 """Configure the photon isolation tool, etcone=0.4"""
387 name =
"DFCommonTruthPhotonIsolationTool3",
388 isoParticlesKey =
"TruthPhotons",
389 allParticlesKey =
"TruthParticles",
390 particleIDsToCalculate = [22],
391 IsolationConeSizes = [0.4],
392 IsolationVarNamePrefix =
'etcone',
393 ChargedParticlesOnly =
False)
398 """Configure the QG decoration tool for AntiKt4TruthDressedWZJets"""
400 name =
"DFCommonTruthDressedWZQGLabelTool",
401 JetCollection =
"AntiKt4TruthDressedWZJets")
410 """Configure the menu truth thinning tool"""
412 MenuTruthThinning = CompFactory.DerivationFramework.MenuTruthThinning
413 acc.addPublicTool(MenuTruthThinning(name, **kwargs),
423 """Configure the truth link repointing tool"""
425 TruthLinkRepointTool = CompFactory.DerivationFramework.TruthLinkRepointTool
426 acc.addPublicTool(TruthLinkRepointTool(name, **kwargs),
434 """Configure the truth PV collection maker tool"""
436 TruthPVCollectionMaker = CompFactory.DerivationFramework.TruthPVCollectionMaker
437 acc.addPublicTool(TruthPVCollectionMaker(name, **kwargs),
444 """Configure the GenericTruthThinning tool"""
446 GenericTruthThinning = CompFactory.DerivationFramework.GenericTruthThinning
447 acc.addPublicTool(GenericTruthThinning(name, **kwargs),