ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
TruthParticleLevelAnalysisAlgorithms
python
ParticleLevelNeutrinosConfig.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3
from
AnalysisAlgorithmsConfig.ConfigBlock
import
ConfigBlock
4
5
6
class
ParticleLevelNeutrinosBlock
(ConfigBlock):
7
"""ConfigBlock for particle-level truth neutrinos"""
8
9
def
__init__
(self):
10
super(ParticleLevelNeutrinosBlock, self).
__init__
()
11
self.addOption(
'containerName'
,
'TruthNeutrinos'
, type=str,
12
info=
'the name of the input truth neutrinos container.'
)
13
self.addOption(
'selectionName'
,
''
, type=str,
14
info=
'the name of the selection to create. If left empty, '
15
'applies the selection to all truth neutrinos.'
)
16
self.addOption(
'isolated'
,
True
, type=bool,
17
info=
'select only truth neutrinos that are isolated.'
)
18
self.addOption(
'notFromTau'
,
True
, type=bool,
19
info=
'select only truth neutrinos that did not orginate '
20
'from a tau decay.'
)
21
# Always skip on data
22
self.setOptionValue(
'skipOnData'
,
True
)
23
24
def
instanceName
(self) :
25
"""Return the instance name for this block"""
26
return
self.
containerName
+
'_'
+ self.
selectionName
27
28
def
makeAlgs
(self, config):
29
config.setSourceName (self.
containerName
, self.
containerName
)
30
31
# decorate the missing elements of the 4-vector so we can save it later
32
alg = config.createAlgorithm(
'CP::ParticleLevelPtEtaPhiDecoratorAlg'
,
33
'ParticleLevelPtEtaPhiEDecoratorNeutrinos'
,
34
reentrant=
True
)
35
alg.particles = self.
containerName
36
37
# check for prompt isolation and possible origin from tau decays
38
alg = config.createAlgorithm(
'CP::ParticleLevelIsolationAlg'
,
39
'ParticleLevelIsolationNeutrinos'
,
40
reentrant=
True
)
41
alg.particles = self.
containerName
42
alg.isolation =
'isIsolated'
+ self.
selectionName
if
self.
isolated
else
'isIsolatedButNotRequired'
+ self.
selectionName
43
alg.notTauOrigin =
'notFromTau'
+ self.
selectionName
if
self.
notFromTau
else
'notFromTauButNotRequired'
+ self.
selectionName
44
alg.checkType =
'Neutrino'
45
46
if
self.
isolated
:
47
config.addSelection (self.
containerName
, self.
selectionName
, alg.isolation+
',as_char'
)
48
if
self.
notFromTau
:
49
config.addSelection (self.
containerName
, self.
selectionName
, alg.notTauOrigin+
',as_char'
)
50
51
# output branches to be scheduled only once
52
if
ParticleLevelNeutrinosBlock.get_instance_count() == 1
or
'pt'
not
in
config.getOutputVars(self.
containerName
):
53
outputVars = [
54
[
'pt'
,
'pt'
,
'float'
],
55
[
'eta'
,
'eta'
,
'float'
],
56
[
'phi'
,
'phi'
,
'float'
],
57
[
'e'
,
'e'
,
'float'
],
58
]
59
for
decoration, branch, auxType
in
outputVars:
60
config.addOutputVar (self.
containerName
, decoration, branch, noSys=
True
, auxType=auxType)
ParticleLevelNeutrinosConfig.ParticleLevelNeutrinosBlock
Definition
ParticleLevelNeutrinosConfig.py:6
ParticleLevelNeutrinosConfig.ParticleLevelNeutrinosBlock.notFromTau
notFromTau
Definition
ParticleLevelNeutrinosConfig.py:48
ParticleLevelNeutrinosConfig.ParticleLevelNeutrinosBlock.isolated
isolated
Definition
ParticleLevelNeutrinosConfig.py:46
ParticleLevelNeutrinosConfig.ParticleLevelNeutrinosBlock.__init__
__init__(self)
Definition
ParticleLevelNeutrinosConfig.py:9
ParticleLevelNeutrinosConfig.ParticleLevelNeutrinosBlock.selectionName
selectionName
Definition
ParticleLevelNeutrinosConfig.py:47
ParticleLevelNeutrinosConfig.ParticleLevelNeutrinosBlock.instanceName
instanceName(self)
Definition
ParticleLevelNeutrinosConfig.py:24
ParticleLevelNeutrinosConfig.ParticleLevelNeutrinosBlock.containerName
containerName
Definition
ParticleLevelNeutrinosConfig.py:29
ParticleLevelNeutrinosConfig.ParticleLevelNeutrinosBlock.makeAlgs
makeAlgs(self, config)
Definition
ParticleLevelNeutrinosConfig.py:28
Generated on
for ATLAS Offline Software by
1.17.0