CMS 3D CMS Logo

CastorShape.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 
21 {
22 
23  // cout << endl << " ===== computeShapeCastor !!! " << endl << endl;
24 
25  const float ts = 3.0; // time constant in t * exp(-(t/ts)**2)
26 
27 
28  int j;
29  float norm;
30 
31  // HF SHAPE
32  norm = 0.0;
33  for( j = 0; j < 3 * ts && j < nbin_; j++){
34  //nt_[j] = ((float)j)*exp(-((float)(j*j))/(ts*ts));
35  nt_[j] = j * exp(-(j*j)/(ts*ts));
36  norm += nt_[j];
37  }
38  // normalize pulse area to 1.0
39  for( j = 0; j < 3 * ts && j < nbin_; j++){
40  nt_[j] /= norm;
41  }
42 }
43 
44 double CastorShape::operator () (double time) const
45 {
46 
47  // return pulse amplitude for request time in ns
48  int jtime;
49  jtime = static_cast<int>(time+0.5);
50 
51  if(jtime >= 0 && jtime < nbin_)
52  return nt_[jtime];
53  else
54  return 0.0;
55 }
56 
57 double
59 {
60  return 0.0 ;
61 }
virtual double timeToRise() const
Definition: CastorShape.cc:58
void computeShapeCastor()
Definition: CastorShape.cc:20
Electronic response of the preamp.
Definition: CaloVShape.h:11
std::vector< float > nt_
Definition: CastorShape.h:32
virtual double operator()(double time) const
Definition: CastorShape.cc:44
shaper for Castor
Definition: CastorShape.h:16