CondFormats
CastorObjects
src
CastorQIEShape.cc
Go to the documentation of this file.
1
6
#include "
CondFormats/CastorObjects/interface/CastorQIEShape.h
"
7
8
namespace
{
9
const
float
binMin[32] = {-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
10
16, 18, 20, 22, 24, 26, 28, 31, 34, 37, 40, 44, 48, 52, 57, 62};
11
}
12
13
CastorQIEShape::CastorQIEShape
() {
14
for
(
int
i
= 0;
i
< 32;
i
++)
15
mValues
[
i
] = binMin[
i
];
16
expand
();
17
}
18
19
CastorQIEShape::~CastorQIEShape
() {}
20
21
void
CastorQIEShape::expand
() {
22
int
scale
= 1;
23
for
(
unsigned
range
= 1;
range
< 4;
range
++) {
24
scale
=
scale
* 5;
25
unsigned
index
=
range
* 32;
26
mValues
[
index
] =
mValues
[
index
- 2];
// link to previous range
27
for
(
unsigned
i
= 1;
i
< 32;
i
++) {
28
mValues
[
index
+
i
] =
mValues
[
index
+
i
- 1] +
scale
* (
mValues
[
i
] -
mValues
[
i
- 1]);
29
}
30
}
31
mValues
[128] = 2 *
mValues
[127] -
mValues
[126];
// extrapolate
32
}
33
34
float
CastorQIEShape::lowEdge
(
unsigned
fAdc)
const
{
35
if
(fAdc < 128)
36
return
mValues
[fAdc];
37
return
0.;
38
}
39
40
float
CastorQIEShape::center
(
unsigned
fAdc)
const
{
41
if
(fAdc < 128) {
42
if
(fAdc % 32 == 31)
43
return
0.5 * (3 *
mValues
[fAdc] -
mValues
[fAdc - 1]);
// extrapolate
44
else
45
return
0.5 * (
mValues
[fAdc] +
mValues
[fAdc + 1]);
// interpolate
46
}
47
return
0.;
48
}
49
50
float
CastorQIEShape::highEdge
(
unsigned
fAdc)
const
{
51
if
(fAdc >= 128)
52
return
0;
53
if
(fAdc == 127)
54
return
mValues
[fAdc + 1];
55
if
(fAdc % 32 == 31)
56
return
mValues
[fAdc + 3];
57
return
mValues
[fAdc + 1];
58
}
59
60
bool
CastorQIEShape::setLowEdge
(
float
fValue,
unsigned
fAdc) {
61
if
(fAdc >= 32)
62
return
false
;
63
mValues
[fAdc] = fValue;
64
return
true
;
65
}
66
67
bool
CastorQIEShape::setLowEdges
(
const
float
fValue[32]) {
68
bool
result
=
true
;
69
for
(
int
adc
= 0;
adc
< 32;
adc
++)
70
result
=
result
&&
setLowEdge
(fValue[
adc
],
adc
);
71
expand
();
72
return
result
;
73
}
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
CastorQIEShape::setLowEdges
bool setLowEdges(const float fValue[32])
Definition:
CastorQIEShape.cc:67
CastorQIEShape::lowEdge
float lowEdge(unsigned fAdc) const
Definition:
CastorQIEShape.cc:34
CastorQIEShape::CastorQIEShape
CastorQIEShape()
Definition:
CastorQIEShape.cc:13
CastorQIEShape::highEdge
float highEdge(unsigned fAdc) const
Definition:
CastorQIEShape.cc:50
CastorQIEShape::expand
void expand()
Definition:
CastorQIEShape.cc:21
CastorQIEShape::center
float center(unsigned fAdc) const
Definition:
CastorQIEShape.cc:40
CastorQIEShape::mValues
float mValues[129]
Definition:
CastorQIEShape.h:29
CastorQIEShape::range
unsigned range(unsigned fAdc) const
Definition:
CastorQIEShape.h:22
CastorQIEShape::~CastorQIEShape
~CastorQIEShape()
Definition:
CastorQIEShape.cc:19
Scenarios_cff.scale
scale
Definition:
Scenarios_cff.py:2186
CastorQIEShape::setLowEdge
bool setLowEdge(float fValue, unsigned fAdc)
Definition:
CastorQIEShape.cc:60
AlignmentPI::index
index
Definition:
AlignmentPayloadInspectorHelper.h:46
CastorQIEShape.h
mps_fire.result
result
Definition:
mps_fire.py:303
Generated for CMSSW Reference Manual by
1.8.16