]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG1/TPC/AliPerfAnalyzeInvPt.h
bug fix and small changed in the macros
[u/mrichter/AliRoot.git] / PWG1 / TPC / AliPerfAnalyzeInvPt.h
CommitLineData
6bcacaf1 1
ba06aaec 2#ifndef ALIPERFANALYZEINVPT_H
3#define ALIPERFANALYZEINVPT_H
acb9d358 4
ba06aaec 5//----------------------------------------------------------------------------------------------------
6// Class to analyse output of AliPerformancePtCalib.cxx and AliPerformancePtCalibMC.cxx:
7// Projection of 1/pt vs theta and vs phi resp. histoprams will be fitted with either
8// polynomial or gaussian fit function to extract minimum position of 1/pt.
9// Fit options and theta, phi bins can be set by user.
10// Attention: use the Set* functions of AliPerformancePtCalib.h and AliPerformancePtCalibMC.h
11// when running AliPerformancePtCalib*::Analyse().
12//
13// Author: S. Schuchmann 11/13/2009
14//----------------------------------------------------------------------------------------------------
acb9d358 15
16class TNamed;
17class TString;
18class TList;
ba06aaec 19class TF1;
acb9d358 20class TH1F;
21class TH2F;
ba06aaec 22class TH3F;
acb9d358 23class TGraphErrors;
ba06aaec 24//class TMath;
25class TH1D;
26class TH2D;
27class TCanvas;
28class TObjArray;
29
acb9d358 30
31class AliPerfAnalyzeInvPt : public TNamed {
32
ba06aaec 33public:
34 AliPerfAnalyzeInvPt();
35 AliPerfAnalyzeInvPt(Char_t* name, Char_t* title);
acb9d358 36 virtual ~AliPerfAnalyzeInvPt(){;}
ba06aaec 37 void InitGraphs(Double_t *binsXTheta,Double_t *fitParamTheta,Double_t *errFitParamTheta,Double_t *binsXPhi,Double_t *fitParamPhi,Double_t *errFitParamPhi);
acb9d358 38 void InitFitFcn();
ba06aaec 39 void StartAnalysis(const TH2F *histThetaInvPt, const TH2F *histPhiInvPt, TObjArray* aFolderObj);
40 void SetProjBinsPhi(const Double_t *pBins,const Int_t sizep);
41 void SetProjBinsTheta(const Double_t *tBins, const Int_t sizet);
42 void SetMakeFitOption(const Bool_t setGausFit, const Double_t exclusionR,const Double_t fitR );
6bcacaf1 43 void SetDoRebin(const Int_t rebin){if(rebin) {fDoRebin = kTRUE; fRebin = rebin;}}
acb9d358 44
ba06aaec 45protected:
46 Double_t fThetaBins[100];// array of theta bins for projection and fit
47 Double_t fPhiBins[100];// array of phi bins for projection and fit
acb9d358 48
ba06aaec 49 Int_t fNThetaBins;// number of theta bins for projection and fit
50 Int_t fNPhiBins; // number of phi bins for projection and fit
51 Double_t fRange;// fit range of 1/pt spectrum
52 Double_t fExclRange ;// range of exlusion of points around 0 when fitting 1/pt
53 Bool_t fFitGaus;// set this flag for usage of gaussian fit function instead of polynomial (default)
6bcacaf1 54 Bool_t fDoRebin;
55 Int_t fRebin;
ba06aaec 56 // projection histos
57 TH1F *fHistFitTheta[100];// projection histos for analysis in theta bins
58 TH1F *fHistFitPhi[100];// projection histos for analysis in phi bins
acb9d358 59
ba06aaec 60 //histos for copy of input histos
61 TH2F *fHistH2InvPtTheta; // for copy of input histos
62 TH2F *fHistH2InvPtPhi; // for copy of input histos
63
64 //graphs for displaying the fit parameters (minimum position of 1/pt and error)
65 TGraphErrors *fGrMinPosTheta;
66 TGraphErrors *fGrMinPosPhi;
acb9d358 67
68
69
ba06aaec 70private:
71 //fit functions
72 TF1 *fFitMinPos;//fit function for first fit with polynomial
73 TF1 *fFitMinPosRejP;//fit function for second fit with polynomial to improve result
74 TF1 *fFitInvGauss;//fit functionfor first fit with gaussian
75 TF1 *fFitInvGaussRejP;//fit function for second fit with gaussian to improve result
acb9d358 76
ba06aaec 77 // infput for fit functions
78 static Double_t Polynomial(Double_t *x, const Double_t *par);
79 static Double_t PolynomialRejP(Double_t *x, const Double_t *par);
80 static Double_t InvGauss(Double_t *x, const Double_t *par);
81 static Double_t InvGaussRejP(Double_t *x, const Double_t *par);
82
83 //functions for fitting procedure
84 void MakeFit(TH1F *dmproy, TF1 * fitpb, Double_t &mean, Double_t &ErrMean, Double_t &excl,Double_t &range);
85 void MakeFitBetter(TH1F *dmproy, TF1 * fitpb2, Double_t &mean, Double_t &ErrMean, Double_t &f, Double_t &excl, Double_t &range);
86 void MakeFitInvGauss(TH1F *dmproy, TF1 * fitpb2, Double_t &mean, Double_t &ErrMean,Double_t &excl , Double_t &range);
87 void MakeFitInvGaussBetter(TH1F *dmproy, TF1 * fitpb2, Double_t &mean, Double_t &ErrMean, Double_t &f,Double_t &excl, Double_t &range);
acb9d358 88
89
90
91
ba06aaec 92 AliPerfAnalyzeInvPt(const AliPerfAnalyzeInvPt&); // not implemented
93 AliPerfAnalyzeInvPt& operator=(const AliPerfAnalyzeInvPt&); // not implemented
acb9d358 94
ba06aaec 95 ClassDef(AliPerfAnalyzeInvPt, 1);
acb9d358 96};
97
98#endif