ATLAS Offline Software
Loading...
Searching...
No Matches
TrigEMClusterCnvTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5
6// EDM include(s):
11
12// Local include(s):
14
15namespace xAODMaker {
16
18 const std::string& name,
19 const IInterface* parent )
20 : AthAlgTool( type, name, parent ) {
21
22 // Declare the interface(s) provided by the tool:
23 declareInterface< ITrigEMClusterCnvTool >( this );
24 }
25
35 StatusCode
37 xAOD::TrigEMClusterContainer* xaod ) const {
38
39 ATH_MSG_DEBUG( "Size of the xAOD container before loop: "
40 << xaod->size() );
41
42 // Number of available samplings:
43 const unsigned int samplings = 25; // Is this really right?...
44
45 // Loop over the AOD objects:
48
49 for( ; aod_itr != aod_end; ++aod_itr ) {
50
51 // Create the xAOD object:
53 xaod->push_back( cluster );
54
55 cluster->setRawEnergy ( ( *aod_itr )->rawEnergy() );
56 cluster->setRawEt ( ( *aod_itr )->rawEt() );
57 cluster->setRawEta ( ( *aod_itr )->rawEta() );
58 cluster->setRawPhi ( ( *aod_itr )->rawPhi() );
59 cluster->setRoIword ( ( *aod_itr )->RoIword() );
60 cluster->setNCells ( ( *aod_itr )->nCells() );
61 cluster->setClusterQuality( ( *aod_itr )->quality() );
62
63 cluster->setEnergy ( ( *aod_itr )->energy() );
64 cluster->setEt ( ( *aod_itr )->et() );
65 cluster->setEta ( ( *aod_itr )->eta() );
66 cluster->setPhi ( ( *aod_itr )->phi() );
67 cluster->setE237 ( ( *aod_itr )->e237() );
68 cluster->setE277 ( ( *aod_itr )->e277() );
69 cluster->setFracs1 ( ( *aod_itr )->fracs1() );
70 cluster->setWeta2 ( ( *aod_itr )->weta2() );
71 cluster->setEhad1 ( ( *aod_itr )->ehad1() );
72 cluster->setEta1 ( ( *aod_itr )->Eta1() );
73 cluster->setEmaxs1 ( ( *aod_itr )->emaxs1() );
74 cluster->setE2tsts1( ( *aod_itr )->e2tsts1() );
75 cluster->setE233 ( ( *aod_itr )->e233() );
76 cluster->setWstot ( ( *aod_itr )->wstot() );
77
78 for( unsigned int i = 0; i < samplings; ++i ) {
79 const CaloSampling::CaloSample sample =
80 static_cast< CaloSampling::CaloSample >( i );
81 const float rawValue = ( *aod_itr )->rawEnergy( sample );
82 if( ! cluster->setRawEnergy( sample, rawValue ) ) {
83 ATH_MSG_WARNING( "Unable to set raw energy for sampling "
84 << sample );
85 }
86 const float value = ( *aod_itr )->energy( sample );
87 if( ! cluster->setEnergy( sample, value ) ) {
88 ATH_MSG_WARNING( "Unable to set energy for sampling "
89 << sample );
90 }
91 }
92
93 ATH_MSG_DEBUG( "rawEnergy: "
94 << ( *aod_itr )->rawEnergy() << "; "
95 << "rawEt: "
96 << ( *aod_itr )->rawEt() << "; "
97 << "rawEta: "
98 << ( *aod_itr )->rawEta() << "; "
99 << "rawPhi: "
100 << ( *aod_itr )->rawPhi() << "; "
101 << std::hex << "m_roiWord: 0x"
102 << ( *aod_itr )->RoIword() << "; " << std::dec
103 << "numberUsedCells: "
104 << ( *aod_itr )->nCells() << "; "
105 << "quality: "
106 << ( *aod_itr )->quality() << ";" );
107
108 if( msg().level() <= MSG::DEBUG ) {
109 for( unsigned int i = 0; i < samplings; ++i ) {
110 const CaloSampling::CaloSample sample =
111 static_cast< CaloSampling::CaloSample >( i );
112 ATH_MSG_DEBUG( "rawEnergySample : "
114 << " = "
115 << ( *aod_itr )->rawEnergy( sample ) << ";" );
116 }
117 }
118
119 ATH_MSG_DEBUG( "energy: "
120 << ( *aod_itr )->energy() << "; "
121 << "et: "
122 << ( *aod_itr )->et() << "; "
123 << "eta: "
124 << ( *aod_itr )->eta() << "; "
125 << "phi: "
126 << ( *aod_itr )->phi() << "; "
127 << "e237: "
128 << ( *aod_itr )->e237() << "; "
129 << "e277: "
130 << ( *aod_itr )->e277() << "; "
131 << "fracs1: "
132 << ( *aod_itr )->fracs1() << "; "
133 << "weta2: "
134 << ( *aod_itr )->weta2() << "; "
135 << "ehad1: "
136 << ( *aod_itr )->ehad1() << "; "
137 << "Eta1: "
138 << ( *aod_itr )->Eta1() << "; "
139 << "emaxs1: "
140 << ( *aod_itr )->emaxs1() << "; "
141 << "e2tsts1: "
142 << ( *aod_itr )->e2tsts1() << "; "
143 << "e233: "
144 << ( *aod_itr )->e233() << "; "
145 << "wstot: "
146 << ( *aod_itr )->wstot() );
147
148 if( msg().level() <= MSG::DEBUG ) {
149 for( unsigned int i = 0; i < samplings; ++i ) {
150 const CaloSampling::CaloSample sample =
151 static_cast< CaloSampling::CaloSample >( i );
152 ATH_MSG_DEBUG( "energySample : "
154 << " = "
155 << ( *aod_itr )->energy( sample ) << ";" );
156 }
157 }
158
159 }
160
161 ATH_MSG_DEBUG( "Size of the xAOD container after loop: "
162 << xaod->size() );
163
164 // Return gracefully:
165 return StatusCode::SUCCESS;
166 }
167
168} // namespace xAODMaker
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
MsgStream & msg() const
static std::string getSamplingName(CaloSample theSample)
Returns a string (name) for each CaloSampling.
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
TrigEMClusterCnvTool(const std::string &type, const std::string &name, const IInterface *parent)
Regular AlgTool constructor.
virtual StatusCode convert(const TrigEMClusterContainer *aod, xAOD::TrigEMClusterContainer *xaod) const override
Function that fills an existing xAOD::TrigEMCluster.
void setClusterQuality(unsigned int)
set quality of cluster built (to be defined)
void setNCells(int)
set number of cells used from RoI
void setRoIword(long)
set RoI Word
void setRawPhi(float)
set Raw Phi (no calibration)
void setRawEnergy(float)
set Raw Energy (no calibration)
void setRawEta(float)
set Raw Eta (no calibration)
void setRawEt(float)
set Raw Et (no calibration)
void setPhi(float)
set Phi (calibrated)
void setEta(float)
set Eta (calibrated)
void setEt(float)
set Et (calibrated)
void setEhad1(float)
set hadronic Energy (first hadronic layer)
void setWeta2(float)
set cluster width (based on a 3x5 cluster - 2nd layer)
void setEnergy(float energy)
set Energy (calibrated)
void setE2tsts1(float)
set second maximum energy in sampling 1 (strip layer)
void setE237(float)
set Energy in a 3x7 cluster (no calibration) around hottest cell
void setE277(float)
set Energy in a 7x7 cluster (no calibration) around hottest cell
void setEmaxs1(float)
set maximum energy in sampling 1 (strip layer)
void setFracs1(float)
set Energy in a 7 strips (around hottest strip) minus energy in 3 strips divided by energy in 3 strip...
void setWstot(float)
set width in first layer
void setE233(float)
set Energy in a 3x3 cluster (no calibration) around hottest cell
void setEta1(float)
set Eta sampling 1 (strip layer)
TrigEMClusterContainer_v1 TrigEMClusterContainer
Define the latest version of the trigger EM cluster container.
TrigEMCluster_v1 TrigEMCluster
Define the latest version of the trigger EM cluster class.