]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGPP/TPC/AliPerfAnalyzeInvPt.h
Merge remote-tracking branch 'origin/master' into mergingFlat
[u/mrichter/AliRoot.git] / PWGPP / 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:
ab886e13 7// Projection of charge/pt vs theta and vs phi resp. histoprams will be fitted with either
8// polynomial or gaussian fit function to extract minimum position of charge/pt.
ba06aaec 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;
ab886e13 20class TH1F;
acb9d358 21class TH2F;
ab886e13 22class TH1D;
acb9d358 23class TGraphErrors;
ba06aaec 24//class TMath;
ba06aaec 25class TCanvas;
26class TObjArray;
27
acb9d358 28
29class AliPerfAnalyzeInvPt : public TNamed {
30
ba06aaec 31public:
4823e4d4 32 AliPerfAnalyzeInvPt(const Char_t* name="AliPerfAnalyzeInvPt", const Char_t* title="AliPerfAnalyzeInvPt");
acb9d358 33 virtual ~AliPerfAnalyzeInvPt(){;}
ba06aaec 34 void InitGraphs(Double_t *binsXTheta,Double_t *fitParamTheta,Double_t *errFitParamTheta,Double_t *binsXPhi,Double_t *fitParamPhi,Double_t *errFitParamPhi);
acb9d358 35 void InitFitFcn();
ba06aaec 36 void StartAnalysis(const TH2F *histThetaInvPt, const TH2F *histPhiInvPt, TObjArray* aFolderObj);
37 void SetProjBinsPhi(const Double_t *pBins,const Int_t sizep);
38 void SetProjBinsTheta(const Double_t *tBins, const Int_t sizet);
39 void SetMakeFitOption(const Bool_t setGausFit, const Double_t exclusionR,const Double_t fitR );
6bcacaf1 40 void SetDoRebin(const Int_t rebin){if(rebin) {fDoRebin = kTRUE; fRebin = rebin;}}
acb9d358 41
ba06aaec 42protected:
43 Double_t fThetaBins[100];// array of theta bins for projection and fit
44 Double_t fPhiBins[100];// array of phi bins for projection and fit
acb9d358 45
ba06aaec 46 Int_t fNThetaBins;// number of theta bins for projection and fit
47 Int_t fNPhiBins; // number of phi bins for projection and fit
48 Double_t fRange;// fit range of 1/pt spectrum
49 Double_t fExclRange ;// range of exlusion of points around 0 when fitting 1/pt
50 Bool_t fFitGaus;// set this flag for usage of gaussian fit function instead of polynomial (default)
6bcacaf1 51 Bool_t fDoRebin;
52 Int_t fRebin;
ba06aaec 53 // projection histos
ab886e13 54 TH1D *fHistFitTheta[100];// projection histos for analysis in theta bins
55 TH1D *fHistFitPhi[100];// projection histos for analysis in phi bins
acb9d358 56
ba06aaec 57 //histos for copy of input histos
58 TH2F *fHistH2InvPtTheta; // for copy of input histos
59 TH2F *fHistH2InvPtPhi; // for copy of input histos
60
61 //graphs for displaying the fit parameters (minimum position of 1/pt and error)
62 TGraphErrors *fGrMinPosTheta;
63 TGraphErrors *fGrMinPosPhi;
acb9d358 64
65
66
ba06aaec 67private:
68 //fit functions
69 TF1 *fFitMinPos;//fit function for first fit with polynomial
70 TF1 *fFitMinPosRejP;//fit function for second fit with polynomial to improve result
71 TF1 *fFitInvGauss;//fit functionfor first fit with gaussian
72 TF1 *fFitInvGaussRejP;//fit function for second fit with gaussian to improve result
acb9d358 73
ba06aaec 74 // infput for fit functions
75 static Double_t Polynomial(Double_t *x, const Double_t *par);
76 static Double_t PolynomialRejP(Double_t *x, const Double_t *par);
77 static Double_t InvGauss(Double_t *x, const Double_t *par);
78 static Double_t InvGaussRejP(Double_t *x, const Double_t *par);
79
80 //functions for fitting procedure
ab886e13 81 void MakeFit(TH1D *dmproy, TF1 * fitpb, Double_t &mean, Double_t &ErrMean, Double_t &excl,Double_t &range);
82 void MakeFitBetter(TH1D *dmproy, TF1 * fitpb2, Double_t &mean, Double_t &ErrMean, Double_t &f, Double_t &excl, Double_t &range);
83 void MakeFitInvGauss(TH1D *dmproy, TF1 * fitpb2, Double_t &mean, Double_t &ErrMean,Double_t &excl , Double_t &range);
84 void MakeFitInvGaussBetter(TH1D *dmproy, TF1 * fitpb2, Double_t &mean, Double_t &ErrMean, Double_t &f,Double_t &excl, Double_t &range);
acb9d358 85
86
87
88
ba06aaec 89 AliPerfAnalyzeInvPt(const AliPerfAnalyzeInvPt&); // not implemented
90 AliPerfAnalyzeInvPt& operator=(const AliPerfAnalyzeInvPt&); // not implemented
acb9d358 91
ba06aaec 92 ClassDef(AliPerfAnalyzeInvPt, 1);
acb9d358 93};
94
95#endif