ATLAS Offline Software
Loading...
Searching...
No Matches
ParticleLevelResonancesConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2
3from AnalysisAlgorithmsConfig.ConfigBlock import ConfigBlock
4
5
6class ParticleLevelResonancesBlock(ConfigBlock):
7 """ConfigBlock for particle-level truth resonances, i.e. unstable objects that """
8 """would NOT be used to build a detector-level final state. This includes """
9 """TruthBoson, TruthBottom, TruthTop, TruthBSM. Provides only basic functionalities, """
10 """like storing the four-vector information, applying pT/eta selections, and thinning."""
11
12 def __init__(self):
13 super(ParticleLevelResonancesBlock, self).__init__()
14 self.addOption('containerName', '', type=str,
15 info='the name of the input truth container. Supported options: `TruthBoson`, `TruthBottom`, `TruthTop`, `TruthBSM`.')
16 # Always skip on data
17 self.setOptionValue('skipOnData', True)
18
19 def instanceName (self) :
20 """Return the instance name for this block"""
21 return self.containerName
22
23 def makeAlgs(self, config):
24 config.setSourceName (self.containerName, self.containerName)
25
26 # decorate the missing elements of the 4-vector so we can save it later
27 alg = config.createAlgorithm('CP::ParticleLevelPtEtaPhiDecoratorAlg',
28 'ParticleLevelPtEtaPhiEDecoratorResonances',
29 reentrant=True)
30 alg.particles = self.containerName
31
32 outputVars = [
33 ['pt', 'pt', 'float'],
34 ['eta', 'eta', 'float'],
35 ['phi', 'phi', 'float'],
36 ['m', 'm', 'float'],
37 ['classifierParticleType', 'type', 'unsigned'],
38 ['classifierParticleOrigin', 'origin', 'unsigned'],
39 ['pdgId', 'pdgId', 'int'],
40 ['status', 'status', 'int'],
41 ]
42 for decoration, branch, auxType in outputVars:
43 config.addOutputVar (self.containerName, decoration, branch, noSys=True, auxType=auxType)