CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalSiPMShape.cc
Go to the documentation of this file.
2 
3 #include <cmath>
4 
5 HcalSiPMShape::HcalSiPMShape() : CaloVShape(), nBins_(512), nt_(nBins_, 0.) {
6  computeShape();
7 }
8 
10  CaloVShape(other), nBins_(other.nBins_), nt_(other.nt_) {
11 }
12 
13 double HcalSiPMShape::operator () (double time) const {
14  int jtime = static_cast<int>(time + 0.5);
15  if (jtime>=0 && jtime<nBins_)
16  return nt_[jtime];
17  return 0.;
18 }
19 
21 
22  double norm = 0.;
23  for (int j = 0; j < nBins_; ++j) {
24  if (j <= 31.)
25  nt_[j] = 2.15*j;
26  else if ((j > 31) && (j <= 96))
27  nt_[j] = 102.1 - 1.12*j;
28  else
29  nt_[j] = 0.0076*j - 6.4;
30  norm += (nt_[j]>0) ? nt_[j] : 0.;
31  }
32 
33  for (int j = 0; j < nBins_; ++j) {
34  nt_[j] /= norm;
35  }
36 }
virtual double operator()(double time) const
Electronic response of the preamp.
Definition: CaloVShape.h:11
std::vector< double > nt_
Definition: HcalSiPMShape.h:25
tuple norm
Definition: lumiNorm.py:78
int j
Definition: DBlmapReader.cc:9
void computeShape()