CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalEBTriggerPrimitiveDigi.cc
Go to the documentation of this file.
2 #include <iostream>
3 
4 
6 }
7 //EcalTriggerPrimitiveDigi::EcalTriggerPrimitiveDigi(const EcalTrigTowerDetId& id) : id_(id),
8 //size_(0), data_(MAXSAMPLES) {
9 //}
10 
12  size_(0), data_(MAXSAMPLES) {
13 }
14 
16 {
17 // std::cout << " In setSample i " << i << " sam " << sam << std::endl;
18  data_[i]=sam;
19 // std::cout << " In setSample data_[i] " << data_[i] << std::endl;
20 
21 }
22 
24 {
25  if (size_ == 1)
26  return 0;
27  else if (size_ == 5)
28  return 2;
29  else
30  return -1;
31 }
32 
35 {
36  int sample = sampleOfInterest();
37  if (sample != -1)
38  return data_[sample].compressedEt();
39  else
40  return -1;
41 }
42 
45 {
46  int sample = sampleOfInterest();
47  if (sample != -1)
48  return data_[sample].fineGrain();
49  else
50  return false;
51 }
54 {
55  int sample = sampleOfInterest();
56  if (sample != -1)
57  return data_[sample].ttFlag();
58  else
59  return -1;
60 }
61 
63 {
64  int sample = sampleOfInterest();
65  if (sample != -1)
66  return data_[sample].l1aSpike();
67  else
68  return -1;
69 }
70 
72 {
73  if (size_ == 1)
74  return false;
75  else if (size_ > 1)
76  return true;
77  return false;
78 }
79 
81  if (size<0) size_=0;
82  else if (size>MAXSAMPLES) size_=MAXSAMPLES;
83  else size_=size;
84 }
85 
86 
87 std::ostream& operator<<(std::ostream& s, const EcalEBTriggerPrimitiveDigi& digi) {
88  s << digi.id() << " " << digi.size() << " samples " << std::endl;
89  for (int i=0; i<digi.size(); i++)
90  s << " " << digi.sample(i) << std::endl;
91  return s;
92 }
93 
int i
Definition: DBlmapReader.cc:9
bool fineGrain() const
get the fine-grain bit of interesting sample
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
int compressedEt() const
get the encoded/compressed Et of interesting sample
void setSample(int i, const EcalTriggerPrimitiveSample &sam)
int ttFlag() const
get the Trigger tower Flag of interesting sample
bool isDebug() const
True if debug mode (# of samples &gt; 1)
std::vector< EcalTriggerPrimitiveSample > data_
const EcalTriggerPrimitiveSample & sample(int i) const
size_(0)
Definition: OwnArray.h:181
tuple size
Write out results.
int sampleOfInterest() const
Gets the interesting sample.