CMS 3D CMS Logo

EcalEBTriggerPrimitiveDigi.cc
Go to the documentation of this file.
2 #include <iostream>
3 
5 //EcalTriggerPrimitiveDigi::EcalTriggerPrimitiveDigi(const EcalTrigTowerDetId& id) : id_(id),
6 //size_(0), data_(MAXSAMPLES) {
7 //}
8 
9 EcalEBTriggerPrimitiveDigi::EcalEBTriggerPrimitiveDigi(const EBDetId& id) : id_(id), size_(0), data_(MAXSAMPLES) {}
10 
12  // std::cout << " In setSample i " << i << " sam " << sam << std::endl;
13  data_[i] = sam;
14  // std::cout << " In setSample data_[i] " << data_[i] << std::endl;
15 }
16 
18  if (size_ == 1)
19  return 0;
20  else if (size_ == 5)
21  return 2;
22  else
23  return -1;
24 }
25 
28  int sample = sampleOfInterest();
29  if (sample != -1)
30  return data_[sample].encodedEt();
31  else
32  return -1;
33 }
34 
36  int sample = sampleOfInterest();
37  if (sample != -1)
38  return data_[sample].l1aSpike();
39  else
40  return -1;
41 }
42 
44  int sample = sampleOfInterest();
45  if (sample != -1)
46  return data_[sample].time();
47  else
48  return -1;
49 }
50 
52  if (size_ == 1)
53  return false;
54  else if (size_ > 1)
55  return true;
56  return false;
57 }
58 
60  if (size < 0)
61  size_ = 0;
62  else if (size > MAXSAMPLES)
63  size_ = MAXSAMPLES;
64  else
65  size_ = size;
66 }
67 
68 std::ostream& operator<<(std::ostream& s, const EcalEBTriggerPrimitiveDigi& digi) {
69  s << digi.id() << " " << digi.size() << " samples " << std::endl;
70  for (int i = 0; i < digi.size(); i++)
71  s << " " << digi.sample(i) << std::endl;
72  return s;
73 }
mps_fire.i
i
Definition: mps_fire.py:355
EcalEBTriggerPrimitiveDigi::size_
int size_
Definition: EcalEBTriggerPrimitiveDigi.h:57
EcalEBTriggerPrimitiveDigi.h
operator<<
std::ostream & operator<<(std::ostream &s, const EcalEBTriggerPrimitiveDigi &digi)
Definition: EcalEBTriggerPrimitiveDigi.cc:68
EBDetId
Definition: EBDetId.h:17
EcalEBTriggerPrimitiveDigi::setSize
void setSize(int size)
Definition: EcalEBTriggerPrimitiveDigi.cc:59
EcalEBTriggerPrimitiveDigi::size
int size() const
Definition: EcalEBTriggerPrimitiveDigi.h:29
EcalEBTriggerPrimitiveSample
Definition: EcalEBTriggerPrimitiveSample.h:12
EcalEBTriggerPrimitiveDigi::sample
const EcalEBTriggerPrimitiveSample & sample(int i) const
Definition: EcalEBTriggerPrimitiveDigi.h:32
alignCSCRings.s
s
Definition: alignCSCRings.py:92
EcalEBTriggerPrimitiveDigi::EcalEBTriggerPrimitiveDigi
EcalEBTriggerPrimitiveDigi()
Definition: EcalEBTriggerPrimitiveDigi.cc:4
EcalEBTriggerPrimitiveDigi::setSample
void setSample(int i, const EcalEBTriggerPrimitiveSample &sam)
Definition: EcalEBTriggerPrimitiveDigi.cc:11
EcalEBTriggerPrimitiveDigi::time
int time() const
Time info.
Definition: EcalEBTriggerPrimitiveDigi.cc:43
EcalEBTriggerPrimitiveDigi::MAXSAMPLES
static const int MAXSAMPLES
Definition: EcalEBTriggerPrimitiveDigi.h:38
EcalEBTriggerPrimitiveDigi::data_
std::vector< EcalEBTriggerPrimitiveSample > data_
Definition: EcalEBTriggerPrimitiveDigi.h:58
EcalEBTriggerPrimitiveDigi::sampleOfInterest
int sampleOfInterest() const
Gets the interesting sample.
Definition: EcalEBTriggerPrimitiveDigi.cc:17
EcalEBTriggerPrimitiveDigi
Definition: EcalEBTriggerPrimitiveDigi.h:15
EcalEBTriggerPrimitiveDigi::l1aSpike
bool l1aSpike() const
Spike flag.
Definition: EcalEBTriggerPrimitiveDigi.cc:35
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
EcalEBTriggerPrimitiveDigi::id
const EBDetId & id() const
Definition: EcalEBTriggerPrimitiveDigi.h:28
EcalEBTriggerPrimitiveDigi::encodedEt
int encodedEt() const
get the 10 bits Et of interesting sample
Definition: EcalEBTriggerPrimitiveDigi.cc:27
EcalEBTriggerPrimitiveDigi::isDebug
bool isDebug() const
True if debug mode (# of samples > 1)
Definition: EcalEBTriggerPrimitiveDigi.cc:51
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443