CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

DebugZMCTruth Class Reference

Inheritance diagram for DebugZMCTruth:
edm::EDAnalyzer

List of all members.

Public Member Functions

 DebugZMCTruth (const edm::ParameterSet &pset)

Private Member Functions

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

Private Attributes

InputTag genParticles_
InputTag match_
InputTag src_

Detailed Description

Definition at line 14 of file DebugZMCTruth.cc.


Constructor & Destructor Documentation

DebugZMCTruth::DebugZMCTruth ( const edm::ParameterSet pset)

Definition at line 22 of file DebugZMCTruth.cc.

                                                    :
  src_(cfg.getParameter<InputTag>("src")),
  genParticles_(cfg.getParameter<InputTag>("genParticles")),
match_(cfg.getParameter<InputTag>("mcMatch")) {
}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 29 of file DebugZMCTruth.cc.

References gather_cfg::cout, genParticleCandidates2GenParticles_cfi::genParticles, genParticles_, i, edm::Ref< C, T, F >::isNull(), match(), match_, alcazmumu_cfi::src, and src_.

                                                                       {
  Handle<GenParticleCollection> genParticles;
  event.getByLabel(genParticles_, genParticles);
  Handle<CandidateView> src;
  event.getByLabel(src_, src);
  cout << ">>> event has " << src->size() << " reconstructed particles in {" << src_ << "}" <<endl;
  Handle<GenParticleMatch> match;
  event.getByLabel(match_, match);
  cout << ">>> Z matches: ";
  for(unsigned int i = 0; i < src->size(); ++i) {
    CandidateBaseRef ref = src->refAt(i);
    GenParticleRef mc = (*match)[ref];
    cout << (mc.isNull() ? "(no)" : "(yes)");
  }
  cout << endl;
}

Member Data Documentation

Definition at line 19 of file DebugZMCTruth.cc.

Referenced by analyze().

Definition at line 19 of file DebugZMCTruth.cc.

Referenced by analyze().

Definition at line 19 of file DebugZMCTruth.cc.

Referenced by analyze().