CMS 3D CMS Logo

Static Public Member Functions

reco::componenthelper::MultipleComponents< C, T, F, S > Struct Template Reference

#include <component.h>

List of all members.

Static Public Member Functions

static T get (const Candidate &c, size_t i)
static size_t numberOf (const Candidate &c)

Detailed Description

template<typename C, typename T, T(C::*)(size_t) const F, size_t(C::*)() const S>
struct reco::componenthelper::MultipleComponents< C, T, F, S >

Definition at line 36 of file component.h.


Member Function Documentation

template<typename C , typename T , T(C::*)(size_t) const F, size_t(C::*)() const S>
static T reco::componenthelper::MultipleComponents< C, T, F, S >::get ( const Candidate c,
size_t  i 
) [inline, static]

Definition at line 42 of file component.h.

References trackerHits::c, funct::C, Exception, and i.

                                                    {
        const C * dc = dynamic_cast<const C *>( & c );
        if ( dc == 0 ) return T();
        if ( i < (dc->*S)() ) return (dc->*F)( i );
        else throw cms::Exception( "Error" ) << "index " << i << " out ot range";
      }
template<typename C , typename T , T(C::*)(size_t) const F, size_t(C::*)() const S>
static size_t reco::componenthelper::MultipleComponents< C, T, F, S >::numberOf ( const Candidate c) [inline, static]

Definition at line 37 of file component.h.

References trackerHits::c, and funct::C.

                                                    { 
        const C * dc = dynamic_cast<const C *>( & c );
        if ( dc == 0 ) return 0;
        return (dc->*S)(); 
      }