ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDMaker
egammaD3PDMaker
python
egammaCluster.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3
#
4
# @file egammaD3PDMaker/python/egammaCluster.py
5
# @author scott snyder <snyder@bnl.gov>
6
# @date Mar, 2013
7
# @brief Add cluster information to a egamma D3PD object.
8
#
9
10
11
from
D3PDMakerCoreComps.SimpleAssociation
import
SimpleAssociation
12
from
D3PDMakerCoreComps.ContainedVectorMultiAssociation
import
ContainedVectorMultiAssociation
13
from
AthenaConfiguration.ComponentFactory
import
CompFactory
14
15
D3PD = CompFactory.D3PD
16
17
18
def
egammaCluster (egamma, allSamplings = False, fwdEVars = False):
19
ClusterAssoc = SimpleAssociation \
20
(egamma,
21
D3PD.egammaClusterAssociationTool
)
22
ClusterAssoc.defineBlock \
23
(2,
'ClusterKin'
,
D3PD.FourMomFillerTool
,
24
prefix =
'cl_'
,
25
WriteE =
True
,
26
WriteM =
False
)
27
ClusterAssoc.defineBlock (
28
2,
'ClusterTime'
,
29
D3PD.AuxDataFillerTool
,
30
Vars = [
'time'
],
31
prefix =
'cl_'
)
32
33
ClusterAssoc.defineBlock \
34
(2,
'PositionInCalo'
,
35
# CaloD3PDMaker
36
D3PD.ClusterPositionInCaloFillerTool
,
37
prefix =
'cl_'
)
38
ClusterAssoc.defineBlock \
39
(2,
'Position0InCalo'
,
40
# CaloD3PDMaker
41
D3PD.ClusterPositionInCaloFillerTool
,
42
prefix =
'cl_'
,
43
FillSeedCoordinates=
True
)
44
ClusterAssoc.defineBlock \
45
(2,
'Samplings'
,
46
# CaloD3PDMaker
47
D3PD.ClusterEMSamplingFillerTool
)
48
49
if
allSamplings:
50
ClusterAssoc.defineBlock \
51
(2,
'AllSamplings'
,
52
# CaloD3PDMaker
53
D3PD.ClusterSamplingFillerTool
,
54
EmHadEnergies =
False
,
55
SamplingEnergies =
True
)
56
if
fwdEVars:
57
ClusterAssoc.defineBlock (
58
1,
'FwdEVars'
,
59
D3PD.AuxDataFillerTool
,
60
Vars = [
'firstEdens = FIRST_ENG_DENS < float: 0'
,
61
'cellmaxfrac = ENG_FRAC_MAX < float: 0'
,
62
'longitudinal = LONGITUDINAL < float: 0'
,
63
'secondlambda = SECOND_LAMBDA < float: 0'
,
64
'lateral = LATERAL < float: 0'
,
65
'secondR = SECOND_R < float: 0'
,
66
'centerlambda = CENTER_LAMBDA < float: 0'
,
67
])
68
69
# Allow writing cluster cells.
70
# Off by default.
71
Cells = ContainedVectorMultiAssociation (
72
ClusterAssoc,
73
# CaloD3PDMaker
74
D3PD.CaloClusterCellAssociationTool
,
75
"cell_"
,
76
99,
77
blockname =
'ClusterCells'
)
78
Cells.defineBlock (4,
'CellKinematics'
,
79
D3PD.FourMomFillerTool
,
80
WriteE =
True
, WriteM =
False
)
81
Cells.defineBlock (4,
'CellRawPosition'
,
82
# CaloD3PDMaker
83
D3PD.CaloCellRawFillerTool
)
84
Cells.defineBlock (5,
'CellDetail1'
,
85
# CaloD3PDMaker
86
D3PD.CaloCellDetailsFillerTool
,
87
SaveCellQuality=
True
,
88
SaveTimeInfo=
True
,
89
SaveDetInfo=
True
,
90
SaveCellGain=
True
,
91
SaveBadCellStatus=
False
,
92
SaveId =
False
,
93
SavePositionInfo=
False
,
94
)
95
cellDetail2 = \
96
Cells.defineBlock (6,
'CellDetail2'
,
97
# CaloD3PDMaker
98
D3PD.CaloCellDetailsFillerTool
,
99
SaveCellQuality=
False
,
100
SaveTimeInfo=
False
,
101
SaveDetInfo=
False
,
102
SaveCellGain=
False
,
103
SaveBadCellStatus=
True
,
104
SaveId =
True
,
105
SavePositionInfo=
True
,
106
)
107
def
_cellDetail2Hook (c, flags, acc, *args, **kw):
108
from
CaloBadChannelTool.CaloBadChanToolConfig
import
CaloBadChanToolCfg
109
c.BadChannelTool = acc.popToolsAndMerge (CaloBadChanToolCfg (flags))
110
return
111
cellDetail2.defineHook (_cellDetail2Hook)
112
113
return
ClusterAssoc
D3PD::AuxDataFillerTool
Copy aux data to D3PD.
Definition
AuxDataFillerTool.h:35
D3PD::CaloCellDetailsFillerTool
Block filler tool for EM samplings from a CaloCluster.
Definition
CaloCellDetailsFillerTool.h:34
D3PD::CaloCellRawFillerTool
Block filler tool for calo cell raw eta/phi.
Definition
CaloCellRawFillerTool.h:29
D3PD::CaloClusterCellAssociationTool
Associate from a CaloCluster to CaloCell.
Definition
CaloClusterCellAssociationTool.h:34
D3PD::ClusterEMSamplingFillerTool
Block filler tool for EM samplings from a CaloCluster.
Definition
ClusterEMSamplingFillerTool.h:34
D3PD::ClusterPositionInCaloFillerTool
Block filler tool for eta/phi positions in calo coordinate from a CaloCluster.
Definition
ClusterPositionInCaloFillerTool.h:32
D3PD::ClusterSamplingFillerTool
Block filler tool for EM samplings from a CaloCluster.
Definition
ClusterSamplingFillerTool.h:33
D3PD::FourMomFillerTool
Block filler tool for a four-momentum.
Definition
FourMomFillerTool.h:56
D3PD::egammaClusterAssociationTool
Associate from an egamma to its CaloCluster.
Definition
egammaClusterAssociationTool.h:33
Generated on
for ATLAS Offline Software by
1.17.0