CMS 3D CMS Logo

ZMassHistogrammer Class Reference

Inheritance diagram for ZMassHistogrammer:

edm::EDAnalyzer

List of all members.

Public Member Functions

 ZMassHistogrammer (const edm::ParameterSet &pset)

Private Member Functions

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

Private Attributes

edm::InputTag gen_
TH1F * h_mZ_
TH1F * h_mZMC_
edm::InputTag z_


Detailed Description

Definition at line 5 of file ZMassHistogrammer.cc.


Constructor & Destructor Documentation

ZMassHistogrammer::ZMassHistogrammer ( const edm::ParameterSet pset  ) 

Definition at line 29 of file ZMassHistogrammer.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), h_mZ_, and h_mZMC_.

00029                                                              :
00030   z_(pset.getParameter<InputTag>("z")),
00031   gen_(pset.getParameter<InputTag>("gen")) { 
00032   cout << ">>> Z Mass constructor" << endl;
00033   Service<TFileService> fs;
00034   h_mZ_ = fs->make<TH1F>("ZMass", "Z mass (GeV/c^{2})", 100,  0, 200);
00035   h_mZMC_ = fs->make<TH1F>("ZMCMass", "Z MC mass (GeV/c^{2})", 100,  0, 200);
00036 }


Member Function Documentation

void ZMassHistogrammer::analyze ( const edm::Event event,
const edm::EventSetup setup 
) [private, virtual]

Implements edm::EDAnalyzer.

Definition at line 38 of file ZMassHistogrammer.cc.

References reco::Particle::charge(), GenMuonPlsPt100GeV_cfg::cout, reco::Candidate::daughter(), lat::endl(), gen_, h_mZ_, h_mZMC_, i, reco::Particle::mass(), reco::Candidate::numberOfDaughters(), reco::Particle::pdgId(), reco::Particle::status(), z, and z_.

00038                                                                                  { 
00039   cout << ">>> Z Mass analyze" << endl;
00040   Handle<CandidateCollection> z;
00041   Handle<CandidateCollection> gen;
00042   event.getByLabel(z_, z);
00043   event.getByLabel(gen_, gen);
00044   for(size_t i = 0; i < z->size(); ++i) {
00045     const Candidate &zCand = (*z)[i];
00046     h_mZ_->Fill(zCand.mass());
00047   }
00048   for(size_t i = 0; i < gen->size(); ++i) {
00049     const Candidate &genCand = (*gen)[i];
00050     if((genCand.pdgId() == 23) && (genCand.status() == 2)) //this is an intermediate Z0
00051       cout << ">>> intermediate Z0 found, with " << genCand.numberOfDaughters() 
00052            << " daughters" << endl;
00053     if((genCand.pdgId() == 23)&&(genCand.status() == 3)) { //this is a Z0
00054       cout << ">>> Z0 found, with " << genCand.numberOfDaughters() 
00055            << " daughters" << endl;
00056       h_mZMC_->Fill(genCand.mass());
00057       if(genCand.numberOfDaughters() == 3) {//Z0 decays in mu+ mu-, the 3rd daughter is the same Z0
00058         const Candidate * dauGen0 = genCand.daughter(0);
00059         const Candidate * dauGen1 = genCand.daughter(1);
00060         const Candidate * dauGen2 = genCand.daughter(2);
00061         cout << ">>> daughter MC 0 PDG Id " << dauGen0->pdgId() 
00062              << ", status " << dauGen0->status() 
00063              << ", charge " << dauGen0->charge() 
00064              << endl;
00065         cout << ">>> daughter MC 1 PDG Id " << dauGen1->pdgId() 
00066              << ", status " << dauGen1->status()
00067              << ", charge " << dauGen1->charge() 
00068              << endl;
00069         cout << ">>> daughter MC 2 PDG Id " << dauGen2->pdgId() 
00070              << ", status " << dauGen2->status()
00071              << ", charge " << dauGen2->charge() << endl;
00072       }
00073     }
00074   }
00075 }


Member Data Documentation

edm::InputTag ZMassHistogrammer::gen_ [private]

Definition at line 10 of file ZMassHistogrammer.cc.

Referenced by analyze().

TH1F* ZMassHistogrammer::h_mZ_ [private]

Definition at line 11 of file ZMassHistogrammer.cc.

Referenced by analyze(), and ZMassHistogrammer().

TH1F * ZMassHistogrammer::h_mZMC_ [private]

Definition at line 11 of file ZMassHistogrammer.cc.

Referenced by analyze(), and ZMassHistogrammer().

edm::InputTag ZMassHistogrammer::z_ [private]

Definition at line 10 of file ZMassHistogrammer.cc.

Referenced by analyze().


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