Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
CALO JETS
PF JETS
Definition at line 16 of file TopJetFWLiteAnalyzer.cc.
References beam_dqm_sourceclient-live_cfg::cerr, gather_cfg::cout, FWLiteEnabler::enable(), HCALHighEnergyHPDFilter_cfi::energy, PVValHelper::eta, b2gHadronicHLTEventValidation_cfi::etaJets, training_settings::idx, singleTopDQM_cfi::jets, nevt, L1TdeCSCTF_cfi::outFile, PVValHelper::phi, DiDispStaMuonMonitor_cfi::pt, and setNiceStyle().
20 <<
"Wrong number of arguments! Please specify:" << std::endl
21 <<
" * filepath" << std::endl
22 <<
" * process name" << std::endl;
28 gSystem->Load(
"libFWCoreFWLite");
35 TH1I* noJets =
new TH1I(
"noJets",
"N_{Jets}", 10, 0, 10);
36 TH1F* ptJets =
new TH1F(
"ptJets",
"pt_{Jets}", 100, 0., 300.);
37 TH1F* enJets =
new TH1F(
"enJets",
"energy_{Jets}", 100, 0., 300.);
38 TH1F*
etaJets =
new TH1F(
"etaJets",
"eta_{Jets}", 100, -3., 3.);
39 TH1F* phiJets =
new TH1F(
"phiJets",
"phi_{Jets}", 100, -5., 5.);
44 TFile* inFile = TFile::Open(
argv[1]);
45 TTree* events_ =
nullptr;
47 inFile->GetObject(
"Events", events_);
48 if (events_ ==
nullptr) {
51 <<
"Unable to retrieve TTree Events!" << std::endl
52 <<
" Eighter wrong file name or the the tree doesn't exists" << std::endl;
59 sprintf(jetsName,
"patJets_selectedPatJets__%s.obj",
argv[2]);
60 TBranch* jets_ = events_->GetBranch(jetsName);
61 assert(jets_ !=
nullptr);
64 std::vector<pat::Jet>
jets;
65 int nevt = events_->GetEntries();
68 std::cout <<
"start looping " << nevt <<
" events..." << std::endl;
70 for (
int evt = 0; evt <
nevt; ++evt) {
72 jets_->SetAddress(&jets);
75 events_->GetEntry(evt, 0);
78 if (evt > 0 && !(evt % 10))
79 std::cout <<
" processing event: " << evt << std::endl;
83 noJets->Fill(jets.size());
84 for (
unsigned idx = 0;
idx < jets.size(); ++
idx) {
86 ptJets->Fill(jets[
idx].
pt());
88 etaJets->Fill(jets[
idx].
eta());
89 phiJets->Fill(jets[
idx].
phi());
98 TFile
outFile(
"analyzeJets.root",
"recreate");
static void enable()
enable automatic library loading