CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes
HcalSiPMShape Class Reference

#include <HcalSiPMShape.h>

Inheritance diagram for HcalSiPMShape:
CaloVShape

Public Member Functions

 HcalSiPMShape ()
 
 HcalSiPMShape (const HcalSiPMShape &other)
 
virtual double operator() (double time) const
 
virtual double timeToRise () const
 
virtual ~HcalSiPMShape ()
 
- Public Member Functions inherited from CaloVShape
 CaloVShape ()
 
virtual ~CaloVShape ()
 

Static Public Member Functions

static double gexp (double t, double A, double c, double t0, double s)
 
static double gexpIndefIntegral (double t, double A, double c, double t0, double s)
 
static double gexpIntegral0Inf (double A, double c, double t0, double s)
 

Protected Member Functions

virtual double analyticPulseShape (double t) const
 
void computeShape ()
 

Private Attributes

int nBins_
 
std::vector< double > nt_
 

Detailed Description

Definition at line 8 of file HcalSiPMShape.h.

Constructor & Destructor Documentation

HcalSiPMShape::HcalSiPMShape ( )

Definition at line 7 of file HcalSiPMShape.cc.

References computeShape().

7  : CaloVShape(), nBins_(35*2+1),
8  nt_(nBins_, 0.) {
9  computeShape();
10 }
std::vector< double > nt_
Definition: HcalSiPMShape.h:32
void computeShape()
HcalSiPMShape::HcalSiPMShape ( const HcalSiPMShape other)

Definition at line 12 of file HcalSiPMShape.cc.

12  :
13  CaloVShape(other), nBins_(other.nBins_), nt_(other.nt_) {
14 }
std::vector< double > nt_
Definition: HcalSiPMShape.h:32
virtual HcalSiPMShape::~HcalSiPMShape ( )
inlinevirtual

Definition at line 14 of file HcalSiPMShape.h.

14 {}

Member Function Documentation

double HcalSiPMShape::analyticPulseShape ( double  t) const
protectedvirtual

Definition at line 57 of file HcalSiPMShape.cc.

References alignmentValidation::c1, gexp(), and indexGen::s2.

Referenced by computeShape().

57  {
58  double A1(0.08757), c1(-0.5257), t01(2.4013), s1(0.6721);
59  double A2(0.007598), c2(-0.1501), t02(6.9412), s2(0.8710);
60  return gexp(t,A1,c1,t01,s1) + gexp(t,A2,c2,t02,s2);
61 }
static double gexp(double t, double A, double c, double t0, double s)
tuple s2
Definition: indexGen.py:106
void HcalSiPMShape::computeShape ( )
protected

Definition at line 23 of file HcalSiPMShape.cc.

References analyticPulseShape(), j, nBins_, and nt_.

Referenced by HcalSiPMShape().

23  {
24 
25  double norm = 0.;
26  for (int j = 0; j < nBins_; ++j) {
27  nt_[j] = analyticPulseShape(j/2.);
28  norm += (nt_[j]>0) ? nt_[j] : 0.;
29  }
30 
31  // std::cout << "SiPM pulse shape: ";
32  for (int j = 0; j < nBins_; ++j) {
33  nt_[j] /= norm;
34  // std::cout << nt_[j] << ' ';
35  }
36  // std::cout << std::endl;
37 }
virtual double analyticPulseShape(double t) const
std::vector< double > nt_
Definition: HcalSiPMShape.h:32
int j
Definition: DBlmapReader.cc:9
double HcalSiPMShape::gexp ( double  t,
double  A,
double  c,
double  t0,
double  s 
)
static

Definition at line 39 of file HcalSiPMShape.cc.

References create_public_lumi_plots::exp, and mathSSE::sqrt().

Referenced by analyticPulseShape().

39  {
40  static double const root2(sqrt(2));
41  return -A*0.5*exp(c*t+0.5*c*c*s*s-c*s)*(erf(-0.5*root2/s*(t-t0+c*s*s))-1);
42 }
T sqrt(T t)
Definition: SSEVec.h:48
double HcalSiPMShape::gexpIndefIntegral ( double  t,
double  A,
double  c,
double  t0,
double  s 
)
static

Definition at line 44 of file HcalSiPMShape.cc.

References EnergyCorrector::c, create_public_lumi_plots::exp, and mathSSE::sqrt().

45  {
46  static double const root2(sqrt(2));
47 
48  return (exp(-c*t0)*(exp(c*t0)*erf((root2*t0-root2*t)/(2*s))-exp(c*t+(c*c*s*2)/2)*erf((t0-t-c*s*s)/(root2*s))+exp(c*t+(c*c*s*s)/2))*A)/(2*c);
49 }
T sqrt(T t)
Definition: SSEVec.h:48
double HcalSiPMShape::gexpIntegral0Inf ( double  A,
double  c,
double  t0,
double  s 
)
static

Definition at line 51 of file HcalSiPMShape.cc.

References EnergyCorrector::c, create_public_lumi_plots::exp, and mathSSE::sqrt().

52  {
53  static double const root2(sqrt(2));
54  return (exp(-c*t0)*(exp((c*c*s*s)/2)*erf((root2*t0-root2*c*s*s)/(2*s))-exp(c*t0)*erf(t0/(root2*s))-exp(c*t0)-exp((c*c*s*s)/2))*A)/(2*c);
55 }
T sqrt(T t)
Definition: SSEVec.h:48
double HcalSiPMShape::operator() ( double  time) const
virtual

Implements CaloVShape.

Definition at line 16 of file HcalSiPMShape.cc.

References nBins_, and nt_.

16  {
17  int jtime = static_cast<int>(time*2 + 0.5);
18  if (jtime>=0 && jtime<nBins_)
19  return nt_[jtime];
20  return 0.;
21 }
std::vector< double > nt_
Definition: HcalSiPMShape.h:32
virtual double HcalSiPMShape::timeToRise ( ) const
inlinevirtual

Implements CaloVShape.

Definition at line 18 of file HcalSiPMShape.h.

18 {return 3.5;}

Member Data Documentation

int HcalSiPMShape::nBins_
private

Definition at line 31 of file HcalSiPMShape.h.

Referenced by computeShape(), and operator()().

std::vector<double> HcalSiPMShape::nt_
private

Definition at line 32 of file HcalSiPMShape.h.

Referenced by computeShape(), and operator()().