CMS 3D CMS Logo

TopMuonAnalyzer Class Reference

#include <TopQuarkAnalysis/Examples/plugins/TopMuonAnalyzer.h>

Inheritance diagram for TopMuonAnalyzer:

edm::EDAnalyzer

List of all members.

Public Member Functions

 TopMuonAnalyzer (const edm::ParameterSet &)
 ~TopMuonAnalyzer ()

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
virtual void beginJob (const edm::EventSetup &)
virtual void endJob ()

Private Attributes

TH1F * energy_Muons
TH1F * eta_Muons
edm::InputTag inputElec_
edm::InputTag inputMuon_
TH1I * Num_Leptons
TH1I * Num_Muons
TH1F * phi_Muons
TH1F * pt_Muons


Detailed Description

Definition at line 13 of file TopMuonAnalyzer.h.


Constructor & Destructor Documentation

TopMuonAnalyzer::TopMuonAnalyzer ( const edm::ParameterSet cfg  )  [explicit]

Definition at line 6 of file TopMuonAnalyzer.cc.

References energy_Muons, eta_Muons, Num_Leptons, Num_Muons, phi_Muons, and pt_Muons.

00006                                                           :
00007   inputElec_(cfg.getParameter<edm::InputTag>("inputElec")),
00008   inputMuon_(cfg.getParameter<edm::InputTag>("inputMuon"))
00009 {
00010   edm::Service<TFileService> fs;
00011   
00012   Num_Muons   = fs->make<TH1I>("Number_of_Muons",  "Num_{Muons}",    10,  0 ,  10 );
00013   Num_Leptons = fs->make<TH1I>("Number_of_Leptons","Num_{Leptons}",  10,  0 ,  10 );
00014   pt_Muons    = fs->make<TH1F>("pt_of_Muons",      "pt_{Muons}",    100,  0., 300.);
00015   energy_Muons= fs->make<TH1F>("energy_of_Muons",  "energy_{Muons}",100,  0., 300.);
00016   eta_Muons   = fs->make<TH1F>("eta_of_Muons",  "eta_{Muons}",      100, -3.,   3.);
00017   phi_Muons   = fs->make<TH1F>("phi_of_Muons",  "phi_{Muons}",      100, -5.,   5.);
00018   
00019 }

TopMuonAnalyzer::~TopMuonAnalyzer (  ) 

Definition at line 21 of file TopMuonAnalyzer.cc.

00022 {
00023 }


Member Function Documentation

void TopMuonAnalyzer::analyze ( const edm::Event evt,
const edm::EventSetup setup 
) [private, virtual]

Implements edm::EDAnalyzer.

Definition at line 26 of file TopMuonAnalyzer.cc.

References energy_Muons, eta_Muons, edm::Event::getByLabel(), inputElec_, inputMuon_, metsig::muon, muons_cfi::muons, Num_Leptons, Num_Muons, phi_Muons, and pt_Muons.

00027 {
00028   edm::Handle<std::vector<pat::Electron> > elecs;
00029   evt.getByLabel(inputElec_, elecs);
00030   
00031   edm::Handle<std::vector<pat::Muon> > muons;
00032   evt.getByLabel(inputMuon_, muons); 
00033 
00034   Num_Muons  ->Fill( muons->size() ); 
00035   Num_Leptons->Fill( elecs->size() + muons->size() );
00036 
00037   for( std::vector<pat::Muon>::const_iterator muon=muons->begin(); 
00038        muon!=muons->end(); ++muon){
00039     pt_Muons    ->Fill( muon->pt()     );
00040     energy_Muons->Fill( muon->energy() );
00041     eta_Muons   ->Fill( muon->eta()    );
00042     phi_Muons   ->Fill( muon->phi()    );
00043   }   
00044 }

void TopMuonAnalyzer::beginJob ( const edm::EventSetup  )  [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 46 of file TopMuonAnalyzer.cc.

00047 {
00048 }

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

Reimplemented from edm::EDAnalyzer.

Definition at line 50 of file TopMuonAnalyzer.cc.

00051 {
00052 }


Member Data Documentation

TH1F* TopMuonAnalyzer::energy_Muons [private]

Definition at line 32 of file TopMuonAnalyzer.h.

Referenced by analyze(), and TopMuonAnalyzer().

TH1F* TopMuonAnalyzer::eta_Muons [private]

Definition at line 33 of file TopMuonAnalyzer.h.

Referenced by analyze(), and TopMuonAnalyzer().

edm::InputTag TopMuonAnalyzer::inputElec_ [private]

Definition at line 26 of file TopMuonAnalyzer.h.

Referenced by analyze().

edm::InputTag TopMuonAnalyzer::inputMuon_ [private]

Definition at line 27 of file TopMuonAnalyzer.h.

Referenced by analyze().

TH1I* TopMuonAnalyzer::Num_Leptons [private]

Definition at line 29 of file TopMuonAnalyzer.h.

Referenced by analyze(), and TopMuonAnalyzer().

TH1I* TopMuonAnalyzer::Num_Muons [private]

Definition at line 30 of file TopMuonAnalyzer.h.

Referenced by analyze(), and TopMuonAnalyzer().

TH1F* TopMuonAnalyzer::phi_Muons [private]

Definition at line 34 of file TopMuonAnalyzer.h.

Referenced by analyze(), and TopMuonAnalyzer().

TH1F* TopMuonAnalyzer::pt_Muons [private]

Definition at line 31 of file TopMuonAnalyzer.h.

Referenced by analyze(), and TopMuonAnalyzer().


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