20 #include <vdt/vdtMath.h>
74 rhoToken_(
cc.consumes(conf.getParameter<
edm::
InputTag>(
"rhoTag"))),
75 useClosestToCentreSeedCrysDef_(conf.getParameter<
bool>(
"useClosestToCentreSeedCrysDef")),
76 maxRawEnergyForLowPtEBSigma_(conf.getParameter<double>(
"maxRawEnergyForLowPtEBSigma")),
77 maxRawEnergyForLowPtEESigma_(conf.getParameter<double>(
"maxRawEnergyForLowPtEESigma")) {
78 if (conf.
exists(
"eleRegs")) {
81 if (conf.
exists(
"phoRegs")) {
112 bool rescaleDependentValues = superClus->clusters().
isAvailable();
120 const float rawEnergy = superClus->rawEnergy();
121 const float rawESEnergy = superClus->preshowerEnergy();
123 const float rawEt = rawEnergy * superClus->position().rho() / superClus->position().r();
127 const float ecalMeanCorr = ecalMean > 0. ? ecalMean : 1.0;
140 const float corrEnergy = (rawEnergy + rawESEnergy) * ecalMeanCorr;
141 const float corrEnergyErr = corrEnergy * ecalSigma;
146 std::pair<float, float> combEnergyAndErr =
eleRegs_->epComb.combine(ele);
173 const float rawEnergy = superClus->rawEnergy();
174 const float rawESEnergy = superClus->preshowerEnergy();
176 const float rawEt = rawEnergy * superClus->position().rho() / superClus->position().r();
179 const float ecalMeanCorr = ecalMean > 0. ? ecalMean : 1.0;
190 const double corrEnergy = (rawEnergy + rawESEnergy) * ecalMeanCorr;
191 const double corrEnergyErr = corrEnergy * ecalSigma;
193 pho.
setCorrectedEnergy(reco::Photon::P4type::regression2, corrEnergy, corrEnergyErr,
true);
199 std::array<float, 32>
data;
204 const bool isEB = ele.
isEB();
205 const double rawEnergy = superClus->rawEnergy();
206 const double rawESEnergy = superClus->preshowerEnergy();
207 const int numberOfClusters = superClus->clusters().size();
210 float e5x5Inverse = ssFull5x5.
e5x5 != 0. ? vdt::fast_inv(ssFull5x5.e5x5) : 0.;
213 data[1] = superClus->etaWidth();
214 data[2] = superClus->phiWidth();
215 data[3] = superClus->seed()->energy() / rawEnergy;
216 data[4] = ssFull5x5.e5x5 / rawEnergy;
219 data[7] = seedClus->
eta() - superClus->position().Eta();
221 data[9] = ssFull5x5.r9;
222 data[10] = ssFull5x5.sigmaIetaIeta;
223 data[11] = ssFull5x5.sigmaIetaIphi;
224 data[12] = ssFull5x5.sigmaIphiIphi;
225 data[13] = ssFull5x5.eMax * e5x5Inverse;
226 data[14] = ssFull5x5.e2nd * e5x5Inverse;
227 data[15] = ssFull5x5.eTop * e5x5Inverse;
228 data[16] = ssFull5x5.eBottom * e5x5Inverse;
229 data[17] = ssFull5x5.eLeft * e5x5Inverse;
230 data[18] = ssFull5x5.eRight * e5x5Inverse;
231 data[19] = ssFull5x5.e2x5Max * e5x5Inverse;
232 data[20] = ssFull5x5.e2x5Left * e5x5Inverse;
233 data[21] = ssFull5x5.e2x5Right * e5x5Inverse;
234 data[22] = ssFull5x5.e2x5Top * e5x5Inverse;
235 data[23] = ssFull5x5.e2x5Bottom * e5x5Inverse;
242 int signIEta =
iEta > 0 ? +1 : -1;
246 data[29] = (iPhi - 1) % 2;
247 const int iEtaCorr =
iEta - (
iEta > 0 ? +1 : -1);
248 const int iEtaCorr26 =
iEta - (
iEta > 0 ? +26 : -26);
250 data[31] = (iPhi - 1) % 20;
256 data[28] = rawESEnergy / rawEnergy;
263 std::array<float, 32>
data;
268 const bool isEB = pho.
isEB();
269 const double rawEnergy = superClus->rawEnergy();
270 const double rawESEnergy = superClus->preshowerEnergy();
271 const int numberOfClusters = superClus->clusters().size();
274 float e5x5Inverse = ssFull5x5.
e5x5 != 0. ? vdt::fast_inv(ssFull5x5.e5x5) : 0.;
277 data[1] = superClus->etaWidth();
278 data[2] = superClus->phiWidth();
279 data[3] = superClus->seed()->energy() / rawEnergy;
280 data[4] = ssFull5x5.e5x5 / rawEnergy;
285 data[7] = seedClus->
eta() - superClus->position().Eta();
288 data[10] = ssFull5x5.sigmaIetaIeta;
291 data[11] = ssFull5x5.sigmaIetaIphi;
292 data[12] = ssFull5x5.sigmaIphiIphi;
293 data[13] = ssFull5x5.maxEnergyXtal * e5x5Inverse;
294 data[14] = ssFull5x5.e2nd * e5x5Inverse;
295 data[15] = ssFull5x5.eTop * e5x5Inverse;
296 data[16] = ssFull5x5.eBottom * e5x5Inverse;
297 data[17] = ssFull5x5.eLeft * e5x5Inverse;
298 data[18] = ssFull5x5.eRight * e5x5Inverse;
299 data[19] = ssFull5x5.e2x5Max * e5x5Inverse;
300 data[20] = ssFull5x5.e2x5Left * e5x5Inverse;
301 data[21] = ssFull5x5.e2x5Right * e5x5Inverse;
302 data[22] = ssFull5x5.e2x5Top * e5x5Inverse;
303 data[23] = ssFull5x5.e2x5Bottom * e5x5Inverse;
312 int signIEta =
iEta > 0 ? +1 : -1;
314 data[29] = (iPhi - 1) % 2;
315 const int iEtaCorr =
iEta - (
iEta > 0 ? +1 : -1);
316 const int iEtaCorr26 =
iEta - (
iEta > 0 ? +26 : -26);
318 data[31] = (iPhi - 1) % 20;
324 data[28] = rawESEnergy / rawEnergy;
346 iEtaOrX = ebId.
ieta();
347 iPhiOrY = ebId.iphi();
364 epComb.setEventContent(iSetup);