ATLAS Offline Software
Loading...
Searching...
No Matches
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
11from D3PDMakerCoreComps.SimpleAssociation import SimpleAssociation
12from D3PDMakerCoreComps.ContainedVectorMultiAssociation import ContainedVectorMultiAssociation
13from AthenaConfiguration.ComponentFactory import CompFactory
14
15D3PD = CompFactory.D3PD
16
17
18def egammaCluster (egamma, allSamplings = False, fwdEVars = False):
19 ClusterAssoc = SimpleAssociation \
20 (egamma,
22 ClusterAssoc.defineBlock \
23 (2, 'ClusterKin', D3PD.FourMomFillerTool,
24 prefix = 'cl_',
25 WriteE = True,
26 WriteM = False)
27 ClusterAssoc.defineBlock (
28 2, 'ClusterTime',
30 Vars = ['time'],
31 prefix = 'cl_')
32
33 ClusterAssoc.defineBlock \
34 (2, 'PositionInCalo',
35 # CaloD3PDMaker
37 prefix = 'cl_')
38 ClusterAssoc.defineBlock \
39 (2, 'Position0InCalo',
40 # CaloD3PDMaker
42 prefix = 'cl_',
43 FillSeedCoordinates=True)
44 ClusterAssoc.defineBlock \
45 (2, 'Samplings',
46 # CaloD3PDMaker
48
49 if allSamplings:
50 ClusterAssoc.defineBlock \
51 (2, 'AllSamplings',
52 # CaloD3PDMaker
54 EmHadEnergies = False,
55 SamplingEnergies = True)
56 if fwdEVars:
57 ClusterAssoc.defineBlock (
58 1, 'FwdEVars',
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
75 "cell_",
76 99,
77 blockname = 'ClusterCells')
78 Cells.defineBlock (4, 'CellKinematics',
80 WriteE = True, WriteM = False)
81 Cells.defineBlock (4, 'CellRawPosition',
82 # CaloD3PDMaker
84 Cells.defineBlock (5, 'CellDetail1',
85 # CaloD3PDMaker
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
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
Copy aux data to D3PD.
Block filler tool for EM samplings from a CaloCluster.
Block filler tool for calo cell raw eta/phi.
Associate from a CaloCluster to CaloCell.
Block filler tool for EM samplings from a CaloCluster.
Block filler tool for eta/phi positions in calo coordinate from a CaloCluster.
Block filler tool for EM samplings from a CaloCluster.
Block filler tool for a four-momentum.
Associate from an egamma to its CaloCluster.