CMS 3D CMS Logo

ESDataFrame.cc
Go to the documentation of this file.
2 
3 ESDataFrame::ESDataFrame() : id_(0), size_(0) {}
4 
5 ESDataFrame::ESDataFrame(const ESDetId& id) : id_(id), size_(0) {}
6 
8  setSize(df.size());
9  for (int i(0); i != size_; ++i) {
10  static const int offset(65536); // for uint16 to int16
11  static const uint16_t limit(32767);
12  const int dint(limit < df[i] ? (int)df[i] - offset : df[i]);
13  data_[i] = ESSample((int16_t)dint);
14  }
15 }
16 
18  if (size > MAXSAMPLES)
19  size_ = MAXSAMPLES;
20  else if (size <= 0)
21  size_ = 0;
22  else
23  size_ = size;
24 }
25 
26 std::ostream& operator<<(std::ostream& s, const ESDataFrame& digi) {
27  s << digi.id() << " " << digi.size() << " samples " << std::endl;
28  for (int i = 0; i < digi.size(); i++)
29  s << " " << digi.sample(i) << std::endl;
30  return s;
31 }
size
Write out results.
const ESDetId & id() const
Definition: ESDataFrame.h:19
int size() const
Definition: ESDataFrame.h:21
ESSample data_[MAXSAMPLES]
Definition: ESDataFrame.h:36
const ESSample & sample(int i) const
Definition: ESDataFrame.h:24
void setSize(int size)
Definition: ESDataFrame.cc:17
static const int MAXSAMPLES
Definition: ESDataFrame.h:30
std::ostream & operator<<(std::ostream &s, const ESDataFrame &digi)
Definition: ESDataFrame.cc:26