CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static 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
 
const std::string & purpose () const
 
unsigned int size () const
 
const std::string & typeName () 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 ()
 

Static Public Member Functions

static const std::string & classPurpose ()
 
static const std::string & classRegisterTypeName ()
 
static const std::string & classTypeName ()
 

Additional Inherited Members

- Protected Member Functions inherited from FWItemRandomAccessorBase
 FWItemRandomAccessorBase (const TClass *type, const std::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 234 of file FWItemRandomAccessor.h.

Member Typedef Documentation

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

Definition at line 237 of file FWItemRandomAccessor.h.

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

Definition at line 238 of file FWItemRandomAccessor.h.

Constructor & Destructor Documentation

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

Definition at line 240 of file FWItemRandomAccessor.h.

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

Member Function Documentation

const std::string & ME0DigiPreRecoAccessor::classPurpose ( )
static

Definition at line 56 of file FWItemMuonAccessors.cc.

const std::string & ME0DigiPreRecoAccessor::classRegisterTypeName ( )
static

Definition at line 56 of file FWItemMuonAccessors.cc.

const std::string & ME0DigiPreRecoAccessor::classTypeName ( )
static

Definition at line 56 of file FWItemMuonAccessors.cc.

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

Implements FWItemAccessorBase.

Definition at line 246 of file FWItemRandomAccessor.h.

References EnergyCorrector::c, SoftLeptonByDistance_cfi::distance, FWItemRandomAccessorBase::getDataPtr(), and mps_fire::i.

247  {
248  if (!getDataPtr())
249  return 0;
250  const container_type *c = reinterpret_cast<const container_type*>(getDataPtr());
251  size_t collectionOffset = 0;
252 
253  for (typename container_type::DigiRangeIterator ci = c->begin(), ce = c->end(); ci != ce; ++ci)
254  {
255  int i = iIndex - collectionOffset;
256 
258 
259 
260  if (i < std::distance(vt.second.first, vt.second.second))
261  return &(*(vt.second.first + i));
262  collectionOffset += std::distance(vt.second.first, vt.second.second);
263  }
264 
265  return 0;
266  }
template<class C , class V >
const std::string& FWItemMuonDigiAccessor< C, V >::purpose ( ) const
inline

Definition at line 244 of file FWItemRandomAccessor.h.

247 {
template<class C , class V >
unsigned int FWItemMuonDigiAccessor< C, V >::size ( void  ) const
inlinevirtual

Implements FWItemAccessorBase.

Definition at line 268 of file FWItemRandomAccessor.h.

References EnergyCorrector::c, SoftLeptonByDistance_cfi::distance, and FWItemRandomAccessorBase::getDataPtr().

Referenced by ntupleDataFormat._Collection::__iter__(), and ntupleDataFormat._Collection::__len__().

269  {
270  if (!getDataPtr())
271  return 0;
272  const container_type *c = reinterpret_cast<const container_type*>(getDataPtr());
273  size_t finalSize = 0;
274 
275  for (typename container_type::DigiRangeIterator ci = c->begin(), ce = c->end(); ci != ce; ++ci)
276  {
278  finalSize += std::distance(vt.second.first, vt.second.second);
279  }
280 
281  return finalSize;
282  }
template<class C , class V >
const std::string& FWItemMuonDigiAccessor< C, V >::typeName ( ) const
inline

Definition at line 244 of file FWItemRandomAccessor.h.

247 {