40 #include "CLHEP/Units/GlobalPhysicalConstants.h" 56 beamSpot_(conf.getParameter<
edm::InputTag>(
"beamSpot"))
68 assert(matchingCondition_==
"Cone") ;
195 if ( locSC != std::string::npos ) {
196 std::cout <<
"Matching objects are SuperClusters "<< std::endl;
199 std::cout <<
"Didn't recognize input matching objects!! " << std::endl;
207 hlabel=
"h_"+type+
"Num"; htitle=
"# "+type+
"s";
209 hlabel=
"h_"+type+
"_eta"; htitle=type+
" #eta";
211 hlabel=
"h_"+type+
"_abseta"; htitle=type+
" |#eta|";
213 hlabel=
"h_"+type+
"_P"; htitle=type+
" p";
215 hlabel=
"h_"+type+
"_Pt"; htitle=type+
" pt";
217 hlabel=
"h_"+type+
"_phi"; htitle=type+
" phi";
219 hlabel=
"h_"+type+
"_z"; htitle=type+
" z";
251 h_ele_vertexTIP =
new TH1F(
"h_ele_vertexTIP",
"ele transverse impact parameter (wrt bs)",90,0.,0.15);
252 h_ele_charge =
new TH1F(
"h_ele_charge",
"ele charge",5,-2.,2.);
260 h_ele_Et->GetXaxis()-> SetTitle(
"E_{T} (GeV)");
261 h_ele_Et->GetYaxis()-> SetTitle(
"Events");
282 histNum_=
new TH1F(
"h_recEleNum",
"# rec electrons",20, 0.,20.);
284 histNum_-> GetXaxis()-> SetTitle(
"N_{ele}");
285 histNum_-> GetYaxis()-> SetTitle(
"Events");
295 histSclSigEtaEta_ =
new TH1F(
"h_scl_sigetaeta",
"ele supercluster sigma eta eta",100,0.,0.05);
309 h_ele_lostHits =
new TH1F(
"h_ele_lostHits",
"ele track # lost hits", 5,0.,5.);
313 h_ele_chi2 =
new TH1F(
"h_ele_chi2",
"ele track #chi^{2}", 100,0.,15.);
322 h_ele_chi2->GetXaxis()-> SetTitle(
"#Chi^{2}");
344 h_ele_PinMnPout =
new TH1F(
"h_ele_PinMnPout",
"ele track inner p - outer p, mean" ,
nbinp,0.,200.);
347 h_ele_mva =
new TH1F(
"h_ele_mva",
"ele identification mva",100,-1.,1.);
350 h_ele_PinMnPout->GetXaxis()-> SetTitle(
"P_{vertex} - P_{out} (GeV/c)");
365 h_ele_EoP->GetXaxis()-> SetTitle(
"E/P_{vertex}");
366 h_ele_EoP->GetYaxis()-> SetTitle(
"Events");
385 h_ele_HoE-> GetXaxis()-> SetTitle(
"H/E") ;
386 h_ele_HoE-> GetYaxis()-> SetTitle(
"Events") ;
392 h_ele_tkSumPt_dr03 =
new TH1F(
"h_ele_tkSumPt_dr03",
"tk isolation sum, dR=0.3",100,0.0,20.);
450 std::cout <<
"efficiency calculation " << std::endl;
454 h_ele_ptEff->Reset();
456 h_ele_ptEff->GetXaxis()->SetTitle(
"p_{T} (GeV/c)");
457 h_ele_ptEff->GetYaxis()->SetTitle(
"Efficiency");
461 h_ele_etaEff->Reset();
463 h_ele_etaEff->Print();
464 h_ele_etaEff->GetXaxis()->SetTitle(
"#eta");
465 h_ele_etaEff->GetYaxis()->SetTitle(
"Efficiency");
469 h_ele_absetaEff->Reset();
471 h_ele_absetaEff->GetXaxis()->SetTitle(
"|#eta|");
472 h_ele_absetaEff->GetYaxis()->SetTitle(
"Efficiency");
476 h_ele_phiEff->Reset();
478 h_ele_phiEff->GetXaxis()->SetTitle(
"#phi (rad)");
479 h_ele_phiEff->GetYaxis()->SetTitle(
"Efficiency");
486 h_ele_zEff->GetXaxis()->SetTitle(
"z (cm)");
487 h_ele_zEff->GetYaxis()->SetTitle(
"Efficiency");
597 h_ele_mee_os-> GetXaxis()-> SetTitle(
"m_{e^{+}e^{-}} (GeV/c^{2})");
606 h_ele_etaEff->Write();
608 h_ele_phiEff->Write();
609 h_ele_absetaEff->Write();
610 h_ele_ptEff->Write();
650 edm::LogInfo(
"DQMAnalyzer::analyze")<<
"Treating event "<<iEvent.
id() ;
657 edm::LogInfo(
"DQMAnalyzer::analyze")<<
"Event has "<<gsfElectrons.
product()->size()<<
" electrons" ;
663 histNum_->Fill((*gsfElectrons).size());
666 reco::GsfElectronCollection::const_iterator gsfIter ;
668 ( gsfIter=gsfElectrons->begin() ;
669 gsfIter!=gsfElectrons->end();
674 (gsfIter->vertex().x()-bs.
position().x()) * (gsfIter->vertex().x()-bs.
position().x()) +
675 (gsfIter->vertex().y()-bs.
position().y()) * (gsfIter->vertex().y()-bs.
position().y()) ;
676 vertexTIP =
sqrt(vertexTIP) ;
679 if (!
selected(gsfIter,vertexTIP)) continue ;
685 h_ele_Et->Fill( gsfIter->superCluster()->energy()/cosh( gsfIter->superCluster()->eta()) );
699 double R=TMath::Sqrt(sclRef->x()*sclRef->x() + sclRef->y()*sclRef->y() +sclRef->z()*sclRef->z());
700 double Rt=TMath::Sqrt(sclRef->x()*sclRef->x() + sclRef->y()*sclRef->y());
721 h_ele_chi2->Fill( gsfIter->gsfTrack()->normalizedChi2() );
722 h_ele_chi2VsEta->Fill( gsfIter->eta(), gsfIter->gsfTrack()->normalizedChi2() );
723 h_ele_chi2VsPhi->Fill( gsfIter->phi(), gsfIter->gsfTrack()->normalizedChi2() );
724 h_ele_chi2VsPt->Fill( gsfIter->pt(), gsfIter->gsfTrack()->normalizedChi2() );
730 h_ele_PinMnPout->Fill( gsfIter->gsfTrack()->innerMomentum().R() - gsfIter->gsfTrack()->outerMomentum().R() );
731 h_ele_outerP->Fill( gsfIter->gsfTrack()->outerMomentum().R() );
732 h_ele_outerPt->Fill( gsfIter->gsfTrack()->outerMomentum().Rho() );
736 h_ele_PinMnPout_mode->Fill( gsfIter->trackMomentumAtVtx().R() - gsfIter->trackMomentumOut().R() );
755 h_ele_EoP->Fill( gsfIter->eSuperClusterOverP() );
763 h_ele_HoE->Fill(gsfIter->hadronicOverEm());
772 if (gsfIter->trackerDrivenSeed()||gsfIter->ecalDrivenSeed())
h_ele_provenance->Fill(0.);
773 if (gsfIter->trackerDrivenSeed()&&!gsfIter->ecalDrivenSeed())
h_ele_provenance->Fill(-2.);
774 if (!gsfIter->trackerDrivenSeed()&&gsfIter->ecalDrivenSeed())
h_ele_provenance->Fill(2.);
787 int matchingObjectNum=0 ;
788 reco::SuperClusterCollection::const_iterator moIter ;
790 ( moIter=recoClusters->begin() ;
791 moIter!=recoClusters->end() ;
815 bool okGsfFound =
false;
816 double gsfOkRatio = 999999.;
818 reco::GsfElectronCollection::const_iterator gsfIter ;
820 ( gsfIter=gsfElectrons->begin() ;
821 gsfIter!=gsfElectrons->end() ;
825 (gsfIter->vertex().x()-bs.
position().x()) * (gsfIter->vertex().x()-bs.
position().x()) +
826 (gsfIter->vertex().y()-bs.
position().y()) * (gsfIter->vertex().y()-bs.
position().y()) ;
827 vertexTIP =
sqrt(vertexTIP) ;
830 if (!
selected(gsfIter,vertexTIP)) continue ;
834 reco::GsfElectronCollection::const_iterator gsfIter2 ;
836 ( gsfIter2=gsfIter+1 ;
837 gsfIter2!=gsfElectrons->end() ;
841 float mee2 = p12.Dot(p12) ;
842 bool opsign = (gsfIter->charge()*gsfIter2->charge()<0.) ;
843 float invMass =
sqrt(mee2) ;
848 if(
TAGcheckclass_ && (gsfIter->classification()==GsfElectron::SHOWERING || gsfIter->isGap()))
break;
851 if(
PROBEetcut_ && (gsfIter2->superCluster()->energy()/cosh(gsfIter2->superCluster()->eta())<
minEt_))
continue;
852 if(
PROBEcheckclass_ && (gsfIter2->classification()==GsfElectron::SHOWERING || gsfIter2->isGap()))
continue;
854 if( invMass < massLow_ || invMass >
massHigh_ ) continue ;
857 bestGsfElectron =* gsfIter2 ;
863 reco::GsfElectronCollection::const_iterator gsfIter2 ;
865 ( gsfIter2=gsfIter+1;
866 gsfIter2!=gsfElectrons->end() ;
870 float mee2 = p12.Dot(p12) ;
872 float invMass =
sqrt(mee2) ;
879 double dphi = gsfIter->phi()-moIter->phi() ;
881 { dphi = dphi < 0? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi ; }
887 double tmpGsfRatio = gsfIter->p()/moIter->energy();
888 if ( fabs(tmpGsfRatio-1) < fabs(gsfOkRatio-1) &&
Selection_ != 4 )
890 gsfOkRatio = tmpGsfRatio;
891 bestGsfElectron=*gsfIter;
953 for (
unsigned int i=0;
i<triggerNames.
size();
i++)
960 for (
unsigned int i=0;
i!=
n;
i++)
968 n=triggerResults->
size() ;
971 for (
unsigned int i=0 ;
i!=
n ;
i++)
995 unsigned int fired=0 ;
996 for (
unsigned int i=0 ;
i!=
n ;
i++ )
1026 if (gsfIter->pt()<
minPt_)
return true ;
1028 if (gsfIter->isEB() &&
isEE_)
return true ;
1029 if (gsfIter->isEE() &&
isEB_)
return true ;
1033 if (gsfIter->trackerDrivenSeed() &&
isEcalDriven_)
return true ;
1040 if (gsfIter->superCluster()->energy()/cosh(gsfIter->superCluster()->eta())<
minEt_)
return true ;
1047 if (gsfIter->isEB() && vertexTIP >
tipMaxBarrel_)
return true ;
1050 if (gsfIter->dr03TkSumPt() >
tkIso03Max_)
return true ;
1054 if (gsfIter->isEB() && gsfIter->dr03EcalRecHitSumEt() >
ecalIso03MaxBarrel_)
return true ;
1062 if (gsfIter->isEB() && gsfIter->eSuperClusterOverP() <
eOverPMinBarrel_)
return true ;
1063 if (gsfIter->isEB() && gsfIter->eSuperClusterOverP() >
eOverPMaxBarrel_)
return true ;
1064 if (gsfIter->isEE() && gsfIter->eSuperClusterOverP() <
eOverPMinEndcaps_)
return true ;
1065 if (gsfIter->isEE() && gsfIter->eSuperClusterOverP() >
eOverPMaxEndcaps_)
return true ;
1066 if (gsfIter->isEB() && fabs(gsfIter->deltaEtaSuperClusterTrackAtVtx()) <
dEtaMinBarrel_)
return true ;
1067 if (gsfIter->isEB() && fabs(gsfIter->deltaEtaSuperClusterTrackAtVtx()) >
dEtaMaxBarrel_)
return true ;
1068 if (gsfIter->isEE() && fabs(gsfIter->deltaEtaSuperClusterTrackAtVtx()) <
dEtaMinEndcaps_)
return true ;
1069 if (gsfIter->isEE() && fabs(gsfIter->deltaEtaSuperClusterTrackAtVtx()) >
dEtaMaxEndcaps_)
return true ;
1070 if (gsfIter->isEB() && fabs(gsfIter->deltaPhiSuperClusterTrackAtVtx()) <
dPhiMinBarrel_)
return true ;
1071 if (gsfIter->isEB() && fabs(gsfIter->deltaPhiSuperClusterTrackAtVtx()) >
dPhiMaxBarrel_)
return true ;
1072 if (gsfIter->isEE() && fabs(gsfIter->deltaPhiSuperClusterTrackAtVtx()) <
dPhiMinEndcaps_)
return true ;
1073 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
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 accept() const
Has at least one path accepted the event?
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
void analyze(const edm::Event &e, const edm::EventSetup &c) override
std::vector< unsigned int > HLTPathsByIndex_
unsigned int size() const
Get number of paths stored.
TH2F * h_ele_lostHitsVsPhi
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
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_
T const * product() const
std::string const & triggerName(unsigned int index) const
double sigIetaIetaMinBarrel_
TH1F * h_ele_tkSumPt_dr04
TH1F * h_ele_matchingObjectPt_matched
edm::InputTag electronCollection_
double ecalIso03MaxEndcaps_
TH1F * h_ele_dEtaCl_propOut
return(e1-e2)*(e1-e2)+dp *dp
TH1F * h_matchingObjectPt
SuperClusterRef superCluster() const override
reference to a SuperCluster
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
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
DQMAnalyzer(const edm::ParameterSet &conf)
TH1F * h_ele_hcalDepth2TowerSumEt_dr04
Power< A, B >::type pow(const A &a, const B &b)
double ecalIso03MaxBarrel_