42 #include "CLHEP/Units/GlobalPhysicalConstants.h"
58 beamSpot_(conf.getParameter<edm::InputTag>(
"beamSpot"))
70 assert(matchingCondition_==
"Cone") ;
197 if ( locSC != std::string::npos ) {
198 std::cout <<
"Matching objects are SuperClusters "<< std::endl;
201 std::cout <<
"Didn't recognize input matching objects!! " << std::endl;
209 hlabel=
"h_"+type+
"Num"; htitle=
"# "+type+
"s";
211 hlabel=
"h_"+type+
"_eta"; htitle=type+
" #eta";
213 hlabel=
"h_"+type+
"_abseta"; htitle=type+
" |#eta|";
215 hlabel=
"h_"+type+
"_P"; htitle=type+
" p";
217 hlabel=
"h_"+type+
"_Pt"; htitle=type+
" pt";
219 hlabel=
"h_"+type+
"_phi"; htitle=type+
" phi";
221 hlabel=
"h_"+type+
"_z"; htitle=type+
" z";
253 h_ele_vertexTIP =
new TH1F(
"h_ele_vertexTIP",
"ele transverse impact parameter (wrt bs)",90,0.,0.15);
254 h_ele_charge =
new TH1F(
"h_ele_charge",
"ele charge",5,-2.,2.);
262 h_ele_Et->GetXaxis()-> SetTitle(
"E_{T} (GeV)");
263 h_ele_Et->GetYaxis()-> SetTitle(
"Events");
284 histNum_=
new TH1F(
"h_recEleNum",
"# rec electrons",20, 0.,20.);
286 histNum_-> GetXaxis()-> SetTitle(
"N_{ele}");
287 histNum_-> GetYaxis()-> SetTitle(
"Events");
297 histSclSigEtaEta_ =
new TH1F(
"h_scl_sigetaeta",
"ele supercluster sigma eta eta",100,0.,0.05);
311 h_ele_lostHits =
new TH1F(
"h_ele_lostHits",
"ele track # lost hits", 5,0.,5.);
315 h_ele_chi2 =
new TH1F(
"h_ele_chi2",
"ele track #chi^{2}", 100,0.,15.);
324 h_ele_chi2->GetXaxis()-> SetTitle(
"#Chi^{2}");
346 h_ele_PinMnPout =
new TH1F(
"h_ele_PinMnPout",
"ele track inner p - outer p, mean" ,
nbinp,0.,200.);
349 h_ele_mva =
new TH1F(
"h_ele_mva",
"ele identification mva",100,-1.,1.);
352 h_ele_PinMnPout->GetXaxis()-> SetTitle(
"P_{vertex} - P_{out} (GeV/c)");
367 h_ele_EoP->GetXaxis()-> SetTitle(
"E/P_{vertex}");
368 h_ele_EoP->GetYaxis()-> SetTitle(
"Events");
387 h_ele_HoE-> GetXaxis()-> SetTitle(
"H/E") ;
388 h_ele_HoE-> GetYaxis()-> SetTitle(
"Events") ;
394 h_ele_tkSumPt_dr03 =
new TH1F(
"h_ele_tkSumPt_dr03",
"tk isolation sum, dR=0.3",100,0.0,20.);
452 std::cout <<
"efficiency calculation " << std::endl;
456 h_ele_ptEff->Reset();
458 h_ele_ptEff->GetXaxis()->SetTitle(
"p_{T} (GeV/c)");
459 h_ele_ptEff->GetYaxis()->SetTitle(
"Efficiency");
463 h_ele_etaEff->Reset();
465 h_ele_etaEff->Print();
466 h_ele_etaEff->GetXaxis()->SetTitle(
"#eta");
467 h_ele_etaEff->GetYaxis()->SetTitle(
"Efficiency");
471 h_ele_absetaEff->Reset();
473 h_ele_absetaEff->GetXaxis()->SetTitle(
"|#eta|");
474 h_ele_absetaEff->GetYaxis()->SetTitle(
"Efficiency");
478 h_ele_phiEff->Reset();
480 h_ele_phiEff->GetXaxis()->SetTitle(
"#phi (rad)");
481 h_ele_phiEff->GetYaxis()->SetTitle(
"Efficiency");
488 h_ele_zEff->GetXaxis()->SetTitle(
"z (cm)");
489 h_ele_zEff->GetYaxis()->SetTitle(
"Efficiency");
599 h_ele_mee_os-> GetXaxis()-> SetTitle(
"m_{e^{+}e^{-}} (GeV/c^{2})");
608 h_ele_etaEff->Write();
610 h_ele_phiEff->Write();
611 h_ele_absetaEff->Write();
612 h_ele_ptEff->Write();
652 edm::LogInfo(
"DQMAnalyzer::analyze")<<
"Treating event "<<iEvent.
id() ;
659 edm::LogInfo(
"DQMAnalyzer::analyze")<<
"Event has "<<gsfElectrons.
product()->size()<<
" electrons" ;
665 histNum_->Fill((*gsfElectrons).size());
668 reco::GsfElectronCollection::const_iterator gsfIter ;
670 ( gsfIter=gsfElectrons->begin() ;
671 gsfIter!=gsfElectrons->end();
676 (gsfIter->vertex().x()-bs.
position().x()) * (gsfIter->vertex().x()-bs.
position().x()) +
677 (gsfIter->vertex().y()-bs.
position().y()) * (gsfIter->vertex().y()-bs.
position().y()) ;
678 vertexTIP =
sqrt(vertexTIP) ;
681 if (!
selected(gsfIter,vertexTIP)) continue ;
687 h_ele_Et->Fill( gsfIter->superCluster()->energy()/cosh( gsfIter->superCluster()->eta()) );
701 double R=TMath::Sqrt(sclRef->x()*sclRef->x() + sclRef->y()*sclRef->y() +sclRef->z()*sclRef->z());
702 double Rt=TMath::Sqrt(sclRef->x()*sclRef->x() + sclRef->y()*sclRef->y());
723 h_ele_chi2->Fill( gsfIter->gsfTrack()->normalizedChi2() );
724 h_ele_chi2VsEta->Fill( gsfIter->eta(), gsfIter->gsfTrack()->normalizedChi2() );
725 h_ele_chi2VsPhi->Fill( gsfIter->phi(), gsfIter->gsfTrack()->normalizedChi2() );
726 h_ele_chi2VsPt->Fill( gsfIter->pt(), gsfIter->gsfTrack()->normalizedChi2() );
732 h_ele_PinMnPout->Fill( gsfIter->gsfTrack()->innerMomentum().R() - gsfIter->gsfTrack()->outerMomentum().R() );
733 h_ele_outerP->Fill( gsfIter->gsfTrack()->outerMomentum().R() );
734 h_ele_outerPt->Fill( gsfIter->gsfTrack()->outerMomentum().Rho() );
738 h_ele_PinMnPout_mode->Fill( gsfIter->trackMomentumAtVtx().R() - gsfIter->trackMomentumOut().R() );
757 h_ele_EoP->Fill( gsfIter->eSuperClusterOverP() );
765 h_ele_HoE->Fill(gsfIter->hadronicOverEm());
774 if (gsfIter->trackerDrivenSeed()||gsfIter->ecalDrivenSeed())
h_ele_provenance->Fill(0.);
775 if (gsfIter->trackerDrivenSeed()&&!gsfIter->ecalDrivenSeed())
h_ele_provenance->Fill(-2.);
776 if (!gsfIter->trackerDrivenSeed()&&gsfIter->ecalDrivenSeed())
h_ele_provenance->Fill(2.);
789 int matchingObjectNum=0 ;
790 reco::SuperClusterCollection::const_iterator moIter ;
792 ( moIter=recoClusters->begin() ;
793 moIter!=recoClusters->end() ;
817 bool okGsfFound =
false;
818 double gsfOkRatio = 999999.;
820 reco::GsfElectronCollection::const_iterator gsfIter ;
822 ( gsfIter=gsfElectrons->begin() ;
823 gsfIter!=gsfElectrons->end() ;
827 (gsfIter->vertex().x()-bs.
position().x()) * (gsfIter->vertex().x()-bs.
position().x()) +
828 (gsfIter->vertex().y()-bs.
position().y()) * (gsfIter->vertex().y()-bs.
position().y()) ;
829 vertexTIP =
sqrt(vertexTIP) ;
832 if (!
selected(gsfIter,vertexTIP)) continue ;
836 reco::GsfElectronCollection::const_iterator gsfIter2 ;
838 ( gsfIter2=gsfIter+1 ;
839 gsfIter2!=gsfElectrons->end() ;
843 float mee2 = p12.Dot(p12) ;
844 bool opsign = (gsfIter->charge()*gsfIter2->charge()<0.) ;
845 float invMass =
sqrt(mee2) ;
850 if(
TAGcheckclass_ && (gsfIter->classification()==GsfElectron::SHOWERING || gsfIter->isGap()))
break;
853 if(
PROBEetcut_ && (gsfIter2->superCluster()->energy()/cosh(gsfIter2->superCluster()->eta())<
minEt_))
continue;
854 if(
PROBEcheckclass_ && (gsfIter2->classification()==GsfElectron::SHOWERING || gsfIter2->isGap()))
continue;
856 if( invMass < massLow_ || invMass >
massHigh_ ) continue ;
859 bestGsfElectron =* gsfIter2 ;
865 reco::GsfElectronCollection::const_iterator gsfIter2 ;
867 ( gsfIter2=gsfIter+1;
868 gsfIter2!=gsfElectrons->end() ;
872 float mee2 = p12.Dot(p12) ;
874 float invMass =
sqrt(mee2) ;
881 double dphi = gsfIter->phi()-moIter->phi() ;
883 { dphi = dphi < 0? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi ; }
889 double tmpGsfRatio = gsfIter->p()/moIter->energy();
890 if ( fabs(tmpGsfRatio-1) < fabs(gsfOkRatio-1) &&
Selection_ != 4 )
892 gsfOkRatio = tmpGsfRatio;
893 bestGsfElectron=*gsfIter;
955 for (
unsigned int i=0;
i<triggerNames.
size();
i++)
962 for (
unsigned int i=0;
i!=
n;
i++)
970 n=triggerResults->size() ;
973 for (
unsigned int i=0 ;
i!=
n ;
i++)
997 unsigned int fired=0 ;
998 for (
unsigned int i=0 ;
i!=
n ;
i++ )
1028 if (gsfIter->pt()<
minPt_)
return true ;
1030 if (gsfIter->isEB() &&
isEE_)
return true ;
1031 if (gsfIter->isEE() &&
isEB_)
return true ;
1035 if (gsfIter->trackerDrivenSeed() &&
isEcalDriven_)
return true ;
1042 if (gsfIter->superCluster()->energy()/cosh(gsfIter->superCluster()->eta())<
minEt_)
return true ;
1049 if (gsfIter->isEB() && vertexTIP >
tipMaxBarrel_)
return true ;
1052 if (gsfIter->dr03TkSumPt() >
tkIso03Max_)
return true ;
1056 if (gsfIter->isEB() && gsfIter->dr03EcalRecHitSumEt() >
ecalIso03MaxBarrel_)
return true ;
1064 if (gsfIter->isEB() && gsfIter->eSuperClusterOverP() <
eOverPMinBarrel_)
return true ;
1065 if (gsfIter->isEB() && gsfIter->eSuperClusterOverP() >
eOverPMaxBarrel_)
return true ;
1066 if (gsfIter->isEE() && gsfIter->eSuperClusterOverP() <
eOverPMinEndcaps_)
return true ;
1067 if (gsfIter->isEE() && gsfIter->eSuperClusterOverP() >
eOverPMaxEndcaps_)
return true ;
1068 if (gsfIter->isEB() && fabs(gsfIter->deltaEtaSuperClusterTrackAtVtx()) <
dEtaMinBarrel_)
return true ;
1069 if (gsfIter->isEB() && fabs(gsfIter->deltaEtaSuperClusterTrackAtVtx()) >
dEtaMaxBarrel_)
return true ;
1070 if (gsfIter->isEE() && fabs(gsfIter->deltaEtaSuperClusterTrackAtVtx()) <
dEtaMinEndcaps_)
return true ;
1071 if (gsfIter->isEE() && fabs(gsfIter->deltaEtaSuperClusterTrackAtVtx()) >
dEtaMaxEndcaps_)
return true ;
1072 if (gsfIter->isEB() && fabs(gsfIter->deltaPhiSuperClusterTrackAtVtx()) <
dPhiMinBarrel_)
return true ;
1073 if (gsfIter->isEB() && fabs(gsfIter->deltaPhiSuperClusterTrackAtVtx()) >
dPhiMaxBarrel_)
return true ;
1074 if (gsfIter->isEE() && fabs(gsfIter->deltaPhiSuperClusterTrackAtVtx()) <
dPhiMinEndcaps_)
return true ;
1075 if (gsfIter->isEE() && fabs(gsfIter->deltaPhiSuperClusterTrackAtVtx()) >
dPhiMaxEndcaps_)
return true ;
double hcalIso03Depth2MaxEndcaps_
bool trigger(const edm::Event &e)
T getParameter(std::string const &) const
TH1F * h_matchingObjectAbsEta
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
edm::InputTag matchingObjectCollection_
double sigIetaIetaMinEndcaps_
TH1F * h_matchingObjectEta
TH2F * h_ele_ambiguousTracksVsEta
double maxAbsEtaMatchingObject_
TH1F * h_ele_dEtaSc_propVtx
TH1F * h_ele_ecalRecHitSumEt_dr04
TH1F * h_ele_dEtaEleCl_propOut
TH1F * h_ele_dPhiSc_propVtx
double hcalIso03Depth1MaxBarrel_
TH1F * h_ele_ecalRecHitSumEt_dr03
TH1F * h_ele_tkSumPt_dr03
bool generalCut(const reco::GsfElectronCollection::const_iterator &gsfIter)
TH1F * h_ele_matchingObjectAbsEta_matched
TH1F * h_ele_outerPt_mode
double maxPtMatchingObject_
Strings::size_type size() const
double sigIetaIetaMaxBarrel_
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
TH1F * h_ele_hcalDepth1TowerSumEt_dr03
double hadronicOverEmMaxBarrel_
double hcalIso03Depth1MaxEndcaps_
TH1F * h_ele_hcalDepth1TowerSumEt_dr04
bool selected(const reco::GsfElectronCollection::const_iterator &gsfIter, double vertexTIP)
double sigIetaIetaMaxEndcaps_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
TH2F * h_ele_lostHitsVsEta
unsigned int nAfterTrigger_
unsigned int triggerIndex(std::string const &name) const
std::vector< unsigned int > HLTPathsByIndex_
TH2F * h_ele_lostHitsVsPhi
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
bool isolationCut(const reco::GsfElectronCollection::const_iterator &gsfIter, double vertexTIP)
TH2F * h_ele_ambiguousTracksVsPhi
TH1F * h_matchingObjectPhi
bool idCut(const reco::GsfElectronCollection::const_iterator &gsfIter)
TH1F * h_ele_matchingObjectZ_matched
TH1F * h_ele_PinMnPout_mode
static std::string const triggerResults
TH1F * h_ele_dPhiEleCl_propOut
TH1F * h_ele_matchingObjectPhi_matched
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)
bool etCut(const reco::GsfElectronCollection::const_iterator &gsfIter)
TH1F * h_ele_hcalDepth2TowerSumEt_dr03
TH2F * h_ele_foundHitsVsPhi
double hadronicOverEmMaxEndcaps_
double deltaR(double eta1, double eta2, double phi1, double phi2)
TH2F * h_ele_foundHitsVsPt
std::vector< std::string > HLTPathsByName_
TH2F * h_ele_ambiguousTracksVsPt
std::string matchingCondition_
std::string const & triggerName(unsigned int index) const
double sigIetaIetaMinBarrel_
TH1F * h_ele_tkSumPt_dr04
TH1F * h_ele_matchingObjectPt_matched
T const * product() const
edm::InputTag electronCollection_
double ecalIso03MaxEndcaps_
TH1F * h_ele_dEtaCl_propOut
return(e1-e2)*(e1-e2)+dp *dp
TH1F * h_matchingObjectPt
edm::InputTag triggerResults_
TH1F * h_ele_dPhiCl_propOut
TH2F * h_ele_lostHitsVsPt
TH1F * h_ele_matchingObjectEta_matched
const Point & position() const
position
TH1F * h_matchingObjectNum
volatile std::atomic< bool > shutdown_flag false
TH1F * h_ele_ambiguousTracks
TH2F * h_ele_foundHitsVsEta
DQMAnalyzer(const edm::ParameterSet &conf)
TH1F * h_ele_hcalDepth2TowerSumEt_dr04
Power< A, B >::type pow(const A &a, const B &b)
double ecalIso03MaxBarrel_