CMS 3D CMS Logo

ZToMuMuHistogrammer Class Reference

Inheritance diagram for ZToMuMuHistogrammer:

HistoAnalyzer< C > edm::EDAnalyzer

List of all members.

Public Member Functions

 ZToMuMuHistogrammer (const edm::ParameterSet &pset)

Private Member Functions

virtual void analyze (const edm::Event &event, const edm::EventSetup &setup)
 process an event

Private Attributes

TH1 * h_eta1
TH1 * h_eta2
TH1 * h_iso1
TH1 * h_iso2
TH1 * h_pt1
TH1 * h_pt2
InputTag muIso1_
InputTag muIso2_
InputTag zCands_


Detailed Description

Definition at line 30 of file ZToMuMuHistogrammer.cc.


Constructor & Destructor Documentation

ZToMuMuHistogrammer::ZToMuMuHistogrammer ( const edm::ParameterSet pset  ) 

Definition at line 41 of file ZToMuMuHistogrammer.cc.

References h_eta1, h_eta2, h_iso1, h_iso2, h_pt1, and h_pt2.

00041                                                                    : 
00042   BaseAnalyzer(cfg),
00043   zCands_(cfg.getParameter<InputTag>("src")),
00044   muIso1_(cfg.getParameter<InputTag>("muonIsolations1")),
00045   muIso2_(cfg.getParameter<InputTag>("muonIsolations2")) {
00046   Service<TFileService> fs;
00047   h_pt1  = fs->make<TH1D>("mu1Pt",   "muon 1 p_{t} (GeV/c)", 2000,  0., 200.);
00048   h_pt2  = fs->make<TH1D>("mu2Pt",   "muon 2 p_{t} (GeV/c)", 2000,  0., 200.);
00049   h_eta1 = fs->make<TH1D>("mu1Eta",  "muon 1 #eta", 600,  -3, 3);
00050   h_eta2 = fs->make<TH1D>("mu2Eta",  "muon 2 #eta", 600,  -3, 3);
00051   h_iso1 = fs->make<TH1D>("mu1Iso",  "muon 1 isolation (#Sigma p_{t})", 1000, 0, 100);
00052   h_iso2 = fs->make<TH1D>("mu2Iso",  "muon 2 isolation (#Sigma p_{t})", 1000, 0, 100);
00053 }


Member Function Documentation

void ZToMuMuHistogrammer::analyze ( const edm::Event iEvent,
const edm::EventSetup  
) [private, virtual]

process an event

Reimplemented from HistoAnalyzer< C >.

Definition at line 55 of file ZToMuMuHistogrammer.cc.

References HistoAnalyzer< C >::analyze(), edm::RefToBase< T >::castTo(), reco::Candidate::daughter(), reco::Particle::eta(), edm::Event::getByLabel(), h_eta1, h_eta2, h_iso1, h_iso2, h_pt1, h_pt2, i, iso1, reco::Candidate::masterClone(), muIso1_, muIso2_, n, reco::Particle::pt(), std::swap(), and zCands_.

00055                                                                                 {
00056   // perform configurable set of Z histograms
00057   BaseAnalyzer::analyze(ev, setup);
00058 
00059   // perform customized plots for Z->l+l-
00060   Handle<CandidateCollection> zCands;
00061   ev.getByLabel(zCands_, zCands);
00062   Handle<CandDoubleAssociations> muIso1;
00063   ev.getByLabel(muIso1_, muIso1);
00064   Handle<CandDoubleAssociations> muIso2;
00065   ev.getByLabel(muIso2_, muIso2);
00066 
00067   size_t n = zCands->size();
00068   
00069   for(size_t i = 0; i < n; i++) {
00070     const Candidate & zCand = (*zCands)[i];
00071     const Candidate * dau1 = zCand.daughter(0);
00072     const Candidate * dau2 = zCand.daughter(1);
00073     CandidateRef mu1 = dau1->masterClone().castTo<CandidateRef>();
00074     CandidateRef mu2 = dau2->masterClone().castTo<CandidateRef>();
00075     double iso1 = (*muIso1)[mu1];
00076     double iso2 = (*muIso2)[mu2];    
00077     if (dau1->pt() < dau2->pt()) { 
00078       std::swap(dau1, dau2); 
00079       std::swap(iso1, iso2);
00080     }
00081     h_pt1->Fill(dau1->pt());
00082     h_pt2->Fill(dau2->pt());
00083     h_eta1->Fill(dau1->eta());
00084     h_eta2->Fill(dau2->eta());
00085     h_iso1->Fill(iso1);
00086     h_iso2->Fill(iso2);
00087   }
00088 }  


Member Data Documentation

TH1 * ZToMuMuHistogrammer::h_eta1 [private]

Definition at line 37 of file ZToMuMuHistogrammer.cc.

Referenced by analyze(), and ZToMuMuHistogrammer().

TH1 * ZToMuMuHistogrammer::h_eta2 [private]

Definition at line 37 of file ZToMuMuHistogrammer.cc.

Referenced by analyze(), and ZToMuMuHistogrammer().

TH1 * ZToMuMuHistogrammer::h_iso1 [private]

Definition at line 37 of file ZToMuMuHistogrammer.cc.

Referenced by analyze(), and ZToMuMuHistogrammer().

TH1 * ZToMuMuHistogrammer::h_iso2 [private]

Definition at line 37 of file ZToMuMuHistogrammer.cc.

Referenced by analyze(), and ZToMuMuHistogrammer().

TH1* ZToMuMuHistogrammer::h_pt1 [private]

Definition at line 37 of file ZToMuMuHistogrammer.cc.

Referenced by analyze(), and ZToMuMuHistogrammer().

TH1 * ZToMuMuHistogrammer::h_pt2 [private]

Definition at line 37 of file ZToMuMuHistogrammer.cc.

Referenced by analyze(), and ZToMuMuHistogrammer().

InputTag ZToMuMuHistogrammer::muIso1_ [private]

Definition at line 36 of file ZToMuMuHistogrammer.cc.

Referenced by analyze().

InputTag ZToMuMuHistogrammer::muIso2_ [private]

Definition at line 36 of file ZToMuMuHistogrammer.cc.

Referenced by analyze().

InputTag ZToMuMuHistogrammer::zCands_ [private]

Definition at line 36 of file ZToMuMuHistogrammer.cc.

Referenced by analyze().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:36:10 2009 for CMSSW by  doxygen 1.5.4