Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
shTest.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file shTest.C
1 void shTest(){
2  Double_t par[] = {0.3164, 3., 1.5}; // guesses
3  Double_t points(24);
4  TF1 * sT = new TF1("sT","0.3164*pow(x,4)*exp(-x*1.5)",0., points);
5  sT->Draw();
6  Double_t shapeInt = sT->Integral(0., points);
7  Double_t shapeMax = sT->GetMaximum(0.,points);
8  Double_t shapePeak= sT->GetMaximumX(0.,points);
9  Double_t shapeRMS = sqrt(sT->Moment(2,0.,points)-sT->Moment(1,0.,points)*sT->Moment(1,0.,points));
10  cout<<"SHAPE Peak = "<<shapePeak<<" Max = "<<shapeMax<<" RMS = "<<shapeRMS<<" Integral = "<<shapeInt<<endl;
11  // return par[0]*pow(x1,4.)*(exp(-x1*16./fN)); // fN is set to (float)NSAMPLES
12 }
13 
14 
15 Double_t signalShape(Double_t *x, Double_t * par){
16  return par[0]*pow((x-par[1]),par[2])*exp(-(x-par[1])*par[3]);
17 }
18