CMS 3D CMS Logo

List of all members | Static Public Member Functions
BPHUserData Class Reference

Static Public Member Functions

template<class T >
static const Tget (const pat::CompositeCandidate &cand, const string &name)
 
static float get (const pat::CompositeCandidate &cand, const string &name, float d=0.0)
 
template<class T >
static const TgetByRef (const pat::CompositeCandidate &cand, const string &name)
 

Detailed Description

Definition at line 85 of file BPHHistoSpecificDecay.cc.

Member Function Documentation

◆ get() [1/2]

template<class T >
static const T* BPHUserData::get ( const pat::CompositeCandidate cand,
const string &  name 
)
inlinestatic

◆ get() [2/2]

static float BPHUserData::get ( const pat::CompositeCandidate cand,
const string &  name,
float  d = 0.0 
)
inlinestatic

◆ getByRef()

template<class T >
static const T* BPHUserData::getByRef ( const pat::CompositeCandidate cand,
const string &  name 
)
inlinestatic

Definition at line 99 of file BPHHistoSpecificDecay.cc.

References Skims_PA_cff::name.

99  {
100  if (cand.hasUserData(name)) {
101  typedef edm::Ref<std::vector<T>> objRef;
102  const objRef* ref = cand.userData<objRef>(name);
103  if (ref == nullptr)
104  return nullptr;
105  if (ref->isNull())
106  return nullptr;
107  return ref->get();
108  }
109  return nullptr;
110  }