#include <TopQuarkAnalysis/Examples/plugins/TopMuonAnalyzer.h>
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 |
Definition at line 13 of file TopMuonAnalyzer.h.
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 | ( | ) |
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] |
TH1F* TopMuonAnalyzer::energy_Muons [private] |
TH1F* TopMuonAnalyzer::eta_Muons [private] |
edm::InputTag TopMuonAnalyzer::inputElec_ [private] |
edm::InputTag TopMuonAnalyzer::inputMuon_ [private] |
TH1I* TopMuonAnalyzer::Num_Leptons [private] |
TH1I* TopMuonAnalyzer::Num_Muons [private] |
TH1F* TopMuonAnalyzer::phi_Muons [private] |
TH1F* TopMuonAnalyzer::pt_Muons [private] |