38 hists_.find(histName)->second->Fill(value);
44 std::map<std::string, TH1F*>
hists_;
55 elecsToken_(consumes<edm::
View<pat::
Electron> >(iConfig.getUntrackedParameter<edm::
InputTag>(
"elecs"))),
56 muonsToken_(consumes<edm::
View<pat::
Muon> >(iConfig.getUntrackedParameter<edm::
InputTag>(
"muons"))),
57 jetsToken_(consumes<edm::
View<pat::
Jet> >(iConfig.getUntrackedParameter<edm::
InputTag>(
"jets"))),
83 fill(
"elecMult", elecs->size());
84 if (elecs->begin() != elecs->end()) {
85 fill(
"elecIso", (elecs->begin()->trackIso() + elecs->begin()->caloIso()) / elecs->begin()->pt());
86 fill(
"elecPt", elecs->begin()->pt());
90 fill(
"muonMult", muons->size());
91 if (muons->begin() != muons->end()) {
92 fill(
"muonIso", (muons->begin()->trackIso() + muons->begin()->caloIso()) / muons->begin()->pt());
93 fill(
"muonPt", muons->begin()->pt());
98 fill(
"jetMult", jets->size());
100 fill(
"jet0Pt", (*jets)[0].pt());
101 if (jets->size() > 1)
102 fill(
"jet1Pt", (*jets)[1].pt());
103 if (jets->size() > 2)
104 fill(
"jet2Pt", (*jets)[2].pt());
105 if (jets->size() > 3)
106 fill(
"jet3Pt", (*jets)[3].pt());
109 fill(
"met", met->empty() ? 0 : (*met)[0].et());
117 hists_[
"yield"] = fs->
make<TH1F>(
"yield",
"electron multiplicity", 1, 0., 1.);
118 hists_[
"elecMult"] = fs->
make<TH1F>(
"elecMult",
"electron multiplicity", 10, 0., 10.);
119 hists_[
"elecIso"] = fs->
make<TH1F>(
"elecIso",
"electron isolation", 20, 0., 1.);
120 hists_[
"elecPt"] = fs->
make<TH1F>(
"elecPt",
"electron pt", 30, 0., 150.);
121 hists_[
"muonMult"] = fs->
make<TH1F>(
"muonMult",
"muon multiplicity", 10, 0., 10.);
122 hists_[
"muonIso"] = fs->
make<TH1F>(
"muonIso",
"muon isolation", 20, 0., 1.);
123 hists_[
"muonPt"] = fs->
make<TH1F>(
"muonPt",
"muon pt", 30, 0., 150.);
124 hists_[
"jetMult"] = fs->
make<TH1F>(
"jetMult",
"jet multiplicity", 15, 0., 15.);
125 hists_[
"jet0Pt"] = fs->
make<TH1F>(
"jet0Pt",
"1. leading jet pt", 50, 0., 250.);
126 hists_[
"jet1Pt"] = fs->
make<TH1F>(
"jet1Pt",
"1. leading jet pt", 50, 0., 250.);
127 hists_[
"jet2Pt"] = fs->
make<TH1F>(
"jet2Pt",
"1. leading jet pt", 50, 0., 200.);
128 hists_[
"jet3Pt"] = fs->
make<TH1F>(
"jet3Pt",
"1. leading jet pt", 50, 0., 200.);
129 hists_[
"met"] = fs->
make<TH1F>(
"met",
"missing E_{T}", 25, 0., 200.);
void endJob() override
everything that needs to be done after the event loop
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
T * make(const Args &...args) const
make new ROOT object
void analyze(const edm::Event &, const edm::EventSetup &) override
everything that needs to be done during the event loop
PatTopSelectionAnalyzer(const edm::ParameterSet &)
default constructor
void beginJob() override
everything that needs to be done before the event loop
edm::EDGetTokenT< edm::View< pat::MET > > metToken_
edm::EDGetTokenT< edm::View< pat::Jet > > jetsToken_
edm::EDGetTokenT< edm::View< pat::Electron > > elecsToken_
void fill(const std::string histName, double value) const
fill histogram if it had been booked before
edm::EDGetTokenT< edm::View< pat::Muon > > muonsToken_
metToken_(consumes< reco::PFMETCollection >(iConfig.getParameter< edm::InputTag >("met")))
std::map< std::string, TH1F * > hists_
bool booked(const std::string histName) const
check if histogram was booked
constexpr char Electron[]
~PatTopSelectionAnalyzer() override
default destructor