CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalDigiCollections.h
Go to the documentation of this file.
1 #ifndef DIGIECAL_ECALDIGICOLLECTION_H
2 #define DIGIECAL_ECALDIGICOLLECTION_H
3 
15 
19 
21 public:
23  static const size_type MAXSAMPLES = 10;
24  explicit EcalDigiCollection(size_type istride=MAXSAMPLES, int isubdet=0) :
25  edm::DataFrameContainer(istride, isubdet){}
26  void swap(DataFrameContainer& other) {this->DataFrameContainer::swap(other);}
27 };
28 
29 // make edm (and ecal client) happy
31 public:
33  typedef EBDataFrame Digi;
35 
37  EcalDigiCollection(istride, EcalBarrel){}
38  void swap(EBDigiCollection& other) {this->EcalDigiCollection::swap(other);}
39 };
40 
42 public:
44  typedef EEDataFrame Digi;
46 
48  EcalDigiCollection(istride, EcalEndcap){}
49  void swap(EEDigiCollection& other) {this->EcalDigiCollection::swap(other);}
50 };
51 
53 {
54  public:
56  typedef ESDataFrame Digi;
58 
62  void swap(ESDigiCollection& other) {this->EcalDigiCollection::swap(other);}
63 
64  void push_back( unsigned int i )
65  {
66  DataFrameContainer::push_back( i ) ;
67  }
68 
69  void push_back( const Digi& digi )
70  {
71  uint16_t esdata[NSAMPLE] ;
72  for( unsigned int i ( 0 ) ; i != NSAMPLE; ++i )
73  {
74  static const int offset ( 65536 ) ; // for int16 to uint16
75  const int16_t dshort ( digi[i].raw() ) ;
76  const int dint ( (int) dshort + // add offset for uint16 conversion
77  ( (int16_t) 0 > dshort ?
78  offset : (int) 0 ) ) ;
79  esdata[i] = dint ;
80  }
81  EcalDigiCollection::push_back( digi.id()(), esdata ) ;
82  }
83 };
84 
85 
86 // Free swap functions
87 inline
89  lhs.swap(rhs);
90 }
91 
92 inline
94  lhs.swap(rhs);
95 }
96 
97 inline
99  lhs.swap(rhs);
100 }
101 
102 inline
104  lhs.swap(rhs);
105 }
106 
108 
114 
115 #endif
void swap(ora::Record &rh, ora::Record &lh)
Definition: Record.h:70
int i
Definition: DBlmapReader.cc:9
edm::DataFrameContainer::size_type size_type
void swap(EBDigiCollection &other)
edm::SortedCollection< EcalMatacqDigi > EcalMatacqDigiCollection
static const size_type NSAMPLE
const ESDetId & id() const
Definition: ESDataFrame.h:21
EcalDigiCollection(size_type istride=MAXSAMPLES, int isubdet=0)
edm::DataFrameContainer::size_type size_type
edm::SortedCollection< EBSrFlag > EBSrFlagCollection
ESDigiCollection(size_type istride=NSAMPLE)
edm::SortedCollection< EESrFlag > EESrFlagCollection
static const int MAXSAMPLES
Definition: ESDataFrame.h:32
edm::SortedCollection< EcalPnDiodeDigi > EcalPnDiodeDigiCollection
Digi::key_type DetId
edm::DataFrameContainer::size_type size_type
static const size_type MAXSAMPLES
edm::SortedCollection< EcalTriggerPrimitiveDigi > EcalTrigPrimDigiCollection
void swap(DataFrameContainer &other)
void push_back(unsigned int i)
void push_back(id_type iid, data_type const *idata)
edm::SortedCollection< EcalPseudoStripInputDigi > EcalPSInputDigiCollection
void push_back(const Digi &digi)
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)
Digi::key_type DetId