21 static const unsigned int MAXBIN = 8;
25 static const float BINS[] = {30., 40., 50., 60., 70., 80., 100., 125., 150.};
58 hists_.find(histName)->second->Fill(value);
73 : corrLevel_(cfg.getParameter<std::
string>(
"corrLevel")),
74 jetsToken_(consumes<edm::
View<pat::
Jet> >(cfg.getParameter<edm::
InputTag>(
"src"))) {
79 hists_[
"mult"] = fs->
make<TH1F>(
"mult",
"N_{Jet}", 15, 0., 15.);
81 hists_[
"pt"] = fs->
make<TH1F>(
"pt",
"p_{T}(Jet) [GeV]", 60, 0., 300.);
83 hists_[
"eta"] = fs->
make<TH1F>(
"eta",
"#eta (Jet)", 60, -3., 3.);
85 hists_[
"phi"] = fs->
make<TH1F>(
"phi",
"#phi (Jet)", 60, 3.2, 3.2);
87 hists_[
"mass"] = fs->
make<TH1F>(
"mass",
"M_{jj} [GeV]", 50, 0., 500.);
89 for (
unsigned int idx = 0; idx <
MAXBIN; ++idx) {
91 sprintf(buffer,
"jes_%i", idx);
93 sprintf(title,
"p_{T}^{rec}/p_{T}^{gen} [%i GeV - %i GeV]", (
int)
BINS[idx], (
int)
BINS[idx + 1]);
115 for (
unsigned int idx = 0; idx <
MAXBIN; ++idx) {
116 if (
BINS[idx] <=
jet->genJet()->pt() &&
jet->genJet()->pt() <
BINS[idx + 1]) {
118 sprintf(buffer,
"jes_%i", idx);
125 fill(
"mult", jets->size());
127 if (jets->size() > 1) {
128 fill(
"mass", ((*jets)[0].p4() + (*jets)[1].p4()).
mass());
134 std::cout <<
"[" << idx <<
"] :: eta=" << std::setw(10) << jet->eta() <<
" phi=" << std::setw(10) << jet->phi()
135 <<
" size: " << jet->availableJECLevels().
size() << std::endl;
136 for (
unsigned int idx = 0; idx < jet->availableJECLevels().
size(); ++idx) {
138 if (jet->availableJECLevels()[idx].find(
"L5Flavor") != std::string::npos ||
139 jet->availableJECLevels()[idx].find(
"L7Parton") != std::string::npos) {
std::string corrLevel_
correction level for pat jet
double pt() const final
transverse momentum
#define DEFINE_FWK_MODULE(type)
PatJetAnalyzer(const edm::ParameterSet &cfg)
default contructor
T * make(const Args &...args) const
make new ROOT object
void fill(const std::string histName, double value) const
fill histogram if it had been booked before
void analyze(const edm::Event &event, const edm::EventSetup &setup) override
everything that needs to be done during the even loop
edm::EDGetTokenT< edm::View< pat::Jet > > jetsToken_
pat jets
static const float BINS[]
std::string currentJECLevel() const
return the name of the current step of jet energy corrections
Analysis-level calorimeter jet class.
Module to analyze pat::Jets in the context of a more complex exercise.
bool booked(const std::string histName) const
check if histogram was booked
static const unsigned int MAXBIN
std::map< std::string, TH1F * > hists_
management of 1d histograms
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
~PatJetAnalyzer() override
default destructor
void print(edm::View< pat::Jet >::const_iterator &jet, unsigned int idx)