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 override
 
const std::string & purpose () const
 
unsigned int size () const override
 
const std::string & typeName () const
 
- Public Member Functions inherited from FWItemRandomAccessorBase
const void * data () const override
 
 FWItemRandomAccessorBase (const FWItemRandomAccessorBase &)=delete
 
bool isCollection () const override
 
const TClass * modelType () const override
 
const FWItemRandomAccessorBaseoperator= (const FWItemRandomAccessorBase &)=delete
 
void reset () override
 
void setData (const edm::ObjectWithDict &) override
 override if id of an object should be different than the index More...
 
const TClass * type () const override
 
 ~FWItemRandomAccessorBase () override
 
- 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 212 of file FWItemRandomAccessor.h.

Member Typedef Documentation

◆ container_type

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

Definition at line 214 of file FWItemRandomAccessor.h.

◆ value_type

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

Definition at line 215 of file FWItemRandomAccessor.h.

Constructor & Destructor Documentation

◆ FWItemMuonDigiAccessor()

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

Definition at line 217 of file FWItemRandomAccessor.h.

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

Member Function Documentation

◆ classPurpose()

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

Definition at line 76 of file FWItemMuonAccessors.cc.

◆ classRegisterTypeName()

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

Definition at line 76 of file FWItemMuonAccessors.cc.

◆ classTypeName()

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

Definition at line 76 of file FWItemMuonAccessors.cc.

◆ modelData()

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

Implements FWItemAccessorBase.

Definition at line 221 of file FWItemRandomAccessor.h.

References DummyCfis::c, HLT_2024v14_cff::distance, FWItemRandomAccessorBase::getDataPtr(), and mps_fire::i.

221  {
222  if (!getDataPtr())
223  return nullptr;
224  const container_type *c = reinterpret_cast<const container_type *>(getDataPtr());
225  size_t collectionOffset = 0;
226 
227  for (typename container_type::DigiRangeIterator ci = c->begin(), ce = c->end(); ci != ce; ++ci) {
228  int i = iIndex - collectionOffset;
229 
231 
232  if (i < std::distance(vt.second.first, vt.second.second))
233  return &(*(vt.second.first + i));
234  collectionOffset += std::distance(vt.second.first, vt.second.second);
235  }
236 
237  return nullptr;
238  }

◆ purpose()

template<class C , class V >
const std::string& FWItemMuonDigiAccessor< C, V >::purpose ( ) const
inline

Definition at line 219 of file FWItemRandomAccessor.h.

221 {

◆ size()

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

Implements FWItemAccessorBase.

Definition at line 240 of file FWItemRandomAccessor.h.

References DummyCfis::c, HLT_2024v14_cff::distance, and FWItemRandomAccessorBase::getDataPtr().

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

240  {
241  if (!getDataPtr())
242  return 0;
243  const container_type *c = reinterpret_cast<const container_type *>(getDataPtr());
244  size_t finalSize = 0;
245 
246  for (typename container_type::DigiRangeIterator ci = c->begin(), ce = c->end(); ci != ce; ++ci) {
248  finalSize += std::distance(vt.second.first, vt.second.second);
249  }
250 
251  return finalSize;
252  }

◆ typeName()

template<class C , class V >
const std::string& FWItemMuonDigiAccessor< C, V >::typeName ( ) const
inline

Definition at line 219 of file FWItemRandomAccessor.h.

221 {