20 #include "CLHEP/Units/GlobalPhysicalConstants.h"
41 assert(matchingCondition_ ==
"Cone");
165 iBooker,
"vertexPt_barrel",
"ele transverse momentum in barrel",
nbinpt, 0.,
ptmax,
"p_{T vertex} (GeV/c)");
167 iBooker,
"vertexPt_endcaps",
"ele transverse momentum in endcaps",
nbinpt, 0.,
ptmax,
"p_{T vertex} (GeV/c)");
171 "ele momentum #eta vs #phi",
181 iBooker,
"vertexXvsY",
"ele vertex x vs y",
nbinxyz2D, -0.1, 0.1,
nbinxyz2D, -0.1, 0.1,
"x (cm)",
"y (cm)");
188 h1_chi2 =
bookH1(iBooker,
"chi2",
"ele track #chi^{2}", 100, 0., 15.,
"#Chi^{2}");
190 iBooker,
"chi2VsEta",
"ele track #chi^{2} vs #eta",
nbineta2D,
etamin,
etamax, 0., 15.,
"#eta",
"<#chi^{2}>");
193 "ele track #chi^{2} vs #phi",
204 "ele track # found hits vs #eta",
214 "ele track # found hits vs #phi",
222 h1_lostHits =
bookH1(iBooker,
"lostHits",
"ele track # lost hits", 5, 0., 5.,
"N_{lost hits}");
225 "ele track # lost hits vs #eta",
235 "ele track # lost hits vs #eta",
249 "ele E/P_{vertex} vs #phi",
258 bookH1(iBooker,
"EeleOPout_barrel",
"ele E_{ele}/P_{out} in barrel",
nbineop, 0.,
eopmax,
"E_{ele}/P_{out}");
260 bookH1(iBooker,
"EeleOPout_endcaps",
"ele E_{ele}/P_{out} in endcaps",
nbineop, 0.,
eopmax,
"E_{ele}/P_{out}");
262 "dEtaSc_propVtx_barrel",
263 "ele #eta_{sc} - #eta_{tr}, prop from vertex, in barrel",
267 "#eta_{sc} - #eta_{tr}");
269 "dEtaSc_propVtx_endcapsPos",
270 "ele #eta_{sc} - #eta_{tr}, prop from vertex, in positive endcap",
274 "#eta_{sc} - #eta_{tr}");
276 "dEtaSc_propVtx_endcapsNeg",
277 "ele #eta_{sc} - #eta_{tr}, prop from vertex, in negative endcap",
281 "#eta_{sc} - #eta_{tr}");
283 "dEtaSc_propVtxVsPhi",
284 "ele #eta_{sc} - #eta_{tr}, prop from vertex vs #phi",
291 "<#eta_{sc} - #eta_{tr}>");
293 "dEtaEleCl_propOut_barrel",
294 "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, in barrel",
298 "#eta_{elecl} - #eta_{tr}");
300 "dEtaEleCl_propOut_endcapsPos",
301 "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, in positive endcap",
305 "#eta_{elecl} - #eta_{tr}");
307 "dEtaEleCl_propOut_endcapsNeg",
308 "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, in negative endcap",
312 "#eta_{elecl} - #eta_{tr}");
314 "dPhiSc_propVtx_barrel",
315 "ele #phi_{sc} - #phi_{tr}, prop from vertex, in barrel",
319 "#phi_{sc} - #phi_{tr} (rad)");
321 "dPhiSc_propVtx_endcapsPos",
322 "ele #phi_{sc} - #phi_{tr}, prop from vertex, in positive endcap",
326 "#phi_{sc} - #phi_{tr} (rad)");
328 "dPhiSc_propVtx_endcapsNeg",
329 "ele #phi_{sc} - #phi_{tr}, prop from vertex, in negative endcap",
333 "#phi_{sc} - #phi_{tr} (rad)");
335 "dPhiSc_propVtxVsPhi",
336 "ele #phi_{sc} - #phi_{tr}, prop from vertex vs #phi",
343 "<#phi_{sc} - #phi_{tr}> (rad)");
345 "dPhiEleCl_propOut_barrel",
346 "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, in barrel",
350 "#phi_{elecl} - #phi_{tr} (rad)");
352 "dPhiEleCl_propOut_endcapsPos",
353 "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, in positive endcap",
357 "#phi_{elecl} - #phi_{tr} (rad)");
359 "dPhiEleCl_propOut_endcapsNeg",
360 "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, in negative endcap",
364 "#phi_{elecl} - #phi_{tr} (rad)");
367 "ele hadronic energy / em energy, in barrel",
376 "ele hadronic energy / em energy, in endcaps",
385 "ele hadronic energy / em energy vs #phi",
395 bookH1(iBooker,
"sclSigEtaEta_barrel",
"ele sigma eta eta in barrel", 100, 0., 0.05,
"sietaieta");
397 bookH1(iBooker,
"sclSigEtaEta_endcaps",
"ele sigma eta eta in endcaps", 100, 0., 0.05,
"sietaieta");
399 bookH1(iBooker,
"sigIEtaIEta5x5_barrel",
"ele sigma ieta ieta 5x5 in barrel", 100, 0., 0.05,
"sietaieta5x5");
401 bookH1(iBooker,
"sigIEtaIEta5x5_endcaps",
"ele sigma ieta ieta 5x5 in endcaps", 100, 0., 0.05,
"sietaieta5x5");
404 h1_fbrem =
bookH1(iBooker,
"fbrem",
"ele brem fraction", 100, 0., 1.,
"P_{in} - P_{out} / P_{in}");
407 "ele brem fraction vs #eta",
414 "<P_{in} - P_{out} / P_{in}>");
417 "ele brem fraction vs #phi",
424 "<P_{in} - P_{out} / P_{in}>");
425 h1_classes =
bookH1(iBooker,
"classes",
"ele electron classes", 10, 0.0, 10.);
428 h1_mva =
bookH1(iBooker,
"mva",
"ele identification mva", 100, -1., 1.,
"mva");
433 iBooker,
"tkSumPt_dr03",
"tk isolation sum, dR=0.3", 100, 0.0, 20.,
"TkIsoSum (GeV/c)",
"Events",
"ELE_LOGY E1 P");
435 "ecalRecHitSumEt_dr03",
436 "ecal isolation sum, dR=0.3",
444 "hcalTowerSumEt_dr03",
445 "hcal isolation sum, dR=0.3",
456 "Charged PF candidate sum, dR=0.3",
460 "PF charged (GeV/c)",
465 "Neutral EM PF candidate sum, dR=0.3",
469 "PF neutral EM (GeV)",
474 "Neutral Had PF candidate sum, dR=0.3",
478 "PF neutral Had (GeV)",
487 "ele pairs invariant mass, opposite sign",
491 "m_{e^{+}e^{-}} (GeV/c^{2})");
494 "ele pairs invariant mass, opposite sign, barrel-barrel",
498 "m_{e^{+}e^{-}} (GeV/c^{2})");
501 "ele pairs invariant mass, opposite sign, endcap-endcap",
505 "m_{e^{+}e^{-}} (GeV/c^{2})");
508 "ele pairs invariant mass, opposite sign, barrel-endcap",
512 "m_{e^{+}e^{-}} (GeV/c^{2})");
522 if (std::string::npos !=
std::string(l.module).find(
"SuperCluster", 0)) {
523 matchingObjectType =
"SC";
525 if (matchingObjectType.empty()) {
526 edm::LogError(
"ElectronMcFakeValidator::beginJob") <<
"Unknown matching object type !";
528 edm::LogInfo(
"ElectronMcFakeValidator::beginJob") <<
"Matching object type: " << matchingObjectType;
533 iBooker,
"matchingObject_Eta", matchingObjectType +
" #eta",
nbineta,
etamin,
etamax,
"#eta_{SC}");
536 iBooker,
"matchingObject_Pt", matchingObjectType +
" pt",
nbinpteff, 5.,
ptmax,
"pt_{SC} (GeV/c)");
538 iBooker,
"matchingObject_Phi", matchingObjectType +
" #phi",
nbinphi,
phimin,
phimax,
"#phi (rad)");
541 iBooker,
"matchedObject_Eta",
"Efficiency vs matching SC #eta",
nbineta,
etamin,
etamax,
"#eta_{SC}");
543 iBooker,
"matchedObject_Pt",
"Efficiency vs matching SC E_{T}",
nbinpteff, 5.,
ptmax,
"pt_{SC} (GeV/c)");
545 iBooker,
"matchedObject_Phi",
"Efficiency vs matching SC #phi",
nbinphi,
phimin,
phimax,
"#phi (rad)");
570 edm::LogInfo(
"ElectronAnalyzer::analyze") <<
"Treating " << gsfElectrons.
product()->size() <<
" electrons"
571 <<
" from event " << ievt <<
" in run " << irun <<
" and lumiblock " << ils;
575 reco::GsfElectronCollection::const_iterator gsfIter;
576 for (gsfIter = gsfElectrons->begin(); gsfIter != gsfElectrons->end(); gsfIter++) {
578 double vertexTIP = (gsfIter->vertex().x() - bs.
position().x()) * (gsfIter->vertex().x() - bs.
position().x()) +
579 (gsfIter->vertex().y() - bs.
position().y()) * (gsfIter->vertex().y() - bs.
position().y());
580 vertexTIP =
sqrt(vertexTIP);
587 reco::GsfElectronCollection::const_iterator gsfIter2;
588 for (gsfIter2 = gsfIter + 1; gsfIter2 != gsfElectrons->end(); gsfIter2++) {
593 if (((gsfIter->charge()) * (gsfIter2->charge())) < 0.) {
595 if (gsfIter->isEB() && gsfIter2->isEB())
597 else if (gsfIter->isEE() && gsfIter2->isEE())
617 double R = TMath::Sqrt(sclRef->x() * sclRef->x() + sclRef->y() * sclRef->y() + sclRef->z() * sclRef->z());
618 double Rt = TMath::Sqrt(sclRef->x() * sclRef->x() + sclRef->y() * sclRef->y());
629 h1_chi2->
Fill(gsfIter->gsfTrack()->normalizedChi2());
635 if (gsfIter->isEB()) {
646 if (gsfIter->isEE()) {
649 if (gsfIter->eta() > 0) {
673 int eleClass = gsfIter->classification();
680 if (gsfIter->ecalDrivenSeed())
682 if (gsfIter->trackerDrivenSeed())
684 if (gsfIter->trackerDrivenSeed() || gsfIter->ecalDrivenSeed())
686 if (gsfIter->trackerDrivenSeed() && !gsfIter->ecalDrivenSeed())
688 if (!gsfIter->trackerDrivenSeed() && gsfIter->ecalDrivenSeed())
704 int matchingObjectNum = 0;
705 reco::SuperClusterCollection::const_iterator moIter;
706 for (moIter = recoClusters->begin(); moIter != recoClusters->end(); moIter++) {
720 bool okGsfFound =
false;
721 double gsfOkRatio = 999999999.;
723 reco::GsfElectronCollection::const_iterator gsfIter;
724 for (gsfIter = gsfElectrons->begin(); gsfIter != gsfElectrons->end(); gsfIter++) {
725 double vertexTIP = (gsfIter->vertex().x() - bs.
position().x()) * (gsfIter->vertex().x() - bs.
position().x()) +
726 (gsfIter->vertex().y() - bs.
position().y()) * (gsfIter->vertex().y() - bs.
position().y());
727 vertexTIP =
sqrt(vertexTIP);
735 double dphi = gsfIter->phi() - moIter->phi();
737 dphi = dphi < 0 ? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi;
739 double deltaR =
sqrt(
pow((moIter->eta() - gsfIter->eta()), 2) +
pow(dphi, 2));
741 double tmpGsfRatio = gsfIter->p() / moIter->energy();
743 gsfOkRatio = tmpGsfRatio;
744 bestGsfElectron = *gsfIter;
764 float mee2 = p12.Dot(p12);
765 float invMass = mee2 > 0. ?
sqrt(mee2) : 0;
784 if (gsfIter->pt() <
minPt_)
787 if (gsfIter->isEB() &&
isEE_)
789 if (gsfIter->isEE() &&
isEB_)
803 if (gsfIter->superCluster()->energy() / cosh(gsfIter->superCluster()->eta()) <
minEt_)
MonitorElement * h1_foundHits
EventNumber_t event() const
MonitorElement * h1_dEtaSc_propVtx_endcapsPos
double hadronicOverEmMaxEndcaps_
MonitorElement * h1_mee_os
const LorentzVector & p4(P4Kind kind) const
bool selected(const reco::GsfElectronCollection::const_iterator &gsfIter, double vertexTIP)
MonitorElement * h1_dPhiSc_propVtx_barrel
virtual void setCurrentFolder(std::string const &fullpath)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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
edm::LuminosityBlockNumber_t luminosityBlock() const
MonitorElement * h1_hcalTowerSumEt_dr03
MonitorElement * h1_dPhiEleCl_propOut_endcapsNeg
MonitorElement * h1_matchingObject_Eta
MonitorElement * h1_Hoe_barrel
auto const & tracks
cannot be loose
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
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_
MonitorElement * py_fbremVsPhi
T const * product() const
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
T getParameter(std::string const &) const
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
const Point & position() const
position
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)