CMS 3D CMS Logo

EcalEBTriggerPrimitiveDigi.h
Go to the documentation of this file.
1 #ifndef ECALEBTRIGGERPRIMITIVEDIGI_H
2 #define ECALEBTRIGGERPRIMITIVEDIGI_H 1
3 
4 #include <ostream>
5 #include <vector>
8 
16 public:
17  typedef EBDetId key_type;
18 
19  EcalEBTriggerPrimitiveDigi(); // for persistence
21 
23  std::swap(id_, rh.id_);
24  std::swap(size_, rh.size_);
25  std::swap(data_, rh.data_);
26  }
27 
28  const EBDetId& id() const { return id_; }
29  int size() const { return size_; }
30 
31  const EcalEBTriggerPrimitiveSample& operator[](int i) const { return data_[i]; }
32  const EcalEBTriggerPrimitiveSample& sample(int i) const { return data_[i]; }
33 
34  void setSize(int size);
35  void setSample(int i, const EcalEBTriggerPrimitiveSample& sam);
36  void setSampleValue(int i, uint16_t value) { data_[i].setValue(value); }
37 
38  static const int MAXSAMPLES = 20;
39 
41  int encodedEt() const;
42 
44  bool l1aSpike() const;
45 
47  int time() const;
48 
50  bool isDebug() const;
51 
53  int sampleOfInterest() const;
54 
55 private:
57  int size_;
58  std::vector<EcalEBTriggerPrimitiveSample> data_;
59 };
60 
62 
63 std::ostream& operator<<(std::ostream& s, const EcalEBTriggerPrimitiveDigi& digi);
64 
65 #endif
void swap(EcalEBTriggerPrimitiveDigi &rh)
int sampleOfInterest() const
Gets the interesting sample.
std::vector< EcalEBTriggerPrimitiveSample > data_
const EcalEBTriggerPrimitiveSample & operator[](int i) const
bool int lh
Definition: SIMDVec.h:27
void setSample(int i, const EcalEBTriggerPrimitiveSample &sam)
void setSampleValue(int i, uint16_t value)
EBDetId key_type
For the sorted collection.
bool isDebug() const
True if debug mode (# of samples > 1)
std::ostream & operator<<(std::ostream &s, const EcalEBTriggerPrimitiveDigi &digi)
int encodedEt() const
get the 10 bits Et of interesting sample
Definition: value.py:1
void swap(EcalEBTriggerPrimitiveDigi &lh, EcalEBTriggerPrimitiveDigi &rh)
const EcalEBTriggerPrimitiveSample & sample(int i) const