40 #include "CLHEP/Units/GlobalPhysicalConstants.h"
123 ptmax =
pset.getParameter<
double>(
"Ptmax");
124 pmax =
pset.getParameter<
double>(
"Pmax");
184 if (locSC != std::string::npos) {
185 std::cout <<
"Matching objects are SuperClusters " << std::endl;
188 std::cout <<
"Didn't recognize input matching objects!! " << std::endl;
196 hlabel =
"h_" +
type +
"Num";
197 htitle =
"# " +
type +
"s";
199 hlabel =
"h_" +
type +
"_eta";
200 htitle =
type +
" #eta";
202 hlabel =
"h_" +
type +
"_abseta";
203 htitle =
type +
" |#eta|";
205 hlabel =
"h_" +
type +
"_P";
206 htitle =
type +
" p";
208 hlabel =
"h_" +
type +
"_Pt";
209 htitle =
type +
" pt";
211 hlabel =
"h_" +
type +
"_phi";
212 htitle =
type +
" phi";
214 hlabel =
"h_" +
type +
"_z";
215 htitle =
type +
" z";
226 new TH1F(
"h_ele_matchingObjectEta_matched",
"Efficiency vs matching SC #eta",
nbineta,
etamin,
etamax);
229 new TH1F(
"h_ele_matchingObjectAbsEta_matched",
"Efficiency vs matching SC |#eta|",
nbineta / 2, 0., 2.5);
232 new TH1F(
"h_ele_matchingObjectPt_matched",
"Efficiency vs matching SC E_{T}",
nbinpteff, 5.,
ptmax);
235 new TH1F(
"h_ele_matchingObjectPhi_matched",
"Efficiency vs matching SC phi",
nbinphi,
phimin,
phimax);
238 new TH1F(
"h_ele_matchingObjectZ_matched",
"Efficiency vs matching SC z",
nbinxyz, -25, 25);
252 h_ele_vertexTIP =
new TH1F(
"h_ele_vertexTIP",
"ele transverse impact parameter (wrt bs)", 90, 0., 0.15);
253 h_ele_charge =
new TH1F(
"h_ele_charge",
"ele charge", 5, -2., 2.);
261 h_ele_Et->GetXaxis()->SetTitle(
"E_{T} (GeV)");
262 h_ele_Et->GetYaxis()->SetTitle(
"Events");
283 histNum_ =
new TH1F(
"h_recEleNum",
"# rec electrons", 20, 0., 20.);
285 histNum_->GetXaxis()->SetTitle(
"N_{ele}");
286 histNum_->GetYaxis()->SetTitle(
"Events");
296 histSclSigEtaEta_ =
new TH1F(
"h_scl_sigetaeta",
"ele supercluster sigma eta eta", 100, 0., 0.05);
304 new TH2F(
"h_ele_ambiguousTracksVsEta",
"ele # ambiguous tracks vs eta",
nbineta2D,
etamin,
etamax, 5, 0., 5.);
306 new TH2F(
"h_ele_ambiguousTracksVsPhi",
"ele # ambiguous tracks vs phi",
nbinphi2D,
phimin,
phimax, 5, 0., 5.);
308 new TH2F(
"h_ele_ambiguousTracksVsPt",
"ele # ambiguous tracks vs pt",
nbinpt2D, 0.,
ptmax, 5, 0., 5.);
316 h_ele_lostHits =
new TH1F(
"h_ele_lostHits",
"ele track # lost hits", 5, 0., 5.);
323 h_ele_chi2 =
new TH1F(
"h_ele_chi2",
"ele track #chi^{2}", 100, 0., 15.);
347 "ele #eta_{cl} - #eta_{tr}, prop from outermost",
352 "ele #phi_{cl} - #phi_{tr}, prop from outermost",
357 "ele #eta_{EleCl} - #eta_{tr}, prop from outermost",
362 "ele #phi_{EleCl} - #phi_{tr}, prop from outermost",
372 h_ele_PinMnPout =
new TH1F(
"h_ele_PinMnPout",
"ele track inner p - outer p, mean",
nbinp, 0., 200.);
375 h_ele_mva =
new TH1F(
"h_ele_mva",
"ele identification mva", 100, -1., 1.);
376 h_ele_provenance =
new TH1F(
"h_ele_provenance",
"ele provenance", 5, -2., 3.);
393 h_ele_EoP->GetXaxis()->SetTitle(
"E/P_{vertex}");
394 h_ele_EoP->GetYaxis()->SetTitle(
"Events");
414 h_ele_HoE->GetYaxis()->SetTitle(
"Events");
420 h_ele_tkSumPt_dr03 =
new TH1F(
"h_ele_tkSumPt_dr03",
"tk isolation sum, dR=0.3", 100, 0.0, 20.);
423 new TH1F(
"h_ele_hcalDepth1TowerSumEt_dr03",
"hcal depth1 isolation sum, dR=0.3", 100, 0.0, 20.);
425 new TH1F(
"h_ele_hcalDepth2TowerSumEt_dr03",
"hcal depth2 isolation sum, dR=0.3", 100, 0.0, 20.);
426 h_ele_tkSumPt_dr04 =
new TH1F(
"h_ele_tkSumPt_dr04",
"hcal isolation sum", 100, 0.0, 20.);
429 new TH1F(
"h_ele_hcalDepth1TowerSumEt_dr04",
"hcal depth1 isolation sum, dR=0.4", 100, 0.0, 20.);
431 new TH1F(
"h_ele_hcalDepth2TowerSumEt_dr04",
"hcal depth2 isolation sum, dR=0.4", 100, 0.0, 20.);
478 std::cout <<
"efficiency calculation " << std::endl;
482 h_ele_ptEff->Reset();
484 h_ele_ptEff->GetXaxis()->SetTitle(
"p_{T} (GeV/c)");
485 h_ele_ptEff->GetYaxis()->SetTitle(
"Efficiency");
489 h_ele_etaEff->Reset();
491 h_ele_etaEff->Print();
492 h_ele_etaEff->GetXaxis()->SetTitle(
"#eta");
493 h_ele_etaEff->GetYaxis()->SetTitle(
"Efficiency");
497 h_ele_absetaEff->Reset();
499 h_ele_absetaEff->GetXaxis()->SetTitle(
"|#eta|");
500 h_ele_absetaEff->GetYaxis()->SetTitle(
"Efficiency");
504 h_ele_phiEff->Reset();
506 h_ele_phiEff->GetXaxis()->SetTitle(
"#phi (rad)");
507 h_ele_phiEff->GetYaxis()->SetTitle(
"Efficiency");
514 h_ele_zEff->GetXaxis()->SetTitle(
"z (cm)");
515 h_ele_zEff->GetYaxis()->SetTitle(
"Efficiency");
617 h_ele_mee_os->GetXaxis()->SetTitle(
"m_{e^{+}e^{-}} (GeV/c^{2})");
626 h_ele_etaEff->Write();
628 h_ele_phiEff->Write();
629 h_ele_absetaEff->Write();
630 h_ele_ptEff->Write();
679 histNum_->Fill((*gsfElectrons).size());
682 reco::GsfElectronCollection::const_iterator gsfIter;
685 double vertexTIP = (gsfIter->vertex().x() -
bs.position().x()) * (gsfIter->vertex().x() -
bs.position().x()) +
686 (gsfIter->vertex().y() -
bs.position().y()) * (gsfIter->vertex().y() -
bs.position().y());
687 vertexTIP =
sqrt(vertexTIP);
697 h_ele_Et->Fill(gsfIter->superCluster()->energy() / cosh(gsfIter->superCluster()->eta()));
711 double R = TMath::Sqrt(sclRef->x() * sclRef->x() + sclRef->y() * sclRef->y() + sclRef->z() * sclRef->z());
712 double Rt = TMath::Sqrt(sclRef->x() * sclRef->x() + sclRef->y() * sclRef->y());
732 h_ele_chi2->Fill(gsfIter->gsfTrack()->normalizedChi2());
733 h_ele_chi2VsEta->Fill(gsfIter->eta(), gsfIter->gsfTrack()->normalizedChi2());
734 h_ele_chi2VsPhi->Fill(gsfIter->phi(), gsfIter->gsfTrack()->normalizedChi2());
735 h_ele_chi2VsPt->Fill(gsfIter->pt(), gsfIter->gsfTrack()->normalizedChi2());
740 h_ele_PinMnPout->Fill(gsfIter->gsfTrack()->innerMomentum().R() - gsfIter->gsfTrack()->outerMomentum().R());
741 h_ele_outerP->Fill(gsfIter->gsfTrack()->outerMomentum().R());
742 h_ele_outerPt->Fill(gsfIter->gsfTrack()->outerMomentum().Rho());
746 h_ele_PinMnPout_mode->Fill(gsfIter->trackMomentumAtVtx().R() - gsfIter->trackMomentumOut().R());
765 h_ele_EoP->Fill(gsfIter->eSuperClusterOverP());
773 h_ele_HoE->Fill(gsfIter->hadronicOverEm());
780 if (gsfIter->ecalDrivenSeed())
782 if (gsfIter->trackerDrivenSeed())
784 if (gsfIter->trackerDrivenSeed() || gsfIter->ecalDrivenSeed())
786 if (gsfIter->trackerDrivenSeed() && !gsfIter->ecalDrivenSeed())
788 if (!gsfIter->trackerDrivenSeed() && gsfIter->ecalDrivenSeed())
802 int matchingObjectNum = 0;
803 reco::SuperClusterCollection::const_iterator moIter;
804 for (moIter = recoClusters->begin(); moIter != recoClusters->end(); moIter++) {
826 bool okGsfFound =
false;
827 double gsfOkRatio = 999999.;
829 reco::GsfElectronCollection::const_iterator gsfIter;
831 double vertexTIP = (gsfIter->vertex().x() -
bs.position().x()) * (gsfIter->vertex().x() -
bs.position().x()) +
832 (gsfIter->vertex().y() -
bs.position().y()) * (gsfIter->vertex().y() -
bs.position().y());
833 vertexTIP =
sqrt(vertexTIP);
840 reco::GsfElectronCollection::const_iterator gsfIter2;
841 for (gsfIter2 = gsfIter + 1; gsfIter2 !=
gsfElectrons->end(); gsfIter2++) {
843 float mee2 = p12.Dot(p12);
844 bool opsign = (gsfIter->charge() * gsfIter2->charge() < 0.);
845 float invMass =
sqrt(mee2);
851 if (
TAGcheckclass_ && (gsfIter->classification() == GsfElectron::SHOWERING || gsfIter->isGap()))
855 if (
PROBEetcut_ && (gsfIter2->superCluster()->energy() / cosh(gsfIter2->superCluster()->eta()) <
minEt_))
857 if (
PROBEcheckclass_ && (gsfIter2->classification() == GsfElectron::SHOWERING || gsfIter2->isGap()))
860 if (invMass < massLow_ || invMass >
massHigh_)
864 bestGsfElectron = *gsfIter2;
868 reco::GsfElectronCollection::const_iterator gsfIter2;
869 for (gsfIter2 = gsfIter + 1; gsfIter2 !=
gsfElectrons->end(); gsfIter2++) {
871 float mee2 = p12.Dot(p12);
873 float invMass =
sqrt(mee2);
879 double dphi = gsfIter->phi() - moIter->phi();
881 dphi = dphi < 0 ? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi;
887 double tmpGsfRatio = gsfIter->p() / moIter->energy();
888 if (fabs(tmpGsfRatio - 1) < fabs(gsfOkRatio - 1) &&
Selection_ != 4) {
889 gsfOkRatio = tmpGsfRatio;
890 bestGsfElectron = *gsfIter;
953 for (
unsigned int i = 0;
i !=
n;
i++) {
962 for (
unsigned int i = 0;
i !=
n;
i++) {
985 unsigned int fired = 0;
986 for (
unsigned int i = 0;
i !=
n;
i++) {
1015 if (gsfIter->pt() <
minPt_)
1018 if (gsfIter->isEB() &&
isEE_)
1020 if (gsfIter->isEE() &&
isEB_)
1034 if (gsfIter->superCluster()->energy() / cosh(gsfIter->superCluster()->eta()) <
minEt_)
1071 if (gsfIter->isEB() && fabs(gsfIter->deltaEtaSuperClusterTrackAtVtx()) <
dEtaMinBarrel_)
1073 if (gsfIter->isEB() && fabs(gsfIter->deltaEtaSuperClusterTrackAtVtx()) >
dEtaMaxBarrel_)
1075 if (gsfIter->isEE() && fabs(gsfIter->deltaEtaSuperClusterTrackAtVtx()) <
dEtaMinEndcaps_)
1077 if (gsfIter->isEE() && fabs(gsfIter->deltaEtaSuperClusterTrackAtVtx()) >
dEtaMaxEndcaps_)
1079 if (gsfIter->isEB() && fabs(gsfIter->deltaPhiSuperClusterTrackAtVtx()) <
dPhiMinBarrel_)
1081 if (gsfIter->isEB() && fabs(gsfIter->deltaPhiSuperClusterTrackAtVtx()) >
dPhiMaxBarrel_)
1083 if (gsfIter->isEE() && fabs(gsfIter->deltaPhiSuperClusterTrackAtVtx()) <
dPhiMinEndcaps_)
1085 if (gsfIter->isEE() && fabs(gsfIter->deltaPhiSuperClusterTrackAtVtx()) >
dPhiMaxEndcaps_)