ATLAS Offline Software
Public Member Functions | List of all members
ParticleLevelPhotonsConfig.ParticleLevelPhotonsBlock Class Reference
Inheritance diagram for ParticleLevelPhotonsConfig.ParticleLevelPhotonsBlock:
Collaboration diagram for ParticleLevelPhotonsConfig.ParticleLevelPhotonsBlock:

Public Member Functions

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

Detailed Description

ConfigBlock for particle-level truth photons

Definition at line 6 of file ParticleLevelPhotonsConfig.py.

Constructor & Destructor Documentation

◆ __init__()

def 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  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 photons.')
16  self.addOption('isolated', True, type=bool,
17  info='select only truth photons that are isolated.')
18  self.addOption('isolationVariable', '', type=str,
19  info='variable to use in isolation cuts of the form "var/pT < cut".')
20  self.addOption('isolationCut', -1, type=float,
21  info='threshold to use in isolation cuts of the form "var/pT < cut".')
22  # Always skip on data
23  self.setOptionValue('skipOnData', True)
24 

Member Function Documentation

◆ instanceName()

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

Definition at line 25 of file ParticleLevelPhotonsConfig.py.

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

◆ makeAlgs()

def ParticleLevelPhotonsConfig.ParticleLevelPhotonsBlock.makeAlgs (   self,
  config 
)

Definition at line 29 of file ParticleLevelPhotonsConfig.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  'ParticleLevelPtEtaPhiDecoratorPhotons',
35  reentrant=True)
36  alg.particles = self.containerName
37 
38  # check for prompt isolation
39  alg = config.createAlgorithm('CP::ParticleLevelIsolationAlg',
40  'ParticleLevelIsolationPhotons',
41  reentrant=True)
42  alg.particles = self.containerName
43  alg.isolation = 'isIsolated' + self.selectionName if self.isolated else 'isIsolatedButNotRequired' + self.selectionName
44  alg.notTauOrigin = 'notFromTauButNotRequired' + self.selectionName
45  alg.checkType = 'IsoPhoton'
46  if self.isolationVariable != '':
47  alg.isoVar = self.isolationVariable
48  alg.isoCut = self.isolationCut
49 
50  if self.isolated:
51  config.addSelection (self.containerName, self.selectionName, alg.isolation+',as_char')
52 
53  # output branches to be scheduled only once
54  if ParticleLevelPhotonsBlock.get_instance_count() == 1 or 'pt' not in config.getOutputVars(self.containerName):
55  outputVars = [
56  ['pt', 'pt'],
57  ['eta', 'eta'],
58  ['phi', 'phi'],
59  ['e', 'e'],
60  ['classifierParticleType', 'type'],
61  ['classifierParticleOrigin', 'origin'],
62  ]
63  for decoration, branch in outputVars:
64  config.addOutputVar (self.containerName, decoration, branch, noSys=True)

The documentation for this class was generated from the following file:
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18