CMS 3D CMS Logo

EBDataFrame.cc
Go to the documentation of this file.
3 #include <iostream>
4 
6  if (size() != 10) {
7  edm::LogError("InvalidNumberOfSamples")
8  << "This method only applies to signals sampled 10 times (" << size() << " samples found)";
9  return 10.;
10  }
11  // skip faulty channels
12  if (sample(5).adc() == 0)
13  return 10.;
14  size_t imax = 0;
15  int maxAdc = 0;
16  for (int i = 0; i < size(); ++i) {
17  if (sample(i).adc() > maxAdc) {
18  imax = i;
19  maxAdc = sample(i).adc();
20  }
21  }
22  // skip early signals
23  if (imax < 4)
24  return 10.;
25  float ped = 1. / 3. * (sample(0).adc() + sample(1).adc() + sample(2).adc());
26  return 0.18 * (sample(4).adc() - ped) / (sample(5).adc() - ped) + (sample(6).adc() - ped) / (sample(5).adc() - ped);
27 }
28 
29 std::ostream& operator<<(std::ostream& s, const EBDataFrame& digi) {
30  s << digi.id() << " " << digi.size() << " samples " << std::endl;
31  for (int i = 0; i < digi.size(); i++)
32  s << " " << digi[i] << std::endl;
33  return s;
34 }
std::ostream & operator<<(std::ostream &s, const EBDataFrame &digi)
Definition: EBDataFrame.cc:29
key_type id() const
Definition: EBDataFrame.h:28
Log< level::Error, false > LogError
float spikeEstimator() const
Definition: EBDataFrame.cc:5
int size() const
Definition: EcalDataFrame.h:26
EcalMGPASample sample(int i) const
Definition: EcalDataFrame.h:29
int adc() const
get the ADC sample (12 bits)
uint16_t *__restrict__ uint16_t const *__restrict__ adc