Public Member Functions | |
PatElectronAnalyzer (const edm::ParameterSet &) | |
~PatElectronAnalyzer () | |
Private Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
virtual void | beginJob () |
virtual void | endJob () |
Private Attributes | |
TH1F * | deltaPhi_ |
TH1F * | deltaR_ |
std::string | electronID_ |
edm::InputTag | electronSrc_ |
TH1F * | eta_ |
TH1F * | genEta_ |
edm::ParameterSet | genMatchMode_ |
TH1F * | genPhi_ |
TH1F * | genPt_ |
TH1F * | invMass_ |
TH1F * | isoTag_ |
double | maxDeltaM_ |
double | maxDeltaR_ |
double | maxEta_ |
double | maxTagIso_ |
double | minPt_ |
unsigned int | mode_ |
TH1I * | nr_ |
edm::InputTag | particleSrc_ |
TH1F * | phi_ |
TH1F * | pt_ |
edm::ParameterSet | tagAndProbeMode_ |
Definition at line 12 of file PatElectronAnalyzer.cc.
PatElectronAnalyzer::PatElectronAnalyzer | ( | const edm::ParameterSet & | cfg | ) | [explicit] |
Definition at line 77 of file PatElectronAnalyzer.cc.
References deltaPhi_, deltaR_, eta_, genEta_, genMatchMode_, genPhi_, genPt_, edm::ParameterSet::getParameter(), invMass_, isoTag_, maxDeltaM_, maxDeltaR_, maxTagIso_, nr_, phi_, pt_, and tagAndProbeMode_.
: minPt_ (cfg.getParameter<double>("minPt")), maxEta_ (cfg.getParameter<double>("maxEta")), mode_ (cfg.getParameter<unsigned int>("mode")), electronID_ (cfg.getParameter<std::string>("electronID")), electronSrc_ (cfg.getParameter<edm::InputTag>("electronSrc")), particleSrc_ (cfg.getParameter<edm::InputTag>("particleSrc")), genMatchMode_(cfg.getParameter<edm::ParameterSet>("genMatchMode")), tagAndProbeMode_(cfg.getParameter<edm::ParameterSet>("tagAndProbeMode")) { // complete the configuration of the analyzer maxDeltaR_ = genMatchMode_ .getParameter<double>("maxDeltaR"); maxDeltaM_ = tagAndProbeMode_.getParameter<double>("maxDeltaM"); maxTagIso_ = tagAndProbeMode_.getParameter<double>("maxTagIso"); // register histograms to the TFileService edm::Service<TFileService> fs; nr_ = fs->make<TH1I>("nr", "nr", 10, 0 , 10 ); pt_ = fs->make<TH1F>("pt", "pt", 20, 0., 100.); eta_ = fs->make<TH1F>("eta", "eta", 30, -3., 3.); phi_ = fs->make<TH1F>("phi", "phi", 35, -3.5, 3.5); genPt_ = fs->make<TH1F>("genPt", "pt", 20, 0., 100.); genEta_ = fs->make<TH1F>("genEta", "eta", 30, -3., 3.); genPhi_ = fs->make<TH1F>("genPhi", "phi", 35, -3.5, 3.5); deltaR_ = fs->make<TH1F>("deltaR", "log(dR)", 50, -5., 0.); isoTag_ = fs->make<TH1F>("isoTag", "iso", 50, 0., 10.); invMass_ = fs->make<TH1F>("invMass", "m", 100, 50., 150.); deltaPhi_= fs->make<TH1F>("deltaPhi", "deltaPhi", 100, -3.5, 3.5); }
PatElectronAnalyzer::~PatElectronAnalyzer | ( | ) |
Definition at line 108 of file PatElectronAnalyzer.cc.
{ }
void PatElectronAnalyzer::analyze | ( | const edm::Event & | evt, |
const edm::EventSetup & | setup | ||
) | [private, virtual] |
Implements edm::EDAnalyzer.
Definition at line 113 of file PatElectronAnalyzer.cc.
References abs, SiPixelRawToDigiRegional_cfi::deltaPhi, deltaPhi_, deltaR(), deltaR_, electronID_, HI_PhotonSkim_cff::electrons, electronSrc_, eta_, genEta_, genPhi_, genPt_, edm::Event::getByLabel(), invMass_, isoTag_, maxDeltaM_, maxDeltaR_, maxEta_, maxTagIso_, minPt_, mode_, nr_, particleSrc_, phi_, and pt_.
{ // get electron collection edm::Handle<std::vector<pat::Electron> > electrons; evt.getByLabel(electronSrc_, electrons); // get generator particle collection edm::Handle<reco::GenParticleCollection> particles; evt.getByLabel(particleSrc_, particles); nr_->Fill( electrons->size() ); // ---------------------------------------------------------------------- // // First Part Mode 0: genMatch // // ---------------------------------------------------------------------- if( mode_==0 ){ // loop generator particles for(reco::GenParticleCollection::const_iterator part=particles->begin(); part!=particles->end(); ++part){ // only loop stable electrons if( part->status()==1 && abs(part->pdgId())==11 ){ if( part->pt()>minPt_ && fabs(part->eta())<maxEta_ ){ genPt_ ->Fill( part->pt() ); genEta_->Fill( part->eta() ); genPhi_->Fill( part->phi() ); } } } // loop electrons for( std::vector<pat::Electron>::const_iterator elec=electrons->begin(); elec!=electrons->end(); ++elec ){ if( elec->genLepton() ){ float deltaR = ROOT::Math::VectorUtil::DeltaR(elec->genLepton()->p4(), elec->p4()); deltaR_->Fill(TMath::Log10(deltaR)); if( deltaR<maxDeltaR_ ){ if( electronID_.compare("none")!=0 ){ if( elec->electronID(electronID_)<0.5 ) continue; } if( elec->pt()>minPt_ && fabs(elec->eta())<maxEta_ ){ pt_ ->Fill( elec->pt() ); eta_->Fill( elec->eta() ); phi_->Fill( elec->phi() ); } } } } } // ---------------------------------------------------------------------- // // Second Part Mode 1: tagAndProbe // // ---------------------------------------------------------------------- if( mode_==1 ){ // loop tag electron for( std::vector<pat::Electron>::const_iterator elec=electrons->begin(); elec!=electrons->end(); ++elec ){ isoTag_->Fill(elec->trackIso()); if( elec->trackIso()<maxTagIso_ && elec->electronID("eidTight")>0.5 ){ // loop probe electron for( std::vector<pat::Electron>::const_iterator probe=electrons->begin(); probe!=electrons->end(); ++probe ){ // skip the tag electron itself if( probe==elec ) continue; float zMass = (probe->p4()+elec->p4()).mass(); invMass_ ->Fill(zMass); float deltaPhi = ROOT::Math::VectorUtil::DeltaPhi(elec->p4(), probe->p4()); deltaPhi_->Fill(deltaPhi); // check for the Z mass if( fabs( zMass-90. )<maxDeltaM_ ){ if( electronID_.compare("none")!=0 ){ if( probe->electronID(electronID_)<0.5 ) continue; } if( probe->pt()>minPt_ && fabs(probe->eta())<maxEta_ ){ pt_ ->Fill( probe->pt() ); eta_->Fill( probe->eta() ); phi_->Fill( probe->phi() ); } } } } } } }
void PatElectronAnalyzer::beginJob | ( | void | ) | [private, virtual] |
void PatElectronAnalyzer::endJob | ( | void | ) | [private, virtual] |
TH1F* PatElectronAnalyzer::deltaPhi_ [private] |
Definition at line 70 of file PatElectronAnalyzer.cc.
Referenced by analyze(), and PatElectronAnalyzer().
TH1F* PatElectronAnalyzer::deltaR_ [private] |
Definition at line 67 of file PatElectronAnalyzer.cc.
Referenced by analyze(), and PatElectronAnalyzer().
std::string PatElectronAnalyzer::electronID_ [private] |
Definition at line 43 of file PatElectronAnalyzer.cc.
Referenced by analyze().
Definition at line 46 of file PatElectronAnalyzer.cc.
Referenced by analyze().
TH1F* PatElectronAnalyzer::eta_ [private] |
Definition at line 62 of file PatElectronAnalyzer.cc.
Referenced by analyze(), and PatElectronAnalyzer().
TH1F* PatElectronAnalyzer::genEta_ [private] |
Definition at line 65 of file PatElectronAnalyzer.cc.
Referenced by analyze(), and PatElectronAnalyzer().
Definition at line 50 of file PatElectronAnalyzer.cc.
Referenced by PatElectronAnalyzer().
TH1F* PatElectronAnalyzer::genPhi_ [private] |
Definition at line 66 of file PatElectronAnalyzer.cc.
Referenced by analyze(), and PatElectronAnalyzer().
TH1F* PatElectronAnalyzer::genPt_ [private] |
Definition at line 64 of file PatElectronAnalyzer.cc.
Referenced by analyze(), and PatElectronAnalyzer().
TH1F* PatElectronAnalyzer::invMass_ [private] |
Definition at line 69 of file PatElectronAnalyzer.cc.
Referenced by analyze(), and PatElectronAnalyzer().
TH1F* PatElectronAnalyzer::isoTag_ [private] |
Definition at line 68 of file PatElectronAnalyzer.cc.
Referenced by analyze(), and PatElectronAnalyzer().
double PatElectronAnalyzer::maxDeltaM_ [private] |
Definition at line 56 of file PatElectronAnalyzer.cc.
Referenced by analyze(), and PatElectronAnalyzer().
double PatElectronAnalyzer::maxDeltaR_ [private] |
Definition at line 55 of file PatElectronAnalyzer.cc.
Referenced by analyze(), and PatElectronAnalyzer().
double PatElectronAnalyzer::maxEta_ [private] |
Definition at line 28 of file PatElectronAnalyzer.cc.
Referenced by analyze().
double PatElectronAnalyzer::maxTagIso_ [private] |
Definition at line 57 of file PatElectronAnalyzer.cc.
Referenced by analyze(), and PatElectronAnalyzer().
double PatElectronAnalyzer::minPt_ [private] |
Definition at line 27 of file PatElectronAnalyzer.cc.
Referenced by analyze().
unsigned int PatElectronAnalyzer::mode_ [private] |
Definition at line 33 of file PatElectronAnalyzer.cc.
Referenced by analyze().
TH1I* PatElectronAnalyzer::nr_ [private] |
Definition at line 60 of file PatElectronAnalyzer.cc.
Referenced by analyze(), and PatElectronAnalyzer().
Definition at line 48 of file PatElectronAnalyzer.cc.
Referenced by analyze().
TH1F* PatElectronAnalyzer::phi_ [private] |
Definition at line 63 of file PatElectronAnalyzer.cc.
Referenced by analyze(), and PatElectronAnalyzer().
TH1F* PatElectronAnalyzer::pt_ [private] |
Definition at line 61 of file PatElectronAnalyzer.cc.
Referenced by analyze(), and PatElectronAnalyzer().
Definition at line 51 of file PatElectronAnalyzer.cc.
Referenced by PatElectronAnalyzer().