156{
157 const CaloClusterCellLink* cellLinks = clus->
getCellLinks();
158 if (!cellLinks) {
160 return StatusCode::FAILURE;
161 }
162
163
164
166 if (!caloCells) {
168 return StatusCode::FAILURE;
169 }
170
171
172
175 return StatusCode::FAILURE;
176 }
177
178 CaloClusterCellLink::const_iterator it_cell = cellLinks->
begin(),
179 it_cell_e = cellLinks->
end();
180
181
182 double emax = 0.;
183 std::pair<const CaloCell*,double> maxcell{nullptr,0};
184 for(; it_cell != it_cell_e; ++it_cell) {
185 const CaloCell*
cell = (*it_cell);
186 if (cell) {
187 if (!
cell->caloDDE()) {
189 <<
cell->eta() <<
" phi = " <<
cell->phi());
190 continue;
191 }
192 int layer =
cell->caloDDE()->getSampling();
193 if (layer == CaloSampling::EMB2 || layer == CaloSampling::EME2) {
195 double eCell =
cell->energy();
197 if (eCell > emax) {
198 emax = eCell;
199 maxcell.first =
cell;
201 }
202 }
203 }
204 }
205
206 if (emax > 0) {
207 etamax = maxcell.first->caloDDE()->eta_raw();
208 phimax = maxcell.first->caloDDE()->phi_raw();
209 if (msgLvl(MSG::DEBUG)) {
211 double etaAmax = clus->
etamax(sam);
212 double phiAmax = clus->
phimax(sam);
215 << " maximum layer 2 energy cell, E = " << maxcell.first->energy()
216 << " check E = " << vemax
217 << " w = " << maxcell.second << "\n"
218 << " in calo frame, eta = " << etamax << " phi = " << phimax << "\n"
219 << " in ATLAS frame, eta = " << etaAmax << " phi = " << phiAmax);
220 }
221 } else {
222 ATH_MSG_WARNING(
"No layer 2 cell with positive energy ! Should never happen");
223 return StatusCode::FAILURE;
224 }
225 return StatusCode::SUCCESS;
226}
weight_t weight() const
Accessor for weight associated to this cell.
const CaloCellContainer * getCellContainer() const
Method to access underlying cell container.
const_iterator end() const
const end method
const DataLink< CaloCellContainer > & getCellContainerLink() const
const_iterator begin() const
const begin method
const ID_type & dataID() const
Get the key that we reference, as a string.
SG::ReadHandleKey< CaloCellContainer > m_SGKey_CaloCells
Gaudi::Property< bool > m_UseWeightForMaxCell
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version)
float energy_max(const CaloSample sampling) const
Retrieve maximum cell energy in given sampling.
float energyBE(const unsigned layer) const
Get the energy in one layer of the EM Calo.
float etamax(const CaloSample sampling) const
Retrieve of cell with maximum energy in given sampling.
float phimax(const CaloSample sampling) const
Retrieve of cell with maximum energy in given sampling.