CMS 3D CMS Logo

EcalTriggerPrimitiveDigi.h
Go to the documentation of this file.
1 #ifndef ECALTRIGGERPRIMITIVEDIGI_H
2 #define ECALTRIGGERPRIMITIVEDIGI_H 1
3 
4 #include <ostream>
5 #include <vector>
6 
9 
17 public:
19 
20  EcalTriggerPrimitiveDigi(); // for persistence
21  explicit EcalTriggerPrimitiveDigi(const EcalTrigTowerDetId& id);
22 
24  std::swap(id_, rh.id_);
25  std::swap(size_, rh.size_);
26  std::swap(data_, rh.data_);
27  }
28 
29  const EcalTrigTowerDetId& id() const { return id_; }
30  int size() const { return size_; }
31 
32  const EcalTriggerPrimitiveSample& operator[](int i) const { return data_[i]; }
33  const EcalTriggerPrimitiveSample& sample(int i) const { return data_[i]; }
34 
35  void setSize(int size);
36  void setSample(int i, const EcalTriggerPrimitiveSample& sam) { data_[i] = sam; }
37  void setSampleValue(int i, uint16_t value) { data_[i].setValue(value); }
38 
39  static const int MAXSAMPLES = 20;
40 
42  int compressedEt() const;
43 
45  bool fineGrain() const;
46 
48  int ttFlag() const;
49 
53  int sFGVB() const;
54 
59  int l1aSpike() const { return sFGVB(); }
60 
62  bool isDebug() const;
63 
65  int sampleOfInterest() const;
66 
67 private:
69  int size_;
70  std::vector<EcalTriggerPrimitiveSample> data_;
71 };
72 
74 
75 std::ostream& operator<<(std::ostream& s, const EcalTriggerPrimitiveDigi& digi);
76 
77 #endif
void swap(EcalTriggerPrimitiveDigi &lh, EcalTriggerPrimitiveDigi &rh)
bool fineGrain() const
get the fine-grain bit of interesting sample
const EcalTrigTowerDetId & id() const
bool isDebug() const
True if debug mode (# of samples > 1)
void swap(EcalTriggerPrimitiveDigi &rh)
bool int lh
Definition: SIMDVec.h:20
int sampleOfInterest() const
Gets the interesting sample.
void setSample(int i, const EcalTriggerPrimitiveSample &sam)
const EcalTriggerPrimitiveSample & operator[](int i) const
std::ostream & operator<<(std::ostream &s, const EcalTriggerPrimitiveDigi &digi)
EcalTrigTowerDetId key_type
For the sorted collection.
Definition: value.py:1
int compressedEt() const
get the encoded/compressed Et of interesting sample
void setSampleValue(int i, uint16_t value)
int ttFlag() const
get the Trigger tower Flag of interesting sample
std::vector< EcalTriggerPrimitiveSample > data_
const EcalTriggerPrimitiveSample & sample(int i) const