CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
pat::eventhypothesis::DynCastCandPtr< T > Class Template Reference

#include <EventHypothesisLooper.h>

Public Member Functions

void clearCache ()
 
const Tget (const reco::Candidate *ptr)
 
bool typeOk (const reco::Candidate *ptr)
 

Private Member Functions

void doPtr (const reco::Candidate *ptr)
 

Private Attributes

const TcachePtr_
 
bool isPtrCached_
 

Detailed Description

template<typename T>
class pat::eventhypothesis::DynCastCandPtr< T >

Definition at line 11 of file EventHypothesisLooper.h.

Member Function Documentation

◆ clearCache()

template<typename T>
void pat::eventhypothesis::DynCastCandPtr< T >::clearCache ( )
inline

◆ doPtr()

template<typename T >
void pat::eventhypothesis::DynCastCandPtr< T >::doPtr ( const reco::Candidate ptr)
private

Definition at line 26 of file EventHypothesisLooper.h.

Referenced by pat::eventhypothesis::DynCastCandPtr< T >::typeOk().

26  {
27  if (!isPtrCached_) {
28  cachePtr_ = dynamic_cast<const T *>(ptr);
29  isPtrCached_ = true;
30  }
31  }
long double T

◆ get()

template<typename T >
const T * pat::eventhypothesis::DynCastCandPtr< T >::get ( const reco::Candidate ptr)

Definition at line 33 of file EventHypothesisLooper.h.

References Exception, and Skims_PA_cff::name.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), submitPVValidationJobs.BetterConfigParser::__updateDict(), util.rrapi.RRApi::columns(), rrapi.RRApi::columns(), rrapi.RRApi::count(), util.rrapi.RRApi::count(), rrapi.RRApi::data(), util.rrapi.RRApi::data(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), submitPVValidationJobs.BetterConfigParser::getResultingSection(), util.rrapi.RRApi::report(), rrapi.RRApi::report(), rrapi.RRApi::reports(), util.rrapi.RRApi::reports(), rrapi.RRApi::tables(), util.rrapi.RRApi::tables(), util.rrapi.RRApi::tags(), rrapi.RRApi::tags(), rrapi.RRApi::templates(), util.rrapi.RRApi::templates(), util.rrapi.RRApi::workspaces(), and rrapi.RRApi::workspaces().

33  {
34  doPtr(ptr);
35  if ((ptr != nullptr) && (cachePtr_ == nullptr))
36  throw cms::Exception("Type Checking")
37  << "You can't convert a " << typeid(*ptr).name() << " to a " << typeid(T).name() << "\n"
38  << "note: you can use c++filt command to convert the above in human readable types.\n";
39  return cachePtr_;
40  }
void doPtr(const reco::Candidate *ptr)
long double T

◆ typeOk()

template<typename T>
bool pat::eventhypothesis::DynCastCandPtr< T >::typeOk ( const reco::Candidate ptr)
inline

Member Data Documentation

◆ cachePtr_

template<typename T>
const T* pat::eventhypothesis::DynCastCandPtr< T >::cachePtr_
private

◆ isPtrCached_

template<typename T>
bool pat::eventhypothesis::DynCastCandPtr< T >::isPtrCached_
private