CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ZDCShape.cc
Go to the documentation of this file.
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 
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 }
shaper for ZDC
Definition: ZDCShape.h:15
Electronic response of the preamp.
Definition: CaloVShape.h:11
double timeToRise() const override
Definition: ZDCShape.cc:8
Exp< T >::type exp(const T &t)
Definition: Exp.h:22
double operator()(double time) const override
Definition: ZDCShape.cc:31
tuple d
Definition: ztail.py:151
ZDCShape()
Definition: ZDCShape.cc:4
int nbin_
Definition: ZDCShape.h:28
void computeShapeZDC()
Definition: ZDCShape.cc:10
std::vector< float > nt_
Definition: ZDCShape.h:29