CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HFShape.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 
26 {
27 
28  // cout << endl << " ===== computeShapeHF !!! " << endl << endl;
29 
30  const float k0=0.7956; // shape parameters
31  const float p2=1.355;
32  const float p4=2.327;
33  const float p1=4.3; // position parameter
34 
35  int j;
36  float norm,r0,sigma0;
37 
38  // HF SHAPE
39  norm = 0.0;
40  for( j = 0; j < 25 && j < nbin_; j++){
41 
42  r0 = j-p1;
43  if (r0<0) sigma0 = p2;
44  else sigma0 = p2*p4;
45  r0 = r0/sigma0;
46  if(r0 < k0) nt_[j] = exp(-0.5*r0*r0);
47  else nt_[j] = exp(0.5*k0*k0-k0*r0);
48  norm += nt_[j];
49  }
50  // normalize pulse area to 1.0
51  for( j = 0; j < 25 && j < nbin_; j++){
52  nt_[j] /= norm;
53  }
54 }
55 
56 double HFShape::operator () (double time) const
57 {
58 
59  // return pulse amplitude for request time in ns
60  int jtime;
61  jtime = static_cast<int>(time+0.5);
62 
63  if(jtime >= 0 && jtime < nbin_)
64  return nt_[jtime];
65  else
66  return 0.0;
67 }
68 
HFShape()
Definition: HFShape.cc:4
virtual double operator()(double time) const
Definition: HFShape.cc:56
void computeShapeHF()
Definition: HFShape.cc:25
Electronic response of the preamp.
Definition: CaloVShape.h:11
Exp< T >::type exp(const T &t)
Definition: Exp.h:22
double p4[4]
Definition: TauolaWrapper.h:92
tuple norm
Definition: lumiNorm.py:78
virtual double timeToRise() const
Definition: HFShape.cc:20
int nbin_
Definition: HFShape.h:32
shaper for HF
Definition: HFShape.h:16
int j
Definition: DBlmapReader.cc:9
double p2[4]
Definition: TauolaWrapper.h:90
double p1[4]
Definition: TauolaWrapper.h:89
std::vector< float > nt_
Definition: HFShape.h:33