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)
 
template<class T >
static const TgetByRef (const pat::CompositeCandidate &cand, const string &name)
 

Detailed Description

Definition at line 38 of file BPHHistoSpecificDecay.cc.

Member Function Documentation

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

Definition at line 47 of file BPHHistoSpecificDecay.cc.

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

Referenced by BPHDaughterSelect::accept(), and BPHHistoSpecificDecay::analyze().

48  {
49  if ( cand.hasUserData( name ) ) {
50  typedef edm::Ref< std::vector<T> > objRef;
51  const objRef* ref = cand.userData<objRef>( name );
52  if ( ref == 0 ) return 0;
53  if ( ref->isNull() ) return 0;
54  return ref->get();
55  }
56  return 0;
57  }
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:280
bool hasUserData(const std::string &key) const
Check if user data with a specific type is present.
Definition: PATObject.h:286