StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
doNbdFitMaker.C
1 /****************************************************************************************************
2  * $Id: doNbdFitMaker.C,v 1.2 2012/04/25 05:29:16 hmasui Exp $
3  * $Log: doNbdFitMaker.C,v $
4  * Revision 1.2 2012/04/25 05:29:16 hmasui
5  * Added histogram name
6  *
7 ****************************************************************************************************/
8 
9 //____________________________________________________________________________________________________
10 void doNbdFitMaker(
11  const Char_t* outputFileName = "",
12  const Int_t nevents = 1000,
13  const Char_t* realData = "refmult.root",
14  const Char_t* glauber = "ncoll_npart.root",
15  const Char_t* realHistogram = "hRefMultTpc",
16  const Double_t multiplicityCut = 30,
17  const Double_t npp = 1.37,
18  const Double_t k = 1.0,
19  const Double_t x = 0.13,
20  const Double_t efficiency = 1.00,
21  const Double_t triggerbias = 1.00,
22  const Bool_t isConstEfficiency = kTRUE
23 ){
24  gSystem->Load("St_base");
25  gSystem->Load("StUtilities");
26  gSystem->Load("StGlauberUtilities");
27  gSystem->Load("StCentralityMaker");
28 
29  StNbdFitMaker* maker = new StNbdFitMaker();
30  maker->DoCentralityDetermination() ;
31 
32  // Set parameters
33  maker->SetParameters(npp, k, x, efficiency, triggerbias, isConstEfficiency);
34 
35  // Set low multiplicity cut off for fitting
36  maker->SetMinimumMultiplicityCut(multiplicityCut);
37 
38  // Read input files
39  maker->ReadData(realData, glauber, realHistogram);
40 
41  // Fit
42  maker->Fit(nevents, outputFileName);
43 }
44 
45 //____________________________________________________________________________________________________
46 void scan(
47  const Int_t nevents = 200000,
48  const Char_t* realData = "refmult.root",
49  const Char_t* glauber = "ncoll_npart.root",
50  const Char_t* realHistogram = "hRefMultTpc",
51  const Double_t multiplicityCut = 50,
52  const Int_t nppbin = 40, const Double_t nppmin = 1.2, const Double_t nppmax = 1.6,
53  const Int_t kbin = 1, const Double_t kmin = 2.0, const Double_t kmax = 2.0,
54  const Int_t xbin = 50, const Double_t xmin = 0.08, const Double_t xmax = 0.18,
55  const Double_t efficiency = 1.00,
56  const Double_t triggerbias = 1.00,
57  const Bool_t isConstEfficiency = kTRUE
58 ){
59  gSystem->Load("St_base");
60  gSystem->Load("StUtilities");
61  gSystem->Load("StGlauberUtilities");
62  gSystem->Load("StCentralityMaker");
63 
64  StNbdFitMaker* maker = new StNbdFitMaker();
65 
66  // Set dummy parameters
67  maker->SetParameters(nppmin, kmin, xmin, efficiency, triggerbias, isConstEfficiency);
68 
69  // Set low multiplicity cut off for fitting
70  maker->SetMinimumMultiplicityCut(multiplicityCut);
71 
72  // Read input files
73  maker->ReadData(realData, glauber, realHistogram);
74 
75  // Fit
76  maker->Scan(nevents, nppbin, nppmin, nppmax, kbin, kmin, kmax, xbin, xmin, xmax,
77  efficiency, triggerbias, isConstEfficiency);
78 }
79 
80 //____________________________________________________________________________________________________
81 void simulateMultiplicity(
82  const Char_t* outputFileName = "test.root",
83  const Int_t nevents = 500000,
84  const Char_t* glauber = "ncoll_npart.root",
85  const Double_t npp = 2.9,
86  const Double_t k = 2.0,
87  const Double_t x = 0.20,
88  const Double_t efficiency = 1.00,
89  const Double_t triggerbias = 1.00,
90  const Bool_t isConstEfficiency = kTRUE
91 ){
92  gSystem->Load("St_base");
93  gSystem->Load("StUtilities");
94  gSystem->Load("StGlauberUtilities");
95  gSystem->Load("StCentralityMaker");
96 
97  StNbdFitMaker* maker = new StNbdFitMaker();
98 
99  // Set parameters
100  maker->SetParameters(npp, k, x, efficiency, triggerbias, isConstEfficiency);
101 
102  // Read input files
103  maker->ReadGlauber(glauber, 3000, 0, 3000);
104 
105  // Fit
106  maker->Simulate(nevents, outputFileName);
107 }
108 
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.