43 #include "CLHEP/Units/GlobalPhysicalConstants.h"
59 beamSpot_(conf.getParameter<edm::InputTag>(
"beamSpot"))
71 assert(matchingCondition_==
"Cone") ;
198 if ( locSC != std::string::npos ) {
199 std::cout <<
"Matching objects are SuperClusters "<< std::endl;
202 std::cout <<
"Didn't recognize input matching objects!! " << std::endl;
210 hlabel=
"h_"+type+
"Num"; htitle=
"# "+type+
"s";
212 hlabel=
"h_"+type+
"_eta"; htitle=type+
" #eta";
214 hlabel=
"h_"+type+
"_abseta"; htitle=type+
" |#eta|";
216 hlabel=
"h_"+type+
"_P"; htitle=type+
" p";
218 hlabel=
"h_"+type+
"_Pt"; htitle=type+
" pt";
220 hlabel=
"h_"+type+
"_phi"; htitle=type+
" phi";
222 hlabel=
"h_"+type+
"_z"; htitle=type+
" z";
254 h_ele_vertexTIP =
new TH1F(
"h_ele_vertexTIP",
"ele transverse impact parameter (wrt bs)",90,0.,0.15);
255 h_ele_charge =
new TH1F(
"h_ele_charge",
"ele charge",5,-2.,2.);
263 h_ele_Et->GetXaxis()-> SetTitle(
"E_{T} (GeV)");
264 h_ele_Et->GetYaxis()-> SetTitle(
"Events");
285 histNum_=
new TH1F(
"h_recEleNum",
"# rec electrons",20, 0.,20.);
287 histNum_-> GetXaxis()-> SetTitle(
"N_{ele}");
288 histNum_-> GetYaxis()-> SetTitle(
"Events");
298 histSclSigEtaEta_ =
new TH1F(
"h_scl_sigetaeta",
"ele supercluster sigma eta eta",100,0.,0.05);
312 h_ele_lostHits =
new TH1F(
"h_ele_lostHits",
"ele track # lost hits", 5,0.,5.);
316 h_ele_chi2 =
new TH1F(
"h_ele_chi2",
"ele track #chi^{2}", 100,0.,15.);
325 h_ele_chi2->GetXaxis()-> SetTitle(
"#Chi^{2}");
347 h_ele_PinMnPout =
new TH1F(
"h_ele_PinMnPout",
"ele track inner p - outer p, mean" ,
nbinp,0.,200.);
350 h_ele_mva =
new TH1F(
"h_ele_mva",
"ele identification mva",100,-1.,1.);
353 h_ele_PinMnPout->GetXaxis()-> SetTitle(
"P_{vertex} - P_{out} (GeV/c)");
368 h_ele_EoP->GetXaxis()-> SetTitle(
"E/P_{vertex}");
369 h_ele_EoP->GetYaxis()-> SetTitle(
"Events");
388 h_ele_HoE-> GetXaxis()-> SetTitle(
"H/E") ;
389 h_ele_HoE-> GetYaxis()-> SetTitle(
"Events") ;
395 h_ele_tkSumPt_dr03 =
new TH1F(
"h_ele_tkSumPt_dr03",
"tk isolation sum, dR=0.3",100,0.0,20.);
453 std::cout <<
"efficiency calculation " << std::endl;
457 h_ele_ptEff->Reset();
459 h_ele_ptEff->GetXaxis()->SetTitle(
"p_{T} (GeV/c)");
460 h_ele_ptEff->GetYaxis()->SetTitle(
"Efficiency");
464 h_ele_etaEff->Reset();
466 h_ele_etaEff->Print();
467 h_ele_etaEff->GetXaxis()->SetTitle(
"#eta");
468 h_ele_etaEff->GetYaxis()->SetTitle(
"Efficiency");
472 h_ele_absetaEff->Reset();
474 h_ele_absetaEff->GetXaxis()->SetTitle(
"|#eta|");
475 h_ele_absetaEff->GetYaxis()->SetTitle(
"Efficiency");
479 h_ele_phiEff->Reset();
481 h_ele_phiEff->GetXaxis()->SetTitle(
"#phi (rad)");
482 h_ele_phiEff->GetYaxis()->SetTitle(
"Efficiency");
489 h_ele_zEff->GetXaxis()->SetTitle(
"z (cm)");
490 h_ele_zEff->GetYaxis()->SetTitle(
"Efficiency");
600 h_ele_mee_os-> GetXaxis()-> SetTitle(
"m_{e^{+}e^{-}} (GeV/c^{2})");
609 h_ele_etaEff->Write();
611 h_ele_phiEff->Write();
612 h_ele_absetaEff->Write();
613 h_ele_ptEff->Write();
653 edm::LogInfo(
"DQMAnalyzer::analyze")<<
"Treating event "<<iEvent.
id() ;
660 edm::LogInfo(
"DQMAnalyzer::analyze")<<
"Event has "<<gsfElectrons.
product()->size()<<
" electrons" ;
666 histNum_->Fill((*gsfElectrons).size());
669 reco::GsfElectronCollection::const_iterator gsfIter ;
671 ( gsfIter=gsfElectrons->begin() ;
672 gsfIter!=gsfElectrons->end();
677 (gsfIter->vertex().x()-bs.
position().x()) * (gsfIter->vertex().x()-bs.
position().x()) +
678 (gsfIter->vertex().y()-bs.
position().y()) * (gsfIter->vertex().y()-bs.
position().y()) ;
679 vertexTIP =
sqrt(vertexTIP) ;
682 if (!
selected(gsfIter,vertexTIP)) continue ;
688 h_ele_Et->Fill( gsfIter->superCluster()->energy()/cosh( gsfIter->superCluster()->eta()) );
702 double R=TMath::Sqrt(sclRef->x()*sclRef->x() + sclRef->y()*sclRef->y() +sclRef->z()*sclRef->z());
703 double Rt=TMath::Sqrt(sclRef->x()*sclRef->x() + sclRef->y()*sclRef->y());
724 h_ele_chi2->Fill( gsfIter->gsfTrack()->normalizedChi2() );
725 h_ele_chi2VsEta->Fill( gsfIter->eta(), gsfIter->gsfTrack()->normalizedChi2() );
726 h_ele_chi2VsPhi->Fill( gsfIter->phi(), gsfIter->gsfTrack()->normalizedChi2() );
727 h_ele_chi2VsPt->Fill( gsfIter->pt(), gsfIter->gsfTrack()->normalizedChi2() );
733 h_ele_PinMnPout->Fill( gsfIter->gsfTrack()->innerMomentum().R() - gsfIter->gsfTrack()->outerMomentum().R() );
734 h_ele_outerP->Fill( gsfIter->gsfTrack()->outerMomentum().R() );
735 h_ele_outerPt->Fill( gsfIter->gsfTrack()->outerMomentum().Rho() );
739 h_ele_PinMnPout_mode->Fill( gsfIter->trackMomentumAtVtx().R() - gsfIter->trackMomentumOut().R() );
758 h_ele_EoP->Fill( gsfIter->eSuperClusterOverP() );
766 h_ele_HoE->Fill(gsfIter->hadronicOverEm());
775 if (gsfIter->trackerDrivenSeed()||gsfIter->ecalDrivenSeed())
h_ele_provenance->Fill(0.);
776 if (gsfIter->trackerDrivenSeed()&&!gsfIter->ecalDrivenSeed())
h_ele_provenance->Fill(-2.);
777 if (!gsfIter->trackerDrivenSeed()&&gsfIter->ecalDrivenSeed())
h_ele_provenance->Fill(2.);
790 int matchingObjectNum=0 ;
791 reco::SuperClusterCollection::const_iterator moIter ;
793 ( moIter=recoClusters->begin() ;
794 moIter!=recoClusters->end() ;
818 bool okGsfFound =
false;
819 double gsfOkRatio = 999999.;
821 reco::GsfElectronCollection::const_iterator gsfIter ;
823 ( gsfIter=gsfElectrons->begin() ;
824 gsfIter!=gsfElectrons->end() ;
828 (gsfIter->vertex().x()-bs.
position().x()) * (gsfIter->vertex().x()-bs.
position().x()) +
829 (gsfIter->vertex().y()-bs.
position().y()) * (gsfIter->vertex().y()-bs.
position().y()) ;
830 vertexTIP =
sqrt(vertexTIP) ;
833 if (!
selected(gsfIter,vertexTIP)) continue ;
837 reco::GsfElectronCollection::const_iterator gsfIter2 ;
839 ( gsfIter2=gsfIter+1 ;
840 gsfIter2!=gsfElectrons->end() ;
844 float mee2 = p12.Dot(p12) ;
845 bool opsign = (gsfIter->charge()*gsfIter2->charge()<0.) ;
846 float invMass =
sqrt(mee2) ;
851 if(
TAGcheckclass_ && (gsfIter->classification()==GsfElectron::SHOWERING || gsfIter->isGap()))
break;
854 if(
PROBEetcut_ && (gsfIter2->superCluster()->energy()/cosh(gsfIter2->superCluster()->eta())<
minEt_))
continue;
855 if(
PROBEcheckclass_ && (gsfIter2->classification()==GsfElectron::SHOWERING || gsfIter2->isGap()))
continue;
857 if( invMass < massLow_ || invMass >
massHigh_ ) continue ;
860 bestGsfElectron =* gsfIter2 ;
866 reco::GsfElectronCollection::const_iterator gsfIter2 ;
868 ( gsfIter2=gsfIter+1;
869 gsfIter2!=gsfElectrons->end() ;
873 float mee2 = p12.Dot(p12) ;
875 float invMass =
sqrt(mee2) ;
882 double dphi = gsfIter->phi()-moIter->phi() ;
884 { dphi = dphi < 0? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi ; }
890 double tmpGsfRatio = gsfIter->p()/moIter->energy();
891 if ( fabs(tmpGsfRatio-1) < fabs(gsfOkRatio-1) &&
Selection_ != 4 )
893 gsfOkRatio = tmpGsfRatio;
894 bestGsfElectron=*gsfIter;
956 for (
unsigned int i=0;
i<triggerNames.
size();
i++)
963 for (
unsigned int i=0;
i!=
n;
i++)
971 n=triggerResults->size() ;
974 for (
unsigned int i=0 ;
i!=
n ;
i++)
998 unsigned int fired=0 ;
999 for (
unsigned int i=0 ;
i!=
n ;
i++ )
1029 if (gsfIter->pt()<
minPt_)
return true ;
1031 if (gsfIter->isEB() &&
isEE_)
return true ;
1032 if (gsfIter->isEE() &&
isEB_)
return true ;
1036 if (gsfIter->trackerDrivenSeed() &&
isEcalDriven_)
return true ;
1043 if (gsfIter->superCluster()->energy()/cosh(gsfIter->superCluster()->eta())<
minEt_)
return true ;
1050 if (gsfIter->isEB() && vertexTIP >
tipMaxBarrel_)
return true ;
1053 if (gsfIter->dr03TkSumPt() >
tkIso03Max_)
return true ;
1057 if (gsfIter->isEB() && gsfIter->dr03EcalRecHitSumEt() >
ecalIso03MaxBarrel_)
return true ;
1065 if (gsfIter->isEB() && gsfIter->eSuperClusterOverP() <
eOverPMinBarrel_)
return true ;
1066 if (gsfIter->isEB() && gsfIter->eSuperClusterOverP() >
eOverPMaxBarrel_)
return true ;
1067 if (gsfIter->isEE() && gsfIter->eSuperClusterOverP() <
eOverPMinEndcaps_)
return true ;
1068 if (gsfIter->isEE() && gsfIter->eSuperClusterOverP() >
eOverPMaxEndcaps_)
return true ;
1069 if (gsfIter->isEB() && fabs(gsfIter->deltaEtaSuperClusterTrackAtVtx()) <
dEtaMinBarrel_)
return true ;
1070 if (gsfIter->isEB() && fabs(gsfIter->deltaEtaSuperClusterTrackAtVtx()) >
dEtaMaxBarrel_)
return true ;
1071 if (gsfIter->isEE() && fabs(gsfIter->deltaEtaSuperClusterTrackAtVtx()) <
dEtaMinEndcaps_)
return true ;
1072 if (gsfIter->isEE() && fabs(gsfIter->deltaEtaSuperClusterTrackAtVtx()) >
dEtaMaxEndcaps_)
return true ;
1073 if (gsfIter->isEB() && fabs(gsfIter->deltaPhiSuperClusterTrackAtVtx()) <
dPhiMinBarrel_)
return true ;
1074 if (gsfIter->isEB() && fabs(gsfIter->deltaPhiSuperClusterTrackAtVtx()) >
dPhiMaxBarrel_)
return true ;
1075 if (gsfIter->isEE() && fabs(gsfIter->deltaPhiSuperClusterTrackAtVtx()) <
dPhiMinEndcaps_)
return true ;
1076 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
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
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
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_