6 #include "CLHEP/Units/GlobalPhysicalConstants.h" 37 xyz_nbin=histosSet.getParameter<
int>(
"Nbinxyz");
39 pt_nbin=histosSet.getParameter<
int>(
"Nbinpt");
40 pt2D_nbin=histosSet.getParameter<
int>(
"Nbinpt2D");
41 pteff_nbin=histosSet.getParameter<
int>(
"Nbinpteff");
42 pt_max=histosSet.getParameter<
double>(
"Ptmax");
44 fhits_nbin=histosSet.getParameter<
int>(
"Nbinfhits");
45 fhits_max=histosSet.getParameter<
double>(
"Fhitsmax");
47 eta_nbin=histosSet.getParameter<
int>(
"Nbineta");
48 eta2D_nbin=histosSet.getParameter<
int>(
"Nbineta2D");
49 eta_min=histosSet.getParameter<
double>(
"Etamin");
50 eta_max=histosSet.getParameter<
double>(
"Etamax");
57 dphi_nbin=histosSet.getParameter<
int>(
"Nbindphi");
58 dphi_min=histosSet.getParameter<
double>(
"Dphimin");
59 dphi_max=histosSet.getParameter<
double>(
"Dphimax");
66 hoe_nbin= histosSet.getParameter<
int>(
"Nbinhoe");
67 hoe_min=histosSet.getParameter<
double>(
"Hoemin");
68 hoe_max=histosSet.getParameter<
double>(
"Hoemax");
70 mee_nbin= histosSet.getParameter<
int>(
"Nbinmee");
71 mee_min=histosSet.getParameter<
double>(
"Meemin");
72 mee_max=histosSet.getParameter<
double>(
"Meemax");
74 poptrue_nbin= histosSet.getParameter<
int>(
"Nbinpoptrue");
75 poptrue_min=histosSet.getParameter<
double>(
"Poptruemin");
76 poptrue_max=histosSet.getParameter<
double>(
"Poptruemax");
146 h1_recEleNum =
bookH1(iBooker,
"recEleNum",
"# rec electrons",11, -0.5,10.5,
"N_{ele}");
179 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");
180 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");
182 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");
183 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");
227 edm::LogInfo(
"ElectronMcSignalValidatorMiniAOD::analyze")
228 <<
"Treating event "<<iEvent.
id()
229 <<
" with "<<electrons.
product()->size()<<
" electrons" ;
238 pat::ElectronCollection::const_iterator el1 ;
239 pat::ElectronCollection::const_iterator el2 ;
240 for(el1=electrons->begin(); el1!=electrons->end(); el1++) {
241 for (el2=el1+1 ; el2!=electrons->end() ; el2++ )
244 float mee2 = p12.Dot(p12);
246 if ( el1->charge() * el2->charge() < 0. )
257 int mcNum=0, gamNum=0, eleNum=0 ;
259 bool matchingMotherID ;
265 for(
size_t i=0;
i<genParticles->size();
i++) {
277 if ( (*genParticles)[
i].pdgId() == 22 )
283 matchingMotherID =
false ;
298 matchingMotherID =
true ;
302 matchingMotherID =
true ;
315 if (!matchingMotherID) {continue ;}
323 bool okGsfFound =
false ;
324 bool passMiniAODSelection =
true ;
325 double gsfOkRatio = 999999. ;
328 double dphi = el.
phi()-(*genParticles)[
i].phi() ;
330 { dphi = dphi < 0? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi ; }
331 double deltaR2 = (el.eta()-(*genParticles)[
i].eta()) * (el.eta()-(*genParticles)[
i].eta()) + dphi * dphi;
334 if ( ( ((*genParticles)[
i].
pdgId() == 11) && (el.charge() < 0.) ) ||
335 ( ((*genParticles)[
i].pdgId() == -11) && (el.charge() > 0.) ) )
337 double tmpGsfRatio = el.p()/(*genParticles)[
i].p() ;
340 gsfOkRatio = tmpGsfRatio;
360 if (! okGsfFound) continue ;
365 passMiniAODSelection = bestGsfElectron.
pt() >= 5.;
374 if ( passMiniAODSelection ) {
379 if ( passMiniAODSelection ) {
383 if (bestGsfElectron.
isEB()) {
388 if (bestGsfElectron.
isEE()) {
398 if (passMiniAODSelection) {
403 if (passMiniAODSelection) {
412 if (passMiniAODSelection) {
418 double one_over_pt = 1. / bestGsfElectron.
pt();
424 if (bestGsfElectron.
isEB()) {
430 if (bestGsfElectron.
isEE()) {
const PflowIsolationVariables & pfIsolationVariables() const
T getParameter(std::string const &) const
virtual double pt() const final
transverse momentum
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
edm::EDGetTokenT< edm::ValueMap< float > > ValueMaps_Photons_
MonitorElement * h1_ele_fbrem_mAOD_endcaps
virtual double eta() const final
momentum pseudorapidity
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
MonitorElement * h1_ele_chargedHadronRelativeIso_mAOD
std::vector< int > matchingIDs_
virtual const Candidate * mother(size_type i=0) const =0
return pointer to mother
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
edm::EDGetTokenT< edm::ValueMap< float > > ValueMaps_NeutralHadrons_
float sumChargedHadronPt_recomp
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
virtual double phi() const final
momentum azimuthal angle
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
virtual int pdgId() const =0
PDG identifier.
MonitorElement * h1_ele_neutralHadronRelativeIso_mAOD_barrel
MonitorElement * h1_recEleNum
float sumPhotonEt
sum pt of PF photons // old float photonIso ;
MonitorElement * h1_ele_photonRelativeIso_mAOD_recomp
float hcalOverEcal() const
Abs< T >::type abs(const T &t)
virtual double p() const final
magnitude of momentum vector
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_
edm::Ptr< pat::Electron > PatElectronPtr
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_chargedHadronRelativeIso_mAOD_recomp
MonitorElement * h1_ele_photonRelativeIso_mAOD_endcaps
float relisoNeutralHadronPt_recomp
Analysis-level electron class.
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
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * h1_ele_neutralHadronRelativeIso_mAOD_endcaps
float relisoChargedHadronPt_recomp
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 ~ElectronMcSignalValidatorMiniAOD()
MonitorElement * h1_ele_dPhiCl_propOut_mAOD
float sumNeutralHadronPt_recomp
edm::EDGetTokenT< edm::ValueMap< float > > ValueMaps_ChargedHadrons_
edm::EDGetTokenT< pat::ElectronCollection > electronToken_
virtual size_type numberOfDaughters() const =0
number of daughters
MonitorElement * h1_ele_neutralHadronRelativeIso_mAOD_recomp
void setBookStatOverflowFlag(const bool &)
float sumChargedHadronPt
sum-pt of charged Hadron // old float chargedHadronIso ;
float relisoPhotonPt_recomp
MonitorElement * h1_ele_dPhiCl_propOut_mAOD_endcaps