37 #include "CLHEP/Units/GlobalPhysicalConstants.h"
179 bool selected(
const reco::GsfElectronCollection::const_iterator &gsfIter,
double vertexTIP);
180 bool generalCut(
const reco::GsfElectronCollection::const_iterator &gsfIter);
181 bool etCut(
const reco::GsfElectronCollection::const_iterator &gsfIter);
182 bool isolationCut(
const reco::GsfElectronCollection::const_iterator &gsfIter,
double vertexTIP);
183 bool idCut(
const reco::GsfElectronCollection::const_iterator &gsfIter);
286 using namespace reco;
357 ptmax =
pset.getParameter<
double>(
"Ptmax");
358 pmax =
pset.getParameter<
double>(
"Pmax");
418 if (locSC != std::string::npos) {
419 std::cout <<
"Matching objects are SuperClusters " << std::endl;
422 std::cout <<
"Didn't recognize input matching objects!! " << std::endl;
430 hlabel =
"h_" +
type +
"Num";
431 htitle =
"# " +
type +
"s";
433 hlabel =
"h_" +
type +
"_eta";
434 htitle =
type +
" #eta";
436 hlabel =
"h_" +
type +
"_abseta";
437 htitle =
type +
" |#eta|";
439 hlabel =
"h_" +
type +
"_P";
440 htitle =
type +
" p";
442 hlabel =
"h_" +
type +
"_Pt";
443 htitle =
type +
" pt";
445 hlabel =
"h_" +
type +
"_phi";
446 htitle =
type +
" phi";
448 hlabel =
"h_" +
type +
"_z";
449 htitle =
type +
" z";
460 new TH1F(
"h_ele_matchingObjectEta_matched",
"Efficiency vs matching SC #eta",
nbineta,
etamin,
etamax);
463 new TH1F(
"h_ele_matchingObjectAbsEta_matched",
"Efficiency vs matching SC |#eta|",
nbineta / 2, 0., 2.5);
466 new TH1F(
"h_ele_matchingObjectPt_matched",
"Efficiency vs matching SC E_{T}",
nbinpteff, 5.,
ptmax);
469 new TH1F(
"h_ele_matchingObjectPhi_matched",
"Efficiency vs matching SC phi",
nbinphi,
phimin,
phimax);
472 new TH1F(
"h_ele_matchingObjectZ_matched",
"Efficiency vs matching SC z",
nbinxyz, -25, 25);
486 h_ele_vertexTIP =
new TH1F(
"h_ele_vertexTIP",
"ele transverse impact parameter (wrt bs)", 90, 0., 0.15);
487 h_ele_charge =
new TH1F(
"h_ele_charge",
"ele charge", 5, -2., 2.);
495 h_ele_Et->GetXaxis()->SetTitle(
"E_{T} (GeV)");
496 h_ele_Et->GetYaxis()->SetTitle(
"Events");
517 histNum_ =
new TH1F(
"h_recEleNum",
"# rec electrons", 20, 0., 20.);
519 histNum_->GetXaxis()->SetTitle(
"N_{ele}");
520 histNum_->GetYaxis()->SetTitle(
"Events");
530 histSclSigEtaEta_ =
new TH1F(
"h_scl_sigetaeta",
"ele supercluster sigma eta eta", 100, 0., 0.05);
538 new TH2F(
"h_ele_ambiguousTracksVsEta",
"ele # ambiguous tracks vs eta",
nbineta2D,
etamin,
etamax, 5, 0., 5.);
540 new TH2F(
"h_ele_ambiguousTracksVsPhi",
"ele # ambiguous tracks vs phi",
nbinphi2D,
phimin,
phimax, 5, 0., 5.);
542 new TH2F(
"h_ele_ambiguousTracksVsPt",
"ele # ambiguous tracks vs pt",
nbinpt2D, 0.,
ptmax, 5, 0., 5.);
550 h_ele_lostHits =
new TH1F(
"h_ele_lostHits",
"ele track # lost hits", 5, 0., 5.);
557 h_ele_chi2 =
new TH1F(
"h_ele_chi2",
"ele track #chi^{2}", 100, 0., 15.);
580 "ele #eta_{cl} - #eta_{tr}, prop from outermost",
585 "ele #phi_{cl} - #phi_{tr}, prop from outermost",
590 "ele #eta_{EleCl} - #eta_{tr}, prop from outermost",
595 "ele #phi_{EleCl} - #phi_{tr}, prop from outermost",
605 h_ele_PinMnPout =
new TH1F(
"h_ele_PinMnPout",
"ele track inner p - outer p, mean",
nbinp, 0., 200.);
608 h_ele_mva =
new TH1F(
"h_ele_mva",
"ele identification mva", 100, -1., 1.);
609 h_ele_provenance =
new TH1F(
"h_ele_provenance",
"ele provenance", 5, -2., 3.);
626 h_ele_EoP->GetXaxis()->SetTitle(
"E/P_{vertex}");
627 h_ele_EoP->GetYaxis()->SetTitle(
"Events");
645 h_ele_HoE->GetYaxis()->SetTitle(
"Events");
651 h_ele_tkSumPt_dr03 =
new TH1F(
"h_ele_tkSumPt_dr03",
"tk isolation sum, dR=0.3", 100, 0.0, 20.);
654 new TH1F(
"h_ele_hcalDepth1TowerSumEt_dr03",
"hcal depth1 isolation sum, dR=0.3", 100, 0.0, 20.);
656 new TH1F(
"h_ele_hcalDepth2TowerSumEt_dr03",
"hcal depth2 isolation sum, dR=0.3", 100, 0.0, 20.);
657 h_ele_tkSumPt_dr04 =
new TH1F(
"h_ele_tkSumPt_dr04",
"hcal isolation sum", 100, 0.0, 20.);
660 new TH1F(
"h_ele_hcalDepth1TowerSumEt_dr04",
"hcal depth1 isolation sum, dR=0.4", 100, 0.0, 20.);
662 new TH1F(
"h_ele_hcalDepth2TowerSumEt_dr04",
"hcal depth2 isolation sum, dR=0.4", 100, 0.0, 20.);
672 std::cout <<
"efficiency calculation " << std::endl;
676 h_ele_ptEff->Reset();
678 h_ele_ptEff->GetXaxis()->SetTitle(
"p_{T} (GeV/c)");
679 h_ele_ptEff->GetYaxis()->SetTitle(
"Efficiency");
683 h_ele_etaEff->Reset();
685 h_ele_etaEff->Print();
686 h_ele_etaEff->GetXaxis()->SetTitle(
"#eta");
687 h_ele_etaEff->GetYaxis()->SetTitle(
"Efficiency");
691 h_ele_absetaEff->Reset();
693 h_ele_absetaEff->GetXaxis()->SetTitle(
"|#eta|");
694 h_ele_absetaEff->GetYaxis()->SetTitle(
"Efficiency");
698 h_ele_phiEff->Reset();
700 h_ele_phiEff->GetXaxis()->SetTitle(
"#phi (rad)");
701 h_ele_phiEff->GetYaxis()->SetTitle(
"Efficiency");
708 h_ele_zEff->GetXaxis()->SetTitle(
"z (cm)");
709 h_ele_zEff->GetYaxis()->SetTitle(
"Efficiency");
809 h_ele_mee_os->GetXaxis()->SetTitle(
"m_{e^{+}e^{-}} (GeV/c^{2})");
818 h_ele_etaEff->Write();
820 h_ele_phiEff->Write();
821 h_ele_absetaEff->Write();
822 h_ele_ptEff->Write();
871 histNum_->Fill((*gsfElectrons).size());
874 reco::GsfElectronCollection::const_iterator gsfIter;
877 double vertexTIP = (gsfIter->vertex().x() -
bs.position().x()) * (gsfIter->vertex().x() -
bs.position().x()) +
878 (gsfIter->vertex().y() -
bs.position().y()) * (gsfIter->vertex().y() -
bs.position().y());
879 vertexTIP =
sqrt(vertexTIP);
888 h_ele_Et->Fill(gsfIter->superCluster()->energy() / cosh(gsfIter->superCluster()->eta()));
902 double R =
std::sqrt(sclRef->x() * sclRef->x() + sclRef->y() * sclRef->y() + sclRef->z() * sclRef->z());
903 double Rt =
std::sqrt(sclRef->x() * sclRef->x() + sclRef->y() * sclRef->y());
923 h_ele_chi2->Fill(gsfIter->gsfTrack()->normalizedChi2());
924 h_ele_chi2VsEta->Fill(gsfIter->eta(), gsfIter->gsfTrack()->normalizedChi2());
925 h_ele_chi2VsPhi->Fill(gsfIter->phi(), gsfIter->gsfTrack()->normalizedChi2());
926 h_ele_chi2VsPt->Fill(gsfIter->pt(), gsfIter->gsfTrack()->normalizedChi2());
931 h_ele_PinMnPout->Fill(gsfIter->gsfTrack()->innerMomentum().R() - gsfIter->gsfTrack()->outerMomentum().R());
932 h_ele_outerP->Fill(gsfIter->gsfTrack()->outerMomentum().R());
933 h_ele_outerPt->Fill(gsfIter->gsfTrack()->outerMomentum().Rho());
937 h_ele_PinMnPout_mode->Fill(gsfIter->trackMomentumAtVtx().R() - gsfIter->trackMomentumOut().R());
942 h_ele_EoP->Fill(gsfIter->eSuperClusterOverP());
950 h_ele_HoE->Fill(gsfIter->hadronicOverEm());
957 if (gsfIter->ecalDrivenSeed())
959 if (gsfIter->trackerDrivenSeed())
961 if (gsfIter->trackerDrivenSeed() || gsfIter->ecalDrivenSeed())
963 if (gsfIter->trackerDrivenSeed() && !gsfIter->ecalDrivenSeed())
965 if (!gsfIter->trackerDrivenSeed() && gsfIter->ecalDrivenSeed())
979 int matchingObjectNum = 0;
980 reco::SuperClusterCollection::const_iterator moIter;
981 for (moIter = recoClusters->begin(); moIter != recoClusters->end(); moIter++) {
1003 bool okGsfFound =
false;
1004 double gsfOkRatio = 999999.;
1006 reco::GsfElectronCollection::const_iterator gsfIter;
1008 double vertexTIP = (gsfIter->vertex().x() -
bs.position().x()) * (gsfIter->vertex().x() -
bs.position().x()) +
1009 (gsfIter->vertex().y() -
bs.position().y()) * (gsfIter->vertex().y() -
bs.position().y());
1010 vertexTIP =
sqrt(vertexTIP);
1017 reco::GsfElectronCollection::const_iterator gsfIter2;
1018 for (gsfIter2 = gsfIter + 1; gsfIter2 !=
gsfElectrons->end(); gsfIter2++) {
1020 float mee2 = p12.Dot(p12);
1021 bool opsign = (gsfIter->charge() * gsfIter2->charge() < 0.);
1022 float invMass =
sqrt(mee2);
1028 if (
TAGcheckclass_ && (gsfIter->classification() == GsfElectron::SHOWERING || gsfIter->isGap()))
1032 if (
PROBEetcut_ && (gsfIter2->superCluster()->energy() / cosh(gsfIter2->superCluster()->eta()) <
minEt_))
1034 if (
PROBEcheckclass_ && (gsfIter2->classification() == GsfElectron::SHOWERING || gsfIter2->isGap()))
1037 if (invMass < massLow_ || invMass >
massHigh_)
1041 bestGsfElectron = *gsfIter2;
1045 reco::GsfElectronCollection::const_iterator gsfIter2;
1046 for (gsfIter2 = gsfIter + 1; gsfIter2 !=
gsfElectrons->end(); gsfIter2++) {
1048 float mee2 = p12.Dot(p12);
1050 float invMass =
sqrt(mee2);
1056 double dphi = gsfIter->phi() - moIter->phi();
1058 dphi = dphi < 0 ? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi;
1064 double tmpGsfRatio = gsfIter->p() / moIter->energy();
1065 if (fabs(tmpGsfRatio - 1) < fabs(gsfOkRatio - 1) &&
Selection_ != 4) {
1066 gsfOkRatio = tmpGsfRatio;
1067 bestGsfElectron = *gsfIter;
1115 for (
unsigned int i = 0;
i !=
n;
i++) {
1124 for (
unsigned int i = 0;
i !=
n;
i++) {
1147 unsigned int fired = 0;
1148 for (
unsigned int i = 0;
i !=
n;
i++) {
1177 if (gsfIter->pt() <
minPt_)
1180 if (gsfIter->isEB() &&
isEE_)
1182 if (gsfIter->isEE() &&
isEB_)
1196 if (gsfIter->superCluster()->energy() / cosh(gsfIter->superCluster()->eta()) <
minEt_)
1233 if (gsfIter->isEB() && fabs(gsfIter->deltaEtaSuperClusterTrackAtVtx()) <
dEtaMinBarrel_)
1235 if (gsfIter->isEB() && fabs(gsfIter->deltaEtaSuperClusterTrackAtVtx()) >
dEtaMaxBarrel_)
1237 if (gsfIter->isEE() && fabs(gsfIter->deltaEtaSuperClusterTrackAtVtx()) <
dEtaMinEndcaps_)
1239 if (gsfIter->isEE() && fabs(gsfIter->deltaEtaSuperClusterTrackAtVtx()) >
dEtaMaxEndcaps_)
1241 if (gsfIter->isEB() && fabs(gsfIter->deltaPhiSuperClusterTrackAtVtx()) <
dPhiMinBarrel_)
1243 if (gsfIter->isEB() && fabs(gsfIter->deltaPhiSuperClusterTrackAtVtx()) >
dPhiMaxBarrel_)
1245 if (gsfIter->isEE() && fabs(gsfIter->deltaPhiSuperClusterTrackAtVtx()) <
dPhiMinEndcaps_)
1247 if (gsfIter->isEE() && fabs(gsfIter->deltaPhiSuperClusterTrackAtVtx()) >
dPhiMaxEndcaps_)