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 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 electrons.')
16 self.addOption('isolated', True, type=bool,
17 info='select only truth electrons that are isolated.')
18 self.addOption('notFromTau', True, type=bool,
19 info='select only truth electrons that did not orginate '
20 'from a tau decay.')
21 self.addOption('saveUID', False, type=bool,
22 info='save unique ID in output')
23 # Always skip on data
24 self.setOptionValue('skipOnData', True)
25

Member Function Documentation

◆ instanceName()

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

Definition at line 26 of file ParticleLevelElectronsConfig.py.

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

◆ makeAlgs()

ParticleLevelElectronsConfig.ParticleLevelElectronsBlock.makeAlgs ( self,
config )

Definition at line 32 of file ParticleLevelElectronsConfig.py.

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

Member Data Documentation

◆ containerName

ParticleLevelElectronsConfig.ParticleLevelElectronsBlock.containerName

Definition at line 33 of file ParticleLevelElectronsConfig.py.

◆ isolated

ParticleLevelElectronsConfig.ParticleLevelElectronsBlock.isolated

Definition at line 50 of file ParticleLevelElectronsConfig.py.

◆ notFromTau

ParticleLevelElectronsConfig.ParticleLevelElectronsBlock.notFromTau

Definition at line 52 of file ParticleLevelElectronsConfig.py.

◆ saveUID

ParticleLevelElectronsConfig.ParticleLevelElectronsBlock.saveUID

Definition at line 66 of file ParticleLevelElectronsConfig.py.

◆ selectionName

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

Definition at line 29 of file ParticleLevelElectronsConfig.py.


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