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 edm::EDConsumerBase

Public Member Functions

 DebugZMCTruth (const edm::ParameterSet &pset)
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

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

Private Attributes

EDGetTokenT
< GenParticleCollection
genParticlesToken_
 
EDGetTokenT< GenParticleMatchmatchToken_
 
InputTag src_
 
EDGetTokenT< CandidateViewsrcToken_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- 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::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 14 of file DebugZMCTruth.cc.

Constructor & Destructor Documentation

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

Definition at line 25 of file DebugZMCTruth.cc.

25  :
26  src_(cfg.getParameter<InputTag>("src")),
27  srcToken_(consumes<CandidateView>(src_)),
28  genParticlesToken_(consumes<GenParticleCollection>(cfg.getParameter<InputTag>("genParticles"))),
29  matchToken_(consumes<GenParticleMatch>(cfg.getParameter<InputTag>("mcMatch"))) {
30 }
tuple cfg
Definition: looper.py:259
EDGetTokenT< GenParticleCollection > genParticlesToken_
EDGetTokenT< CandidateView > srcToken_
EDGetTokenT< GenParticleMatch > matchToken_

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 33 of file DebugZMCTruth.cc.

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

33  {
35  event.getByToken(genParticlesToken_, genParticles);
37  event.getByToken(srcToken_, src);
38  cout << ">>> event has " << src->size() << " reconstructed particles in {" << src_ << "}" <<endl;
40  event.getByToken(matchToken_, match);
41  cout << ">>> Z matches: ";
42  for(unsigned int i = 0; i < src->size(); ++i) {
43  CandidateBaseRef ref = src->refAt(i);
44  GenParticleRef mc = (*match)[ref];
45  cout << (mc.isNull() ? "(no)" : "(yes)");
46  }
47  cout << endl;
48 }
int i
Definition: DBlmapReader.cc:9
bool isNull() const
Checks for null.
Definition: Ref.h:247
EDGetTokenT< GenParticleCollection > genParticlesToken_
EDGetTokenT< CandidateView > srcToken_
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:10
EDGetTokenT< GenParticleMatch > matchToken_

Member Data Documentation

EDGetTokenT<GenParticleCollection> DebugZMCTruth::genParticlesToken_
private

Definition at line 21 of file DebugZMCTruth.cc.

Referenced by analyze().

EDGetTokenT<GenParticleMatch> DebugZMCTruth::matchToken_
private

Definition at line 22 of file DebugZMCTruth.cc.

Referenced by analyze().

InputTag DebugZMCTruth::src_
private

Definition at line 19 of file DebugZMCTruth.cc.

Referenced by analyze().

EDGetTokenT<CandidateView> DebugZMCTruth::srcToken_
private

Definition at line 20 of file DebugZMCTruth.cc.

Referenced by analyze().