24 #include "CLHEP/Units/GlobalPhysicalConstants.h"
56 xyz_nbin=histosSet.getParameter<
int>(
"Nbinxyz");
58 pt_nbin=histosSet.getParameter<
int>(
"Nbinpt");
59 pt2D_nbin=histosSet.getParameter<
int>(
"Nbinpt2D");
60 pteff_nbin=histosSet.getParameter<
int>(
"Nbinpteff");
61 pt_max=histosSet.getParameter<
double>(
"Ptmax");
63 fhits_nbin=histosSet.getParameter<
int>(
"Nbinfhits");
64 fhits_max=histosSet.getParameter<
double>(
"Fhitsmax");
66 eta_nbin=histosSet.getParameter<
int>(
"Nbineta");
67 eta2D_nbin=histosSet.getParameter<
int>(
"Nbineta2D");
68 eta_min=histosSet.getParameter<
double>(
"Etamin");
69 eta_max=histosSet.getParameter<
double>(
"Etamax");
76 dphi_nbin=histosSet.getParameter<
int>(
"Nbindphi");
77 dphi_min=histosSet.getParameter<
double>(
"Dphimin");
78 dphi_max=histosSet.getParameter<
double>(
"Dphimax");
85 hoe_nbin= histosSet.getParameter<
int>(
"Nbinhoe");
86 hoe_min=histosSet.getParameter<
double>(
"Hoemin");
87 hoe_max=histosSet.getParameter<
double>(
"Hoemax");
89 mee_nbin= histosSet.getParameter<
int>(
"Nbinmee");
90 mee_min=histosSet.getParameter<
double>(
"Meemin");
91 mee_max=histosSet.getParameter<
double>(
"Meemax");
93 poptrue_nbin= histosSet.getParameter<
int>(
"Nbinpoptrue");
94 poptrue_min=histosSet.getParameter<
double>(
"Poptruemin");
95 poptrue_max=histosSet.getParameter<
double>(
"Poptruemax");
162 h1_recEleNum =
bookH1(iBooker,
"recEleNum",
"# rec electrons",11, -0.5,10.5,
"N_{ele}");
195 h1_ele_dEtaSc_propVtx_mAOD_barrel =
bookH1withSumw2(iBooker,
"dEtaSc_propVtx_mAOD_barrel",
"ele #eta_{sc} - #eta_{tr}, prop from vertex, barrel",
detamatch_nbin,
detamatch_min,
detamatch_max,
"#eta_{sc} - #eta_{tr}",
"Events",
"ELE_LOGY E1 P");
196 h1_ele_dEtaSc_propVtx_mAOD_endcaps =
bookH1withSumw2(iBooker,
"dEtaSc_propVtx_mAOD_endcaps",
"ele #eta_{sc} - #eta_{tr}, prop from vertex, endcaps",
detamatch_nbin,
detamatch_min,
detamatch_max,
"#eta_{sc} - #eta_{tr}",
"Events",
"ELE_LOGY E1 P");
198 h1_ele_dPhiCl_propOut_mAOD_barrel =
bookH1withSumw2(iBooker,
"dPhiCl_propOut_mAOD_barrel",
"ele #phi_{cl} - #phi_{tr}, prop from outermost, barrel",
dphimatch_nbin,
dphimatch_min,
dphimatch_max,
"#phi_{seedcl} - #phi_{tr} (rad)",
"Events",
"ELE_LOGY E1 P");
199 h1_ele_dPhiCl_propOut_mAOD_endcaps =
bookH1withSumw2(iBooker,
"dPhiCl_propOut_mAOD_endcaps",
"ele #phi_{cl} - #phi_{tr}, prop from outermost, endcaps",
dphimatch_nbin,
dphimatch_min,
dphimatch_max,
"#phi_{seedcl} - #phi_{tr} (rad)",
"Events",
"ELE_LOGY E1 P");
228 edm::LogInfo(
"ElectronMcSignalValidatorMiniAOD::analyze")
229 <<
"Treating event "<<iEvent.
id()
230 <<
" with "<<electrons.
product()->size()<<
" electrons" ;
240 pat::ElectronCollection::const_iterator el1 ;
241 pat::ElectronCollection::const_iterator el2 ;
242 for(el1=electrons->begin(); el1!=electrons->end(); el1++) {
244 for (el2=el1+1 ; el2!=electrons->end() ; el2++ )
247 float mee2 = p12.Dot(p12);
249 if ( el1->charge() * el2->charge() < 0. )
260 int mcNum=0, gamNum=0, eleNum=0 ;
262 bool matchingMotherID ;
268 for(
size_t i=0;
i<genParticles->size();
i++) {
273 if ( (*genParticles)[
i].pdgId() == 22 )
279 matchingMotherID =
false ;
282 { matchingMotherID =
true ;
286 if (!matchingMotherID) continue ;
294 bool okGsfFound =
false ;
295 bool passMiniAODSelection =
true ;
296 double gsfOkRatio = 999999. ;
299 double dphi = el.
phi()-(*genParticles)[
i].phi() ;
301 { dphi = dphi < 0? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi ; }
302 double deltaR2 = (el.eta()-(*genParticles)[
i].eta()) * (el.eta()-(*genParticles)[
i].eta()) + dphi * dphi;
305 if ( ( ((*genParticles)[
i].
pdgId() == 11) && (el.charge() < 0.) ) ||
306 ( ((*genParticles)[
i].pdgId() == -11) && (el.charge() > 0.) ) )
308 double tmpGsfRatio = el.p()/(*genParticles)[
i].p() ;
311 gsfOkRatio = tmpGsfRatio;
319 if (! okGsfFound) continue ;
324 passMiniAODSelection = bestGsfElectron.
pt() >= 5.;
333 if ( passMiniAODSelection ) {
338 if ( passMiniAODSelection ) {
354 if (passMiniAODSelection) {
359 if (passMiniAODSelection) {
368 if (passMiniAODSelection) {
374 double one_over_pt = 1. / bestGsfElectron.
pt();
380 if (bestGsfElectron.
isEB()) {
386 if (bestGsfElectron.
isEE()) {
const PflowIsolationVariables & pfIsolationVariables() const
T getParameter(std::string const &) const
MonitorElement * h1_ele_dEtaSc_propVtx_mAOD
MonitorElement * h2_ele_PoPtrueVsEta
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")
const LorentzVector & p4(P4Kind kind) const
MonitorElement * h1_scl_SigIEtaIEta_mAOD_endcaps
virtual const Candidate * mother(size_type i=0) const =0
return pointer to mother
MonitorElement * h1_ele_fbrem_mAOD_endcaps
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * h1_ele_HoE_mAOD
MonitorElement * h1_ele_fbrem_mAOD_barrel
std::vector< int > matchingMotherIDs_
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")
MonitorElement * h1_ele_mee_os
virtual double phi() const final
momentum azimuthal angle
MonitorElement * h1_ele_chargedHadronRelativeIso_mAOD
std::vector< int > matchingIDs_
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 * 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_
float deltaEtaSuperClusterTrackAtVtx() const
MonitorElement * h1_ele_vertexPt_nocut
reco::GsfTrackRef gsfTrack() const
override the reco::GsfElectron::gsfTrack method, to access the internal storage of the supercluster ...
float deltaPhiSeedClusterTrackAtCalo() const
MonitorElement * h1_ele_neutralHadronRelativeIso_mAOD_barrel
MonitorElement * h1_recEleNum
float sumPhotonEt
sum pt of PF photons // old float photonIso ;
float hcalOverEcal() const
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
float scSigmaIEtaIEta() const
void setBookEfficiencyFlag(const bool &)
std::string outputInternalPath_
virtual int pdgId() const =0
PDG identifier.
void setCurrentFolder(const std::string &fullpath)
MonitorElement * h1_ele_dPhiCl_propOut_mAOD_barrel
T const * product() const
MonitorElement * h1_ele_chargedHadronRelativeIso_mAOD_barrel
MonitorElement * h1_ele_photonRelativeIso_mAOD_endcaps
Analysis-level electron class.
virtual double p() const final
magnitude of momentum vector
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * h2_ele_foundHitsVsEta
MonitorElement * h2_ele_foundHitsVsEta_mAOD
MonitorElement * h1_ele_HoE_mAOD_barrel
MonitorElement * h1_ele_neutralHadronRelativeIso_mAOD_endcaps
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")
MonitorElement * h1_ele_HoE_mAOD_endcaps
virtual double eta() const final
momentum pseudorapidity
virtual ~ElectronMcSignalValidatorMiniAOD()
volatile std::atomic< bool > shutdown_flag false
MonitorElement * h1_ele_dPhiCl_propOut_mAOD
edm::EDGetTokenT< pat::ElectronCollection > electronToken_
void setBookStatOverflowFlag(const bool &)
float sumChargedHadronPt
sum-pt of charged Hadron // old float chargedHadronIso ;
MonitorElement * h1_ele_dPhiCl_propOut_mAOD_endcaps
virtual double pt() const final
transverse momentum