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