ATLAS Offline Software
Loading...
Searching...
No Matches
ParticleLevelTausConfig.ParticleLevelTausBlock Class Reference
Inheritance diagram for ParticleLevelTausConfig.ParticleLevelTausBlock:
Collaboration diagram for ParticleLevelTausConfig.ParticleLevelTausBlock:

Public Member Functions

 __init__ (self)
 instanceName (self)
 makeAlgs (self, config)

Public Attributes

name selectionName = name + '_' + self.selectionName
 containerName
 isolated
 saveUID

Detailed Description

ConfigBlock for particle-level truth taus

Definition at line 6 of file ParticleLevelTausConfig.py.

Constructor & Destructor Documentation

◆ __init__()

ParticleLevelTausConfig.ParticleLevelTausBlock.__init__ ( self)

Definition at line 9 of file ParticleLevelTausConfig.py.

9 def __init__(self):
10 super(ParticleLevelTausBlock, self).__init__()
11 self.addOption('containerName', 'TruthTaus', type=str,
12 info='the name of the input truth taus container')
13 self.addOption('selectionName', '', type=str,
14 info='the name of the selection to create. The default is "",'
15 ' which applies the selection to all truth taus.')
16 self.addOption('isolated', True, type=bool,
17 info='select only truth taus that are isolated.')
18 self.addOption('saveUID', False, type=bool,
19 info='save unique ID in output')
20 # Always skip on data
21 self.setOptionValue('skipOnData', True)
22

Member Function Documentation

◆ instanceName()

ParticleLevelTausConfig.ParticleLevelTausBlock.instanceName ( self)
Return the instance name for this block

Definition at line 23 of file ParticleLevelTausConfig.py.

23 def instanceName (self) :
24 """Return the instance name for this block"""
25 name = self.containerName
26 if self.selectionName: name = name + '_' + self.selectionName
27 return name
28

◆ makeAlgs()

ParticleLevelTausConfig.ParticleLevelTausBlock.makeAlgs ( self,
config )

Definition at line 29 of file ParticleLevelTausConfig.py.

29 def makeAlgs(self, config):
30 config.setSourceName (self.containerName, self.containerName)
31
32 # decorate the missing elements of the 4-vector so we can save it later
33 alg = config.createAlgorithm('CP::ParticleLevelPtEtaPhiDecoratorAlg',
34 'ParticleLevelPtEtaPhiDecoratorTaus',
35 reentrant=True)
36 alg.particles = self.containerName
37
38 # decorate the charge so we can save it later
39 alg = config.createAlgorithm('CP::ParticleLevelChargeDecoratorAlg',
40 'ParticleLevelChargeDecoratorTaus',
41 reentrant=True)
42 alg.particles = self.containerName
43
44 # check for prompt isolation and possible origin from tau decays
45 alg = config.createAlgorithm('CP::ParticleLevelIsolationAlg',
46 'ParticleLevelIsolationTaus',
47 reentrant=True)
48 alg.particles = self.containerName
49 alg.isolation = 'isIsolated' + self.selectionName if self.isolated else 'isIsolatedButNotRequired' + self.selectionName
50 alg.notTauOrigin = 'notFromTauButNotRequired' + self.selectionName
51 alg.checkType = 'IsoTau'
52
53 if self.isolated:
54 config.addSelection (self.containerName, self.selectionName, alg.isolation+',as_char')
55
56 # output branches to be scheduled only once
57 if ParticleLevelTausBlock.get_instance_count() == 1 or 'pt' not in config.getOutputVars(self.containerName):
58 outputVars = [
59 ['pt', 'pt'],
60 ['eta', 'eta'],
61 ['phi', 'phi'],
62 ['e', 'e'],
63 ['charge', 'charge'],
64 ]
65 if self.saveUID:
66 outputVars += [['uid', 'uid']]
67 for decoration, branch in outputVars:
68 config.addOutputVar (self.containerName, decoration, branch, noSys=True)

Member Data Documentation

◆ containerName

ParticleLevelTausConfig.ParticleLevelTausBlock.containerName

Definition at line 30 of file ParticleLevelTausConfig.py.

◆ isolated

ParticleLevelTausConfig.ParticleLevelTausBlock.isolated

Definition at line 53 of file ParticleLevelTausConfig.py.

◆ saveUID

ParticleLevelTausConfig.ParticleLevelTausBlock.saveUID

Definition at line 65 of file ParticleLevelTausConfig.py.

◆ selectionName

ParticleLevelTausConfig.ParticleLevelTausBlock.selectionName = name + '_' + self.selectionName

Definition at line 26 of file ParticleLevelTausConfig.py.


The documentation for this class was generated from the following file: