CMS 3D CMS Logo

EcalTimeDigi.h
Go to the documentation of this file.
1 #ifndef _DataFormats_EcalDigi_ECALTIMEDIGI_H_
2 #define _DataFormats_EcalDigi_ECALTIMEDIGI_H_
3 
4 #include <ostream>
5 #include <vector>
7 
8 class EcalTimeDigi {
9 public:
10  typedef DetId key_type;
11 
12  EcalTimeDigi(); // for persistence
13  explicit EcalTimeDigi(const DetId& id);
14 
15  void swap(EcalTimeDigi& rh) {
16  std::swap(id_, rh.id_);
17  std::swap(size_, rh.size_);
18  std::swap(data_, rh.data_);
19  }
20 
21  const DetId& id() const { return id_; }
22  int size() const { return size_; }
23 
24  const float& operator[](unsigned int i) const { return data_[i]; }
25  const float& sample(unsigned int i) const { return data_[i]; }
26 
27  void setSize(unsigned int size);
28  void setSample(unsigned int i, const float sam) { data_[i] = sam; }
30 
32  int sampleOfInterest() const { return sampleOfInterest_; }
33 
34 private:
36  unsigned int size_;
38  std::vector<float> data_;
39 };
40 
41 inline void swap(EcalTimeDigi& lh, EcalTimeDigi& rh) { lh.swap(rh); }
42 
43 std::ostream& operator<<(std::ostream& s, const EcalTimeDigi& digi);
44 
45 #endif
unsigned int size_
Definition: EcalTimeDigi.h:36
const DetId & id() const
Definition: EcalTimeDigi.h:21
const float & operator[](unsigned int i) const
Definition: EcalTimeDigi.h:24
void setSample(unsigned int i, const float sam)
Definition: EcalTimeDigi.h:28
int size() const
Definition: EcalTimeDigi.h:22
int sampleOfInterest_
Definition: EcalTimeDigi.h:37
bool int lh
Definition: SIMDVec.h:20
void swap(EcalTimeDigi &lh, EcalTimeDigi &rh)
Definition: EcalTimeDigi.h:41
const float & sample(unsigned int i) const
Definition: EcalTimeDigi.h:25
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
void setSampleOfInterest(int i)
Definition: EcalTimeDigi.h:29
void swap(EcalTimeDigi &rh)
Definition: EcalTimeDigi.h:15
std::ostream & operator<<(std::ostream &s, const EcalTimeDigi &digi)
void setSize(unsigned int size)
Definition: EcalTimeDigi.cc:11
DetId key_type
For the sorted collection.
Definition: EcalTimeDigi.h:10
Definition: DetId.h:17
std::vector< float > data_
Definition: EcalTimeDigi.h:38
int sampleOfInterest() const
Gets the BX==0 sample. If =-1 then it means that only OOT hits are present.
Definition: EcalTimeDigi.h:32