#include <TopQuarkAnalysis/Examples/plugins/TopJetAnalyzer.h>
Public Member Functions | |
TopJetAnalyzer (const edm::ParameterSet &) | |
~TopJetAnalyzer () | |
Private Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
virtual void | beginJob (const edm::EventSetup &) |
virtual void | endJob () |
Private Attributes | |
TH1F * | btag_Jets |
TH1F * | energy_Jets |
TH1F * | eta_Jets |
edm::InputTag | input_ |
TH1I * | Num_Jets |
TH1F * | phi_Jets |
TH1F * | pt_Jets |
Definition at line 13 of file TopJetAnalyzer.h.
TopJetAnalyzer::TopJetAnalyzer | ( | const edm::ParameterSet & | cfg | ) | [explicit] |
Definition at line 6 of file TopJetAnalyzer.cc.
References btag_Jets, energy_Jets, eta_Jets, Num_Jets, phi_Jets, and pt_Jets.
00006 : 00007 input_(cfg.getParameter<edm::InputTag>("input")) 00008 { 00009 edm::Service<TFileService> fs; 00010 00011 Num_Jets = fs->make<TH1I>("Number_of_Jets","Num_{Jets}", 10, 0 , 10 ); 00012 pt_Jets = fs->make<TH1F>("pt_of_Jets", "pt_{Jets}", 100, 0., 300.); 00013 energy_Jets=fs->make<TH1F> ("energy_of_Jets","energy_{Jets}",100, 0., 300.); 00014 eta_Jets =fs->make<TH1F> ("eta_of_Jets", "eta_{Jets}", 100, -3., 3.); 00015 phi_Jets =fs->make<TH1F> ("phi_of_Jets", "phi_{Jets}", 100, -5., 5.); 00016 btag_Jets =fs->make<TH1F> ("btag_of_Jets", "btag_{Jet}", 400,-20., 20.); 00017 }
TopJetAnalyzer::~TopJetAnalyzer | ( | ) |
void TopJetAnalyzer::analyze | ( | const edm::Event & | evt, | |
const edm::EventSetup & | setup | |||
) | [private, virtual] |
Implements edm::EDAnalyzer.
Definition at line 24 of file TopJetAnalyzer.cc.
References btag_Jets, energy_Jets, eta_Jets, edm::Event::getByLabel(), input_, metsig::jet, pfTauBenchmarkGeneric_cfi::jets, Num_Jets, phi_Jets, and pt_Jets.
00025 { 00026 edm::Handle<std::vector<pat::Jet> > jets; 00027 evt.getByLabel(input_, jets); 00028 00029 Num_Jets->Fill( jets->size()); 00030 for( std::vector<pat::Jet>::const_iterator jet=jets->begin(); jet!=jets->end(); ++jet){ 00031 pt_Jets ->Fill( jet->pt() ); 00032 energy_Jets->Fill( jet->energy()); 00033 eta_Jets ->Fill( jet->eta() ); 00034 phi_Jets ->Fill( jet->phi() ); 00035 00036 // // test JEC from PAT 00037 // if(jet == jets->begin()){ 00038 // edm::LogVerbatim log("TopJetAnalyzer_jec"); 00039 // //jet->jetCorrFactors().print(); 00040 // log << "--------------------------------\n"; 00041 // log << " Jet Energy Correction Factors: \n"; 00042 // log << "--------------------------------\n"; 00043 // // uncomment for use with PATv1 00044 // // log << " " << jet->jetCorrName() << ": " << jet->pt() << " (default) \n"; 00045 // // uncomment for use with PATv2 00046 // log << " " << jet->corrStep() << ": " << jet->pt() << " (default) \n"; 00047 // log << "--------------------------------\n"; 00048 // log << " " << jet->correctedJet("raw") .jetCorrName() << ": " << jet->correctedJet("raw") .pt() << "\n"; 00049 // log << " " << jet->correctedJet("off") .jetCorrName() << ": " << jet->correctedJet("off") .pt() << "\n"; 00050 // log << " " << jet->correctedJet("rel") .jetCorrName() << ": " << jet->correctedJet("rel") .pt() << "\n"; 00051 // log << " " << jet->correctedJet("abs") .jetCorrName() << ": " << jet->correctedJet("abs") .pt() << "\n"; 00052 // log << " " << jet->correctedJet("emf") .jetCorrName() << ": " << jet->correctedJet("emf") .pt() << "\n"; 00053 // log << " " << jet->correctedJet("had", "glu").jetCorrName() << ": " << jet->correctedJet("had", "glu").pt() << " (gluon )\n"; 00054 // log << " " << jet->correctedJet("had", "uds").jetCorrName() << ": " << jet->correctedJet("had", "uds").pt() << " (uds )\n"; 00055 // log << " " << jet->correctedJet("had", "c" ).jetCorrName() << ": " << jet->correctedJet("had", "c" ).pt() << " (charm )\n"; 00056 // log << " " << jet->correctedJet("had", "b" ).jetCorrName() << ": " << jet->correctedJet("had", "b" ).pt() << " (beauty)\n"; 00057 // log << " " << jet->correctedJet("ue", "glu").jetCorrName() << ": " << jet->correctedJet("ue", "glu").pt() << " (gluon )\n"; 00058 // log << " " << jet->correctedJet("ue", "uds").jetCorrName() << ": " << jet->correctedJet("ue", "uds").pt() << " (uds )\n"; 00059 // log << " " << jet->correctedJet("ue", "c" ).jetCorrName() << ": " << jet->correctedJet("ue", "c" ).pt() << " (charm )\n"; 00060 // log << " " << jet->correctedJet("ue", "b" ).jetCorrName() << ": " << jet->correctedJet("ue", "b" ).pt() << " (beauty)\n"; 00061 // log << " " << jet->correctedJet("part", "glu").jetCorrName() << ": " << jet->correctedJet("part", "glu").pt() << " (gluon )\n"; 00062 // log << " " << jet->correctedJet("part", "uds").jetCorrName() << ": " << jet->correctedJet("part", "uds").pt() << " (uds )\n"; 00063 // log << " " << jet->correctedJet("part", "c" ).jetCorrName() << ": " << jet->correctedJet("part", "c" ).pt() << " (charm )\n"; 00064 // log << " " << jet->correctedJet("part", "b" ).jetCorrName() << ": " << jet->correctedJet("part", "b" ).pt() << " (beauty)\n"; 00065 // } 00066 btag_Jets ->Fill( jet->bDiscriminator("combinedSecondaryVertexBJetTags") ); 00067 } 00068 }
void TopJetAnalyzer::beginJob | ( | const edm::EventSetup & | ) | [private, virtual] |
TH1F* TopJetAnalyzer::btag_Jets [private] |
TH1F* TopJetAnalyzer::energy_Jets [private] |
TH1F* TopJetAnalyzer::eta_Jets [private] |
edm::InputTag TopJetAnalyzer::input_ [private] |
TH1I* TopJetAnalyzer::Num_Jets [private] |
TH1F* TopJetAnalyzer::phi_Jets [private] |
TH1F* TopJetAnalyzer::pt_Jets [private] |