AliRoot Core  edcc906 (edcc906)
AliCaloRawAnalyzerFitter.cxx
Go to the documentation of this file.
1 // -*- mode: c++ -*-
2 
3 /**************************************************************************
4  * This file is property of and copyright by the Experimental Nuclear *
5  * Physics Group, Dep. of Physics *
6  * University of Oslo, Norway, 2007 *
7  * *
8  * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
9  * Contributors are mentioned in the code where appropriate. *
10  * Please report bugs to perthi@fys.uio.no *
11  * *
12  * Permission to use, copy, modify and distribute this software and its *
13  * documentation strictly for non-commercial purposes is hereby granted *
14  * without fee, provided that the above copyright notice appears in all *
15  * copies and that both the copyright notice and this permission notice *
16  * appear in the supporting documentation. The authors make no claims *
17  * about the suitability of this software for any purpose. It is *
18  * provided "as is" without express or implied warranty. *
19  **************************************************************************/
20 
22 
23 #include "TF1.h"
24 
25 #include <iostream>
26 
27 using std::cout;
28 using std::endl;
29 
32 //_______________________________________________________________________
33 AliCaloRawAnalyzerFitter::AliCaloRawAnalyzerFitter(const char *name, const char *nameshort ) :AliCaloRawAnalyzer( name, nameshort),
34 fkEulerSquared(7.389056098930650227),
35 fTf1(0)
36 {
37  for(int i=0; i < ALTROMAXSAMPLES; i++)
38  {
39  fXaxis[i] = i;
40  }
41 
42  fTf1 = new TF1( "myformula", "[0]*((x - [1])/[2])^2*exp(-2*(x -[1])/[2])", 0, 30 );
43 
44  if (fFixTau) // Declared in AliCaloRawAnalyzer
45  {
46  fTf1->FixParameter(2, fTau);
47  }
48  else
49  {
50  fTf1->ReleaseParameter(2); // allow par. to vary
51  fTf1->SetParameter(2, fTau);
52  }
53 }
54 
57 //_______________________________________________________________________
59 {
60  delete fTf1;
61 }
62 
65 //_______________________________________________________________________
66 void
68 {
69  cout << endl;
70  cout << __FILE__ << __LINE__ << "Using this samplerange we get" << endl;
71  cout << __FILE__ << __LINE__ << "AMPLITUDE = " << f->GetParameter(0)/fkEulerSquared << ",.. !!!!" << endl;
72  cout << __FILE__ << __LINE__ << "TOF = " << f->GetParameter(1) << ",.. !!!!" << endl;
73  cout << __FILE__ << __LINE__ << "NDF = " << f->GetNDF() << ",.. !!!!" << endl;
74  cout << endl << endl;
75 }
76 
77 
Base class for extraction of signal amplitude and peak position.
void PrintFitResult(const TF1 *f) const
Print fit results.
const double fkEulerSquared
e^2 = 7.389056098930650227
virtual ~AliCaloRawAnalyzerFitter()
Destructor.
Float_t fTau
Rise time of the signal (peak position = t0 +tau), by defauly it is 235 ns.
double fXaxis[ALTROMAXSAMPLES]
Axis if time bins, ( used by TGraph )
const int ALTROMAXSAMPLES
The maximum number of samples of the ALTRO.
TF1 * f
Definition: interpolTest.C:21
TF1 * fTf1
Analytical formula of the Semi Gaussian to be fitted.
Bool_t fFixTau
Fixed fit parameter or not, used in AliCaloRawAnalyzerFitter.