ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
TruthParticleLevelAnalysisAlgorithms
python
ParticleLevelJetsConfig.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
ParticleLevelJetsBlock
(ConfigBlock):
7
"""ConfigBlock for particle-level truth jets"""
8
9
def
__init__
(self):
10
super(ParticleLevelJetsBlock, self).
__init__
()
11
self.addOption(
'containerName'
,
'AntiKt4TruthDressedWZJets'
, type=str,
12
info=
'the name of the input truth jets container.'
)
13
self.addOption(
'outputTruthLabelIDs'
,
False
, type=bool,
14
info=
'enable `HadronConeExclTruthLabelID` and `PartonTruthLabelID` decorations.'
)
15
# Always skip on data
16
self.setOptionValue(
'skipOnData'
,
True
)
17
18
def
instanceName
(self) :
19
"""Return the instance name for this block"""
20
return
self.
containerName
21
22
def
makeAlgs
(self, config):
23
config.setSourceName (self.
containerName
, self.
containerName
)
24
25
# count the number of heavy-flavour jets for normalisation of e.g. V+HF samples
26
if
"AntiKt4"
in
self.
containerName
:
27
alg = config.createAlgorithm(
'CP::ParticleLevelJetsAlg'
,
28
'ParticleLevelJetsAlg'
,
29
reentrant=
True
)
30
alg.jets = self.
containerName
31
32
# decorate the energy so we can save it later
33
alg = config.createAlgorithm(
'CP::AsgEnergyDecoratorAlg'
,
'ParticleLevelEnergyDecorator'
)
34
alg.particles = self.
containerName
35
36
# For some decorations the type is not known at initialization
37
# time, in which case we need to pass it in manually. We could
38
# also pass in the type for all decorations, but is not
39
# necessary and introduces the possibility of a type mismatch.
40
outputVars = [
41
[
'pt'
,
'pt'
,
None
],
42
[
'eta'
,
'eta'
,
None
],
43
[
'phi'
,
'phi'
,
None
],
44
[
'e_%SYS%'
,
'e'
,
None
],
45
[
'GhostBHadronsFinalCount'
,
'nGhosts_bHadron'
,
'int'
],
46
[
'GhostCHadronsFinalCount'
,
'nGhosts_cHadron'
,
'int'
],
47
]
48
49
if
self.
outputTruthLabelIDs
:
50
outputVars += [
51
[
'HadronConeExclTruthLabelID'
,
'HadronConeExclTruthLabelID'
,
None
],
52
[
'PartonTruthLabelID'
,
'PartonTruthLabelID'
,
None
],
53
]
54
55
for
decoration, branch, auxType
in
outputVars:
56
config.addOutputVar (self.
containerName
, decoration, branch, noSys=
True
, auxType=auxType)
57
58
if
"AntiKt4"
in
self.
containerName
:
59
config.addOutputVar(
'EventInfo'
,
'num_truth_bjets_nocuts'
,
'num_truth_bjets_nocuts'
, noSys=
True
)
60
config.addOutputVar(
'EventInfo'
,
'num_truth_cjets_nocuts'
,
'num_truth_cjets_nocuts'
, noSys=
True
)
ParticleLevelJetsConfig.ParticleLevelJetsBlock
Definition
ParticleLevelJetsConfig.py:6
ParticleLevelJetsConfig.ParticleLevelJetsBlock.makeAlgs
makeAlgs(self, config)
Definition
ParticleLevelJetsConfig.py:22
ParticleLevelJetsConfig.ParticleLevelJetsBlock.__init__
__init__(self)
Definition
ParticleLevelJetsConfig.py:9
ParticleLevelJetsConfig.ParticleLevelJetsBlock.outputTruthLabelIDs
outputTruthLabelIDs
Definition
ParticleLevelJetsConfig.py:49
ParticleLevelJetsConfig.ParticleLevelJetsBlock.containerName
containerName
Definition
ParticleLevelJetsConfig.py:23
ParticleLevelJetsConfig.ParticleLevelJetsBlock.instanceName
instanceName(self)
Definition
ParticleLevelJetsConfig.py:18
Generated on
for ATLAS Offline Software by
1.17.0