CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
HGCDataFrame< D, S > Class Template Reference

Readout digi for HGC. More...

#include <HGCDataFrame.h>

Public Types

typedef D key_type
 key to sort the collection More...
 

Public Member Functions

const std::vector< S > & data () const
 
 HGCDataFrame ()
 CTOR. More...
 
 HGCDataFrame (const D &id)
 
 HGCDataFrame (const HGCDataFrame &o)
 
const D & id () const
 det id More...
 
const Soperator[] (int i) const
 assess/set specific samples More...
 
void print (std::ostream &out=std::cout)
 
void resize (size_t s)
 allow to set size More...
 
const Ssample (int i) const
 
void setData (const std::vector< S > &d)
 
void setSample (int i, const S &sample)
 
int size () const
 total number of samples in the digi More...
 

Private Attributes

std::vector< Sdata_
 
id_
 
size_t maxSampleSize_
 

Detailed Description

template<class D, class S>
class HGCDataFrame< D, S >

Readout digi for HGC.

Definition at line 14 of file HGCDataFrame.h.

Member Typedef Documentation

◆ key_type

template<class D , class S >
typedef D HGCDataFrame< D, S >::key_type

key to sort the collection

Definition at line 19 of file HGCDataFrame.h.

Constructor & Destructor Documentation

◆ HGCDataFrame() [1/3]

template<class D , class S >
HGCDataFrame< D, S >::HGCDataFrame ( )
inline

CTOR.

Definition at line 24 of file HGCDataFrame.h.

References HGCDataFrame< D, S >::data_, and HGCDataFrame< D, S >::maxSampleSize_.

24 : id_(0), maxSampleSize_(15) { data_.resize(maxSampleSize_); }
size_t maxSampleSize_
Definition: HGCDataFrame.h:69
std::vector< S > data_
Definition: HGCDataFrame.h:63

◆ HGCDataFrame() [2/3]

template<class D , class S >
HGCDataFrame< D, S >::HGCDataFrame ( const D &  id)
inline

Definition at line 25 of file HGCDataFrame.h.

References HGCDataFrame< D, S >::data_, and HGCDataFrame< D, S >::maxSampleSize_.

25 : id_(id), maxSampleSize_(15) { data_.resize(maxSampleSize_); }
size_t maxSampleSize_
Definition: HGCDataFrame.h:69
std::vector< S > data_
Definition: HGCDataFrame.h:63

◆ HGCDataFrame() [3/3]

template<class D , class S >
HGCDataFrame< D, S >::HGCDataFrame ( const HGCDataFrame< D, S > &  o)
inline

Definition at line 26 of file HGCDataFrame.h.

26 : data_(o.data_), id_(o.id_), maxSampleSize_(o.maxSampleSize_) {}
size_t maxSampleSize_
Definition: HGCDataFrame.h:69
std::vector< S > data_
Definition: HGCDataFrame.h:63

Member Function Documentation

◆ data()

template<class D , class S >
const std::vector<S>& HGCDataFrame< D, S >::data ( ) const
inline

Definition at line 58 of file HGCDataFrame.h.

References HGCDataFrame< D, S >::data_.

58 { return data_; }
std::vector< S > data_
Definition: HGCDataFrame.h:63

◆ id()

template<class D , class S >
const D& HGCDataFrame< D, S >::id ( ) const
inline

det id

Definition at line 31 of file HGCDataFrame.h.

References HGCDataFrame< D, S >::id_.

Referenced by HGCDigitizerBase::updateOutput().

31 { return id_; }

◆ operator[]()

template<class D , class S >
const S& HGCDataFrame< D, S >::operator[] ( int  i) const
inline

assess/set specific samples

Definition at line 46 of file HGCDataFrame.h.

References HGCDataFrame< D, S >::data_, and mps_fire::i.

46 { return data_[i]; }
std::vector< S > data_
Definition: HGCDataFrame.h:63

◆ print()

template<class D , class S >
void HGCDataFrame< D, S >::print ( std::ostream &  out = std::cout)
inline

Definition at line 52 of file HGCDataFrame.h.

References HGCDataFrame< D, S >::data_, mps_fire::i, and MillePedeFileConverter_cfg::out.

52  {
53  for (size_t i = 0; i < data_.size(); i++) {
54  out << "[" << i << "] ";
55  data_[i].print(out);
56  }
57  }
std::vector< S > data_
Definition: HGCDataFrame.h:63

◆ resize()

template<class D , class S >
void HGCDataFrame< D, S >::resize ( size_t  s)
inline

allow to set size

Definition at line 41 of file HGCDataFrame.h.

References HGCDataFrame< D, S >::data_, and alignCSCRings::s.

Referenced by HGCDigitizerBase::updateOutput().

41 { data_.resize(s); }
std::vector< S > data_
Definition: HGCDataFrame.h:63

◆ sample()

template<class D , class S >
const S& HGCDataFrame< D, S >::sample ( int  i) const
inline

Definition at line 47 of file HGCDataFrame.h.

References HGCDataFrame< D, S >::data_, and mps_fire::i.

Referenced by HGCDataFrame< D, S >::setSample().

47 { return data_[i]; }
std::vector< S > data_
Definition: HGCDataFrame.h:63

◆ setData()

template<class D , class S >
void HGCDataFrame< D, S >::setData ( const std::vector< S > &  d)
inline

Definition at line 59 of file HGCDataFrame.h.

References ztail::d, and HGCDataFrame< D, S >::data_.

59 { data_ = d; }
std::vector< S > data_
Definition: HGCDataFrame.h:63
d
Definition: ztail.py:151

◆ setSample()

template<class D , class S >
void HGCDataFrame< D, S >::setSample ( int  i,
const S sample 
)
inline

Definition at line 48 of file HGCDataFrame.h.

References HGCDataFrame< D, S >::data_, mps_fire::i, and HGCDataFrame< D, S >::sample().

48  {
49  if (i < (int)data_.size())
50  data_[i] = sample;
51  }
const S & sample(int i) const
Definition: HGCDataFrame.h:47
std::vector< S > data_
Definition: HGCDataFrame.h:63

◆ size()

template<class D , class S >
int HGCDataFrame< D, S >::size ( void  ) const
inline

total number of samples in the digi

Definition at line 36 of file HGCDataFrame.h.

References HGCDataFrame< D, S >::data_.

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

36 { return data_.size() & 0xf; }
std::vector< S > data_
Definition: HGCDataFrame.h:63

Member Data Documentation

◆ data_

template<class D , class S >
std::vector<S> HGCDataFrame< D, S >::data_
private

◆ id_

template<class D , class S >
D HGCDataFrame< D, S >::id_
private

Definition at line 66 of file HGCDataFrame.h.

Referenced by HGCDataFrame< D, S >::id().

◆ maxSampleSize_

template<class D , class S >
size_t HGCDataFrame< D, S >::maxSampleSize_
private

Definition at line 69 of file HGCDataFrame.h.

Referenced by HGCDataFrame< D, S >::HGCDataFrame().