SimCalorimetry
HcalSimAlgos
src
ZDCShape.cc
Go to the documentation of this file.
1
#include "
SimCalorimetry/HcalSimAlgos/interface/ZDCShape.h
"
2
#include <cmath>
3
4
ZDCShape::ZDCShape
() : nbin_(256), nt_(nbin_, 0.) {
computeShapeZDC
(); }
5
6
ZDCShape::ZDCShape
(
const
ZDCShape
&
d
) :
CaloVShape
(
d
), nbin_(
d
.nbin_), nt_(
d
.nt_) {}
7
8
double
ZDCShape::timeToRise
()
const
{
return
0.; }
9
10
void
ZDCShape::computeShapeZDC
() {
11
// cout << endl << " ===== computeShapeZDC !!! " << endl << endl;
12
13
const
float
ts = 3.0;
// time constant in t * exp(-(t/ts)**2)
14
15
int
j
;
16
float
norm;
17
18
// ZDC SHAPE
19
norm = 0.0;
20
for
(
j
= 0;
j
< 3 * ts &&
j
<
nbin_
;
j
++) {
21
//nt_[j] = ((float)j)*exp(-((float)(j*j))/(ts*ts));
22
nt_
[
j
] =
j
*
exp
(-(
j
*
j
) / (ts * ts));
23
norm +=
nt_
[
j
];
24
}
25
// normalize pulse area to 1.0
26
for
(
j
= 0;
j
< 3 * ts &&
j
<
nbin_
;
j
++) {
27
nt_
[
j
] /= norm;
28
}
29
}
30
31
double
ZDCShape::operator()
(
double
time
)
const
{
32
// return pulse amplitude for request time in ns
33
int
jtime;
34
jtime = static_cast<int>(
time
+ 0.5);
35
36
if
(jtime >= 0 && jtime <
nbin_
)
37
return
nt_
[jtime];
38
else
39
return
0.0;
40
}
protons_cff.time
time
Definition:
protons_cff.py:39
ZDCShape::operator()
double operator()(double time) const override
Definition:
ZDCShape.cc:31
ZDCShape::nbin_
int nbin_
Definition:
ZDCShape.h:28
ZDCShape::computeShapeZDC
void computeShapeZDC()
Definition:
ZDCShape.cc:10
ZDCShape::ZDCShape
ZDCShape()
Definition:
ZDCShape.cc:4
ZDCShape::nt_
std::vector< float > nt_
Definition:
ZDCShape.h:29
ZDCShape::timeToRise
double timeToRise() const override
Definition:
ZDCShape.cc:8
ZDCShape
shaper for ZDC
Definition:
ZDCShape.h:15
CaloVShape
Electronic response of the preamp.
Definition:
CaloVShape.h:11
ZDCShape.h
ztail.d
d
Definition:
ztail.py:151
dqmiolumiharvest.j
j
Definition:
dqmiolumiharvest.py:66
JetChargeProducer_cfi.exp
exp
Definition:
JetChargeProducer_cfi.py:6
Generated for CMSSW Reference Manual by
1.8.16