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
FWItemMuonDigiAccessor< C, V > Class Template Reference

#include <FWItemRandomAccessor.h>

Inheritance diagram for FWItemMuonDigiAccessor< C, V >:
FWItemRandomAccessorBase FWItemAccessorBase

Public Types

typedef C container_type
 
typedef V value_type
 

Public Member Functions

 FWItemMuonDigiAccessor (const TClass *iClass)
 
const void * modelData (int iIndex) const
 
 REGISTER_FWITEMACCESSOR_METHODS ()
 
unsigned int size () const
 
- Public Member Functions inherited from FWItemRandomAccessorBase
const void * data () const
 
bool isCollection () const
 
const TClass * modelType () const
 
virtual void reset ()
 
void setData (const edm::ObjectWithDict &)
 override if id of an object should be different than the index More...
 
const TClass * type () const
 
virtual ~FWItemRandomAccessorBase ()
 
- Public Member Functions inherited from FWItemAccessorBase
 FWItemAccessorBase ()
 
virtual ~FWItemAccessorBase ()
 

Additional Inherited Members

- Protected Member Functions inherited from FWItemRandomAccessorBase
 FWItemRandomAccessorBase (const TClass *type, const type_info &modelTypeName)
 
void * getDataPtr () const
 
- Protected Attributes inherited from FWItemRandomAccessorBase
void * m_data
 
const TClass * m_modelType
 
const TClass * m_type
 

Detailed Description

template<class C, class V>
class FWItemMuonDigiAccessor< C, V >

Definition at line 235 of file FWItemRandomAccessor.h.

Member Typedef Documentation

template<class C , class V >
typedef C FWItemMuonDigiAccessor< C, V >::container_type

Definition at line 238 of file FWItemRandomAccessor.h.

template<class C , class V >
typedef V FWItemMuonDigiAccessor< C, V >::value_type

Definition at line 239 of file FWItemRandomAccessor.h.

Constructor & Destructor Documentation

template<class C , class V >
FWItemMuonDigiAccessor< C, V >::FWItemMuonDigiAccessor ( const TClass *  iClass)
inline

Definition at line 241 of file FWItemRandomAccessor.h.

242  : FWItemRandomAccessorBase(iClass, typeid(value_type))
243  {}
FWItemRandomAccessorBase(const TClass *type, const type_info &modelTypeName)

Member Function Documentation

template<class C , class V >
const void* FWItemMuonDigiAccessor< C, V >::modelData ( int  iIndex) const
inlinevirtual

Implements FWItemAccessorBase.

Definition at line 247 of file FWItemRandomAccessor.h.

References trackerHits::c, FWItemRandomAccessorBase::getDataPtr(), and i.

248  {
249  if (!getDataPtr())
250  return 0;
251  const container_type *c = reinterpret_cast<const container_type*>(getDataPtr());
252  size_t collectionOffset = 0;
253 
254  for (typename container_type::DigiRangeIterator ci = c->begin(), ce = c->end(); ci != ce; ++ci)
255  {
256  int i = iIndex - collectionOffset;
257 
259 
260 
261  if (i < std::distance(vt.second.first, vt.second.second))
262  return &(*(vt.second.first + i));
263  collectionOffset += std::distance(vt.second.first, vt.second.second);
264  }
265 
266  return 0;
267  }
int i
Definition: DBlmapReader.cc:9
Container::value_type value_type
template<class C , class V >
FWItemMuonDigiAccessor< C, V >::REGISTER_FWITEMACCESSOR_METHODS ( )
template<class C , class V >
unsigned int FWItemMuonDigiAccessor< C, V >::size ( void  ) const
inlinevirtual

Implements FWItemAccessorBase.

Definition at line 269 of file FWItemRandomAccessor.h.

References trackerHits::c, and FWItemRandomAccessorBase::getDataPtr().

270  {
271  if (!getDataPtr())
272  return 0;
273  const container_type *c = reinterpret_cast<const container_type*>(getDataPtr());
274  size_t finalSize = 0;
275 
276  for (typename container_type::DigiRangeIterator ci = c->begin(), ce = c->end(); ci != ce; ++ci)
277  {
279  finalSize += std::distance(vt.second.first, vt.second.second);
280  }
281 
282  return finalSize;
283  }
Container::value_type value_type