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 
42 inline void swap(EcalTimeDigi& lh, EcalTimeDigi& rh) {
43  lh.swap(rh);
44 }
45 
46 std::ostream& operator<<(std::ostream& s, const EcalTimeDigi& digi);
47 
48 
49 
50 #endif
unsigned int size_
Definition: EcalTimeDigi.h:36
int size() const
Definition: EcalTimeDigi.h:22
void setSample(unsigned int i, const float sam)
Definition: EcalTimeDigi.h:28
const DetId & id() const
Definition: EcalTimeDigi.h:21
int sampleOfInterest_
Definition: EcalTimeDigi.h:37
bool int lh
Definition: SIMDVec.h:21
const float & operator[](unsigned int i) const
Definition: EcalTimeDigi.h:24
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
void setSampleOfInterest(int i)
Definition: EcalTimeDigi.h:29
void swap(EcalTimeDigi &rh)
Definition: EcalTimeDigi.h:15
const float & sample(unsigned int i) const
Definition: EcalTimeDigi.h:25
std::ostream & operator<<(std::ostream &s, const EcalTimeDigi &digi)
void setSize(unsigned int size)
Definition: EcalTimeDigi.cc:14
DetId key_type
For the sorted collection.
Definition: EcalTimeDigi.h:10
Definition: DetId.h:18
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