CMS 3D CMS Logo

CaloTowersExample Class Reference

#include <RecoJets/JetAnalyzers/interface/CaloTowersExample.h>

Inheritance diagram for CaloTowersExample:

edm::EDAnalyzer

List of all members.

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


Detailed Description

Definition at line 15 of file CaloTowersExample.h.


Constructor & Destructor Documentation

CaloTowersExample::CaloTowersExample ( const edm::ParameterSet cfg  ) 

Definition at line 20 of file CaloTowersExample.cc.

00020                                                                :
00021   CaloTowersAlgorithm( cfg.getParameter<string>( "CaloTowersAlgorithm" ) )
00022   {
00023 }


Member Function Documentation

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.

References h_et, and m_file.

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 }

void CaloTowersExample::endJob ( void   )  [private, virtual]

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 }


Member Data Documentation

std::string CaloTowersExample::CaloTowersAlgorithm [private]

Definition at line 23 of file CaloTowersExample.h.

Referenced by analyze().

TH1F CaloTowersExample::h_et [private]

Definition at line 24 of file CaloTowersExample.h.

Referenced by analyze(), and beginJob().

TFile* CaloTowersExample::m_file [private]

Definition at line 25 of file CaloTowersExample.h.

Referenced by beginJob(), and endJob().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:16:02 2009 for CMSSW by  doxygen 1.5.4