CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/DQM/SiStripCommissioningAnalysis/src/SiStripPulseShape.cc

Go to the documentation of this file.
00001 #include "DQM/SiStripCommissioningAnalysis/interface/SiStripPulseShape.h"
00002 #include <TF1.h>
00003 #include <TMath.h>
00004 
00005 double fpeak(double *x, double *par)
00006     {
00007       if(x[0]+par[1]<0) return par[0];
00008       return par[0]+par[2]*(x[0]+par[1])*TMath::Exp(-(x[0]+par[1])/par[3]);
00009     }
00010 
00011 double fdeconv(double *x, double *par)
00012     {
00013       double xm = par[4]*(x[0]-25);
00014       double xp = par[4]*(x[0]+25);
00015       double xz = par[4]*x[0];
00016       return 1.2131*fpeak(&xp,par)-1.4715*fpeak(&xz,par)+0.4463*fpeak(&xm,par);
00017     }
00018 
00019 double fpeak_convoluted(double *x, double *par)
00020     {
00021      TF1 f("peak_convoluted",fpeak,0,200,4);
00022      return f.Integral(x[0]-par[4]/2.,x[0]+par[4]/2.,par,1.)/(par[4]);
00023     } 
00024 
00025 double fdeconv_convoluted(double *x, double *par)
00026     {
00027       double xm = (x[0]-25);
00028       double xp = (x[0]+25);
00029       double xz = x[0];
00030       return 1.2131*fpeak_convoluted(&xp,par)-1.4715*fpeak_convoluted(&xz,par)+0.4463*fpeak_convoluted(&xm,par);
00031     }
00032