DataFormats
EcalDigi
src
EBDataFrame.cc
Go to the documentation of this file.
1
#include "
DataFormats/EcalDigi/interface/EBDataFrame.h
"
2
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
3
#include <iostream>
4
5
float
EBDataFrame::spikeEstimator
()
const
{
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
}
EcalDataFrame::sample
EcalMGPASample sample(int i) const
Definition:
EcalDataFrame.h:29
ecalMGPA::adc
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
Definition:
EcalMGPASample.h:11
mps_fire.i
i
Definition:
mps_fire.py:355
MessageLogger.h
EBDataFrame
Definition:
EBDataFrame.h:11
EBDataFrame::id
key_type id() const
Definition:
EBDataFrame.h:28
EcalMGPASample::adc
int adc() const
get the ADC sample (12 bits)
Definition:
EcalMGPASample.h:31
alignCSCRings.s
s
Definition:
alignCSCRings.py:92
EBDataFrame::spikeEstimator
float spikeEstimator() const
Definition:
EBDataFrame.cc:5
edm::LogError
Definition:
MessageLogger.h:183
operator<<
std::ostream & operator<<(std::ostream &s, const EBDataFrame &digi)
Definition:
EBDataFrame.cc:29
EBDataFrame.h
EcalDataFrame::size
int size() const
Definition:
EcalDataFrame.h:26
Generated for CMSSW Reference Manual by
1.8.16