CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
ZMassHistogrammer Class Reference
Inheritance diagram for ZMassHistogrammer:
edm::EDAnalyzer

Public Member Functions

 ZMassHistogrammer (const edm::ParameterSet &pset)
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

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_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

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 gather_cfg::cout, h_mZ_, h_mZMC_, and TFileDirectory::make().

29  :
30  z_(pset.getParameter<InputTag>("z")),
31  gen_(pset.getParameter<InputTag>("gen")) {
32  cout << ">>> Z Mass constructor" << endl;
34  h_mZ_ = fs->make<TH1F>("ZMass", "Z mass (GeV/c^{2})", 100, 0, 200);
35  h_mZMC_ = fs->make<TH1F>("ZMCMass", "Z MC mass (GeV/c^{2})", 100, 0, 200);
36 }
T getParameter(std::string const &) const
T * make() const
make new ROOT object
tuple cout
Definition: gather_cfg.py:121

Member Function Documentation

void ZMassHistogrammer::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 38 of file ZMassHistogrammer.cc.

References reco::Candidate::charge(), gather_cfg::cout, reco::Candidate::daughter(), relval_steps::gen(), gen_, h_mZ_, h_mZMC_, i, reco::Candidate::mass(), reco::Candidate::numberOfDaughters(), reco::Candidate::pdgId(), reco::Candidate::status(), detailsBasic3DVector::z, and z_.

38  {
39  cout << ">>> Z Mass analyze" << endl;
42  event.getByLabel(z_, z);
43  event.getByLabel(gen_, gen);
44  for(unsigned int i = 0; i < z->size(); ++i) {
45  const Candidate &zCand = (*z)[i];
46  h_mZ_->Fill(zCand.mass());
47  }
48  for(unsigned int i = 0; i < gen->size(); ++i) {
49  const Candidate &genCand = (*gen)[i];
50  if((genCand.pdgId() == 23) && (genCand.status() == 2)) //this is an intermediate Z0
51  cout << ">>> intermediate Z0 found, with " << genCand.numberOfDaughters()
52  << " daughters" << endl;
53  if((genCand.pdgId() == 23)&&(genCand.status() == 3)) { //this is a Z0
54  cout << ">>> Z0 found, with " << genCand.numberOfDaughters()
55  << " daughters" << endl;
56  h_mZMC_->Fill(genCand.mass());
57  if(genCand.numberOfDaughters() == 3) {//Z0 decays in mu+ mu-, the 3rd daughter is the same Z0
58  const Candidate * dauGen0 = genCand.daughter(0);
59  const Candidate * dauGen1 = genCand.daughter(1);
60  const Candidate * dauGen2 = genCand.daughter(2);
61  cout << ">>> daughter MC 0 PDG Id " << dauGen0->pdgId()
62  << ", status " << dauGen0->status()
63  << ", charge " << dauGen0->charge()
64  << endl;
65  cout << ">>> daughter MC 1 PDG Id " << dauGen1->pdgId()
66  << ", status " << dauGen1->status()
67  << ", charge " << dauGen1->charge()
68  << endl;
69  cout << ">>> daughter MC 2 PDG Id " << dauGen2->pdgId()
70  << ", status " << dauGen2->status()
71  << ", charge " << dauGen2->charge() << endl;
72  }
73  }
74  }
75 }
int i
Definition: DBlmapReader.cc:9
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
virtual double mass() const =0
mass
virtual int status() const =0
status word
double double double z
virtual size_type numberOfDaughters() const =0
number of daughters
virtual int charge() const =0
electric charge
virtual int pdgId() const =0
PDG identifier.
tuple cout
Definition: gather_cfg.py:121

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().