CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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" ) ),
28  GenJetAlg( cfg.getParameter<string>( "GenJetAlg" ) )
29  {
30 }
31 
33  evtCount = 0;
34 }
35 
36 void SimpleJetDump::analyze( const Event& evt, const EventSetup& es ) {
37 
38  int jetInd;
41 
42  //Find the CaloTowers in leading CaloJets
43  evt.getByLabel( CaloJetAlg, caloJets );
44  evt.getByLabel( GenJetAlg, genJets );
45 
46  cout << endl << "Evt: "<<evtCount <<", Num Calo Jets=" <<caloJets->end() - caloJets->begin() << ", Num Gen Jets=" <<genJets->end() - genJets->begin() <<endl;
47  cout <<" *********************************************************" <<endl;
48  jetInd = 0;
49  for( CaloJetCollection::const_iterator jet = caloJets->begin(); jet != caloJets->end(); ++ jet ) {
50  cout <<"Calo Jet: "<<jetInd<<", pt="<<jet->pt()<<", eta="<<jet->eta()<<", phi="<<jet->phi() <<endl;
51  jetInd++;
52  }
53  cout <<" *********************************************************" <<endl;
54  jetInd = 0;
55  for( GenJetCollection::const_iterator jet = genJets->begin(); jet != genJets->end(); ++ jet ) {
56  cout <<"Gen Jet: "<<jetInd<<", pt="<<jet->pt()<<", eta="<<jet->eta()<<", phi="<<jet->phi() <<endl;
57  jetInd++;
58  }
59  evtCount++;
60  cout <<" *********************************************************" <<endl;
61 
62 }
63 
65 
66 
67 }
tuple cfg
Definition: looper.py:259
SimpleJetDump(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
std::string CaloJetAlg
Definition: SimpleJetDump.h:21
void analyze(const edm::Event &, const edm::EventSetup &)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:413
std::string GenJetAlg
Definition: SimpleJetDump.h:21
tuple cout
Definition: gather_cfg.py:121