CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalTriggerPrimitiveDigi.cc
Go to the documentation of this file.
2 #include <iostream>
3 
5 }
6 
8 size_(0), data_(MAXSAMPLES) {
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 
int i
Definition: DBlmapReader.cc:9
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
bool isDebug() const
True if debug mode (# of samples &gt; 1)
int compressedEt() const
get the encoded/compressed Et of interesting sample
const EcalTriggerPrimitiveSample & sample(int i) const
const EcalTrigTowerDetId & id() const
bool fineGrain() const
get the fine-grain bit of interesting sample
size_(0)
Definition: OwnArray.h:181
int sampleOfInterest() const
Gets the interesting sample.
int ttFlag() const
get the Trigger tower Flag of interesting sample
std::vector< EcalTriggerPrimitiveSample > data_
tuple size
Write out results.