#include <RecoJets/JetAnalyzers/interface/CaloTowersExample.h>
Public Member Functions | |
CaloTowersExample (const edm::ParameterSet &) | |
Private Member Functions | |
void | analyze (const edm::Event &, const edm::EventSetup &) |
void | beginJob (const edm::EventSetup &) |
void | endJob () |
Private Attributes | |
std::string | CaloTowersAlgorithm |
TH1F | h_et |
TFile * | m_file |
Definition at line 15 of file CaloTowersExample.h.
CaloTowersExample::CaloTowersExample | ( | const edm::ParameterSet & | cfg | ) |
Definition at line 20 of file CaloTowersExample.cc.
00020 : 00021 CaloTowersAlgorithm( cfg.getParameter<string>( "CaloTowersAlgorithm" ) ) 00022 { 00023 }
void CaloTowersExample::analyze | ( | const edm::Event & | evt, | |
const edm::EventSetup & | es | |||
) | [private, virtual] |
Implements edm::EDAnalyzer.
Definition at line 32 of file CaloTowersExample.cc.
References IterativeConePu5Jets_PbPb_cff::caloTowers, CaloTowersAlgorithm, edm::Event::getByLabel(), and h_et.
00032 { 00033 00034 //Get the CaloTower collection 00035 Handle<CaloTowerCollection> caloTowers; 00036 evt.getByLabel( CaloTowersAlgorithm, caloTowers ); 00037 00038 //Loop over the two leading CaloJets and fill some histograms 00039 for( CaloTowerCollection::const_iterator cal = caloTowers->begin(); cal != caloTowers->end(); ++ cal ) { 00040 h_et.Fill( cal->et() ); 00041 } 00042 00043 }
void CaloTowersExample::beginJob | ( | const edm::EventSetup & | ) | [private, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 25 of file CaloTowersExample.cc.
00025 { 00026 00027 // Open the histogram file and book some associated histograms 00028 m_file=new TFile("histo.root","RECREATE"); 00029 h_et = TH1F( "et", "E_{T} of leading CaloTowers", 50, 0, 25 ); 00030 }
Reimplemented from edm::EDAnalyzer.
Definition at line 45 of file CaloTowersExample.cc.
References m_file.
00045 { 00046 00047 //Write out the histogram file. 00048 m_file->Write(); 00049 00050 }
std::string CaloTowersExample::CaloTowersAlgorithm [private] |
TH1F CaloTowersExample::h_et [private] |
TFile* CaloTowersExample::m_file [private] |