10 Jets_(cfg.getParameter<edm::
InputTag>(
"Jets")),
11 jecLevel_(cfg.getParameter<std::
string>(
"jecLevel")),
12 patJetCorrFactors_(cfg.getParameter<std::
string>(
"patJetCorrFactors")),
13 help_(cfg.getParameter<bool>(
"help")) {
14 hists_[
"Response"] = fs.
make<TH2F>(
"Response",
"response; #eta;p_{T}(reco)/p_{T}(gen)", 5, -3.3, 3.3, 100, 0.4, 1.6);
21 Jets_(cfg.getParameter<edm::
InputTag>(
"Jets")),
22 JetsToken_(iC.consumes<std::
vector<pat::
Jet> >(Jets_)),
23 jecLevel_(cfg.getParameter<std::
string>(
"jecLevel")),
24 patJetCorrFactors_(cfg.getParameter<std::
string>(
"patJetCorrFactors")),
25 help_(cfg.getParameter<bool>(
"help")) {
26 hists_[
"Response"] = fs.
make<TH2F>(
"Response",
"response; #eta;p_{T}(reco)/p_{T}(gen)", 5, -3.3, 3.3, 100, 0.4, 1.6);
32 TFile*
file =
new TFile(
"myResponse" + TString(
jecLevel_) +
".root",
"RECREATE");
33 TProfile* prof =
hists_[
"Response"]->ProfileX();
46 event.getByLabel(
Jets_, Jets);
49 for (std::vector<Jet>::const_iterator jet_it = Jets->begin(); jet_it != Jets->end(); ++jet_it) {
53 std::cout <<
"\n \n number of available JEC sets: " << jet_it->availableJECSets().size() << std::endl;
54 for (
unsigned int k = 0;
k < jet_it->availableJECSets().size(); ++
k) {
55 std::cout <<
"\n \n available JEC Set: " << jet_it->availableJECSets()[
k] << std::endl;
57 std::cout <<
"\n \n*** You found out which JEC Sets exist! Now correct it in your config file." << std::endl;
58 std::cout <<
"\n \n number of available JEC levels " << jet_it->availableJECLevels().size() << std::endl;
59 for (
unsigned int k = 0;
k < jet_it->availableJECLevels().size(); ++
k) {
62 std::cout <<
"\n \n**** You did it correctly congratulations!!!! And you found out which JEC levels are saved "
63 "within the jets. Correct this in your configuration file."
68 if (jet_it->genParticlesSize() > 0) {
70 jet_it->correctedJet(
jecLevel_).pt() / jet_it->genParticle(0)->pt());
71 std::cout <<
"\n \n**** You did it correctly congratulations!!!! " << std::endl;
AnalysisTasksAnalyzerJEC(const edm::ParameterSet &cfg, TFileDirectory &fs)
default constructor
edm::InputTag Jets_
input tag for mouns
Abstract base class for FWLite and EDM friendly analyzers.
T * make(const Args &...args) const
make new ROOT object
void analyze(const edm::EventBase &event) override
everything that needs to be done during the event loop
~AnalysisTasksAnalyzerJEC() override
default destructor
std::string patJetCorrFactors_
std::map< std::string, TH2 * > hists_
histograms
unsigned int jetInEvents_