CMS 3D CMS Logo

EcalTriggerPrimitiveDigi.cc
Go to the documentation of this file.
2 #include <iostream>
3 
4 EcalTriggerPrimitiveDigi::EcalTriggerPrimitiveDigi() : size_(0), data_(MAXSAMPLES) {
5 }
6 
9 }
10 
11 
12 
14 {
15  if (size_ == 1)
16  return 0;
17  else if (size_ == 5)
18  return 2;
19  else
20  return -1;
21 }
22 
25 {
26  int sample = sampleOfInterest();
27  if (sample != -1)
28  return data_[sample].compressedEt();
29  else
30  return -1;
31 }
32 
35 {
36  int sample = sampleOfInterest();
37  if (sample != -1)
38  return data_[sample].fineGrain();
39  else
40  return false;
41 }
44 {
45  int sample = sampleOfInterest();
46  if (sample != -1)
47  return data_[sample].ttFlag();
48  else
49  return -1;
50 }
51 
53 {
54  int sample = sampleOfInterest();
55  if (sample != -1)
56  return data_[sample].l1aSpike();
57  else
58  return -1;
59 }
60 
62 {
63  if (size_ == 1)
64  return false;
65  else if (size_ > 1)
66  return true;
67  return false;
68 }
69 
71  if (size<0) size_=0;
72  else if (size>MAXSAMPLES) size_=MAXSAMPLES;
73  else size_=size;
74 }
75 
76 
77 std::ostream& operator<<(std::ostream& s, const EcalTriggerPrimitiveDigi& digi) {
78  s << digi.id() << " " << digi.size() << " samples " << std::endl;
79  for (int i=0; i<digi.size(); i++)
80  s << " " << digi.sample(i) << std::endl;
81  return s;
82 }
83 
bool isDebug() const
True if debug mode (# of samples > 1)
int compressedEt() const
get the encoded/compressed Et of interesting sample
const EcalTriggerPrimitiveSample & sample(int i) const
std::ostream & operator<<(std::ostream &s, const EcalTriggerPrimitiveDigi &digi)
const EcalTrigTowerDetId & id() const
bool fineGrain() const
get the fine-grain bit of interesting sample
int sampleOfInterest() const
Gets the interesting sample.
int ttFlag() const
get the Trigger tower Flag of interesting sample
std::vector< EcalTriggerPrimitiveSample > data_