Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "RecoJets/JetAnalyzers/interface/SimpleJetDump.h"
00016 #include "RecoJets/JetAnalyzers/interface/JetPlotsExample.h"
00017 #include "DataFormats/JetReco/interface/CaloJetCollection.h"
00018 #include "DataFormats/JetReco/interface/CaloJet.h"
00019 #include "DataFormats/JetReco/interface/GenJet.h"
00020 #include "FWCore/Framework/interface/Event.h"
00021 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00022 using namespace edm;
00023 using namespace reco;
00024 using namespace std;
00025
00026 SimpleJetDump::SimpleJetDump( const ParameterSet & cfg ) :
00027 CaloJetAlg( cfg.getParameter<string>( "CaloJetAlg" ) ),
00028 GenJetAlg( cfg.getParameter<string>( "GenJetAlg" ) )
00029 {
00030 }
00031
00032 void SimpleJetDump::beginJob( ) {
00033 evtCount = 0;
00034 }
00035
00036 void SimpleJetDump::analyze( const Event& evt, const EventSetup& es ) {
00037
00038 int jetInd;
00039 Handle<CaloJetCollection> caloJets;
00040 Handle<GenJetCollection> genJets;
00041
00042
00043 evt.getByLabel( CaloJetAlg, caloJets );
00044 evt.getByLabel( GenJetAlg, genJets );
00045
00046 cout << endl << "Evt: "<<evtCount <<", Num Calo Jets=" <<caloJets->end() - caloJets->begin() << ", Num Gen Jets=" <<genJets->end() - genJets->begin() <<endl;
00047 cout <<" *********************************************************" <<endl;
00048 jetInd = 0;
00049 for( CaloJetCollection::const_iterator jet = caloJets->begin(); jet != caloJets->end(); ++ jet ) {
00050 cout <<"Calo Jet: "<<jetInd<<", pt="<<jet->pt()<<", eta="<<jet->eta()<<", phi="<<jet->phi() <<endl;
00051 jetInd++;
00052 }
00053 cout <<" *********************************************************" <<endl;
00054 jetInd = 0;
00055 for( GenJetCollection::const_iterator jet = genJets->begin(); jet != genJets->end(); ++ jet ) {
00056 cout <<"Gen Jet: "<<jetInd<<", pt="<<jet->pt()<<", eta="<<jet->eta()<<", phi="<<jet->phi() <<endl;
00057 jetInd++;
00058 }
00059 evtCount++;
00060 cout <<" *********************************************************" <<endl;
00061
00062 }
00063
00064 void SimpleJetDump::endJob() {
00065
00066
00067 }
00068 #include "FWCore/Framework/interface/MakerMacros.h"
00069 DEFINE_FWK_MODULE(SimpleJetDump);