CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HcalDigiCollections.h
Go to the documentation of this file.
1 #ifndef DIGIHCAL_HCALDIGICOLLECTION_H
2 #define DIGIHCAL_HCALDIGICOLLECTION_H
3 
16 
19 
31 
33 
34 template <class Digi>
36 public:
38  static const size_type MAXSAMPLES = 10;
39  HcalDataFrameContainer(int nsamples_per_digi = MAXSAMPLES, int isubdet = 0)
40  : edm::DataFrameContainer(nsamples_per_digi * Digi::WORDS_PER_SAMPLE + Digi::HEADER_WORDS + Digi::FLAG_WORDS,
41  isubdet) {}
42  void swap(DataFrameContainer& other) { this->DataFrameContainer::swap(other); }
43 
44  //helpful accessors
46  Digi backDataFrame() { return Digi(this->back()); }
47  int samples() const { return int((stride() - Digi::HEADER_WORDS - Digi::FLAG_WORDS) / Digi::WORDS_PER_SAMPLE); }
48  void addDataFrame(DetId detid, const uint16_t* data) { push_back(detid.rawId(), data); }
49  void push_back(const Digi& digi) { push_back(digi.id(), digi.begin()); }
50 };
51 
54 
55 #endif
edm::DataFrameContainer::size_type size_type
edm::SortedCollection< HcalTriggerPrimitiveDigi > HcalTrigPrimDigiCollection
void addDataFrame(DetId detid, const uint16_t *data)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
size_type stride() const
edm::SortedCollection< HOTriggerPrimitiveDigi > HOTrigPrimDigiCollection
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:117
edm::SortedCollection< ZDCDataFrame > ZDCDigiCollection
HcalDataFrameContainer< QIE10DataFrame > QIE10DigiCollection
edm::SortedCollection< HODataFrame > HODigiCollection
static const size_type MAXSAMPLES
HcalDataFrameContainer< QIE11DataFrame > QIE11DigiCollection
Definition: DetId.h:17
void swap(DataFrameContainer &other)
edm::SortedCollection< HcalCalibDataFrame > HcalCalibDigiCollection
edm::SortedCollection< HcalHistogramDigi > HcalHistogramDigiCollection
void push_back(id_type iid, data_type const *idata)
HcalDataFrameContainer(int nsamples_per_digi=MAXSAMPLES, int isubdet=0)
edm::SortedCollection< HcalTTPDigi > HcalTTPDigiCollection
edm::SortedCollection< HFDataFrame > HFDigiCollection
void push_back(const Digi &digi)
edm::SortedCollection< CastorDataFrame > CastorDigiCollection
DataContainer const & data() const
edm::SortedCollection< CastorTriggerPrimitiveDigi > CastorTrigPrimDigiCollection
edm::SortedCollection< HBHEDataFrame > HBHEDigiCollection