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
EcalTimeDigi::swap
void swap(EcalTimeDigi &rh)
Definition: EcalTimeDigi.h:15
mps_fire.i
i
Definition: mps_fire.py:355
EcalTimeDigi::sampleOfInterest_
int sampleOfInterest_
Definition: EcalTimeDigi.h:37
EcalTimeDigi::size_
unsigned int size_
Definition: EcalTimeDigi.h:36
EcalTimeDigi::key_type
DetId key_type
For the sorted collection.
Definition: EcalTimeDigi.h:10
mathSSE::lh
bool int lh
Definition: SIMDVec.h:20
operator<<
std::ostream & operator<<(std::ostream &s, const EcalTimeDigi &digi)
EcalTimeDigi::data_
std::vector< float > data_
Definition: EcalTimeDigi.h:38
EcalTimeDigi::EcalTimeDigi
EcalTimeDigi()
Definition: EcalTimeDigi.cc:7
DetId
Definition: DetId.h:17
alignCSCRings.s
s
Definition: alignCSCRings.py:92
EcalTimeDigi::sampleOfInterest
int sampleOfInterest() const
Gets the BX==0 sample. If =-1 then it means that only OOT hits are present.
Definition: EcalTimeDigi.h:32
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
EcalTimeDigi
Definition: EcalTimeDigi.h:8
EcalTimeDigi::setSize
void setSize(unsigned int size)
Definition: EcalTimeDigi.cc:11
EcalTimeDigi::id
const DetId & id() const
Definition: EcalTimeDigi.h:21
EcalTimeDigi::id_
DetId id_
Definition: EcalTimeDigi.h:35
EcalTimeDigi::operator[]
const float & operator[](unsigned int i) const
Definition: EcalTimeDigi.h:24
EcalTimeDigi::setSample
void setSample(unsigned int i, const float sam)
Definition: EcalTimeDigi.h:28
DetId.h
EcalTimeDigi::size
int size() const
Definition: EcalTimeDigi.h:22
swap
void swap(EcalTimeDigi &lh, EcalTimeDigi &rh)
Definition: EcalTimeDigi.h:41
EcalTimeDigi::sample
const float & sample(unsigned int i) const
Definition: EcalTimeDigi.h:25
EcalTimeDigi::setSampleOfInterest
void setSampleOfInterest(int i)
Definition: EcalTimeDigi.h:29