]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG2/SPECTRA/AliITSsadEdxFitter.h
Updated class for fit to ITSsa dE/dx distributions (E.Biolcati)
[u/mrichter/AliRoot.git] / PWG2 / SPECTRA / AliITSsadEdxFitter.h
index 0b07dc0531e12a46af6b45be4660bf5caf133399..a353d65024e63a37bf2a175fb098f9518e1afa26 100644 (file)
-#ifndef ALIITSSADEDXFITTER_H
-#define ALIITSSADEDXFITTER_H
-/* Copyright(c) 2007-2011, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-/* $Id$ */
-
-////////////////////////////////////////////////////
-//class to perform different gaussian fits to the //
-//dEdx distribution, using different approach,    //
-//for the ITS stand-alone track spectra analysis  //
-//E. Biolcati, F. Prino                           //
-////////////////////////////////////////////////////
-
-#include <TObject.h>
-class TGraph;
-
-class AliITSsadEdxFitter  : public TObject {
-
- public:
-  AliITSsadEdxFitter();  
-  virtual ~AliITSsadEdxFitter(){};
-
-  static Double_t CalcSigma(Int_t code,Float_t x, Bool_t mc);
-  static Int_t CalcMean(Int_t code,Float_t x, Float_t mean0, Float_t &mean1, Float_t &mean2);
-
-  void GetFitPar(Double_t *fitpar, Double_t *fitparerr) const;
-  void DoFitTail(TH1F *h, Int_t bin, Int_t code);
-  void DoFit(TH1F *h, Int_t bin, Int_t code, Bool_t mc, TGraph *gres);
-  void DoFitProton(TH1F *h, Int_t bin, Int_t code, Bool_t mc, TGraph *gres);
-  void FillHisto(TH1F *hsps, Int_t bin, Float_t binsize, Int_t code);
-  void FillHistoMC(TH1F *hsps, Int_t bin, Int_t code, TH1F *h);
-  Bool_t IsGoodBin(Int_t bin,Int_t code);
-
-  void SetRangeStep1(Double_t dxlow=-0.2, Double_t dxup=0.3){
-    fRangeStep1[0]=dxlow;
-    fRangeStep1[1]=dxup;
-  }
-  void SetRangeStep2(Double_t dxlow=-0.1, Double_t dxup=0.3){
-    fRangeStep2[0]=dxlow;
-    fRangeStep2[1]=dxup;
-  }
-  void SetRangeStep3(Double_t dxlow=-0.1, Double_t dxup=2.5){
-    fRangeStep3[0]=dxlow;
-    fRangeStep3[1]=dxup;
-  }
-  void SetRangeFinalStep(Double_t dxlow=-3.5, Double_t dxup=3.5){
-    fRangeStep4[0]=dxlow;
-    fRangeStep4[1]=dxup;
-  }
-  void SetLimitsOnSigmaPion(Double_t smin=0.98, Double_t smax=1.02){
-    fLimitsOnSigmaPion[0]=smin;
-    fLimitsOnSigmaPion[1]=smax;
-  }
-  void SetLimitsOnSigmaKaon(Double_t smin=0.98, Double_t smax=1.02){
-    fLimitsOnSigmaKaon[0]=smin;
-    fLimitsOnSigmaKaon[1]=smax;
-  }
-  void SetLimitsOnSigmaProton(Double_t smin=0.98, Double_t smax=1.02){
-    fLimitsOnSigmaProton[0]=smin;
-    fLimitsOnSigmaProton[1]=smax;
-  }
-
-  void PrintAll() const;
-  void CalcResidual(TH1F *h,TF1 *fun,TGraph *gres) const;
-  Double_t GausPlusTail(const Double_t x, const Double_t mean, Double_t rms, Double_t c, Double_t slope, Double_t cut ) const;  
-  Double_t GausOnBackground(const Double_t* x, const Double_t *par) const;
-  void DrawFitFunction(TF1 *fun) const;
-
- private:
-  Double_t fFitpar[5];     // array with fit parameters
-  Double_t fFitparErr[5];  // array with fit parameter errors 
-  Double_t fRangeStep1[2]; // Range for Step1 (w.r.t pion peak)
-  Double_t fRangeStep2[2]; // Range for Step2 (w.r.t kaon/proton peak)
-  Double_t fRangeStep3[2]; // Range for Step3 (w.r.t proton/kaon peak)
-  Double_t fRangeStep4[2]; // Range for Last Fit
-  Double_t fLimitsOnSigmaPion[2]; // limits on sigma pions
-  Double_t fLimitsOnSigmaKaon[2]; // limits on sigma pions
-  Double_t fLimitsOnSigmaProton[2]; // limits on sigma protons
-
-  ClassDef(AliITSsadEdxFitter,1);
-};
-
-#endif
-
+#ifndef ALIITSSADEDXFITTER_H\r
+#define ALIITSSADEDXFITTER_H\r
+/* Copyright(c) 2007-2011, ALICE Experiment at CERN, All rights reserved. *\r
+ * See cxx source for full Copyright notice                               */\r
+\r
+/* $Id$ */\r
+\r
+///////////////////////////////////////////////////////////////////////\r
+// Class with the fits algorithms to be used in the identified       //\r
+// spectra analysis using the ITS in stand-alone mode                //\r
+// Author: E.Biolcati, biolcati@to.infn.it                           //\r
+//         F.Prino, prino@to.infn.it                                 //\r
+///////////////////////////////////////////////////////////////////////\r
+\r
+#include <TObject.h>\r
+class TGraph;\r
+\r
+class AliITSsadEdxFitter  : public TObject {\r
+\r
+ public:\r
+  AliITSsadEdxFitter();  \r
+  virtual ~AliITSsadEdxFitter(){};\r
+\r
+  static Double_t CalcSigma(Int_t code,Float_t x, Bool_t mc);\r
+  static Int_t CalcMean(Int_t code,Float_t x, Float_t mean0, Float_t &mean1, Float_t &mean2);\r
+\r
+  void GetFitPar(Double_t *fitpar, Double_t *fitparerr) const;\r
+  void DoFitTail(TH1F *h, Int_t bin, Int_t code);\r
+  void DoFit(TH1F *h, Int_t bin, Int_t code, Bool_t mc, TGraph *gres);\r
+  void DoFitProton(TH1F *h, Int_t bin, Int_t code, Bool_t mc, TGraph *gres);\r
+       void DoFitOnePeak(TH1F *h, Int_t bin, Int_t signedcode, Bool_t mc);\r
+       void DoFitProtonFirst(TH1F *h, Int_t bin, Int_t signedcode, Bool_t mc, TGraph *gres);\r
+       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
+  void FillHisto(TH1F *hsps, Int_t bin, Float_t binsize, Int_t code);\r
+  void FillHistoMC(TH1F *hsps, Int_t bin, Int_t code, TH1F *h);\r
+  Bool_t IsGoodBin(Int_t bin,Int_t code);\r
+\r
+  void SetRangeStep1(Double_t dxlow=-0.2, Double_t dxup=0.3){\r
+    fRangeStep1[0]=dxlow;\r
+    fRangeStep1[1]=dxup;\r
+  }\r
+  void SetRangeStep2(Double_t dxlow=-0.1, Double_t dxup=0.4){\r
+    fRangeStep2[0]=dxlow;\r
+    fRangeStep2[1]=dxup;\r
+  }\r
+  void SetRangeStep3(Double_t dxlow=-0.1, Double_t dxup=2.5){\r
+    fRangeStep3[0]=dxlow;\r
+    fRangeStep3[1]=dxup;\r
+  }\r
+  void SetRangeFinalStep(Double_t dxlow=-3.5, Double_t dxup=3.5){\r
+    fRangeStep4[0]=dxlow;\r
+    fRangeStep4[1]=dxup;\r
+  }\r
+  void SetLimitsOnSigmaPion(Double_t smin=0.95, Double_t smax=1.05){\r
+    fLimitsOnSigmaPion[0]=smin;\r
+    fLimitsOnSigmaPion[1]=smax;\r
+  }\r
+  void SetLimitsOnSigmaKaon(Double_t smin=0.95, Double_t smax=1.05){\r
+    fLimitsOnSigmaKaon[0]=smin;\r
+    fLimitsOnSigmaKaon[1]=smax;\r
+  }\r
+  void SetLimitsOnSigmaProton(Double_t smin=0.95, Double_t smax=1.05){\r
+    fLimitsOnSigmaProton[0]=smin;\r
+    fLimitsOnSigmaProton[1]=smax;\r
+  }\r
+       void SetBinsUsedPion(Int_t bmin=2, Int_t bmax=14){\r
+               fBinsUsedPion[0]=bmin;\r
+               fBinsUsedPion[1]=bmax;\r
+       }\r
+       void SetBinsUsedKaon(Int_t bmin=7, Int_t bmax=12){\r
+               fBinsUsedKaon[0]=bmin;\r
+               fBinsUsedKaon[1]=bmax;\r
+       }\r
+       void SetBinsUsedProton(Int_t bmin=8, Int_t bmax=17){\r
+               fBinsUsedProton[0]=bmin;\r
+               fBinsUsedProton[1]=bmax;\r
+       }\r
+\r
+  void PrintAll() const;\r
+  void CalcResidual(TH1F *h,TF1 *fun,TGraph *gres) const;\r
+  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
+  Double_t GausOnBackground(const Double_t* x, const Double_t *par) const;\r
+  void DrawFitFunction(TF1 *fun) const;\r
+\r
+ private:\r
+  Double_t fFitpar[3];     // array with fit parameters\r
+  Double_t fFitparErr[3];  // array with fit parameter errors \r
+  Double_t fRangeStep1[2]; // Range for Step1 (w.r.t pion peak)\r
+  Double_t fRangeStep2[2]; // Range for Step2 (w.r.t kaon/proton peak)\r
+  Double_t fRangeStep3[2]; // Range for Step3 (w.r.t proton/kaon peak)\r
+  Double_t fRangeStep4[2]; // Range for Last Fit\r
+  Double_t fLimitsOnSigmaPion[2]; // limits on sigma pions\r
+  Double_t fLimitsOnSigmaKaon[2]; // limits on sigma kaons\r
+  Double_t fLimitsOnSigmaProton[2]; // limits on sigma protons\r
+  Int_t fBinsUsedPion[2];   // limits on bins used pions\r
+  Int_t fBinsUsedKaon[2];   // limits on bins used kaons\r
+  Int_t fBinsUsedProton[2]; // limits on bins used protons\r
+\r
+  ClassDef(AliITSsadEdxFitter,2);\r
+};\r
+\r
+#endif\r
+\r