StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StNbdFitMaker.cxx
1 
2 #include <assert.h>
3 
4 #include "TCanvas.h"
5 #include "TError.h"
6 #include "TFile.h"
7 #include "TGraph.h"
8 #include "TH2.h"
9 #include "TH3.h"
10 #include "TLine.h"
11 #include "TStyle.h"
12 #include "TMath.h"
13 
14 #include "StMessMgr.h"
15 #include "StNegativeBinomial.h"
16 #include "StNbdFitMaker.h"
17 
18 ClassImp(StNbdFitMaker)
19 
20  //____________________________________________________________________________________________________
21  // Default constructor
23 {
24  mNBinomial = 0 ;
25  mhRefMult = 0 ;
26  mhRefMultSim = 0 ;
27 
28  mNData = 0 ;
29 
30  mMinimumMultiplicityCut = 100.0 ; // >50 by default. Can be changed by setMinimumMultiplicityCut(const Double_t)
31 
32  //mDoCentralityDetermination = kFALSE ;
33  mDoCentralityDetermination = kTRUE;
34 
35  mCanvas = 0 ;
36  mCutOff[0] = 0;
37  mCutOff[1] = 0;
38  mOneLine = 0 ;
39  mChi2Graph = 0;
40 }
41 
42 //____________________________________________________________________________________________________
43 // Default destructor
44 StNbdFitMaker::~StNbdFitMaker()
45 {
46  if(mNBinomial) delete mNBinomial ;
47  if(mCanvas) delete mCanvas ;
48 
49  for(Int_t i=0;i<2;i++)
50  {
51  if(mCutOff[i]) delete mCutOff[i] ;
52  }
53  if(mOneLine) delete mOneLine ;
54 
55  if(mChi2Graph) delete mChi2Graph ;
56 }
57 
58 //____________________________________________________________________________________________________
60 {
61  LOG_INFO << "StNbdFitMaker::DoCentralityDetermination Centrality determination is ON" << endm;
62  mDoCentralityDetermination = kTRUE ;
63 }
64 
65 //____________________________________________________________________________________________________
66 Double_t StNbdFitMaker::GetNormalization(const TH1& h1, const TH1& h2, const Double_t min, const Double_t max) const
67 {
68  // Get normalization factor in (min, max)
69  Double_t numerator = 0.0;
70  Double_t denominator = 0.0;
71  const Int_t mulminbin = h1.GetXaxis()->FindBin(min);
72  const Int_t mulmaxbin = h1.GetXaxis()->FindBin(max);
73 
74  for(Int_t mul=mulminbin; mul<mulmaxbin; mul++){
75  const Double_t n1 = h1.GetBinContent(mul+1);
76  const Double_t n1Error = h1.GetBinError(mul+1);
77 
78  if( n1 == 0.0 || n1Error == 0.0 ) continue ;
79 
80  const Double_t n2 = h2.GetBinContent(mul+1);
81 
82  numerator += n1 * n2 / (n1Error*n1Error) ;
83  denominator += n2 * n2 / (n1Error*n1Error) ;
84  }
85 
86  const Double_t norm = (denominator!=0.0) ? numerator / denominator : 1.0 ;
87 
88  LOG_INFO << Form("StNbdFitMaker::GetNormalization (min, max, norm) = (%5d, %5d, %1.7f)",
89  static_cast<Int_t>(min), static_cast<Int_t>(max), norm)
90  << endm;
91 
92  return norm ;
93 }
94 
95 //____________________________________________________________________________________________________
96 Double_t StNbdFitMaker::CalculateChi2(const TH1& hdata, const TH1& hfunc, const Double_t minimumMultiplicityCut)
97 {
99  mNData = 0 ;
100 
101  Double_t chi2 = 0.0 ;
102  for(Int_t ix=0; ix<hdata.GetNbinsX(); ix++){
103  // Lower multiplicity cut off
104  const Double_t mult = hdata.GetBinCenter(ix+1);
105  if( mult < minimumMultiplicityCut ) continue ;
106 
107  // Check data points
108  const Double_t dataError = hdata.GetBinError(ix+1);
109  if( dataError == 0.0 ) continue ;
110  // Check sim points
111  const Double_t simError = hfunc.GetBinError(ix+1);
112  if( simError == 0.0 ) continue ;
113  // Combine errors in quadrature
114  const Double_t totError = TMath::Power((dataError*dataError + simError*simError),0.5);
115 
116  // Calculate chi2
117  const Double_t data = hdata.GetBinContent(ix+1);
118  const Double_t func = hfunc.GetBinContent(ix+1);
119  const Double_t delta = (data - func)/totError ;
120  chi2 += delta*delta ;
121  mNData++;
122  }
123 
124  LOG_INFO << Form("StNbdFitMaker::calculateChi2 M > %5d: (npp, k) = (%1.5f, %1.5f) chi2/ndata = %1.3f/%5d = %1.3f",
125  static_cast<Int_t>(minimumMultiplicityCut), mNBinomial->GetNpp(), mNBinomial->GetK(), chi2, mNData, chi2/static_cast<Double_t>(mNData))
126  << endm;
127 
128  return chi2 ;
129 }
130 
131 //____________________________________________________________________________________________________
132 void StNbdFitMaker::CalculateCentrality(const TH1& hdata, const TH1& hmc) const
133 {
134  // - Calculate centrality from the MC multiplicity distribution
135  // - Also calculate the re-weighting correction = MC/Data, important for peripheral (typically 60-80%)
136  //
137  // NOTE: Assume MC multiplicity has been normalized to the real data
138 
139  const UInt_t ncent = 16 ; // 0-80% (5% increment)
140  Int_t centBin[2][3][ncent]; // Final centrality bins
141 
142  for(UInt_t i=0; i<2; i++) {
143  // For cross check, do centrality determination
144  // 1) from peripheral to central
145  // 2) from central to peripheral
146  if ( i == 0 ) LOG_INFO << "StNbdFitMaker::CalculateCentrality (1) Centrality determination from peripheral to central" << endm;
147  if ( i == 1 ) LOG_INFO << "StNbdFitMaker::CalculateCentrality (2) Centrality determination from central to peripheral" << endm;
148 
149  // Centrality cut
150  Double_t centralityCut[ncent] ;
151  Double_t centralityMin[ncent] ;
152  Double_t centralityMax[ncent] ;
153 
154  for(UInt_t ic=0; ic<ncent; ic++) {
155  const Double_t sign = (i==0) ? -1.0 : 1.0 ;
156  const Double_t centStep = 0.05 ;
157  const Double_t centCutStart = (i==0) ? 0.80 : 0.05 ;
158  const Double_t centMinStart = (i==0) ? 75.0 : 0.0 ;
159 
160  centralityCut[ic] = centCutStart + sign*centStep * ic ;
161  centralityMin[ic] = centMinStart + sign*centStep * 100.0 * ic ;
162  centralityMax[ic] = (centMinStart + centStep*100.0) + sign*centStep * 100.0 * ic ;
163 
164  // Print centrality definitions
165  LOG_INFO << Form("StNbdFitMaker::CalculateCentrality Centrality: %1.0f-%1.0f %%, cut = %1.2f",
166  TMath::Abs(centralityMin[ic]), TMath::Abs(centralityMax[ic]), centralityCut[ic])
167  << endm;
168  }
169 
170  // Start calculation for three different cases, for systematic error study
171  // 0: default, 1:-5% total cross section, 2:+5% total cross section
172  const Double_t nevent = hmc.Integral() ;
173  for(Int_t it=0; it<3; it++){ // vary total cross section by 5 % in it=1,2
174  Double_t scale = 1.0 ;
175  if( it == 1 ) scale = 0.95 ;
176  if( it == 2 ) scale = 1.05 ;
177 
178  UInt_t bin = 0 ;
179  const Int_t nbin = hmc.GetNbinsX() ;
180  Double_t sum = 0.0;
181  // The following commented code is the original centrality-cut calculator. The updated method is below which
182  // integrates the data from 0-20% and the glauber for centralities >20%
183  /*for(Int_t im=0; im<nbin; im++){
184  const Double_t M = (i==0) ? hmc.GetBinCenter(im+1) : hmc.GetBinCenter(nbin-im) ;
185  const Int_t Mint = (i==0) ? im : nbin-im-1 ;
186  const Double_t count = (i==0) ? hmc.GetBinContent(im+1) : hmc.GetBinContent(nbin-im) ;
187  if( count == 0.0 ) continue ;
188 
189  sum += count ;
190  const Double_t fraction = sum / nevent ;
191  const Double_t fCentBinCut = centralityCut[bin] * scale;
192  const Double_t R = (i==0) ? (1.0 - fraction) : fraction ;
193  const Bool_t isCentOk = (i==0) ? R <= fCentBinCut : R > fCentBinCut ;
194 
195  if( isCentOk && bin < ncent ){
196  cout << Form("%2.2f - %2.2f (%%) : M > %4d (im=%3d, M=%1.1f, bin=%4d) (sum, total, fraction>cut) = (%1.3f, %1.3f, %1.3f>%1.3f)",
197  TMath::Abs(centralityMin[bin]*scale), TMath::Abs(centralityMax[bin]*scale), Mint, im, M, bin, sum, nevent, R, fCentBinCut) << endl;
198 
199  centBin[i][it][bin] = (Double_t)Mint ;
200  bin++;
201  }
202  }// multiplicity loop */
203 
204  // The following is the updated centrality calculation which integrates the data from 0-20% and the glauber for centralities >20%
205  Double_t distance = 1000.0;
206  for(Int_t im=0; im<nbin; im++){
207  const Int_t Mint = (i==0) ? im : nbin-im ;
208  Double_t count = 0.0;
209  if( (i==0 && bin>11) || (i!=0 && bin<4) ) count = (i==0) ? hdata.GetBinContent(im+1) : hdata.GetBinContent(nbin-im);
210  else count = (i==0) ? hmc.GetBinContent(im+1) : hmc.GetBinContent(nbin-im) ;
211  if( count == 0.0 ) continue ;
212 
213  sum += count ;
214  const Double_t fraction = sum / nevent ;
215  const Double_t fCentBinCut = centralityCut[bin] * scale;
216  const Double_t R = (i==0) ? (1.0 - fraction) : fraction ;
217  Double_t thisdistance = TMath::Abs(R - fCentBinCut );
218  //const Bool_t isCentOk = (i==0) ? R <= fCentBinCut : R > fCentBinCut ;
219  const Bool_t isCentOk = (thisdistance > distance) ;
220  distance=thisdistance;
221 
222  if( isCentOk && bin < ncent ){
223  cout << Form("%2.2f - %2.2f (%%) : M > %4d (im=%3d, M=%1.1f, bin=%4d) (sum, total, fraction>cut) = (%1.3f, %1.3f, %1.3f>%1.3f)",
224  TMath::Abs(centralityMin[bin]*scale), TMath::Abs(centralityMax[bin]*scale), Mint, im, (Double_t)Mint, bin, sum, nevent, R, fCentBinCut) << endl;
225  centBin[i][it][bin] = (Double_t)Mint ;
226  bin++;
227  distance=1000.0;
228  }
229  }// multiplicity loop
230  }// different total cross section
231  }// from peripheral or central
232 
233  // Print centrality bins in the array format for implementation in StCentrality.cxx
234  // - Use central to peripheral
235  for(UInt_t ic=0; ic<ncent; ic++) {
236  LOG_INFO << Form(" mMultiplicityCut[0].push_back( %3d ); mCentralityMin[0].push_back( %2.1f ); mCentralityMax[0].push_back( %2.1f );",
237  (Int_t)centBin[1][0][ic], 5.0*ic, 5.0*(ic+1)
238  ) << endm;
239  }
240 
241  // For +/- 5% bins
242  for(UInt_t ic=0; ic<ncent; ic++) {
243  LOG_INFO << Form(" mMultiplicityCut[1].push_back( %3d ); mMultiplicityCut[2].push_back( %3d );",
244  (Int_t)centBin[1][1][ic], (Int_t)centBin[1][2][ic]
245  ) << endm;
246  }
247 
248 }
249 
250 //____________________________________________________________________________________________________
251 void StNbdFitMaker::SetParameters(const Double_t npp, const Double_t k, const Double_t x,
252  const Double_t efficiency, const Double_t triggerbias, const Bool_t isConstEfficiency)
253 {
254  if(mNBinomial) delete mNBinomial ;
255 
256  mNBinomial = new StNegativeBinomial(npp, k, x, efficiency, triggerbias, isConstEfficiency);
257 }
258 
259 //____________________________________________________________________________________________________
261 {
262  mMinimumMultiplicityCut = cut ;
263  LOG_INFO << "StNbdFitMaker::setMinimumMultiplicityCut Set low multiplicity cut off : M > " << cut << endm;
264 }
265 
266 //____________________________________________________________________________________________________
267 void StNbdFitMaker::ReadData(const Char_t* data, const Char_t* glauber, const Char_t* dataHistogramName)
268 {
269  // Read real data file
270  TFile* inputData = TFile::Open(data);
271  if(!inputData || !inputData->IsOpen()){
272  Error("StNbdFitMaker::readData", "can't open %s", data);
273  assert(0);
274  }
275  LOG_INFO << "StNbdFitMaker::readData open Data file: " << inputData->GetName() << endm;
276 
277  mhRefMult = 0;
278  // if( mNBinomial->useTpc() ){
280  mhRefMult = (TH1D*) inputData->Get(dataHistogramName);
281  // mhRefMult = (TH1D*) inputData->Get("hRefMultTpc");
282  // mhRefMult = (TH1D*) inputData->Get("hRefMult");
283  // }
284  // else{
285  // /// FTPC refMult
286  // mhRefMult = (TH1D*) inputData->Get("hRefMultFTpc");
287  // }
288 
289  if(!mhRefMult){
290  Error("StNbdFitMaker::readData", "hRefMult doesn't exist");
291  assert(mhRefMult);
292  }
293 
294  mhRefMult->SetLineColor(1);
295 
296  // Define simulated refmult
297  const Int_t nbinsx = mhRefMult->GetNbinsX() ;
298  const Double_t xmin = mhRefMult->GetXaxis()->GetXmin() ;
299  const Double_t xmax = mhRefMult->GetXaxis()->GetXmax() ;
300  mhRefMultSim = new TH1D("hRefMultSim", "", nbinsx, xmin, xmax);
301  mhRefMultSim->SetLineColor(2);
302 
303  // Sumw2 to calculate error properly
304  mhRefMult->Sumw2();
305  mhRefMultSim->Sumw2();
306 
307  // Read glauber file
308  TFile* inputGlauber = TFile::Open(glauber);
309  if(!inputGlauber || !inputGlauber->IsOpen())
310  {
311  Error("StNbdFitMaker::readData", "can't open %s", glauber);
312  assert(0);
313  }
314  LOG_INFO << "StNbdFitMaker::readData open Glauber file: " << inputGlauber->GetName() << endm;
315 
316  mhNcoll_Npart = (TH2D*) inputGlauber->Get("hNcoll_Npart");
317  if(!mhNcoll_Npart)
318  {
319  Error("StNbdFitMaker::readData", "hNcoll_Npart doesn't exist");
320  assert(mhNcoll_Npart);
321  }
322 }
323 
324 //____________________________________________________________________________________________________
325 //TGraph* StNbdFitMaker::Fit(const Int_t nevents, const Char_t* outputFileName)//old
326 TGraph* StNbdFitMaker::Fit(const Int_t nevents, TString outputFileName)//zaochen
327 {
328  gStyle->SetOptStat(0);
329 
331 
333  if(!mhRefMult)
334  {
335  Error("StNbdFitMaker::Fit", "hRefMult doesn't exist");
336  assert(mhRefMult);
337  }
338 
339  if(!mhNcoll_Npart)
340  {
341  Error("StNbdFitMaker::Fit", "hNcoll_Npart doesn't exist");
342  assert(mhNcoll_Npart);
343  }
344 
345  mhRefMultSim->Reset();
346 
347  Int_t ievent = 0 ;
348  while( ievent < nevents )
349  {
350  Double_t npart, ncoll;
351  mhNcoll_Npart->GetRandom2(npart, ncoll);
352  const Bool_t isNpartNcollOk = (npart>=2 && ncoll>=1) ;
353  if ( !isNpartNcollOk ) continue ;
354 
355  const Int_t multiplicity = mNBinomial->GetMultiplicity(npart, static_cast<Int_t>(ncoll));
356  mhRefMultSim->Fill(multiplicity);
357 
358  if( ievent % (nevents/10) == 0 )
359  {
360  LOG_INFO << Form("StNbdFitMaker::Fit ievent=%10d (npart, ncoll, mult) = (%10d, %10d, %10d)",
361  ievent, (Int_t)npart, (Int_t)ncoll, multiplicity)
362  << endm;
363  }
364 
365  ievent++;
366  }
367 
368  // Normalization
369  const Double_t norm = GetNormalization(*mhRefMult, *mhRefMultSim, mMinimumMultiplicityCut, mhRefMult->GetXaxis()->GetXmax());
370  //const Double_t norm = GetNormalization(*mhRefMult, *mhRefMultSim, mMinimumMultiplicityCut, 400);
371  mhRefMultSim->Scale(norm);
372 
373  // Get chi2
374  const Double_t chi2 = CalculateChi2(*mhRefMult, *mhRefMultSim, mMinimumMultiplicityCut);
375 
376  //----------------------------------------------------------------------------------------------------
377  // Set chi2
378  //----------------------------------------------------------------------------------------------------
379  if(mChi2Graph) delete mChi2Graph ;
380  mChi2Graph = new TGraph();
381  mChi2Graph->SetPoint(0, 0, chi2);
382  mChi2Graph->SetPoint(1, 1, mNData - 2); // 2 fitting parameters (npp, k)
383  mChi2Graph->SetPoint(2, 2, chi2/(mNData-2.0));
384 
385  //----------------------------------------------------------------------------------------------------
386  // Draw
387  //----------------------------------------------------------------------------------------------------
388  mhRefMult->SetMinimum(0.1);
389  mhRefMult->SetMaximum(mhRefMult->GetMaximum()*10.0);
390 
391  mhRefMultSim->SetXTitle("Refmult (MC)");
392  mhRefMultSim->SetYTitle("Count");
393  mhRefMultSim->SetTitle(Form("npp=%1.2f, k=%1.2f, x=%1.2f",
394  mNBinomial->GetNpp(), mNBinomial->GetK(), mNBinomial->GetX()));
395 
396  if(mCanvas) delete mCanvas ;
397  mCanvas = new TCanvas("c1", "c1", 1200, 500);
398  mCanvas->Divide(2, 1);
399  mCanvas->cd(1);
400  mCanvas->GetPad(1)->SetLogy(1);
401 
402  mhRefMult->Draw("h");
403  mhRefMultSim->Draw("hsame");
404 
405  // Normalization line
406  if(mCutOff[0]) delete mCutOff[0] ;
407  mCutOff[0] = new TLine( mMinimumMultiplicityCut, mhRefMult->GetMinimum(), mMinimumMultiplicityCut, mhRefMult->GetMaximum());
408  mCutOff[0]->SetLineColor(4);
409  mCutOff[0]->SetLineStyle(2);
410  mCutOff[0]->Draw();
411 
412  // Draw ratio of MC to data
413  mCanvas->cd(2);
414  TH1* hRatio = (TH1D*) mhRefMultSim->Clone();
415  hRatio->SetName("hRatio");
416  hRatio->Divide(mhRefMult);
417  hRatio->SetYTitle("MC/data");
418 
419  hRatio->SetMinimum(0);
420  hRatio->SetMaximum(2);
421  hRatio->Draw();
422 
423  if(mOneLine) delete mOneLine ;
424  mOneLine = new TLine(hRatio->GetXaxis()->GetXmin(), 1.0, hRatio->GetXaxis()->GetXmax(), 1.0);
425  mOneLine->SetLineColor(4);
426  mOneLine->SetLineStyle(2);
427  mOneLine->Draw();
428 
429  if(mCutOff[1]) delete mCutOff[1] ;
430  mCutOff[1] = new TLine( mMinimumMultiplicityCut, hRatio->GetMinimum(), mMinimumMultiplicityCut, hRatio->GetMaximum());
431  mCutOff[1]->SetLineColor(4);
432  mCutOff[1]->SetLineStyle(2);
433  mCutOff[1]->Draw();
434 
435  mCanvas->cd();
436  mCanvas->Update();
437 
438  //----------------------------------------------------------------------------------------------------
439  // Centrality
440  //----------------------------------------------------------------------------------------------------
441  if ( mDoCentralityDetermination )
442  {
443  CalculateCentrality(*mhRefMult, *mhRefMultSim) ;
444  }
445 
446  //----------------------------------------------------------------------------------------------------
447  // Write only if outputFileName is given
448  //----------------------------------------------------------------------------------------------------
449  //const TString fileName(outputFileName);//zaochen
450  //if(!fileName.IsWhitespace())//zaochen
451  if(!outputFileName.IsWhitespace())//zaochen
452  {
453  LOG_INFO << "StNbdFitMaker::Fit Write output ROOT file : " << outputFileName << endm;
454  TFile* output = TFile::Open(outputFileName, "recreate");
455  mhRefMult->Write();
456  mhRefMultSim->Write();
457  hRatio->Write();
458  output->Close();
459  }
460 
461  return mChi2Graph;
462 }
463 
464 //____________________________________________________________________________________________________
465 Int_t StNbdFitMaker::Scan(const Int_t nevents,
466  const Int_t nppbin, const Double_t nppmin, const Double_t nppmax,
467  const Int_t kbin, const Double_t kmin, const Double_t kmax,
468  const Int_t xbin, const Double_t xmin, const Double_t xmax,
469  //const Double_t x,
470  //const Int_t effbin, const Double_t effmin, const Double_t effmax,
471  const Double_t efficiency,
472  const Double_t triggerbias, const Bool_t isConstEfficiency
473  ){
475  TH3* hChi2 = new TH3D("hChi2", "#chi^{2}/NDF in (npp, k, x) space",
476  nppbin, nppmin, nppmax, kbin, kmin, kmax, xbin, xmin, xmax);
477  hChi2->SetXTitle("n_{pp}");
478  hChi2->SetYTitle("k");
479  hChi2->SetZTitle("x");
480 
481  const Double_t nppstep = (nppbin==1) ? 0 : (nppmax-nppmin)/static_cast<Double_t>(nppbin-1) ;
482  const Double_t kstep = (kbin==1) ? 0 : (kmax-kmin)/static_cast<Double_t>(kbin-1) ;
483  const Double_t xstep = (xbin==1) ? 0 : (xmax-xmin)/static_cast<Double_t>(xbin-1) ;
484 
485  for(Int_t ix=0; ix<nppbin; ix++){
486  const Double_t npp = nppmin + nppstep*ix ;
487 
488  for(Int_t iy=0; iy<kbin; iy++){
489  const Double_t k = kmin + kstep*iy ;
490  LOG_INFO << Form("StNbdFitMaker::Scan Fitting for (npp, k) = (%1.3f, %1.3f) ...", npp, k) << endm;
491 
492  for(Int_t iz=0; iz<xbin; iz++){
493  const Double_t x = xmin + xstep*iz ;
494  // Set parameters
495  SetParameters(npp, k, x, efficiency, triggerbias, isConstEfficiency);
496 
497  //add by Lizhu
498  //const Char_t* fileforratio(Form("Ratio_npp%1.3f_k%1.3f_x%1.3f_eff%1.3f.root", npp, k, x, efficiency));
499  const TString fileforratio = Form("RatioChi2Files/Ratio_npp%1.3f_k%1.3f_x%1.3f_eff%1.3f.root", npp, k, x, efficiency);//zaochen
500 
501  // Fitting, write ROOT file
502  Fit(nevents, fileforratio);
503 
504  // Fitting, do not write ROOT file
505  //Fit(nevents, "");
506 
507  // Get chi2
508  hChi2->SetBinContent(ix+1, iy+1, iz+1, mChi2Graph->GetY()[2]);
509 
510  LOG_INFO << Form("StNbdFitMaker::Scan Fitting for (npp, k, x, d, chi2/ndf) = (%1.3f, %1.3f, %1.3f, %1.3f, %1.3f/%3d=%1.3f) ...",
511  npp, k, x, efficiency, mChi2Graph->GetY()[0], (Int_t)mChi2Graph->GetY()[1], mChi2Graph->GetY()[2])
512  << endm;
513  }// x loop
514  }// k loop
515  }// npp loop
516 
517  //----------------------------------------------------------------------------------------------------
518  // Write chi2 graph
519  // Filename is determined by the range of npp, k and x
520  //----------------------------------------------------------------------------------------------------
521  //const Char_t* fileName(Form("chi2_nevents%d_npp%1.3f-%1.3f_k%1.3f-%1.3f_x%1.3f_%1.3f_eff%1.3f.root",
522  const Char_t* fileName(Form("RatioChi2Files/chi2_nevents%d_npp%1.3f-%1.3f_k%1.3f-%1.3f_x%1.3f_%1.3f_eff%1.3f.root",
523  nevents, nppmin, nppmax, kmin, kmax, xmin, xmax, efficiency));
524  TFile* outputFile = TFile::Open(fileName, "recreate");
525  hChi2->Write();
526  outputFile->Close();
527 
528  return 1;
529 }
530 
531 
TGraph * Fit(const Int_t nevents=1000, const TString outputFileName="")
Definition: FJcore.h:367
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&gt;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.
Double_t GetK() const
Get npp parameter.
Int_t GetMultiplicity(const Double_t npart, const Double_t ncoll) const
Get multiplcity by convoluting NBD.
Double_t GetX() const
Get k parameter.