CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | 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>

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.

81 : iEvent_(iEvent) { }
const edm::Event & iEvent_
template<typename RefType >
edm::EdmEventItemGetter< RefType >::~EdmEventItemGetter ( )
inline

Definition at line 82 of file AssociativeIterator.h.

82 { }

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, convert(), edm::Event::get(), errorMatrix2Lands_multiChannel::id, edm::EdmEventItemGetter< RefType >::id_, edm::EdmEventItemGetter< RefType >::iEvent_, and edm::EdmEventItemGetter< RefType >::view_.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), and betterConfigParser.BetterConfigParser::getResultingSection().

84  {
85  typedef typename edm::RefToBase<element_type> BaseRefType; // could also use Ptr, but then I can't do Ptr->RefToBase
86  if (id_ != id) {
87  id_ = id;
88  iEvent_.get(id_, view_);
89  }
90  BaseRefType ref = view_->refAt(idx);
91  typedef typename helper::RefConverter<BaseRefType, RefType> conv;
92  return conv::convert(ref);
93  }
static HepMC::IO_HEPEVT conv
Handle< View< element_type > > view_
const edm::Event & iEvent_
void convert(uint32 i, char_uint32 v)
Definition: MsgTools.h:46
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:267

Member Data Documentation

template<typename RefType >
ProductID edm::EdmEventItemGetter< RefType >::id_
mutableprivate

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_
mutableprivate

Definition at line 95 of file AssociativeIterator.h.

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