CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 95 of file BPHHistoSpecificDecay.cc.

Member Function Documentation

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

Definition at line 109 of file BPHHistoSpecificDecay.cc.

References pat::PATObject< ObjectType >::hasUserData(), mergeVDriftHistosByStation::name, and pat::PATObject< ObjectType >::userData().

109  {
110  if (cand.hasUserData(name)) {
111  typedef edm::Ref<std::vector<T>> objRef;
112  const objRef* ref = cand.userData<objRef>(name);
113  if (ref == nullptr)
114  return nullptr;
115  if (ref->isNull())
116  return nullptr;
117  return ref->get();
118  }
119  return nullptr;
120  }
const T * userData(const std::string &key) const
Returns user-defined data. Returns NULL if the data is not present, or not of type T...
Definition: PATObject.h:322
bool hasUserData(const std::string &key) const
Check if user data with a specific type is present.
Definition: PATObject.h:327