ATLAS Offline Software
Loading...
Searching...
No Matches
ParticleLevelElectronsConfig.ParticleLevelElectronsBlock Class Reference
Inheritance diagram for ParticleLevelElectronsConfig.ParticleLevelElectronsBlock:
Collaboration diagram for ParticleLevelElectronsConfig.ParticleLevelElectronsBlock:

Public Member Functions

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

Public Attributes

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

Detailed Description

ConfigBlock for particle-level truth electrons

Definition at line 6 of file ParticleLevelElectronsConfig.py.

Constructor & Destructor Documentation

◆ __init__()

ParticleLevelElectronsConfig.ParticleLevelElectronsBlock.__init__ ( self)

Definition at line 9 of file ParticleLevelElectronsConfig.py.

9 def __init__(self):
10 super(ParticleLevelElectronsBlock, self).__init__()
11 self.addOption('containerName', 'TruthElectrons', type=str,
12 info='the name of the input truth electrons container.',
13 meta={'role':'container'})
14 self.addOption('selectionName', '', type=str,
15 info='the name of the selection to create. If left empty, '
16 'applies the selection to all truth electrons.',
17 meta={'role':'selection'})
18 self.addOption('isolated', True, type=bool,
19 info='select only truth electrons that are isolated.')
20 self.addOption('notFromTau', True, type=bool,
21 info='select only truth electrons that did not orginate '
22 'from a tau-lepton decay.')
23 self.addOption('saveUID', False, type=bool,
24 info='save unique ID in output.')
25 # Always skip on data
26 self.setOptionValue('skipOnData', True)
27

Member Function Documentation

◆ instanceName()

ParticleLevelElectronsConfig.ParticleLevelElectronsBlock.instanceName ( self)
Return the instance name for this block

Definition at line 28 of file ParticleLevelElectronsConfig.py.

28 def instanceName (self) :
29 """Return the instance name for this block"""
30 name = self.containerName
31 if self.selectionName: name = name + '_' + self.selectionName
32 return name
33

◆ makeAlgs()

ParticleLevelElectronsConfig.ParticleLevelElectronsBlock.makeAlgs ( self,
config )

Definition at line 34 of file ParticleLevelElectronsConfig.py.

34 def makeAlgs(self, config):
35 config.setSourceName (self.containerName, self.containerName)
36
37 # decorate the charge so we can save it later
38 alg = config.createAlgorithm('CP::ParticleLevelChargeDecoratorAlg',
39 'ParticleLevelChargeDecoratorElectrons',
40 reentrant=True)
41 alg.particles = self.containerName
42
43 # check for prompt isolation and possible origin from tau decays
44 alg = config.createAlgorithm('CP::ParticleLevelIsolationAlg',
45 'ParticleLevelIsolationElectrons',
46 reentrant=True)
47 alg.particles = self.containerName
48 alg.isolation = 'isIsolated' + self.selectionName if self.isolated else 'isIsolatedButNotRequired' + self.selectionName
49 alg.notTauOrigin = 'notFromTau' + self.selectionName if self.notFromTau else 'notFromTauButNotRequired' + self.selectionName
50 alg.checkType = 'IsoElectron'
51
52 if self.isolated:
53 config.addSelection (self.containerName, self.selectionName, alg.isolation+',as_char')
54 if self.notFromTau:
55 config.addSelection (self.containerName, self.selectionName, alg.notTauOrigin+',as_char')
56
57 # output branches to be scheduled only once
58 if 'pt' not in config.getOutputVars(self.containerName):
59 outputVars = [
60 ['pt_dressed', 'pt', 'float'],
61 ['eta_dressed', 'eta', 'float'],
62 ['phi_dressed', 'phi', 'float'],
63 ['e_dressed', 'e', 'float'],
64 ['charge', 'charge', 'float'],
65 ['classifierParticleType', 'type', 'unsigned'],
66 ['classifierParticleOrigin', 'origin', 'unsigned'],
67 ]
68 if self.saveUID:
69 outputVars += [['uid', 'uid', 'int']]
70 for decoration, branch, auxType in outputVars:
71 config.addOutputVar (self.containerName, decoration, branch, noSys=True, auxType=auxType)

Member Data Documentation

◆ containerName

ParticleLevelElectronsConfig.ParticleLevelElectronsBlock.containerName

Definition at line 35 of file ParticleLevelElectronsConfig.py.

◆ isolated

ParticleLevelElectronsConfig.ParticleLevelElectronsBlock.isolated

Definition at line 52 of file ParticleLevelElectronsConfig.py.

◆ notFromTau

ParticleLevelElectronsConfig.ParticleLevelElectronsBlock.notFromTau

Definition at line 54 of file ParticleLevelElectronsConfig.py.

◆ saveUID

ParticleLevelElectronsConfig.ParticleLevelElectronsBlock.saveUID

Definition at line 68 of file ParticleLevelElectronsConfig.py.

◆ selectionName

ParticleLevelElectronsConfig.ParticleLevelElectronsBlock.selectionName = name + '_' + self.selectionName

Definition at line 31 of file ParticleLevelElectronsConfig.py.


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