20 #include "CLHEP/Units/GlobalPhysicalConstants.h" 25 using namespace reco ;
42 assert (matchingCondition_==
"Cone") ;
170 h2_vertexEtaVsPhi =
bookH2(iBooker,
"vertexEtaVsPhi",
"ele momentum #eta vs #phi",
nbineta2D,
etamin,
etamax,
nbinphi2D,
phimin,
phimax,
"#eta",
"#phi (rad)");
171 h2_vertexXvsY =
bookH2(iBooker,
"vertexXvsY",
"ele vertex x vs y",
nbinxyz2D,-0.1,0.1,
nbinxyz2D,-0.1,0.1,
"x (cm)",
"y (cm)");
178 h1_chi2 =
bookH1(iBooker,
"chi2",
"ele track #chi^{2}",100,0.,15.,
"#Chi^{2}");
184 h1_lostHits =
bookH1(iBooker,
"lostHits",
"ele track # lost hits",5,0.,5.,
"N_{lost hits}");
197 py_dEtaSc_propVtxVsPhi =
bookP1(iBooker,
"dEtaSc_propVtxVsPhi",
"ele #eta_{sc} - #eta_{tr}, prop from vertex vs #phi",
nbinphi2D,
phimin,
phimax,
detamatchmin,
detamatchmax,
"#phi (rad)",
"<#eta_{sc} - #eta_{tr}>");
204 py_dPhiSc_propVtxVsPhi =
bookP1(iBooker,
"dPhiSc_propVtxVsPhi",
"ele #phi_{sc} - #phi_{tr}, prop from vertex vs #phi",
nbinphi2D,
phimin,
phimax,
dphimatchmin,
dphimatchmax,
"#phi (rad)",
"<#phi_{sc} - #phi_{tr}> (rad)");
210 py_HoeVsPhi =
bookP1(iBooker,
"HoeVsPhi",
"ele hadronic energy / em energy vs #phi",
nbinphi2D,
phimin,
phimax,
hoemin,
hoemax,
"#phi (rad)",
"<H/E>",
"E1 P") ;
217 h1_fbrem =
bookH1(iBooker,
"fbrem",
"ele brem fraction",100,0.,1.,
"P_{in} - P_{out} / P_{in}") ;
223 h1_mva =
bookH1(iBooker,
"mva",
"ele identification mva",100,-1.,1.,
"mva");
227 h1_tkSumPt_dr03 =
bookH1(iBooker,
"tkSumPt_dr03",
"tk isolation sum, dR=0.3",100,0.0,20.,
"TkIsoSum (GeV/c)",
"Events",
"ELE_LOGY E1 P");
228 h1_ecalRecHitSumEt_dr03 =
bookH1(iBooker,
"ecalRecHitSumEt_dr03",
"ecal isolation sum, dR=0.3",100,0.0,20.,
"EcalIsoSum (GeV)",
"Events",
"ELE_LOGY E1 P");
229 h1_hcalTowerSumEt_dr03 =
bookH1(iBooker,
"hcalTowerSumEt_dr03",
"hcal isolation sum, dR=0.3",100,0.0,20.,
"HcalIsoSum (GeV)",
"Events",
"ELE_LOGY E1 P");
232 h1_PFch_dr03 =
bookH1(iBooker,
"PFch_dr03",
"Charged PF candidate sum, dR=0.3",100,0.0,20.,
"PF charged (GeV/c)",
"Events",
"ELE_LOGY E1 P");
233 h1_PFem_dr03 =
bookH1(iBooker,
"PFem_dr03",
"Neutral EM PF candidate sum, dR=0.3",100,0.0,20.,
"PF neutral EM (GeV)",
"Events",
"ELE_LOGY E1 P");
234 h1_PFnh_dr03 =
bookH1(iBooker,
"PFnh_dr03",
"Neutral Had PF candidate sum, dR=0.3",100,0.0,20.,
"PF neutral Had (GeV)",
"Events",
"ELE_LOGY E1 P");
250 { matchingObjectType =
"SC" ; }
251 if (matchingObjectType==
"")
252 {
edm::LogError(
"ElectronMcFakeValidator::beginJob")<<
"Unknown matching object type !" ; }
254 {
edm::LogInfo(
"ElectronMcFakeValidator::beginJob")<<
"Matching object type: "<<matchingObjectType ; }
286 const BeamSpot bs = *recoBeamSpotHandle ;
293 <<
"Treating "<<gsfElectrons.
product()->size()<<
" electrons" 294 <<
" from event "<<ievt<<
" in run "<<irun<<
" and lumiblock "<<ils ;
298 reco::GsfElectronCollection::const_iterator gsfIter ;
300 ( gsfIter=gsfElectrons->begin() ;
301 gsfIter!=gsfElectrons->end();
306 (gsfIter->vertex().x()-bs.
position().x()) * (gsfIter->vertex().x()-bs.
position().x()) +
307 (gsfIter->vertex().y()-bs.
position().y()) * (gsfIter->vertex().y()-bs.
position().y()) ;
308 vertexTIP =
sqrt(vertexTIP) ;
311 if (!
selected(gsfIter,vertexTIP)) continue ;
314 reco::GsfElectronCollection::const_iterator gsfIter2 ;
316 ( gsfIter2=gsfIter+1;
317 gsfIter2!=gsfElectrons->end() ;
320 if (!
selected(gsfIter2,vertexTIP))
continue ;
323 if ( ( (gsfIter->charge())*(gsfIter2->charge()) )<0. )
338 double R=TMath::Sqrt(sclRef->x()*sclRef->x() + sclRef->y()*sclRef->y() +sclRef->z()*sclRef->z());
339 double Rt=TMath::Sqrt(sclRef->x()*sclRef->x() + sclRef->y()*sclRef->y());
351 h1_chi2->
Fill( gsfIter->gsfTrack()->normalizedChi2() );
352 py_chi2VsEta->
Fill( gsfIter->eta(), gsfIter->gsfTrack()->normalizedChi2() );
353 py_chi2VsPhi->
Fill( gsfIter->phi(), gsfIter->gsfTrack()->normalizedChi2() );
373 if (gsfIter->eta() > 0) {
398 int eleClass = gsfIter->classification() ;
399 if (gsfIter->isEE()) eleClass+=5;
407 if (gsfIter->trackerDrivenSeed()||gsfIter->ecalDrivenSeed())
h1_provenance->
Fill(0.);
408 if (gsfIter->trackerDrivenSeed()&&!gsfIter->ecalDrivenSeed())
h1_provenance->
Fill(-2.);
409 if (!gsfIter->trackerDrivenSeed()&&gsfIter->ecalDrivenSeed())
h1_provenance->
Fill(2.);
426 int matchingObjectNum=0;
427 reco::SuperClusterCollection::const_iterator moIter ;
429 ( moIter=recoClusters->begin() ;
430 moIter!=recoClusters->end() ;
446 bool okGsfFound =
false ;
447 double gsfOkRatio = 999999999. ;
449 reco::GsfElectronCollection::const_iterator gsfIter ;
451 ( gsfIter=gsfElectrons->begin() ;
452 gsfIter!=gsfElectrons->end() ;
457 (gsfIter->vertex().x()-bs.
position().x()) * (gsfIter->vertex().x()-bs.
position().x()) +
458 (gsfIter->vertex().y()-bs.
position().y()) * (gsfIter->vertex().y()-bs.
position().y()) ;
459 vertexTIP =
sqrt(vertexTIP) ;
462 if (!
selected(gsfIter,vertexTIP)) continue ;
467 double dphi = gsfIter->phi()-moIter->phi() ;
469 { dphi = dphi < 0? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi ; }
473 double tmpGsfRatio = gsfIter->p()/moIter->energy() ;
476 gsfOkRatio = tmpGsfRatio;
477 bestGsfElectron=*gsfIter;
503 float mee2 = p12.Dot(p12) ;
504 float invMass = mee2 > 0. ?
sqrt(mee2) : 0;
520 if (gsfIter->pt()<
minPt_)
return true ;
522 if (gsfIter->isEB() &&
isEE_)
return true ;
523 if (gsfIter->isEE() &&
isEB_)
return true ;
527 if (gsfIter->trackerDrivenSeed() &&
isEcalDriven_)
return true ;
534 if (gsfIter->superCluster()->energy()/cosh(gsfIter->superCluster()->eta())<
minEt_)
return true ;
541 if (gsfIter->isEB() && vertexTIP >
tipMaxBarrel_)
return true ;
544 if (gsfIter->dr03TkSumPt() >
tkIso03Max_)
return true ;
556 if (gsfIter->isEB() && gsfIter->eSuperClusterOverP() <
eOverPMinBarrel_)
return true ;
557 if (gsfIter->isEB() && gsfIter->eSuperClusterOverP() >
eOverPMaxBarrel_)
return true ;
558 if (gsfIter->isEE() && gsfIter->eSuperClusterOverP() <
eOverPMinEndcaps_)
return true ;
559 if (gsfIter->isEE() && gsfIter->eSuperClusterOverP() >
eOverPMaxEndcaps_)
return true ;
MonitorElement * h1_foundHits
T getParameter(std::string const &) const
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
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * h1_vertexPt_barrel
MonitorElement * h1_PFch_dr03
MonitorElement * py_lostHitsVsEta
MonitorElement * h1_sclSigEtaEta_barrel
MonitorElement * py_chi2VsEta
edm::EDGetTokenT< reco::SuperClusterCollection > matchingObjectCollection_
MonitorElement * h1_vertexEta
MonitorElement * py_chi2VsPhi
MonitorElement * h1_Eop_endcaps
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")
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
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")
edm::InputTag triggerResults_
MonitorElement * py_HoeVsPhi
MonitorElement * h1_matchedObject_Pt
double sigIetaIetaMinBarrel_
double maxPtMatchingObject_
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
unsigned int LuminosityBlockNumber_t
double ecalIso03MaxBarrel_
MonitorElement * h1_matchedObject_Phi
MonitorElement * h1_PFem_dr03
MonitorElement * h1_tkSumPt_dr03
MonitorElement * h1_dEtaEleCl_propOut_endcapsPos
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
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
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 * 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")
MonitorElement * h1_dEtaEleCl_propOut_endcapsNeg
MonitorElement * h1_dPhiSc_propVtx_endcapsNeg
ElectronAnalyzer(const edm::ParameterSet &conf)
edm::EDGetTokenT< reco::GsfTrackCollection > gsftrackCollection_
MonitorElement * h1_vertexPt_endcaps
MonitorElement * py_lostHitsVsPhi
double deltaR(double eta1, double eta2, double phi1, double phi2)
MonitorElement * h1_vertexZ
MonitorElement * py_dPhiSc_propVtxVsPhi
double hcalIso03Depth1MaxEndcaps_
void setCurrentFolder(const std::string &fullpath)
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)
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
MonitorElement * h2_vertexEtaVsPhi
MonitorElement * h1_EeleOPout_endcaps
edm::EDGetTokenT< reco::GsfElectronCollection > electronCollection_
MonitorElement * h1_classes
MonitorElement * h1_sclEt
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
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
double ecalIso03MaxEndcaps_
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
virtual ~ElectronAnalyzer()
MonitorElement * h1_sigIEtaIEta5x5_endcaps
MonitorElement * h1_sclSigEtaEta_endcaps
const Point & position() const
position
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 * 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 ;
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)