CMS 3D CMS Logo

CastorShape.cc
Go to the documentation of this file.
3 #include <cmath>
4 
5 CastorShape::CastorShape() : nbin_(256), nt_(nbin_, 0.) { computeShapeCastor(); }
6 
7 CastorShape::CastorShape(const CastorShape &d) : CaloVShape(d), nbin_(d.nbin_), nt_(d.nt_) {}
8 
10  edm::LogVerbatim("CastorSim") << "\n ===== computeShapeCastor !!! \n";
11 
12  const float ts = 3.0; // time constant in t * exp(-(t/ts)**2)
13 
14  int j;
15  float norm;
16 
17  // HF SHAPE
18  norm = 0.0;
19  for (j = 0; j < 3 * ts && j < nbin_; j++) {
20  // nt_[j] = ((float)j)*exp(-((float)(j*j))/(ts*ts));
21  nt_[j] = j * exp(-(j * j) / (ts * ts));
22  norm += nt_[j];
23  }
24  // normalize pulse area to 1.0
25  for (j = 0; j < 3 * ts && j < nbin_; j++) {
26  nt_[j] /= norm;
27  }
28 }
29 
30 double CastorShape::operator()(double time) const {
31  // return pulse amplitude for request time in ns
32  int jtime;
33  jtime = static_cast<int>(time + 0.5);
34 
35  if (jtime >= 0 && jtime < nbin_)
36  return nt_[jtime];
37  else
38  return 0.0;
39 }
40 
41 double CastorShape::timeToRise() const { return 0.0; }
Log< level::Info, true > LogVerbatim
void computeShapeCastor()
Definition: CastorShape.cc:9
Electronic response of the preamp.
Definition: CaloVShape.h:11
std::vector< float > nt_
Definition: CastorShape.h:29
double operator()(double time) const override
Definition: CastorShape.cc:30
d
Definition: ztail.py:151
shaper for Castor
Definition: CastorShape.h:15
double timeToRise() const override
Definition: CastorShape.cc:41