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_);
19  std::swap(data_, rh.data_);
20  }
21 
22  const DetId& id() const { return id_; }
23  int size() const { return size_; }
24 
25  const float& operator[](unsigned int i) const { return data_[i]; }
26  const float& sample(unsigned int i) const { return data_[i]; }
27 
28  void setSize(unsigned int size);
29  void setWaveform(float* waveform);
30  void setSample(unsigned int i, const float sam) { data_[i] = sam; }
32 
34  int sampleOfInterest() const { return sampleOfInterest_; }
35  std::vector<float> waveform() const { return waveform_; }
36 
37  static const unsigned int WAVEFORMSAMPLES = 250;
38 
39 private:
41  unsigned int size_;
43  std::vector<float> waveform_;
44  std::vector<float> data_;
45 };
46 
47 inline void swap(EcalTimeDigi& lh, EcalTimeDigi& rh) { lh.swap(rh); }
48 
49 std::ostream& operator<<(std::ostream& s, const EcalTimeDigi& digi);
50 
51 #endif
unsigned int size_
Definition: EcalTimeDigi.h:41
const DetId & id() const
Definition: EcalTimeDigi.h:22
const float & operator[](unsigned int i) const
Definition: EcalTimeDigi.h:25
void setSample(unsigned int i, const float sam)
Definition: EcalTimeDigi.h:30
int size() const
Definition: EcalTimeDigi.h:23
int sampleOfInterest_
Definition: EcalTimeDigi.h:42
bool int lh
Definition: SIMDVec.h:27
void swap(EcalTimeDigi &lh, EcalTimeDigi &rh)
Definition: EcalTimeDigi.h:47
void setWaveform(float *waveform)
Definition: EcalTimeDigi.cc:18
const float & sample(unsigned int i) const
Definition: EcalTimeDigi.h:26
std::vector< float > waveform() const
Definition: EcalTimeDigi.h:35
void setSampleOfInterest(int i)
Definition: EcalTimeDigi.h:31
static const unsigned int WAVEFORMSAMPLES
Definition: EcalTimeDigi.h:37
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:12
DetId key_type
For the sorted collection.
Definition: EcalTimeDigi.h:10
Definition: DetId.h:17
std::vector< float > data_
Definition: EcalTimeDigi.h:44
int sampleOfInterest() const
Gets the BX==0 sample. If =-1 then it means that only OOT hits are present.
Definition: EcalTimeDigi.h:34
std::vector< float > waveform_
Definition: EcalTimeDigi.h:43