CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 }
uint16_t *__restrict__ id
const ESDetId & id() const
Definition: ESDataFrame.h:19
ESSample data_[MAXSAMPLES]
Definition: ESDataFrame.h:36
int size() const
Definition: ESDataFrame.h:21
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
void setSize(int size)
Definition: ESDataFrame.cc:17
static const int MAXSAMPLES
Definition: ESDataFrame.h:30
constexpr size_type size() const
Definition: DataFrame.h:43
const ESSample & sample(int i) const
Definition: ESDataFrame.h:24
tuple size
Write out results.