Public Member Functions | |
PatTopSelectionAnalyzer (const edm::ParameterSet &) | |
default constructor | |
~PatTopSelectionAnalyzer () | |
default destructor | |
Private Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
everything that needs to be done during the event loop | |
virtual void | beginJob () |
everything that needs to be done before the event loop | |
bool | booked (const std::string histName) const |
check if histogram was booked | |
virtual void | endJob () |
everything that needs to be done after the event loop | |
void | fill (const std::string histName, double value) const |
fill histogram if it had been booked before | |
Private Attributes | |
edm::InputTag | elecs_ |
std::map< std::string, TH1F * > | hists_ |
edm::InputTag | jets_ |
edm::InputTag | met_ |
edm::InputTag | muons_ |
Definition at line 13 of file PatTopSelectionAnalyzer.cc.
PatTopSelectionAnalyzer::PatTopSelectionAnalyzer | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
default constructor
Definition at line 51 of file PatTopSelectionAnalyzer.cc.
: hists_(), elecs_(iConfig.getUntrackedParameter<edm::InputTag>("elecs")), muons_(iConfig.getUntrackedParameter<edm::InputTag>("muons")), jets_ (iConfig.getUntrackedParameter<edm::InputTag>("jets" )), met_ (iConfig.getUntrackedParameter<edm::InputTag>("met" )) { }
PatTopSelectionAnalyzer::~PatTopSelectionAnalyzer | ( | ) |
void PatTopSelectionAnalyzer::analyze | ( | const edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [private, virtual] |
everything that needs to be done during the event loop
Implements edm::EDAnalyzer.
Definition at line 65 of file PatTopSelectionAnalyzer.cc.
References elecs_, fill(), edm::Event::getByLabel(), analyzePatCleaning_cfg::jets, jets_, CaloMET_cfi::met, met_, patZpeak::muons, and muons_.
{ // get electron collection edm::Handle<edm::View<pat::Electron> > elecs; iEvent.getByLabel(elecs_,elecs); // get muon collection edm::Handle<edm::View<pat::Muon> > muons; iEvent.getByLabel(muons_,muons); // get jet collection edm::Handle<edm::View<pat::Jet> > jets; iEvent.getByLabel(jets_,jets); // get met collection edm::Handle<edm::View<pat::MET> > met; iEvent.getByLabel(met_,met); // fill yield fill("yield", 0.5); // fill quantities for leading elec and elec multiplicity fill("elecMult", elecs->size()); if(elecs->begin()!=elecs->end()){ fill("elecIso", (elecs->begin()->trackIso()+elecs->begin()->caloIso())/elecs->begin()->pt()); fill("elecPt", elecs->begin()->pt()); } // fill quantities for leading muon and muon multiplicity fill("muonMult", muons->size()); if(muons->begin()!=muons->end()){ fill("muonIso", (muons->begin()->trackIso()+muons->begin()->caloIso())/muons->begin()->pt()); fill("muonPt", muons->begin()->pt()); } // fill quantities for leading jets and jet multiplicity // jet pt is corrected up to L3Absolute fill("jetMult", jets->size()); if( jets->size()>0 ) fill("jet0Pt", (*jets)[0].pt()); if( jets->size()>1 ) fill("jet1Pt", (*jets)[1].pt()); if( jets->size()>2 ) fill("jet2Pt", (*jets)[2].pt()); if( jets->size()>3 ) fill("jet3Pt", (*jets)[3].pt()); // fill MET fill("met", met->empty()?0:(*met)[0].et()); }
void PatTopSelectionAnalyzer::beginJob | ( | void | ) | [private, virtual] |
everything that needs to be done before the event loop
Reimplemented from edm::EDAnalyzer.
Definition at line 113 of file PatTopSelectionAnalyzer.cc.
References hists_.
{ // register to the TFileService edm::Service<TFileService> fs; // book histograms: hists_["yield" ]=fs->make<TH1F>("yield" , "electron multiplicity", 1, 0., 1.); hists_["elecMult"]=fs->make<TH1F>("elecMult", "electron multiplicity", 10, 0., 10.); hists_["elecIso" ]=fs->make<TH1F>("elecIso" , "electron isolation" , 20, 0., 1.); hists_["elecPt" ]=fs->make<TH1F>("elecPt" , "electron pt" , 30, 0., 150.); hists_["muonMult"]=fs->make<TH1F>("muonMult", "muon multiplicity" , 10, 0., 10.); hists_["muonIso" ]=fs->make<TH1F>("muonIso" , "muon isolation" , 20, 0., 1.); hists_["muonPt" ]=fs->make<TH1F>("muonPt" , "muon pt" , 30, 0., 150.); hists_["jetMult" ]=fs->make<TH1F>("jetMult" , "jet multiplicity" , 15, 0., 15.); hists_["jet0Pt" ]=fs->make<TH1F>("jet0Pt" , "1. leading jet pt" , 50, 0., 250.); hists_["jet1Pt" ]=fs->make<TH1F>("jet1Pt" , "1. leading jet pt" , 50, 0., 250.); hists_["jet2Pt" ]=fs->make<TH1F>("jet2Pt" , "1. leading jet pt" , 50, 0., 200.); hists_["jet3Pt" ]=fs->make<TH1F>("jet3Pt" , "1. leading jet pt" , 50, 0., 200.); hists_["met" ]=fs->make<TH1F>("met" , "missing E_{T}" , 25, 0., 200.); }
bool PatTopSelectionAnalyzer::booked | ( | const std::string | histName | ) | const [inline, private] |
check if histogram was booked
Definition at line 30 of file PatTopSelectionAnalyzer.cc.
References hists_.
void PatTopSelectionAnalyzer::endJob | ( | void | ) | [private, virtual] |
everything that needs to be done after the event loop
Reimplemented from edm::EDAnalyzer.
Definition at line 135 of file PatTopSelectionAnalyzer.cc.
{ }
void PatTopSelectionAnalyzer::fill | ( | const std::string | histName, |
double | value | ||
) | const [inline, private] |
edm::InputTag PatTopSelectionAnalyzer::elecs_ [private] |
Definition at line 40 of file PatTopSelectionAnalyzer.cc.
Referenced by analyze().
std::map<std::string, TH1F*> PatTopSelectionAnalyzer::hists_ [private] |
Definition at line 32 of file PatTopSelectionAnalyzer.cc.
Referenced by beginJob(), and booked().
edm::InputTag PatTopSelectionAnalyzer::jets_ [private] |
Definition at line 42 of file PatTopSelectionAnalyzer.cc.
Referenced by analyze().
edm::InputTag PatTopSelectionAnalyzer::met_ [private] |
Definition at line 43 of file PatTopSelectionAnalyzer.cc.
Referenced by analyze().
edm::InputTag PatTopSelectionAnalyzer::muons_ [private] |
Definition at line 41 of file PatTopSelectionAnalyzer.cc.
Referenced by analyze().