CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

edm::EdmEventItemGetter< RefType > Class Template Reference

Helper class that fetches some type of Ref given ProductID and index, using the edm::Event. More...

#include <AssociativeIterator.h>

List of all members.

Public Types

typedef RefType::value_type element_type

Public Member Functions

 EdmEventItemGetter (const edm::Event &iEvent)
RefType get (const ProductID &id, size_t idx) const
 ~EdmEventItemGetter ()

Private Attributes

ProductID id_
const edm::EventiEvent_
Handle< View< element_type > > view_

Detailed Description

template<typename RefType>
class edm::EdmEventItemGetter< RefType >

Helper class that fetches some type of Ref given ProductID and index, using the edm::Event.

Definition at line 78 of file AssociativeIterator.h.


Member Typedef Documentation

template<typename RefType >
typedef RefType::value_type edm::EdmEventItemGetter< RefType >::element_type

Definition at line 80 of file AssociativeIterator.h.


Constructor & Destructor Documentation

template<typename RefType >
edm::EdmEventItemGetter< RefType >::EdmEventItemGetter ( const edm::Event iEvent) [inline]

Definition at line 81 of file AssociativeIterator.h.

: iEvent_(iEvent) { }
template<typename RefType >
edm::EdmEventItemGetter< RefType >::~EdmEventItemGetter ( ) [inline]

Definition at line 82 of file AssociativeIterator.h.

{ }

Member Function Documentation

template<typename RefType >
RefType edm::EdmEventItemGetter< RefType >::get ( const ProductID id,
size_t  idx 
) const [inline]

Definition at line 84 of file AssociativeIterator.h.

References conv, lhef::cc::convert(), edm::Event::get(), ExpressReco_HICollisions_FallBack::id, edm::EdmEventItemGetter< RefType >::id_, edm::EdmEventItemGetter< RefType >::iEvent_, and edm::EdmEventItemGetter< RefType >::view_.

                                                               {
                typedef typename edm::RefToBase<element_type> BaseRefType; // could also use Ptr, but then I can't do Ptr->RefToBase
                if (id_ != id) {
                    id_ = id;
                    iEvent_.get(id_, view_);
                }
                BaseRefType ref = view_->refAt(idx);
                typedef typename helper::RefConverter<BaseRefType, RefType> conv; 
                return conv::convert(ref);
            }

Member Data Documentation

template<typename RefType >
ProductID edm::EdmEventItemGetter< RefType >::id_ [mutable, private]

Definition at line 96 of file AssociativeIterator.h.

Referenced by edm::EdmEventItemGetter< RefType >::get().

template<typename RefType >
const edm::Event& edm::EdmEventItemGetter< RefType >::iEvent_ [private]

Definition at line 97 of file AssociativeIterator.h.

Referenced by edm::EdmEventItemGetter< RefType >::get().

template<typename RefType >
Handle<View<element_type> > edm::EdmEventItemGetter< RefType >::view_ [mutable, private]

Definition at line 95 of file AssociativeIterator.h.

Referenced by edm::EdmEventItemGetter< RefType >::get().