StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StNbdFitMaker.h
1 /******************************************************************************
2  * $Id: StNbdFitMaker.h,v 1.2 2012/04/25 05:15:30 hmasui Exp $
3  * $Log: StNbdFitMaker.h,v $
4  * Revision 1.2 2012/04/25 05:15:30 hmasui
5  * Added centrality calculation. Real data histogram name can be now specified in ReadData() function
6  *
7  ******************************************************************************/
8 
9 #ifndef __StNbdFitMaker_h__
10 #define __StNbdFitMaker_h__
11 
12 class TCanvas ;
13 class TGraph ;
14 class TH1 ;
15 class TH2 ;
16 class TLine ;
17 class StNegativeBinomial ;
18 
19 //____________________________________________________________________________________________________
20 // Class StNbdFitMaker: Determine the NBD parameters from the data
22  public:
23  StNbdFitMaker();
24  virtual ~StNbdFitMaker();
25 
28 
30  void ReadData(const Char_t* data, const Char_t* glauber,
31  const Char_t* dataHistogramName = "hRefMultTpc") ;
32 
39  //TGraph* Fit(const Int_t nevents = 1000, const Char_t* outputFileName = "");//zaochen comment
40  TGraph* Fit(const Int_t nevents = 1000, const TString outputFileName = "");
41 
43  Int_t Scan(const Int_t nevents,
44  const Int_t nppbin, const Double_t nppmin, const Double_t nppmax,
45  const Int_t kbin, const Double_t kmin, const Double_t kmax,
46  const Int_t xbin, const Double_t xmin, const Double_t xmax,
47  // const Double_t x,
48  const Double_t efficiency=1.0,
49  // const Int_t effbin, const Double_t effmin, const Double_t effmax,
50  const Double_t triggerbias=1.0, const Bool_t isConstEfficiency=kTRUE
51  );
52 
54  void SetParameters(const Double_t npp, const Double_t k, const Double_t x,
55  const Double_t efficiency, const Double_t triggerbias, const Bool_t isConstEfficiency) ;
56 
58  void SetMinimumMultiplicityCut(const Double_t cut) ;
59 
60  private:
61  // Functions
62  Double_t GetNormalization(const TH1& h1, const TH1& h2,
63  const Double_t min, const Double_t max) const ; // Get normalization factor in (min, max)
64  Double_t CalculateChi2(const TH1& hdata, const TH1& hfunc,
65  const Double_t minimumMultiplicityCut) ; // Get chi2 from data and func
66 
67  void CalculateCentrality(const TH1& hdata, const TH1& hmc) const ;
68 
69  // Data members
70  StNegativeBinomial* mNBinomial ;
71  TH1* mhRefMult ;
72  TH1* mhRefMultSim ;
73  TH2* mhNcoll_Npart ;
74  Int_t mNData ;
75  Double_t mMinimumMultiplicityCut ;
76  Bool_t mDoCentralityDetermination ;
77 
78  TCanvas* mCanvas ;
79  TLine* mCutOff[2] ;
80  TLine* mOneLine ;
81  TGraph* mChi2Graph ;
82 
83  ClassDef(StNbdFitMaker, 0)
84 };
85 #endif
86 
TGraph * Fit(const Int_t nevents=1000, const TString outputFileName="")
Int_t Scan(const Int_t nevents, const Int_t nppbin, const Double_t nppmin, const Double_t nppmax, const Int_t kbin, const Double_t kmin, const Double_t kmax, const Int_t xbin, const Double_t xmin, const Double_t xmax, const Double_t efficiency=1.0, const Double_t triggerbias=1.0, const Bool_t isConstEfficiency=kTRUE)
Find minimum chi2/NDF in (npp, k, efficiency) space.
void SetParameters(const Double_t npp, const Double_t k, const Double_t x, const Double_t efficiency, const Double_t triggerbias, const Bool_t isConstEfficiency)
Set parameters.
void SetMinimumMultiplicityCut(const Double_t cut)
Set minimum multiplicity cuts to avoid inefficiency (default is M>50)
void DoCentralityDetermination()
Default destructor.
void ReadData(const Char_t *data, const Char_t *glauber, const Char_t *dataHistogramName="hRefMultTpc")
Read real data and glauber ROOT files.