CMS 3D CMS Logo

Classes | Functions

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/ElectroWeakAnalysis/ZMuMu/plugins/MCAcceptanceAnalyzer.cc File Reference

#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Utilities/interface/InputTag.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/Event.h"
#include "DataFormats/Common/interface/Handle.h"
#include "DataFormats/Candidate/interface/Candidate.h"
#include "DataFormats/HepMCCandidate/interface/GenParticle.h"
#include <iostream>
#include "FWCore/Framework/interface/MakerMacros.h"

Go to the source code of this file.

Classes

class  MCAcceptanceAnalyzer
struct  ZSelector

Functions

 DEFINE_FWK_MODULE (MCAcceptanceAnalyzer)
const CandidatemcMuDaughter (const Candidate *c)

Function Documentation

DEFINE_FWK_MODULE ( MCAcceptanceAnalyzer  )
const Candidate* mcMuDaughter ( const Candidate c)

Definition at line 14 of file MCAcceptanceAnalyzer.cc.

References reco::Candidate::daughter(), i, n, reco::Candidate::numberOfDaughters(), and reco::Candidate::pdgId().

Referenced by MCAcceptanceAnalyzer::analyze(), and ZSelector::operator()().

                                                    {
  unsigned int n = c->numberOfDaughters();
  for(unsigned int i = 0; i < n; ++i) {
    const Candidate * d = c->daughter(i);
    if(fabs(d->pdgId())==13) return d;
  }
  return 0;
}