14 :
16
17 const CaloClusterCellLink* cellLinks = clus->
getCellLinks();
18 if (!cellLinks) {
20 } else {
21
22
24 if (!caloCells) {
27
28
30 } else {
31
32 CaloClusterCellLink::const_iterator it_cell = cellLinks->
begin(),
33 it_cell_e = cellLinks->
end();
34
35
36 double emax = 0.;
37 std::pair<const CaloCell*,double> maxcell{nullptr,0};
38 for(; it_cell != it_cell_e; ++it_cell) {
39 const CaloCell*
cell = (*it_cell);
40 if (cell) {
41 if (!
cell->caloDDE()) {
43 <<
cell->eta() <<
" phi = " <<
cell->phi());
44 continue;
45 }
46 int layer =
cell->caloDDE()->getSampling();
47 if (layer == CaloSampling::EMB2 || layer == CaloSampling::EME2) {
49 double eCell =
cell->energy();
50 if (UseWeightForMaxCell) eCell *=
w;
51 if (eCell > emax) {
52 emax = eCell;
55 }
56 }
57 }
58 }
59
60 if (emax > 0) {
61 etaCell = maxcell.first->caloDDE()->eta_raw();
62 phiCell = maxcell.first->caloDDE()->phi_raw();
65 double etaAmax = clus->
etamax(sam);
66 double phiAmax = clus->
phimax(sam);
69 << " maximum layer 2 energy cell, E = " << maxcell.first->energy()
70 << " check E = " << vemax
71 << " w = " << maxcell.second << "\n"
72 <<
" in calo frame, eta = " <<
etaCell <<
" phi = " <<
phiCell <<
"\n"
73 << " in ATLAS frame, eta = " << etaAmax << " phi = " << phiAmax);
74 }
75 } else {
76 ATH_MSG_WARNING(
"No layer 2 cell with positive energy ! Should never happen");
77 sc = StatusCode::FAILURE;
78 }
79 sc = StatusCode::SUCCESS;
80 }
81 }
82 }
#define ATH_MSG_WARNING(x)
AthMessaging()
Default constructor:
bool msgLvl(const MSG::Level lvl) const
Test the output level.
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.
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.