CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ESDataFrame.cc
Go to the documentation of this file.
2 
4  size_(0)
5 {
6 }
7 
9  id_(id),
10  size_(0)
11 {
12 }
13 
15  id_ ( df.id() )
16 {
17  setSize( df.size() ) ;
18  for( int i ( 0 ) ; i != size_ ; ++i )
19  {
20  static const int offset ( 65536 ) ; // for uint16 to int16
21  static const uint16_t limit ( 32767 ) ;
22  const int dint ( limit < df[i] ? (int)df[i] - offset : df[i] ) ;
23  data_[i] = ESSample( (int16_t)dint ) ;
24  }
25 }
26 
28  if (size > MAXSAMPLES) size_ = MAXSAMPLES;
29  else if (size <= 0) size_=0;
30  else size_ = size;
31 }
32 
33 std::ostream& operator<<(std::ostream& s, const ESDataFrame& digi) {
34  s << digi.id() << " " << digi.size()
35  << " samples " << std::endl;
36  for (int i=0; i<digi.size(); i++)
37  s << " " << digi.sample(i) << std::endl;
38  return s;
39 }
int i
Definition: DBlmapReader.cc:9
const ESDetId & id() const
Definition: ESDataFrame.h:21
ESSample data_[MAXSAMPLES]
Definition: ESDataFrame.h:39
int size() const
Definition: ESDataFrame.h:23
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
void setSize(int size)
Definition: ESDataFrame.cc:27
static const int MAXSAMPLES
Definition: ESDataFrame.h:32
const ESSample & sample(int i) const
Definition: ESDataFrame.h:26
unsigned int offset(bool)
size_type size() const
Definition: DataFrame.h:63
size_(0)
Definition: OwnArray.h:181
tuple size
Write out results.