CMS 3D CMS Logo

EcalDigiCollections.h
Go to the documentation of this file.
1 #ifndef DIGIECAL_ECALDIGICOLLECTION_H
2 #define DIGIECAL_ECALDIGICOLLECTION_H
3 
20 
25 
27 public:
30  explicit EcalDigiCollectionPh2(size_type istride = MAXSAMPLES, int isubdet = 0)
31  : edm::DataFrameContainer(istride, isubdet) {}
33 };
34 
36 public:
40 
43  void push_back(const Digi& digi) { DataFrameContainer::push_back(digi.id(), digi.frame().begin()); }
45  void push_back(id_type iid, data_type const* idata) { DataFrameContainer::push_back(iid, idata); }
46 };
47 
49 public:
52  explicit EcalDigiCollection(size_type istride = MAXSAMPLES, int isubdet = 0)
53  : edm::DataFrameContainer(istride, isubdet) {}
55  void swap(DataFrameContainer::IdContainer& otherIds, DataFrameContainer::DataContainer& otherData) {
56  this->DataFrameContainer::swap(otherIds, otherData);
57  }
58 };
59 
60 // make edm (and ecal client) happy
62 public:
64  typedef EBDataFrame Digi;
66 
70  this->EcalDigiCollection::swap(otherIds, otherData);
71  }
72  void push_back(const Digi& digi) { DataFrameContainer::push_back(digi.id(), digi.frame().begin()); }
74  void push_back(id_type iid, data_type const* idata) { DataFrameContainer::push_back(iid, idata); }
75 };
76 
78 public:
80  typedef EEDataFrame Digi;
82 
86  this->EcalDigiCollection::swap(otherIds, otherData);
87  }
88  void push_back(const Digi& digi) { edm::DataFrameContainer::push_back(digi.id(), digi.frame().begin()); }
90  void push_back(id_type iid, data_type const* idata) { DataFrameContainer::push_back(iid, idata); }
91 };
92 
94 public:
96  typedef ESDataFrame Digi;
98 
102 
103  void push_back(unsigned int i) { DataFrameContainer::push_back(i); }
104 
105  void push_back(const Digi& digi) {
106  uint16_t esdata[NSAMPLE];
107  for (unsigned int i(0); i != NSAMPLE; ++i) {
108  static const int offset(65536); // for int16 to uint16
109  const int16_t dshort(digi[i].raw());
110  const int dint((int)dshort + // add offset for uint16 conversion
111  ((int16_t)0 > dshort ? offset : (int)0));
112  esdata[i] = dint;
113  }
114  EcalDigiCollection::push_back(digi.id()(), esdata);
115  }
116 };
117 
118 // Free swap functions
119 inline void swap(EcalDigiCollection& lhs, EcalDigiCollection& rhs) { lhs.swap(rhs); }
120 
121 inline void swap(EBDigiCollection& lhs, EBDigiCollection& rhs) { lhs.swap(rhs); }
122 
123 inline void swap(EEDigiCollection& lhs, EEDigiCollection& rhs) { lhs.swap(rhs); }
124 
125 inline void swap(ESDigiCollection& lhs, ESDigiCollection& rhs) { lhs.swap(rhs); }
126 
127 inline void swap(EcalDigiCollectionPh2& lhs, EcalDigiCollectionPh2& rhs) { lhs.swap(rhs); }
128 
129 inline void swap(EBDigiCollectionPh2& lhs, EBDigiCollectionPh2& rhs) { lhs.swap(rhs); }
130 
135 
141 
142 #endif
void push_back(const Digi &digi)
const ESDetId & id() const
Definition: ESDataFrame.h:19
edm::DataFrameContainer::size_type size_type
void swap(EBDigiCollection &other)
edm::SortedCollection< EcalMatacqDigi > EcalMatacqDigiCollection
EcalDataFrame_Ph2 Digi
EBDigiCollectionPh2(size_type istride=MAXSAMPLES)
static const size_type NSAMPLE
void push_back(id_type iid)
edm::SortedCollection< EcalEBTriggerPrimitiveDigi > EcalEBTrigPrimDigiCollection
void push_back(id_type iid)
key_type id() const
Definition: EBDataFrame.h:28
key_type id() const
Definition: EEDataFrame.h:24
EcalDigiCollection(size_type istride=MAXSAMPLES, int isubdet=0)
void swap(DataFrameContainer::IdContainer &otherIds, DataFrameContainer::DataContainer &otherData)
EcalDigiCollectionPh2(size_type istride=MAXSAMPLES, int isubdet=0)
static const size_type MAXSAMPLES
edm::DataFrameContainer::size_type size_type
static constexpr unsigned int sampleSize
Definition: EcalConstants.h:36
edm::DataFrameContainer::size_type size_type
std::vector< data_type > DataContainer
edm::SortedCollection< EBSrFlag > EBSrFlagCollection
void swap(EEDigiCollection::IdContainer &otherIds, EEDigiCollection::DataContainer &otherData)
void push_back(id_type iid, data_type const *idata)
ESDigiCollection(size_type istride=NSAMPLE)
edm::SortedCollection< EESrFlag > EESrFlagCollection
void swap(EBDigiCollection::IdContainer &otherIds, EBDigiCollection::DataContainer &otherData)
static const int MAXSAMPLES
Definition: ESDataFrame.h:30
edm::SortedCollection< EcalPnDiodeDigi > EcalPnDiodeDigiCollection
edm::SortedCollection< EcalEBPhase2TriggerPrimitiveDigi > EcalEBPhase2TrigPrimDigiCollection
Digi::key_type DetId
edm::DataFrame const & frame() const
edm::SortedCollection< EcalTimeDigi > EcalTimeDigiCollection
void push_back(id_type iid)
edm::DataFrameContainer::size_type size_type
void push_back(id_type iid, data_type const *idata)
static const size_type MAXSAMPLES
edm::SortedCollection< EcalTriggerPrimitiveDigi > EcalTrigPrimDigiCollection
void swap(DataFrameContainer &other)
void swap(DataFrameContainer &other)
void push_back(const Digi &digi)
constexpr iterator begin()
Definition: DataFrame.h:33
void push_back(unsigned int i)
edm::DataFrame const & frame() const
Definition: EcalDataFrame.h:50
void push_back(id_type iid, data_type const *idata)
void push_back(id_type iid, data_type const *idata)
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
edm::SortedCollection< EcalPseudoStripInputDigi > EcalPSInputDigiCollection
static constexpr unsigned int sampleSize
Definition: EcalConstants.h:53
void swap(EBDigiCollectionPh2 &other)
void push_back(const Digi &digi)
HLT enums.
std::vector< id_type > IdContainer
void push_back(const Digi &digi)
edm::DataFrameContainer::size_type size_type
void swap(ESDigiCollection &other)
void swap(EEDigiCollection &other)
Digi::key_type DetId
EBDigiCollection(size_type istride=MAXSAMPLES)
edm::DataFrameContainer::size_type size_type
EEDigiCollection(size_type istride=MAXSAMPLES)
void swap(EcalDigiCollection &lhs, EcalDigiCollection &rhs)
Digi::key_type DetId