Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
CalibCalorimetry
HcalAlgos
src
HcalPulseShape.cc
Go to the documentation of this file.
1
#include "
CalibCalorimetry/HcalAlgos/interface/HcalPulseShape.h
"
2
3
HcalPulseShape::HcalPulseShape
() {
4
nbin_
=0;
5
tpeak_
=0;
6
}
7
8
void
HcalPulseShape::setNBin
(
int
n
) {
9
nbin_
=
n
;
10
shape_
=std::vector<float>(
n
,0.0f);
11
}
12
13
void
HcalPulseShape::setShapeBin
(
int
i
,
float
f
) {
14
if
(i>=0 && i<
nbin_
)
shape_
[
i
]=
f
;
15
}
16
17
float
HcalPulseShape::operator()
(
double
t
)
const
{
18
// shape is in 1 ns steps
19
return
at
(t);
20
}
21
22
float
HcalPulseShape::at
(
double
t
)
const
{
23
// shape is in 1 ns steps
24
int
i
=(int)(t+0.5);
25
float
rv=0;
26
if
(i>=0 && i<
nbin_
) rv=
shape_
[
i
];
27
return
rv;
28
}
29
30
float
HcalPulseShape::integrate
(
double
t1,
double
t2)
const
{
31
static
const
float
int_delta_ns = 0.05f;
32
double
intval = 0.0;
33
34
for
(
double
t
= t1;
t
< t2;
t
+= int_delta_ns) {
35
float
loedge =
at
(
t
);
36
float
hiedge =
at
(
t
+int_delta_ns);
37
intval += (loedge+hiedge)*int_delta_ns/2.0;
38
}
39
return
(
float
)intval;
40
}
41
i
int i
Definition:
DBlmapReader.cc:9
HcalPulseShape::setNBin
void setNBin(int n)
Definition:
HcalPulseShape.cc:8
HcalPulseShape::setShapeBin
void setShapeBin(int i, float f)
Definition:
HcalPulseShape.cc:13
HcalPulseShape::at
float at(double time) const
Definition:
HcalPulseShape.cc:22
HcalPulseShape::integrate
float integrate(double tmin, double tmax) const
Definition:
HcalPulseShape.cc:30
HcalPulseShape::tpeak_
float tpeak_
Definition:
HcalPulseShape.h:19
HcalPulseShape::nbin_
int nbin_
Definition:
HcalPulseShape.h:18
HcalPulseShape::HcalPulseShape
HcalPulseShape()
Definition:
HcalPulseShape.cc:3
edmStreamStallGrapher.t
tuple t
Definition:
edmStreamStallGrapher.py:108
HcalPulseShape::shape_
std::vector< float > shape_
Definition:
HcalPulseShape.h:17
HcalPulseShape.h
f
double f[11][100]
Definition:
MuScleFitUtils.cc:78
n
int n
Definition:
DTDataIntegrityTask.cc:30
HcalPulseShape::operator()
float operator()(double time) const
Definition:
HcalPulseShape.cc:17
Generated for CMSSW Reference Manual by
1.8.5