CMS 3D CMS Logo

SimpleJetDump.cc
Go to the documentation of this file.
1 // SimpleJetDump.cc
2 // Description: Prints out Jets, consituent CaloTowers, constituent RecHits and associated Digis (the digis for HCAL only).
3 // The user can specify which level in the config file:
4 // DumpLevel="Jets": Printout of jets and their kinematic quantities.
5 // DumpLevel="Towers": Nested Printout of jets and their constituent CaloTowers
6 // DumpLevel="RecHits": Nested Printout of jets, constituent CaloTowers and constituent RecHits
7 // DumpLevel="Digis": Nested Printout of jets, constituent CaloTowers, RecHits and all the HCAL digis
8 // associated with the RecHit channel (no links exist to go back to actual digis used).
9 // Does simple sanity checks on energy sums at each level: jets=sum of towers, tower=sum of RecHits.
10 // Does quick and dirty estimate of the fC/GeV factor that was applied to make the RecHit from the Digis.
11 //
12 // Author: Robert M. Harris
13 // Date: 19 - October - 2006
14 //
22 using namespace edm;
23 using namespace reco;
24 using namespace std;
25 
27  : CaloJetAlg(cfg.getParameter<string>("CaloJetAlg")), GenJetAlg(cfg.getParameter<string>("GenJetAlg")) {}
28 
30 
31 void SimpleJetDump::analyze(const Event& evt, const EventSetup& es) {
32  int jetInd;
35 
36  //Find the CaloTowers in leading CaloJets
39 
40  cout << endl
41  << "Evt: " << evtCount << ", Num Calo Jets=" << caloJets->end() - caloJets->begin()
42  << ", Num Gen Jets=" << genJets->end() - genJets->begin() << endl;
43  cout << " *********************************************************" << endl;
44  jetInd = 0;
45  for (CaloJetCollection::const_iterator jet = caloJets->begin(); jet != caloJets->end(); ++jet) {
46  cout << "Calo Jet: " << jetInd << ", pt=" << jet->pt() << ", eta=" << jet->eta() << ", phi=" << jet->phi() << endl;
47  jetInd++;
48  }
49  cout << " *********************************************************" << endl;
50  jetInd = 0;
51  for (GenJetCollection::const_iterator jet = genJets->begin(); jet != genJets->end(); ++jet) {
52  cout << "Gen Jet: " << jetInd << ", pt=" << jet->pt() << ", eta=" << jet->eta() << ", phi=" << jet->phi() << endl;
53  jetInd++;
54  }
55  evtCount++;
56  cout << " *********************************************************" << endl;
57 }
58 
void analyze(const edm::Event &, const edm::EventSetup &) override
SimpleJetDump(const edm::ParameterSet &)
std::string CaloJetAlg
Definition: SimpleJetDump.h:21
void beginJob() override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
std::string GenJetAlg
Definition: SimpleJetDump.h:21
void endJob() override
fixed size matrix
HLT enums.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:498