]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/SPECTRA/AliITSsadEdxFitter.h
Updated class for fit to ITSsa dE/dx distributions (E.Biolcati)
[u/mrichter/AliRoot.git] / PWG2 / SPECTRA / AliITSsadEdxFitter.h
CommitLineData
fdfb7ea9 1#ifndef ALIITSSADEDXFITTER_H\r
2#define ALIITSSADEDXFITTER_H\r
3/* Copyright(c) 2007-2011, ALICE Experiment at CERN, All rights reserved. *\r
4 * See cxx source for full Copyright notice */\r
5\r
6/* $Id$ */\r
7\r
8///////////////////////////////////////////////////////////////////////\r
9// Class with the fits algorithms to be used in the identified //\r
10// spectra analysis using the ITS in stand-alone mode //\r
11// Author: E.Biolcati, biolcati@to.infn.it //\r
12// F.Prino, prino@to.infn.it //\r
13///////////////////////////////////////////////////////////////////////\r
14\r
15#include <TObject.h>\r
16class TGraph;\r
17\r
18class AliITSsadEdxFitter : public TObject {\r
19\r
20 public:\r
21 AliITSsadEdxFitter(); \r
22 virtual ~AliITSsadEdxFitter(){};\r
23\r
24 static Double_t CalcSigma(Int_t code,Float_t x, Bool_t mc);\r
25 static Int_t CalcMean(Int_t code,Float_t x, Float_t mean0, Float_t &mean1, Float_t &mean2);\r
26\r
27 void GetFitPar(Double_t *fitpar, Double_t *fitparerr) const;\r
28 void DoFitTail(TH1F *h, Int_t bin, Int_t code);\r
29 void DoFit(TH1F *h, Int_t bin, Int_t code, Bool_t mc, TGraph *gres);\r
30 void DoFitProton(TH1F *h, Int_t bin, Int_t code, Bool_t mc, TGraph *gres);\r
31 void DoFitOnePeak(TH1F *h, Int_t bin, Int_t signedcode, Bool_t mc);\r
32 void DoFitProtonFirst(TH1F *h, Int_t bin, Int_t signedcode, Bool_t mc, TGraph *gres);\r
33 void GetInitialParam(TH1F* h,Bool_t mc,Int_t code,Int_t bin, Float_t &pt, Float_t &ampl, Float_t &mean1, Float_t &mean2, Float_t &mean3, Float_t &sigma1, Float_t &sigma2, Float_t &sigma3);\r
34 void FillHisto(TH1F *hsps, Int_t bin, Float_t binsize, Int_t code);\r
35 void FillHistoMC(TH1F *hsps, Int_t bin, Int_t code, TH1F *h);\r
36 Bool_t IsGoodBin(Int_t bin,Int_t code);\r
37\r
38 void SetRangeStep1(Double_t dxlow=-0.2, Double_t dxup=0.3){\r
39 fRangeStep1[0]=dxlow;\r
40 fRangeStep1[1]=dxup;\r
41 }\r
42 void SetRangeStep2(Double_t dxlow=-0.1, Double_t dxup=0.4){\r
43 fRangeStep2[0]=dxlow;\r
44 fRangeStep2[1]=dxup;\r
45 }\r
46 void SetRangeStep3(Double_t dxlow=-0.1, Double_t dxup=2.5){\r
47 fRangeStep3[0]=dxlow;\r
48 fRangeStep3[1]=dxup;\r
49 }\r
50 void SetRangeFinalStep(Double_t dxlow=-3.5, Double_t dxup=3.5){\r
51 fRangeStep4[0]=dxlow;\r
52 fRangeStep4[1]=dxup;\r
53 }\r
54 void SetLimitsOnSigmaPion(Double_t smin=0.95, Double_t smax=1.05){\r
55 fLimitsOnSigmaPion[0]=smin;\r
56 fLimitsOnSigmaPion[1]=smax;\r
57 }\r
58 void SetLimitsOnSigmaKaon(Double_t smin=0.95, Double_t smax=1.05){\r
59 fLimitsOnSigmaKaon[0]=smin;\r
60 fLimitsOnSigmaKaon[1]=smax;\r
61 }\r
62 void SetLimitsOnSigmaProton(Double_t smin=0.95, Double_t smax=1.05){\r
63 fLimitsOnSigmaProton[0]=smin;\r
64 fLimitsOnSigmaProton[1]=smax;\r
65 }\r
66 void SetBinsUsedPion(Int_t bmin=2, Int_t bmax=14){\r
67 fBinsUsedPion[0]=bmin;\r
68 fBinsUsedPion[1]=bmax;\r
69 }\r
70 void SetBinsUsedKaon(Int_t bmin=7, Int_t bmax=12){\r
71 fBinsUsedKaon[0]=bmin;\r
72 fBinsUsedKaon[1]=bmax;\r
73 }\r
74 void SetBinsUsedProton(Int_t bmin=8, Int_t bmax=17){\r
75 fBinsUsedProton[0]=bmin;\r
76 fBinsUsedProton[1]=bmax;\r
77 }\r
78\r
79 void PrintAll() const;\r
80 void CalcResidual(TH1F *h,TF1 *fun,TGraph *gres) const;\r
81 Double_t GausPlusTail(const Double_t x, const Double_t mean, Double_t rms, Double_t c, Double_t slope, Double_t cut ) const; \r
82 Double_t GausOnBackground(const Double_t* x, const Double_t *par) const;\r
83 void DrawFitFunction(TF1 *fun) const;\r
84\r
85 private:\r
86 Double_t fFitpar[3]; // array with fit parameters\r
87 Double_t fFitparErr[3]; // array with fit parameter errors \r
88 Double_t fRangeStep1[2]; // Range for Step1 (w.r.t pion peak)\r
89 Double_t fRangeStep2[2]; // Range for Step2 (w.r.t kaon/proton peak)\r
90 Double_t fRangeStep3[2]; // Range for Step3 (w.r.t proton/kaon peak)\r
91 Double_t fRangeStep4[2]; // Range for Last Fit\r
92 Double_t fLimitsOnSigmaPion[2]; // limits on sigma pions\r
93 Double_t fLimitsOnSigmaKaon[2]; // limits on sigma kaons\r
94 Double_t fLimitsOnSigmaProton[2]; // limits on sigma protons\r
95 Int_t fBinsUsedPion[2]; // limits on bins used pions\r
96 Int_t fBinsUsedKaon[2]; // limits on bins used kaons\r
97 Int_t fBinsUsedProton[2]; // limits on bins used protons\r
98\r
99 ClassDef(AliITSsadEdxFitter,2);\r
100};\r
101\r
102#endif\r
103\r