33 m_file =
new TFile(HistoFileName.c_str(),
"RECREATE");
36 m_HistNames1D[hname] =
new TH1F(hname, hname, 100, 0, 1000);
38 m_HistNames1D[hname] =
new TH1F(hname, hname, 120, -6, 6);
40 m_HistNames1D[hname] =
new TH1F(hname, hname, 100, -
M_PI,
M_PI);
41 hname =
"NumberOfJets";
42 m_HistNames1D[hname] =
new TH1F(hname, hname, 100, 0, 100);
50 typename JetCollection::const_iterator i_jet;
54 hname =
"NumberOfJets";
55 FillHist1D(hname, jets->size());
57 for (i_jet = jets->begin(); i_jet != jets->end() && index < NJets; ++i_jet) {
59 FillHist1D(hname, i_jet->pt());
61 FillHist1D(hname, i_jet->eta());
63 FillHist1D(hname, i_jet->phi());
71 if (m_file !=
nullptr) {
73 for (std::map<TString, TH1*>::iterator hid = m_HistNames1D.begin(); hid != m_HistNames1D.end(); hid++)
82 std::map<TString, TH1*>::iterator hid = m_HistNames1D.find(histName);
83 if (hid == m_HistNames1D.end())
84 std::cout <<
"%fillHist -- Could not find histogram with name: " << histName << std::endl;
86 hid->second->Fill(value);
T getParameter(std::string const &) const
JetPlotsExample< PFJet > PFJetPlotsExample
JetPlotsExample< GenJet > GenJetPlotsExample
void FillHist1D(const TString &histName, const Double_t &x)
JetPlotsExample< CaloJet > CaloJetPlotsExample
JetPlotsExample< JPTJet > JPTJetPlotsExample
#define DEFINE_FWK_MODULE(type)
JetPlotsExample(edm::ParameterSet const &cfg)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void analyze(edm::Event const &e, edm::EventSetup const &iSetup) override