3 #include "CLHEP/Units/GlobalPhysicalConstants.h" 148 bookH1withSumw2(iBooker,
"vertexPt_nocut",
"pT of prunned electrons",
pt_nbin, 0., 20.,
"p_{T vertex} (GeV/c)");
151 "ele momentum / gen momentum vs eta",
159 bookH2(iBooker,
"sigmaIetaIetaVsPt",
"SigmaIetaIeta vs pt", 100, 0.,
pt_max, 100, 0., 0.05);
165 "ele pairs invariant mass, all reco electrons",
169 "m_{ee} (GeV/c^{2})",
174 "ele pairs invariant mass, opp. sign",
178 "m_{e^{+}e^{-}} (GeV/c^{2})",
186 "ele supercluster sigma ieta ieta",
190 "#sigma_{i#eta i#eta}",
194 "SigIEtaIEta_mAOD_barrel",
195 "ele supercluster sigma ieta ieta, barrel",
199 "#sigma_{i#eta i#eta}",
203 "SigIEtaIEta_mAOD_endcaps",
204 "ele supercluster sigma ieta ieta, endcaps",
208 "#sigma_{i#eta i#eta}",
216 "ele track # found hits vs eta",
224 "foundHitsVsEta_mAOD",
225 "ele track # found hits vs eta",
237 "ele hadronic energy / em energy",
246 "ele hadronic energy / em energy, barrel",
255 "ele hadronic energy / em energy, endcaps",
263 "dEtaSc_propVtx_mAOD",
264 "ele #eta_{sc} - #eta_{tr}, prop from vertex",
268 "#eta_{sc} - #eta_{tr}",
272 "dEtaSc_propVtx_mAOD_barrel",
273 "ele #eta_{sc} - #eta_{tr}, prop from vertex, barrel",
277 "#eta_{sc} - #eta_{tr}",
281 "dEtaSc_propVtx_mAOD_endcaps",
282 "ele #eta_{sc} - #eta_{tr}, prop from vertex, endcaps",
286 "#eta_{sc} - #eta_{tr}",
290 "dPhiCl_propOut_mAOD",
291 "ele #phi_{cl} - #phi_{tr}, prop from outermost",
295 "#phi_{seedcl} - #phi_{tr} (rad)",
299 "dPhiCl_propOut_mAOD_barrel",
300 "ele #phi_{cl} - #phi_{tr}, prop from outermost, barrel",
304 "#phi_{seedcl} - #phi_{tr} (rad)",
308 "dPhiCl_propOut_mAOD_endcaps",
309 "ele #phi_{cl} - #phi_{tr}, prop from outermost, endcaps",
313 "#phi_{seedcl} - #phi_{tr} (rad)",
319 iBooker,
"fbrem_mAOD",
"ele brem fraction, mode of GSF components", 100, 0., 1.,
"P_{in} - P_{out} / P_{in}");
322 "ele brem fraction for barrel, mode of GSF components",
326 "P_{in} - P_{out} / P_{in}");
328 "fbrem_mAOD_endcaps",
329 "ele brem franction for endcaps, mode of GSF components",
333 "P_{in} - P_{out} / P_{in}");
337 "chargedHadronRelativeIso_mAOD",
338 "chargedHadronRelativeIso",
342 "chargedHadronRelativeIso",
346 "chargedHadronRelativeIso_mAOD_barrel",
347 "chargedHadronRelativeIso for barrel",
351 "chargedHadronRelativeIso_barrel",
355 "chargedHadronRelativeIso_mAOD_endcaps",
356 "chargedHadronRelativeIso for endcaps",
360 "chargedHadronRelativeIso_endcaps",
364 "neutralHadronRelativeIso_mAOD",
365 "neutralHadronRelativeIso",
369 "neutralHadronRelativeIso",
373 "neutralHadronRelativeIso_mAOD_barrel",
374 "neutralHadronRelativeIso for barrel",
378 "neutralHadronRelativeIso_barrel",
382 "neutralHadronRelativeIso_mAOD_endcaps",
383 "neutralHadronRelativeIso for endcaps",
387 "neutralHadronRelativeIso_endcaps",
391 "photonRelativeIso_mAOD",
400 "photonRelativeIso_mAOD_barrel",
401 "photonRelativeIso for barrel",
405 "photonRelativeIso_barrel",
409 "photonRelativeIso_mAOD_endcaps",
410 "photonRelativeIso for endcaps",
414 "photonRelativeIso_endcaps",
427 edm::LogInfo(
"ElectronMcSignalValidatorMiniAOD::analyze")
428 <<
"Treating event " <<
iEvent.id() <<
" with " <<
electrons.product()->size() <<
" electrons";
429 edm::LogInfo(
"ElectronMcSignalValidatorMiniAOD::analyze")
431 <<
" multi slimmed electrons";
440 pat::ElectronCollection::const_iterator el1;
441 std::vector<pat::Electron>::const_iterator el3;
442 std::vector<pat::Electron>::const_iterator el4;
447 std::vector<pat::Electron> localCollection;
454 localCollection.push_back(*el1);
462 localCollection.push_back(*el1);
467 for (el3 = localCollection.begin(); el3 != localCollection.end(); el3++) {
468 for (el4 = el3 + 1; el4 != localCollection.end(); el4++) {
470 float mee2 = p12.Dot(p12);
472 if (el3->charge() * el4->charge() < 0.) {
482 int mcNum = 0, gamNum = 0, eleNum = 0;
483 bool matchingMotherID;
501 matchingMotherID =
false;
503 if (mother ==
nullptr) {
504 matchingMotherID =
true;
507 matchingMotherID =
true;
512 if (!matchingMotherID) {
523 bool okGsfFound =
false;
524 bool passMiniAODSelection =
true;
525 double gsfOkRatio = 999999.;
526 bool isEBflag =
false;
527 bool isEEflag =
false;
530 for (el3 = localCollection.begin(); el3 != localCollection.end(); el3++) {
531 double dphi = el3->
phi() - (*genParticles)[
i].phi();
533 dphi = dphi < 0 ? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi;
535 double deltaR2 = (el3->eta() - (*genParticles)[
i].eta()) * (el3->eta() - (*genParticles)[
i].eta()) + dphi * dphi;
538 (((*
genParticles)[
i].pdgId() == -11) && (el3->charge() > 0.))) {
539 double tmpGsfRatio = el3->p() / (*genParticles)[
i].p();
541 gsfOkRatio = tmpGsfRatio;
542 bestGsfElectron = *el3;
553 passMiniAODSelection = bestGsfElectron.
pt() >= 5.;
554 double one_over_pt = 1. / bestGsfElectron.
pt();
555 isEBflag = bestGsfElectron.
isEB();
556 isEEflag = bestGsfElectron.
isEE();
569 if (passMiniAODSelection) {
T getParameter(std::string const &) const
float scSigmaIEtaIEta() const
MonitorElement * h1_ele_dEtaSc_propVtx_mAOD
MonitorElement * h2_ele_PoPtrueVsEta
double pt() const final
transverse momentum
float deltaPhiSeedClusterTrackAtCalo() const
MonitorElement * h1_scl_SigIEtaIEta_mAOD_endcaps
virtual const Candidate * mother(size_type i=0) const =0
return pointer to mother
virtual void setCurrentFolder(std::string const &fullpath)
MonitorElement * h1_ele_fbrem_mAOD_endcaps
MonitorElement * h1_ele_HoE_mAOD
MonitorElement * h1_ele_fbrem_mAOD_barrel
std::vector< int > matchingMotherIDs_
MonitorElement * h1_ele_mee_os
MonitorElement * h1_ele_chargedHadronRelativeIso_mAOD
std::vector< int > matchingIDs_
reco::GsfTrackRef gsfTrack() const override
override the reco::GsfElectron::gsfTrack method, to access the internal storage of the supercluster ...
MonitorElement * h2_ele_sigmaIetaIetaVsPt
MonitorElement * h1_scl_SigIEtaIEta_mAOD
ElectronMcSignalValidatorMiniAOD(const edm::ParameterSet &)
MonitorElement * h1_ele_vertexPt
MonitorElement * h1_scl_SigIEtaIEta_mAOD_barrel
MonitorElement * h1_ele_vertexEta
MonitorElement * h1_ele_dEtaSc_propVtx_mAOD_barrel
MonitorElement * h1_ele_neutralHadronRelativeIso_mAOD
bool set_StatOverflowFlag
MonitorElement * h1_ele_chargedHadronRelativeIso_mAOD_endcaps
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
edm::EDGetTokenT< edm::View< reco::GenParticle > > mcTruthCollection_
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")
virtual size_type numberOfDaughters() const =0
number of daughters
const PflowIsolationVariables & pfIsolationVariables() const
MonitorElement * h1_ele_vertexPt_nocut
double p() const final
magnitude of momentum vector
MonitorElement * h1_ele_neutralHadronRelativeIso_mAOD_barrel
MonitorElement * h1_recEleNum
float sumPhotonEt
sum pt of PF photons // old float photonIso ;
Abs< T >::type abs(const T &t)
MonitorElement * h1_ele_dEtaSc_propVtx_mAOD_endcaps
MonitorElement * h1_ele_photonRelativeIso_mAOD
void setBookPrefix(const std::string &)
MonitorElement * h1_ele_mee_all
MonitorElement * h1_ele_photonRelativeIso_mAOD_barrel
float sumNeutralHadronEt
sum pt of neutral hadrons // old float neutralHadronIso ;
MonitorElement * h1_ele_fbrem_mAOD
const LorentzVector & p4(P4Kind kind) const
float hcalOverEcal(const ShowerShape &ss, int depth) const
edm::EDGetTokenT< pat::ElectronCollection > electronTokenEndcaps_
void setBookEfficiencyFlag(const bool &)
std::string outputInternalPath_
virtual int pdgId() const =0
PDG identifier.
Log< level::Info, false > LogInfo
float deltaEtaSuperClusterTrackAtVtx() const
MonitorElement * h1_ele_dPhiCl_propOut_mAOD_barrel
MonitorElement * h1_ele_chargedHadronRelativeIso_mAOD_barrel
MonitorElement * bookH2withSumw2(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 * h1_ele_photonRelativeIso_mAOD_endcaps
Analysis-level electron class.
void analyze(const edm::Event &, const edm::EventSetup &) override
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")
~ElectronMcSignalValidatorMiniAOD() override
MonitorElement * h2_ele_foundHitsVsEta
MonitorElement * h2_ele_foundHitsVsEta_mAOD
MonitorElement * h1_ele_HoE_mAOD_barrel
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * h1_ele_neutralHadronRelativeIso_mAOD_endcaps
MonitorElement * h1_ele_HoE_mAOD_endcaps
MonitorElement * h1_ele_dPhiCl_propOut_mAOD
edm::EDGetTokenT< pat::ElectronCollection > electronToken_
double phi() const final
momentum azimuthal angle
void setBookStatOverflowFlag(const bool &)
float sumChargedHadronPt
sum-pt of charged Hadron // old float chargedHadronIso ;
MonitorElement * h1_ele_dPhiCl_propOut_mAOD_endcaps
double eta() const final
momentum pseudorapidity