19 #include "CLHEP/Units/GlobalPhysicalConstants.h" 164 iBooker,
"vertexPt_barrel",
"ele transverse momentum in barrel",
nbinpt, 0.,
ptmax,
"p_{T vertex} (GeV/c)");
166 iBooker,
"vertexPt_endcaps",
"ele transverse momentum in endcaps",
nbinpt, 0.,
ptmax,
"p_{T vertex} (GeV/c)");
170 "ele momentum #eta vs #phi",
180 iBooker,
"vertexXvsY",
"ele vertex x vs y",
nbinxyz2D, -0.1, 0.1,
nbinxyz2D, -0.1, 0.1,
"x (cm)",
"y (cm)");
187 h1_chi2 =
bookH1(iBooker,
"chi2",
"ele track #chi^{2}", 100, 0., 15.,
"#Chi^{2}");
189 iBooker,
"chi2VsEta",
"ele track #chi^{2} vs #eta",
nbineta2D,
etamin,
etamax, 0., 15.,
"#eta",
"<#chi^{2}>");
192 "ele track #chi^{2} vs #phi",
203 "ele track # found hits vs #eta",
213 "ele track # found hits vs #phi",
221 h1_lostHits =
bookH1(iBooker,
"lostHits",
"ele track # lost hits", 5, 0., 5.,
"N_{lost hits}");
224 "ele track # lost hits vs #eta",
234 "ele track # lost hits vs #eta",
248 "ele E/P_{vertex} vs #phi",
257 bookH1(iBooker,
"EeleOPout_barrel",
"ele E_{ele}/P_{out} in barrel",
nbineop, 0.,
eopmax,
"E_{ele}/P_{out}");
259 bookH1(iBooker,
"EeleOPout_endcaps",
"ele E_{ele}/P_{out} in endcaps",
nbineop, 0.,
eopmax,
"E_{ele}/P_{out}");
261 "dEtaSc_propVtx_barrel",
262 "ele #eta_{sc} - #eta_{tr}, prop from vertex, in barrel",
266 "#eta_{sc} - #eta_{tr}");
268 "dEtaSc_propVtx_endcapsPos",
269 "ele #eta_{sc} - #eta_{tr}, prop from vertex, in positive endcap",
273 "#eta_{sc} - #eta_{tr}");
275 "dEtaSc_propVtx_endcapsNeg",
276 "ele #eta_{sc} - #eta_{tr}, prop from vertex, in negative endcap",
280 "#eta_{sc} - #eta_{tr}");
282 "dEtaSc_propVtxVsPhi",
283 "ele #eta_{sc} - #eta_{tr}, prop from vertex vs #phi",
290 "<#eta_{sc} - #eta_{tr}>");
292 "dEtaEleCl_propOut_barrel",
293 "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, in barrel",
297 "#eta_{elecl} - #eta_{tr}");
299 "dEtaEleCl_propOut_endcapsPos",
300 "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, in positive endcap",
304 "#eta_{elecl} - #eta_{tr}");
306 "dEtaEleCl_propOut_endcapsNeg",
307 "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, in negative endcap",
311 "#eta_{elecl} - #eta_{tr}");
313 "dPhiSc_propVtx_barrel",
314 "ele #phi_{sc} - #phi_{tr}, prop from vertex, in barrel",
318 "#phi_{sc} - #phi_{tr} (rad)");
320 "dPhiSc_propVtx_endcapsPos",
321 "ele #phi_{sc} - #phi_{tr}, prop from vertex, in positive endcap",
325 "#phi_{sc} - #phi_{tr} (rad)");
327 "dPhiSc_propVtx_endcapsNeg",
328 "ele #phi_{sc} - #phi_{tr}, prop from vertex, in negative endcap",
332 "#phi_{sc} - #phi_{tr} (rad)");
334 "dPhiSc_propVtxVsPhi",
335 "ele #phi_{sc} - #phi_{tr}, prop from vertex vs #phi",
342 "<#phi_{sc} - #phi_{tr}> (rad)");
344 "dPhiEleCl_propOut_barrel",
345 "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, in barrel",
349 "#phi_{elecl} - #phi_{tr} (rad)");
351 "dPhiEleCl_propOut_endcapsPos",
352 "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, in positive endcap",
356 "#phi_{elecl} - #phi_{tr} (rad)");
358 "dPhiEleCl_propOut_endcapsNeg",
359 "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, in negative endcap",
363 "#phi_{elecl} - #phi_{tr} (rad)");
366 "ele hadronic energy / em energy, in barrel",
375 "ele hadronic energy / em energy, in endcaps",
384 "ele hadronic energy / em energy vs #phi",
394 bookH1(iBooker,
"sclSigEtaEta_barrel",
"ele sigma eta eta in barrel", 100, 0., 0.05,
"sietaieta");
396 bookH1(iBooker,
"sclSigEtaEta_endcaps",
"ele sigma eta eta in endcaps", 100, 0., 0.05,
"sietaieta");
398 bookH1(iBooker,
"sigIEtaIEta5x5_barrel",
"ele sigma ieta ieta 5x5 in barrel", 100, 0., 0.05,
"sietaieta5x5");
400 bookH1(iBooker,
"sigIEtaIEta5x5_endcaps",
"ele sigma ieta ieta 5x5 in endcaps", 100, 0., 0.05,
"sietaieta5x5");
403 h1_fbrem =
bookH1(iBooker,
"fbrem",
"ele brem fraction", 100, 0., 1.,
"P_{in} - P_{out} / P_{in}");
406 "ele brem fraction vs #eta",
413 "<P_{in} - P_{out} / P_{in}>");
416 "ele brem fraction vs #phi",
423 "<P_{in} - P_{out} / P_{in}>");
424 h1_classes =
bookH1(iBooker,
"classes",
"ele electron classes", 10, 0.0, 10.);
427 h1_mva =
bookH1(iBooker,
"mva",
"ele identification mva", 100, -1., 1.,
"mva");
432 iBooker,
"tkSumPt_dr03",
"tk isolation sum, dR=0.3", 100, 0.0, 20.,
"TkIsoSum (GeV/c)",
"Events",
"ELE_LOGY E1 P");
434 "ecalRecHitSumEt_dr03",
435 "ecal isolation sum, dR=0.3",
443 "hcalTowerSumEt_dr03",
444 "hcal isolation sum, dR=0.3",
455 "Charged PF candidate sum, dR=0.3",
459 "PF charged (GeV/c)",
464 "Neutral EM PF candidate sum, dR=0.3",
468 "PF neutral EM (GeV)",
473 "Neutral Had PF candidate sum, dR=0.3",
477 "PF neutral Had (GeV)",
486 "ele pairs invariant mass, opposite sign",
490 "m_{e^{+}e^{-}} (GeV/c^{2})");
493 "ele pairs invariant mass, opposite sign, barrel-barrel",
497 "m_{e^{+}e^{-}} (GeV/c^{2})");
500 "ele pairs invariant mass, opposite sign, endcap-endcap",
504 "m_{e^{+}e^{-}} (GeV/c^{2})");
507 "ele pairs invariant mass, opposite sign, barrel-endcap",
511 "m_{e^{+}e^{-}} (GeV/c^{2})");
521 if (std::string::npos !=
std::string(
l.module).find(
"SuperCluster", 0)) {
522 matchingObjectType =
"SC";
524 if (matchingObjectType.empty()) {
525 edm::LogError(
"ElectronMcFakeValidator::beginJob") <<
"Unknown matching object type !";
527 edm::LogInfo(
"ElectronMcFakeValidator::beginJob") <<
"Matching object type: " << matchingObjectType;
532 iBooker,
"matchingObject_Eta", matchingObjectType +
" #eta",
nbineta,
etamin,
etamax,
"#eta_{SC}");
535 iBooker,
"matchingObject_Pt", matchingObjectType +
" pt",
nbinpteff, 5.,
ptmax,
"pt_{SC} (GeV/c)");
537 iBooker,
"matchingObject_Phi", matchingObjectType +
" #phi",
nbinphi,
phimin,
phimax,
"#phi (rad)");
540 iBooker,
"matchedObject_Eta",
"Efficiency vs matching SC #eta",
nbineta,
etamin,
etamax,
"#eta_{SC}");
542 iBooker,
"matchedObject_Pt",
"Efficiency vs matching SC E_{T}",
nbinpteff, 5.,
ptmax,
"pt_{SC} (GeV/c)");
544 iBooker,
"matchedObject_Phi",
"Efficiency vs matching SC #phi",
nbinphi,
phimin,
phimax,
"#phi (rad)");
570 <<
" from event " << ievt <<
" in run " << irun <<
" and lumiblock " << ils;
574 reco::GsfElectronCollection::const_iterator gsfIter;
577 double vertexTIP = (gsfIter->vertex().x() -
bs.position().x()) * (gsfIter->vertex().x() -
bs.position().x()) +
578 (gsfIter->vertex().y() -
bs.position().y()) * (gsfIter->vertex().y() -
bs.position().y());
579 vertexTIP =
sqrt(vertexTIP);
586 reco::GsfElectronCollection::const_iterator gsfIter2;
587 for (gsfIter2 = gsfIter + 1; gsfIter2 !=
gsfElectrons->end(); gsfIter2++) {
592 if (((gsfIter->charge()) * (gsfIter2->charge())) < 0.) {
594 if (gsfIter->isEB() && gsfIter2->isEB())
596 else if (gsfIter->isEE() && gsfIter2->isEE())
616 double R = TMath::Sqrt(sclRef->x() * sclRef->x() + sclRef->y() * sclRef->y() + sclRef->z() * sclRef->z());
617 double Rt = TMath::Sqrt(sclRef->x() * sclRef->x() + sclRef->y() * sclRef->y());
628 h1_chi2->
Fill(gsfIter->gsfTrack()->normalizedChi2());
634 if (gsfIter->isEB()) {
645 if (gsfIter->isEE()) {
648 if (gsfIter->eta() > 0) {
672 int eleClass = gsfIter->classification();
679 if (gsfIter->ecalDrivenSeed())
681 if (gsfIter->trackerDrivenSeed())
683 if (gsfIter->trackerDrivenSeed() || gsfIter->ecalDrivenSeed())
685 if (gsfIter->trackerDrivenSeed() && !gsfIter->ecalDrivenSeed())
687 if (!gsfIter->trackerDrivenSeed() && gsfIter->ecalDrivenSeed())
703 int matchingObjectNum = 0;
704 reco::SuperClusterCollection::const_iterator moIter;
705 for (moIter = recoClusters->begin(); moIter != recoClusters->end(); moIter++) {
719 bool okGsfFound =
false;
720 double gsfOkRatio = 999999999.;
722 reco::GsfElectronCollection::const_iterator gsfIter;
724 double vertexTIP = (gsfIter->vertex().x() -
bs.position().x()) * (gsfIter->vertex().x() -
bs.position().x()) +
725 (gsfIter->vertex().y() -
bs.position().y()) * (gsfIter->vertex().y() -
bs.position().y());
726 vertexTIP =
sqrt(vertexTIP);
734 double dphi = gsfIter->phi() - moIter->phi();
736 dphi = dphi < 0 ? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi;
738 double deltaR =
sqrt(
pow((moIter->eta() - gsfIter->eta()), 2) +
pow(dphi, 2));
740 double tmpGsfRatio = gsfIter->p() / moIter->energy();
742 gsfOkRatio = tmpGsfRatio;
743 bestGsfElectron = *gsfIter;
763 float mee2 = p12.Dot(p12);
764 float invMass = mee2 > 0. ?
sqrt(mee2) : 0;
783 if (gsfIter->pt() <
minPt_)
786 if (gsfIter->isEB() &&
isEE_)
788 if (gsfIter->isEE() &&
isEB_)
802 if (gsfIter->superCluster()->energy() / cosh(gsfIter->superCluster()->eta()) <
minEt_)
MonitorElement * h1_foundHits
T getParameter(std::string const &) const
MonitorElement * h1_dEtaSc_propVtx_endcapsPos
double hadronicOverEmMaxEndcaps_
MonitorElement * h1_mee_os
bool selected(const reco::GsfElectronCollection::const_iterator &gsfIter, double vertexTIP)
MonitorElement * h1_dPhiSc_propVtx_barrel
virtual void setCurrentFolder(std::string const &fullpath)
MonitorElement * h1_vertexPt_barrel
MonitorElement * h1_PFch_dr03
MonitorElement * py_lostHitsVsEta
MonitorElement * h1_mee_os_bb
MonitorElement * h1_sclSigEtaEta_barrel
MonitorElement * py_chi2VsEta
edm::EDGetTokenT< reco::SuperClusterCollection > matchingObjectCollection_
MonitorElement * h1_vertexEta
MonitorElement * py_chi2VsPhi
MonitorElement * h1_Eop_endcaps
unsigned long long EventNumber_t
MonitorElement * h1_ecalRecHitSumEt_dr03
MonitorElement * h1_hcalTowerSumEt_dr03
MonitorElement * h1_dPhiEleCl_propOut_endcapsNeg
MonitorElement * h1_matchingObject_Eta
MonitorElement * h1_Hoe_barrel
edm::InputTag triggerResults_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * py_HoeVsPhi
MonitorElement * h1_matchedObject_Pt
double sigIetaIetaMinBarrel_
Log< level::Error, false > LogError
double maxPtMatchingObject_
unsigned int LuminosityBlockNumber_t
double ecalIso03MaxBarrel_
MonitorElement * h1_matchedObject_Phi
MonitorElement * h1_PFem_dr03
MonitorElement * h1_mee_os_ee
MonitorElement * h1_tkSumPt_dr03
MonitorElement * h1_dEtaEleCl_propOut_endcapsPos
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
MonitorElement * bookH1(DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
double sigIetaIetaMaxBarrel_
MonitorElement * h2_vertexXvsY
MonitorElement * h1_dPhiSc_propVtx_endcapsPos
MonitorElement * py_fbremVsEta
MonitorElement * h1_provenance
MonitorElement * h1_dEtaEleCl_propOut_barrel
MonitorElement * py_EopVsPhi
MonitorElement * h1_PFnh_dr03
MonitorElement * h1_Eop_barrel
MonitorElement * bookP1(DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, double lowY, double highY, const std::string &titleX="", const std::string &titleY="", Option_t *option="E1 P")
float sumPhotonEt
sum pt of PF photons // old float photonIso ;
double sigIetaIetaMinEndcaps_
MonitorElement * py_dEtaSc_propVtxVsPhi
double sigIetaIetaMaxEndcaps_
Abs< T >::type abs(const T &t)
std::string matchingCondition_
float sumNeutralHadronEt
sum pt of neutral hadrons // old float neutralHadronIso ;
MonitorElement * h1_dPhiEleCl_propOut_endcapsPos
const LorentzVector & p4(P4Kind kind) const
double hcalIso03Depth1MaxBarrel_
MonitorElement * h1_Hoe_endcaps
MonitorElement * h1_dEtaEleCl_propOut_endcapsNeg
MonitorElement * h1_dPhiSc_propVtx_endcapsNeg
ElectronAnalyzer(const edm::ParameterSet &conf)
~ElectronAnalyzer() override
edm::EDGetTokenT< reco::GsfTrackCollection > gsftrackCollection_
MonitorElement * h1_vertexPt_endcaps
MonitorElement * py_lostHitsVsPhi
MonitorElement * h1_vertexZ
Log< level::Info, false > LogInfo
MonitorElement * py_dPhiSc_propVtxVsPhi
double hcalIso03Depth1MaxEndcaps_
auto const & tracks
cannot be loose
MonitorElement * py_fbremVsPhi
MonitorElement * h1_dEtaSc_propVtx_endcapsNeg
MonitorElement * py_foundHitsVsPhi
bool etCut(const reco::GsfElectronCollection::const_iterator &gsfIter)
MonitorElement * h1_fbrem
edm::EDGetTokenT< reco::TrackCollection > trackCollection_
double maxAbsEtaMatchingObject_
MonitorElement * h1_lostHits
MonitorElement * h2_vertexEtaVsPhi
MonitorElement * h1_EeleOPout_endcaps
edm::EDGetTokenT< reco::GsfElectronCollection > electronCollection_
MonitorElement * h1_classes
MonitorElement * h1_sclEt
MonitorElement * h1_sigIEtaIEta5x5_barrel
MonitorElement * h1_EeleOPout_barrel
std::string outputInternalPath_
bool generalCut(const reco::GsfElectronCollection::const_iterator &gsfIter)
MonitorElement * h1_dEtaSc_propVtx_barrel
float computeInvMass(const reco::GsfElectron &e1, const reco::GsfElectron &e2)
MonitorElement * h1_matchingObject_Phi
MonitorElement * bookH2(DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const std::string &titleX="", const std::string &titleY="", Option_t *option="COLZ")
MonitorElement * bookH1withSumw2(DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
double ecalIso03MaxEndcaps_
MonitorElement * h1_mee_os_eb
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
MonitorElement * h1_sigIEtaIEta5x5_endcaps
MonitorElement * h1_sclSigEtaEta_endcaps
MonitorElement * py_foundHitsVsEta
edm::EDGetTokenT< reco::VertexCollection > vertexCollection_
bool idCut(const reco::GsfElectronCollection::const_iterator &gsfIter)
double hcalIso03Depth2MaxEndcaps_
float sumChargedHadronPt
sum-pt of charged Hadron // old float chargedHadronIso ;
void analyze(const edm::Event &e, const edm::EventSetup &c) override
double hadronicOverEmMaxBarrel_
MonitorElement * h1_matchedObject_Eta
MonitorElement * h1_matchingObject_Pt
Power< A, B >::type pow(const A &a, const B &b)
MonitorElement * h1_dPhiEleCl_propOut_barrel
bool isolationCut(const reco::GsfElectronCollection::const_iterator &gsfIter, double vertexTIP)