Public Member Functions | |
PatZjetsElectronAnalyzer (const edm::ParameterSet &) | |
~PatZjetsElectronAnalyzer () | |
Private Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
virtual void | beginJob () |
virtual void | endJob () |
Private Attributes | |
std::map< std::string, TH1F * > | histContainer_ |
edm::InputTag | src_ |
Definition at line 13 of file PatZjetsElectronAnalyzer.cc.
PatZjetsElectronAnalyzer::PatZjetsElectronAnalyzer | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 36 of file PatZjetsElectronAnalyzer.cc.
: histContainer_(), src_(iConfig.getUntrackedParameter<edm::InputTag>("src")) { }
PatZjetsElectronAnalyzer::~PatZjetsElectronAnalyzer | ( | ) |
Definition at line 42 of file PatZjetsElectronAnalyzer.cc.
{ }
void PatZjetsElectronAnalyzer::analyze | ( | const edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [private, virtual] |
Implements edm::EDAnalyzer.
Definition at line 47 of file PatZjetsElectronAnalyzer.cc.
References newFWLiteAna::bin, HcalObjRepresent::Fill(), edm::Event::getByLabel(), histContainer_, and src_.
{ // get electron collection edm::Handle<edm::View<pat::Electron> > elecs; iEvent.getByLabel(src_,elecs); // loop electrons for(edm::View<pat::Electron>::const_iterator elec=elecs->begin(); elec!=elecs->end(); ++elec){ // fill simple histograms histContainer_["pt" ]->Fill( elec->pt () ); histContainer_["eta" ]->Fill( elec->eta() ); histContainer_["phi" ]->Fill( elec->phi() ); histContainer_["iso" ]->Fill((elec->trackIso()+elec->caloIso())/elec->pt() ); histContainer_["eop" ]->Fill( elec->eSeedClusterOverP() ); histContainer_["clus"]->Fill( elec->e1x5()/elec->e5x5() ); // fill enegry flow histogram for isolation for(int bin=1; bin<=histContainer_["dr"]->GetNbinsX(); ++bin){ double lowerEdge = histContainer_["dr"]->GetBinLowEdge(bin); double upperEdge = histContainer_["dr"]->GetBinLowEdge(bin)+histContainer_["dr"]->GetBinWidth(bin); histContainer_["dr"]->Fill(histContainer_["dr"]->GetBinCenter(bin), elec->trackIsoDeposit()->depositWithin(upperEdge) - elec->trackIsoDeposit()->depositWithin(lowerEdge)); } // fill electron id histograms if( elec->electronID("eidRobustLoose") > 0.5 ) histContainer_["eIDs" ]->Fill(0); if( elec->electronID("eidRobustTight") > 0.5 ) histContainer_["eIDs" ]->Fill(1); if( elec->electronID("eidLoose" ) > 0.5 ) histContainer_["eIDs" ]->Fill(2); if( elec->electronID("eidTight" ) > 0.5 ) histContainer_["eIDs" ]->Fill(3); if( elec->electronID("eidRobustHighEnergy") > 0.5 ) histContainer_["eIDs" ]->Fill(4); } }
void PatZjetsElectronAnalyzer::beginJob | ( | void | ) | [private, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 83 of file PatZjetsElectronAnalyzer.cc.
References histContainer_.
{ // register to the TFileService edm::Service<TFileService> fs; // book histograms: histContainer_["pt" ]=fs->make<TH1F>("pt" , "pt" , 150, 0., 150.); histContainer_["eta" ]=fs->make<TH1F>("eta" , "eta" , 50, 0., 5.); histContainer_["phi" ]=fs->make<TH1F>("phi" , "phi" , 60, 3.14, 3.14); histContainer_["iso" ]=fs->make<TH1F>("iso" , "iso" , 30, 0., 10.); histContainer_["dr" ]=fs->make<TH1F>("dr" , "dr" , 40, 0., 1.); histContainer_["eop" ]=fs->make<TH1F>("eop" , "eop" , 40, 0., 1.); histContainer_["clus"]=fs->make<TH1F>("clus" , "clus" , 40, 0., 1.); histContainer_["eIDs"]=fs->make<TH1F>("eIDs" , "eIDS" , 5, 0., 5.); }
void PatZjetsElectronAnalyzer::endJob | ( | void | ) | [private, virtual] |
std::map<std::string,TH1F*> PatZjetsElectronAnalyzer::histContainer_ [private] |
Definition at line 28 of file PatZjetsElectronAnalyzer.cc.
Referenced by analyze(), and beginJob().
edm::InputTag PatZjetsElectronAnalyzer::src_ [private] |
Definition at line 31 of file PatZjetsElectronAnalyzer.cc.
Referenced by analyze().