00001 #include "SimCalorimetry/EcalSimAlgos/interface/ESShape.h" 00002 #include <cmath> 00003 00004 ESShape::ESShape(int Gain): 00005 theGain_(Gain) 00006 { 00007 setTpeak(20.0); 00008 00009 if (theGain_==0) { 00010 A_ = 6.; 00011 Qcf_ = 4./350.; 00012 omegac_ = 2./25.; 00013 M_ = 2.; 00014 norm_ = 0.11136*M_; 00015 } 00016 else if (theGain_==1) { 00017 A_ = 17.73; 00018 Qcf_ = 6.044; 00019 omegac_ = 0.1; 00020 M_ = 3.324; 00021 norm_ = 1.374*2438.76; 00022 } 00023 else if (theGain_==2) { 00024 A_ = 18.12; 00025 Qcf_ = 7.58; 00026 omegac_ = 0.08757; 00027 M_ = 3.192; 00028 norm_ = 1.24*2184.13; 00029 } 00030 } 00031 00032 double ESShape::operator () (double time_) const 00033 { 00034 if (time_>0.00001) { 00035 double xf = A_*omegac_*time_; 00036 return (Qcf_/norm_)*pow(xf,M_-1.)*exp(-omegac_*time_); 00037 } 00038 else { 00039 return 0.0; 00040 } 00041 } 00042 00043 double ESShape::derivative (double time_) const 00044 { 00045 if (time_>0.00001) { 00046 double xf = A_*omegac_*time_; 00047 return (Qcf_/norm_)*pow(xf,M_-1.)*exp(-omegac_*time_); 00048 } 00049 else { 00050 return 0.0; 00051 } 00052 } 00053 00054