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
DebugZMCTruth Class Reference
Inheritance diagram for DebugZMCTruth:
edm::EDAnalyzer

Public Member Functions

 DebugZMCTruth (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 Event &event, const EventSetup &setup)
 

Private Attributes

InputTag genParticles_
 
InputTag match_
 
InputTag src_
 

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 14 of file DebugZMCTruth.cc.

Constructor & Destructor Documentation

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

Definition at line 22 of file DebugZMCTruth.cc.

22  :
23  src_(cfg.getParameter<InputTag>("src")),
24  genParticles_(cfg.getParameter<InputTag>("genParticles")),
25 match_(cfg.getParameter<InputTag>("mcMatch")) {
26 }
InputTag match_
InputTag genParticles_

Member Function Documentation

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

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_.

29  {
31  event.getByLabel(genParticles_, genParticles);
33  event.getByLabel(src_, src);
34  cout << ">>> event has " << src->size() << " reconstructed particles in {" << src_ << "}" <<endl;
36  event.getByLabel(match_, match);
37  cout << ">>> Z matches: ";
38  for(unsigned int i = 0; i < src->size(); ++i) {
39  CandidateBaseRef ref = src->refAt(i);
40  GenParticleRef mc = (*match)[ref];
41  cout << (mc.isNull() ? "(no)" : "(yes)");
42  }
43  cout << endl;
44 }
int i
Definition: DBlmapReader.cc:9
bool isNull() const
Checks for null.
Definition: Ref.h:247
InputTag match_
tuple cout
Definition: gather_cfg.py:121
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:6
InputTag genParticles_

Member Data Documentation

InputTag DebugZMCTruth::genParticles_
private

Definition at line 19 of file DebugZMCTruth.cc.

Referenced by analyze().

InputTag DebugZMCTruth::match_
private

Definition at line 19 of file DebugZMCTruth.cc.

Referenced by analyze().

InputTag DebugZMCTruth::src_
private

Definition at line 19 of file DebugZMCTruth.cc.

Referenced by analyze().