ATLAS Offline Software
Loading...
Searching...
No Matches
ParticleLevelPhotonsConfig.ParticleLevelPhotonsBlock Class Reference
Inheritance diagram for ParticleLevelPhotonsConfig.ParticleLevelPhotonsBlock:
Collaboration diagram for ParticleLevelPhotonsConfig.ParticleLevelPhotonsBlock:

Public Member Functions

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

Public Attributes

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

Detailed Description

ConfigBlock for particle-level truth photons

Definition at line 6 of file ParticleLevelPhotonsConfig.py.

Constructor & Destructor Documentation

◆ __init__()

ParticleLevelPhotonsConfig.ParticleLevelPhotonsBlock.__init__ ( self)

Definition at line 9 of file ParticleLevelPhotonsConfig.py.

9 def __init__(self):
10 super(ParticleLevelPhotonsBlock, self).__init__()
11 self.addOption('containerName', 'TruthPhotons', type=str,
12 info='the name of the input truth photons 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 photons.',
17 meta={'role':'selection'})
18 self.addOption('isolated', True, type=bool,
19 info='select only truth photons that are isolated.')
20 self.addOption('isolationVariable', '', type=str,
21 info='variable to use in isolation cuts of the form `var/pT < cut`.')
22 self.addOption('isolationCut', -1, type=float,
23 info='threshold to use in isolation cuts of the form `var/pT < cut`.')
24 self.addOption('saveUID', False, type=bool,
25 info='save unique ID in output.')
26 # Always skip on data
27 self.setOptionValue('skipOnData', True)
28

Member Function Documentation

◆ instanceName()

ParticleLevelPhotonsConfig.ParticleLevelPhotonsBlock.instanceName ( self)
Return the instance name for this block

Definition at line 29 of file ParticleLevelPhotonsConfig.py.

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

◆ makeAlgs()

ParticleLevelPhotonsConfig.ParticleLevelPhotonsBlock.makeAlgs ( self,
config )

Definition at line 35 of file ParticleLevelPhotonsConfig.py.

35 def makeAlgs(self, config):
36 config.setSourceName (self.containerName, self.containerName)
37
38 # decorate the missing elements of the 4-vector so we can save it later
39 alg = config.createAlgorithm('CP::ParticleLevelPtEtaPhiDecoratorAlg',
40 'ParticleLevelPtEtaPhiDecoratorPhotons',
41 reentrant=True)
42 alg.particles = self.containerName
43
44 # check for prompt isolation
45 alg = config.createAlgorithm('CP::ParticleLevelIsolationAlg',
46 'ParticleLevelIsolationPhotons',
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 = 'IsoPhoton'
52 if self.isolationVariable:
53 alg.isoVar = self.isolationVariable
54 alg.isoCut = self.isolationCut
55
56 if self.isolated:
57 config.addSelection (self.containerName, self.selectionName, alg.isolation+',as_char')
58
59 # output branches to be scheduled only once
60 if 'pt' not in config.getOutputVars(self.containerName):
61 outputVars = [
62 ['pt', 'pt', 'float'],
63 ['eta', 'eta', 'float'],
64 ['phi', 'phi', 'float'],
65 ['e', 'e', 'float'],
66 ['classifierParticleType', 'type', 'unsigned'],
67 ['classifierParticleOrigin', 'origin', 'unsigned'],
68 ]
69 if self.saveUID:
70 outputVars += [['uid', 'uid', 'int']]
71 for decoration, branch, auxType in outputVars:
72 config.addOutputVar (self.containerName, decoration, branch, noSys=True, auxType=auxType)

Member Data Documentation

◆ containerName

ParticleLevelPhotonsConfig.ParticleLevelPhotonsBlock.containerName

Definition at line 36 of file ParticleLevelPhotonsConfig.py.

◆ isolated

ParticleLevelPhotonsConfig.ParticleLevelPhotonsBlock.isolated

Definition at line 56 of file ParticleLevelPhotonsConfig.py.

◆ isolationVariable

ParticleLevelPhotonsConfig.ParticleLevelPhotonsBlock.isolationVariable

Definition at line 52 of file ParticleLevelPhotonsConfig.py.

◆ saveUID

ParticleLevelPhotonsConfig.ParticleLevelPhotonsBlock.saveUID

Definition at line 69 of file ParticleLevelPhotonsConfig.py.

◆ selectionName

ParticleLevelPhotonsConfig.ParticleLevelPhotonsBlock.selectionName = name + '_' + self.selectionName

Definition at line 32 of file ParticleLevelPhotonsConfig.py.


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