CMS 3D CMS Logo

ZDCShape.cc
Go to the documentation of this file.
2 #include <cmath>
3 
5 : nbin_(256),
6  nt_(nbin_, 0.)
7 {
9 }
10 
11 
13 : CaloVShape(d),
14  nbin_(d.nbin_),
15  nt_(d.nt_)
16 {
17 }
18 
19 double
21 {
22  return 0. ;
23 }
24 
25 
27 {
28 
29  // cout << endl << " ===== computeShapeZDC !!! " << endl << endl;
30 
31  const float ts = 3.0; // time constant in t * exp(-(t/ts)**2)
32 
33 
34  int j;
35  float norm;
36 
37  // ZDC SHAPE
38  norm = 0.0;
39  for( j = 0; j < 3 * ts && j < nbin_; j++){
40  //nt_[j] = ((float)j)*exp(-((float)(j*j))/(ts*ts));
41  nt_[j] = j * exp(-(j*j)/(ts*ts));
42  norm += nt_[j];
43  }
44  // normalize pulse area to 1.0
45  for( j = 0; j < 3 * ts && j < nbin_; j++){
46  nt_[j] /= norm;
47  }
48 }
49 
50 double ZDCShape::operator () (double time) const
51 {
52 
53  // return pulse amplitude for request time in ns
54  int jtime;
55  jtime = static_cast<int>(time+0.5);
56 
57  if(jtime >= 0 && jtime < nbin_)
58  return nt_[jtime];
59  else
60  return 0.0;
61 }
62 
shaper for ZDC
Definition: ZDCShape.h:16
double operator()(double time) const override
Definition: ZDCShape.cc:50
Electronic response of the preamp.
Definition: CaloVShape.h:11
double timeToRise() const override
Definition: ZDCShape.cc:20
ZDCShape()
Definition: ZDCShape.cc:4
int nbin_
Definition: ZDCShape.h:32
void computeShapeZDC()
Definition: ZDCShape.cc:26
std::vector< float > nt_
Definition: ZDCShape.h:33