11 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
12 from AthenaConfiguration.ComponentFactory
import CompFactory
20 """Configure the TruthCollectionMaker tool"""
22 TruthCollectionMaker = CompFactory.DerivationFramework.TruthCollectionMaker
23 acc.addPublicTool(TruthCollectionMaker(name = name,**kwargs),
28 """Muon truth collection maker"""
30 name =
"DFCommonTruthMuonTool",
31 NewCollectionName =
"TruthMuons",
32 KeepNavigationInfo =
False,
33 ParticleSelectionString = f
"(abs(TruthParticles.pdgId) == 13) && (TruthParticles.status == 1) && TruthParticles.barcode < {flags.Sim.SimBarcodeOffset}")
36 """LHE truth collection maker"""
38 name =
"DFCommonTruthLHETool",
39 NewCollectionName =
"TruthLHEParticles",
40 KeepNavigationInfo =
False,
41 ParticleSelectionString =
"(TruthParticles.status == 1003)")
44 """Electron truth collection maker"""
46 name =
"DFCommonTruthElectronTool",
47 NewCollectionName =
"TruthElectrons",
48 KeepNavigationInfo =
False,
49 ParticleSelectionString = f
"(abs(TruthParticles.pdgId) == 11) && (TruthParticles.status == 1) && TruthParticles.barcode < {flags.Sim.SimBarcodeOffset}")
52 """Photon truth collection maker"""
54 name =
"DFCommonTruthPhotonTool",
55 NewCollectionName =
"TruthPhotons",
56 KeepNavigationInfo =
False,
57 ParticleSelectionString = f
"(abs(TruthParticles.pdgId) == 22) && (TruthParticles.status == 1) && TruthParticles.barcode < {flags.Sim.SimBarcodeOffset}")
61 """Tool for making TruthPhotons from sim samples"""
63 name =
"DFCommonTruthPhotonToolSim",
64 NewCollectionName =
"TruthPhotons",
65 KeepNavigationInfo =
False,
66 ParticleSelectionString = f
"(abs(TruthParticles.pdgId) == 22) && (TruthParticles.status == 1) && ((TruthParticles.classifierParticleOrigin != 42 && TruthParticles.classifierParticleOrigin !=23) || (TruthParticles.pt > 20.0*GeV)) && ( TruthParticles.barcode < {flags.Sim.SimBarcodeOffset} )")
69 """Neutrino truth collection maker"""
70 neutrinoexpression = f
"(TruthParticles.isNeutrino && TruthParticles.status == 1) && TruthParticles.barcode < {flags.Sim.SimBarcodeOffset}"
72 name =
"DFCommonTruthNeutrinoTool",
73 NewCollectionName =
"TruthNeutrinos",
74 KeepNavigationInfo =
False,
75 ParticleSelectionString = neutrinoexpression)
78 """B-quark truth collection maker"""
80 name =
"DFCommonTruthBottomTool",
81 NewCollectionName =
"TruthBottom",
82 KeepNavigationInfo =
False,
83 ParticleSelectionString =
"(abs(TruthParticles.pdgId) == 5)",
87 """Top-quark truth collection maker"""
89 name =
"DFCommonTruthTopTool",
90 NewCollectionName =
"TruthTop",
91 KeepNavigationInfo =
False,
92 ParticleSelectionString =
"(abs(TruthParticles.pdgId) == 6)",
96 """Gauge bosons and Higgs truth collection maker"""
98 name =
"DFCommonTruthBosonTool",
99 NewCollectionName =
"TruthBoson",
100 KeepNavigationInfo =
False,
101 ParticleSelectionString =
"(abs(TruthParticles.pdgId) == 23 || abs(TruthParticles.pdgId) == 24 || abs(TruthParticles.pdgId) == 25)",
106 """BSM particles truth collection maker"""
108 name =
"DFCommonTruthBSMTool",
109 NewCollectionName =
"TruthBSM",
110 KeepNavigationInfo =
False,
111 ParticleSelectionString =
"(TruthParticles.isBSM)",
115 """Forward proton truth collection maker"""
116 beam_energy = flags.Beam.Energy
118 name =
"DFCommonTruthForwardProtonTool",
119 NewCollectionName =
"TruthForwardProtons",
120 KeepNavigationInfo =
False,
121 ParticleSelectionString =
"(TruthParticles.status==1) && (abs(TruthParticles.pdgId)==2212) && (TruthParticles.e>0.8*"+
str(beam_energy)+
")",
129 """Configure the truth D2 decorator tool"""
131 TruthD2Decorator = CompFactory.DerivationFramework.TruthD2Decorator
132 acc.addPublicTool(TruthD2Decorator(name, **kwargs), primary =
True)
136 """Configure the MCTruthClassifier tool"""
138 MCTruthClassifier = CompFactory.MCTruthClassifier
139 acc.addPublicTool(
MCTruthClassifier(name =
"DFCommonTruthClassifier", ParticleCaloExtensionTool =
""),
144 """Configure the TruthClassificationDecorator tool"""
146 TruthClassificationDecorator = CompFactory.DerivationFramework.TruthClassificationDecorator
147 acc.addPublicTool(TruthClassificationDecorator(name = name, **kwargs),
152 """Config the MuonTruthClassifierFallback tool"""
155 if "MCTruthClassifierTool" not in kwargs:
156 from MCTruthClassifier.MCTruthClassifierConfig
import (
157 MCTruthClassifierCfg)
158 kwargs.setdefault(
"MCTruthClassifierTool", acc.popToolsAndMerge(
161 MuonTruthClassifierFallback = CompFactory.DerivationFramework.MuonTruthClassifierFallback
162 acc.addPublicTool(MuonTruthClassifierFallback(name = name, **kwargs),
167 """Configure the TruthDressingTool"""
169 TruthDressingTool = CompFactory.DerivationFramework.TruthDressingTool
170 acc.addPublicTool(TruthDressingTool( name = name, **kwargs),
175 """Configure the truth isolation tool"""
177 TruthIsolationTool = CompFactory.DerivationFramework.TruthIsolationTool
183 """Configure the MuonTruthIsolationTool"""
185 acc.addEventAlgo(CompFactory.DerivationFramework.MuonTruthIsolationDecorAlg(name = name, **kwargs),
190 """Configure the quark/gluon decoration tool"""
192 TruthQGDecorationTool = CompFactory.DerivationFramework.TruthQGDecorationTool
193 acc.addPublicTool(TruthQGDecorationTool(name = name, **kwargs),
198 """Congigure the truth navigation decorator tool"""
200 TruthNavigationDecorator = CompFactory.DerivationFramework.TruthNavigationDecorator
201 acc.addPublicTool(TruthNavigationDecorator(name = name, **kwargs),
206 """Configure the truth decay collection maker"""
208 TruthDecayCollectionMaker = CompFactory.DerivationFramework.TruthDecayCollectionMaker
209 acc.addPublicTool(TruthDecayCollectionMaker(name = name, **kwargs),
214 """Configure the truth Born lepton collection tool"""
216 TruthBornLeptonCollectionMaker = CompFactory.DerivationFramework.TruthBornLeptonCollectionMaker
217 acc.addPublicTool(TruthBornLeptonCollectionMaker(name = name, **kwargs),
222 """Add a mini-collection for the hard scatter and N subsequent generations"""
228 """dress the main truth collection with the classification"""
230 DFCommonTruthClassifier = accMCTC.getPrimary()
232 name =
"DFCommonTruthClassificationTool",
233 ParticlesKey =
"TruthParticles",
234 MCTruthClassifier = DFCommonTruthClassifier)
240 """get the hadron origin classification"""
242 HadronOriginClassifier = CompFactory.DerivationFramework.HadronOriginClassifier
243 acc.addPublicTool(HadronOriginClassifier(name = name, **kwargs),
248 """decorate with the hadron origin classification"""
250 HadronOriginDecorator = CompFactory.DerivationFramework.HadronOriginDecorator
251 acc.addPublicTool(HadronOriginDecorator(name = name, **kwargs),
258 """Configure the electron truth dressing tool"""
260 name =
"DFCommonTruthElectronDressingTool",
261 dressParticlesKey =
"TruthElectrons",
262 usePhotonsFromHadrons =
False,
263 dressingConeSize = 0.1,
264 particleIDsToDress = [11],
265 decorationName = decorationName)
268 """Configure the muon truth dressing tool"""
270 name =
"DFCommonTruthMuonDressingTool",
271 dressParticlesKey =
"TruthMuons",
272 usePhotonsFromHadrons =
False,
273 dressingConeSize = 0.1,
274 particleIDsToDress = [13],
275 decorationName = decorationName)
278 """Configure the tau truth dressing tool"""
280 name =
"DFCommonTruthTauDressingTool",
281 dressParticlesKey =
"TruthTaus",
282 usePhotonsFromHadrons =
False,
283 dressingConeSize = 0.2,
284 particleIDsToDress = [15])
287 """Configure the electron isolation tool, cone=0.2"""
289 name =
"DFCommonTruthElectronIsolationTool1",
290 isoParticlesKey =
"TruthElectrons",
291 allParticlesKey =
"TruthParticles",
292 particleIDsToCalculate = [11],
293 IsolationConeSizes = [0.2],
294 IsolationVarNamePrefix =
'etcone',
295 ChargedParticlesOnly =
False)
298 """Configure the electron isolation tool, cone=0.3"""
300 name =
"DFCommonTruthElectronIsolationTool2",
301 isoParticlesKey =
"TruthElectrons",
302 allParticlesKey =
"TruthParticles",
303 particleIDsToCalculate = [11],
304 IsolationConeSizes = [0.3],
305 IsolationVarNamePrefix =
'ptcone',
306 ChargedParticlesOnly =
True)
309 """Configure the muon isolation tool, cone=0.2"""
311 name =
"DFCommonTruthMuonIsolationTool1",
312 isoParticlesKey =
"TruthMuons",
313 allParticlesKey =
"TruthParticles",
314 particleIDsToCalculate = [13],
315 IsolationConeSizes = [0.2],
316 IsolationVarNamePrefix =
'etcone',
317 ChargedParticlesOnly =
False)
320 """Configure the muon isolation tool, cone=0.3"""
322 name =
"DFCommonTruthMuonIsolationTool2",
323 isoParticlesKey =
"TruthMuons",
324 allParticlesKey =
"TruthParticles",
325 particleIDsToCalculate = [13],
326 IsolationConeSizes = [0.3],
327 IsolationVarNamePrefix =
'ptcone',
328 ChargedParticlesOnly =
True)
331 """Configure the photon isolation tool, etcone"""
333 name =
"DFCommonTruthPhotonIsolationTool1",
334 isoParticlesKey =
"TruthPhotons",
335 allParticlesKey =
"TruthParticles",
336 particleIDsToCalculate = [22],
337 IsolationConeSizes = [0.2],
338 IsolationVarNamePrefix =
'etcone',
339 ChargedParticlesOnly =
False)
343 """Configure the photon isolation tool, ptcone"""
345 name =
"DFCommonTruthPhotonIsolationTool2",
346 isoParticlesKey =
"TruthPhotons",
347 allParticlesKey =
"TruthParticles",
348 particleIDsToCalculate = [22],
349 IsolationConeSizes = [0.2],
350 IsolationVarNamePrefix =
'ptcone',
351 ChargedParticlesOnly =
True)
354 """Configure the photon isolation tool, etcone=0.4"""
356 name =
"DFCommonTruthPhotonIsolationTool3",
357 isoParticlesKey =
"TruthPhotons",
358 allParticlesKey =
"TruthParticles",
359 particleIDsToCalculate = [22],
360 IsolationConeSizes = [0.4],
361 IsolationVarNamePrefix =
'etcone',
362 ChargedParticlesOnly =
False)
366 """Configure the QG decoration tool for AntiKt4TruthDressedWZJets"""
368 name =
"DFCommonTruthDressedWZQGLabelTool",
369 JetCollection =
"AntiKt4TruthDressedWZJets")
378 """Configure the menu truth thinning tool"""
380 MenuTruthThinning = CompFactory.DerivationFramework.MenuTruthThinning
381 acc.addPublicTool(MenuTruthThinning(name, **kwargs),
391 """Configure the truth link repointing tool"""
393 TruthLinkRepointTool = CompFactory.DerivationFramework.TruthLinkRepointTool
394 acc.addPublicTool(TruthLinkRepointTool(name, **kwargs),
401 """Configure the truth PV collection maker tool"""
403 TruthPVCollectionMaker = CompFactory.DerivationFramework.TruthPVCollectionMaker
404 acc.addPublicTool(TruthPVCollectionMaker(name, **kwargs),
410 """Configure the GenericTruthThinning tool"""
412 GenericTruthThinning = CompFactory.DerivationFramework.GenericTruthThinning
413 acc.addPublicTool(GenericTruthThinning(name, **kwargs),