201 const auto &
photons = *photonsHandle;
208 if (!(mcIter->pdgId() == 22))
210 if (mcIter->mother() !=
nullptr && !(mcIter->mother()->pdgId() == 25))
212 if (fabs(mcIter->eta()) > 2.5)
217 float mcPhi = mcIter->phi();
218 float mcEta = mcIter->eta();
220 float mcEnergy = mcIter->energy();
222 double dR = 9999999.;
223 float minDr = 10000.;
225 bool matched =
false;
226 for (
size_t ipho = 0; ipho <
photons.size(); ipho++) {
229 double dphi = pho->phi() - mcPhi;
231 dphi = dphi < 0 ? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi;
233 double deta = pho->superCluster()->position().eta() - mcEta;
236 if (dR < 0.1 && dR < minDr) {
249 bool phoIsInBarrel =
false;
250 bool phoIsInEndcap =
false;
252 float phoEta = matchingPho->superCluster()->position().eta();
253 if (fabs(phoEta) < 1.479) {
254 phoIsInBarrel =
true;
256 phoIsInEndcap =
true;
259 float photonE = matchingPho->energy();
260 float sigmaEoE = matchingPho->getCorrectedEnergyError(matchingPho->getCandidateP4type()) / matchingPho->energy();
261 float photonEt = matchingPho->energy() / cosh(matchingPho->eta());
264 float r9 = matchingPho->r9();
265 float full5x5_r9 = matchingPho->full5x5_r9();
266 float r1 = matchingPho->r1x5();
267 float r2 = matchingPho->r2x5();
268 float sieie = matchingPho->sigmaIetaIeta();
269 float full5x5_sieie = matchingPho->full5x5_sigmaIetaIeta();
270 float hOverE = matchingPho->hadronicOverEm();
271 float newhOverE = matchingPho->hadTowOverEm();
272 float ecalIso = matchingPho->ecalRecHitSumEtConeDR04();
273 float hcalIso = matchingPho->hcalTowerSumEtConeDR04();
274 float newhcalIso = matchingPho->hcalTowerSumEtBcConeDR04();
275 float trkIso = matchingPho->trkSumPtSolidConeDR04();
276 float nIsoTrk = matchingPho->nTrkSolidConeDR04();
278 float chargedHadIso = matchingPho->chargedHadronIso();
279 float neutralHadIso = matchingPho->neutralHadronIso();
280 float photonIso = matchingPho->photonIso();
edm::EDGetTokenT< reco::GenParticleCollection > genpartToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * h_full5x5_sigmaIetaIeta_[3][3]
MonitorElement * h_r1_[3][3]
MonitorElement * h_full5x5_r9_[3][3]
MonitorElement * h_phoSigmaEoE_[3][3]
MonitorElement * h_nHadIso_[3]
MonitorElement * h_ecalRecHitSumEtConeDR04_[3][3]
MonitorElement * h_sigmaIetaIeta_[3][3]
MonitorElement * h_chHadIso_[3]
MonitorElement * h_hcalTowerBcSumEtConeDR04_[3][3]
MonitorElement * h_newhOverE_[3][3]
MonitorElement * h_isoTrkSolidConeDR04_[3][3]
MonitorElement * h_phoIso_[3]
MonitorElement * h_nTrkSolidConeDR04_[3][3]
MonitorElement * h_hOverE_[3][3]
MonitorElement * h_scPhi_[2]
MonitorElement * h_phoERes_[3][3]
MonitorElement * h_phoE_[2][3]
MonitorElement * h_r9_[3][3]
edm::EDGetTokenT< edm::View< pat::Photon > > photonToken_
MonitorElement * h_phoEt_[2][3]
MonitorElement * h_hcalTowerSumEtConeDR04_[3][3]
MonitorElement * h_r2_[3][3]
MonitorElement * h_scEta_[2]
Power< A, B >::type pow(const A &a, const B &b)