14 #include "CaloGeoHelpers/CaloSampling.h"
21 const IInterface*
parent) :
32 const EventContext& context)
const
34 bool clusterInBarrel =
true;
48 double totalEnergy = 0;
51 double energyEta = rtrigEmCluster.
eta();
52 double energyPhi = rtrigEmCluster.
phi();
54 energyEta = caloDDE->
eta();
55 energyPhi = caloDDE->
phi();
63 double etaCell = larcell->eta();
64 double phiCell = larcell->phi();
65 double energyCell = larcell->energy();
69 deta = std::abs(etaCell - energyEta);
70 dphi = std::abs(phiCell - energyPhi);
72 if (dphi >
M_PI) dphi = 2. *
M_PI - dphi;
74 bool condition37 = clusterInBarrel &&
75 ((deta <= 0.0375 + 0.0005) && (dphi <= 0.0875 + 0.0005));
76 bool condition55 = (!clusterInBarrel) &&
77 ((deta <= 0.0625 + 0.0005) && (dphi <= 0.0625 + 0.0005));
79 if (condition37 || condition55) {
81 totalEnergy += energyCell;
83 samp = larcell->caloDDE()->getSampling();
84 rtrigEmCluster.
setEnergy(samp, rtrigEmCluster.
energy(samp) + energyCell);
96 for (
const LArCell* larcell : sel3) {
98 double etaCell = larcell->eta();
99 double phiCell = larcell->phi();
100 double energyCell = larcell->energy();
104 deta = std::abs(etaCell - energyEta);
105 dphi = std::abs(phiCell - energyPhi);
106 if (dphi >
M_PI) dphi = 2. *
M_PI - dphi;
109 bool condition37 = clusterInBarrel && ((deta <= 0.0375 + 0.001) && (dphi <= 0.0875 + 0.001));
110 bool condition55 = (!clusterInBarrel) &&
111 ((deta <= 0.0625 + 0.001) && (dphi <= 0.0625 + 0.001));
113 if (condition37 || condition55) {
115 totalEnergy += energyCell;
116 samp = larcell->caloDDE()->getSampling();
117 rtrigEmCluster.
setEnergy(samp, rtrigEmCluster.
energy(samp) + energyCell);
129 rtrigEmCluster.
setEt(rtrigEmCluster.
energy() / cosh(energyEta));
132 return StatusCode::SUCCESS;