CMS 3D CMS Logo

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 ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

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

Private Attributes

EDGetTokenT< GenParticleCollectiongenParticlesToken_
 
EDGetTokenT< GenParticleMatchmatchToken_
 
InputTag src_
 
EDGetTokenT< CandidateViewsrcToken_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 14 of file DebugZMCTruth.cc.

Constructor & Destructor Documentation

◆ DebugZMCTruth()

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

Definition at line 26 of file DebugZMCTruth.cc.

27  : src_(cfg.getParameter<InputTag>("src")),
28  srcToken_(consumes<CandidateView>(src_)),
29  genParticlesToken_(consumes<GenParticleCollection>(cfg.getParameter<InputTag>("genParticles"))),
30  matchToken_(consumes<GenParticleMatch>(cfg.getParameter<InputTag>("mcMatch"))) {}

Member Function Documentation

◆ analyze()

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

Implements edm::EDAnalyzer.

Definition at line 32 of file DebugZMCTruth.cc.

32  {
34  event.getByToken(genParticlesToken_, genParticles);
36  event.getByToken(srcToken_, src);
37  cout << ">>> event has " << src->size() << " reconstructed particles in {" << src_ << "}" << endl;
39  event.getByToken(matchToken_, match);
40  cout << ">>> Z matches: ";
41  for (unsigned int i = 0; i < src->size(); ++i) {
42  CandidateBaseRef ref = src->refAt(i);
43  GenParticleRef mc = (*match)[ref];
44  cout << (mc.isNull() ? "(no)" : "(yes)");
45  }
46  cout << endl;
47 }

References gather_cfg::cout, genParticles2HepMC_cfi::genParticles, genParticlesToken_, mps_fire::i, match(), matchToken_, CaloTowersParam_cfi::mc, TrackRefitter_38T_cff::src, src_, and srcToken_.

Member Data Documentation

◆ genParticlesToken_

EDGetTokenT<GenParticleCollection> DebugZMCTruth::genParticlesToken_
private

Definition at line 22 of file DebugZMCTruth.cc.

Referenced by analyze().

◆ matchToken_

EDGetTokenT<GenParticleMatch> DebugZMCTruth::matchToken_
private

Definition at line 23 of file DebugZMCTruth.cc.

Referenced by analyze().

◆ src_

InputTag DebugZMCTruth::src_
private

Definition at line 20 of file DebugZMCTruth.cc.

Referenced by analyze().

◆ srcToken_

EDGetTokenT<CandidateView> DebugZMCTruth::srcToken_
private

Definition at line 21 of file DebugZMCTruth.cc.

Referenced by analyze().

DebugZMCTruth::matchToken_
EDGetTokenT< GenParticleMatch > matchToken_
Definition: DebugZMCTruth.cc:23
mps_fire.i
i
Definition: mps_fire.py:355
genParticles2HepMC_cfi.genParticles
genParticles
Definition: genParticles2HepMC_cfi.py:4
CaloTowersParam_cfi.mc
mc
Definition: CaloTowersParam_cfi.py:8
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::Handle
Definition: AssociativeIterator.h:50
edm::Ref< GenParticleCollection >
TrackRefitter_38T_cff.src
src
Definition: TrackRefitter_38T_cff.py:24
match
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
looper.cfg
cfg
Definition: looper.py:297
edm::RefToBase< Candidate >
DebugZMCTruth::srcToken_
EDGetTokenT< CandidateView > srcToken_
Definition: DebugZMCTruth.cc:21
DebugZMCTruth::genParticlesToken_
EDGetTokenT< GenParticleCollection > genParticlesToken_
Definition: DebugZMCTruth.cc:22
edm::InputTag
Definition: InputTag.h:15
DebugZMCTruth::src_
InputTag src_
Definition: DebugZMCTruth.cc:20