adapt the code to run on EventStat output
authoratoia <atoia@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 16 Nov 2011 10:12:51 +0000 (10:12 +0000)
committeratoia <atoia@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 16 Nov 2011 10:12:51 +0000 (10:12 +0000)
PWG2/EVCHAR/makeCentralityBy1D.C [new file with mode: 0644]
PWG2/EVCHAR/makeCentralityFit.C [new file with mode: 0644]

diff --git a/PWG2/EVCHAR/makeCentralityBy1D.C b/PWG2/EVCHAR/makeCentralityBy1D.C
new file mode 100644 (file)
index 0000000..c1d66cf
--- /dev/null
@@ -0,0 +1,29 @@
+void makeCentralityBy1D 
+//(int run =167693, const char *histname ="fHOutMultV0M", float percentXsec=90.05, float mult=77.4) //V0M
+//(int run =167693, const char *histname ="fHOutMultCL1", float percentXsec=90.14, float mult=20) // CL1
+(int run =167693, const char *histname ="fHOutMultTRK", float percentXsec=90.09, float mult=10) // TRK
+{
+ //load libraries
+  // gSystem->SetBuildDir("/tmp/");
+  // gSystem->Load("libCore.so");  
+  // gSystem->Load("libTree.so");
+  // gSystem->Load("libGeom.so");
+  // gSystem->Load("libVMC.so");
+  // gSystem->Load("libPhysics.so");
+  // gSystem->Load("libSTEERBase.so");
+  // gROOT->ProcessLine(".include $ALICE_ROOT/include");
+  gROOT->LoadMacro("AliCentralityBy1D.cxx+");
+  AliCentralityBy1D *mPM = new AliCentralityBy1D();
+
+  TString finname = Form("/home/atoia/analysis/data2011/multRef/AnalysisResults_%i.root",run);
+  TString foutname = Form("/home/atoia/analysis/data2011/by1D/AliCentralityBy1D_%i_TRK.root",run);
+
+  mPM->AddHisto(histname);  
+  mPM->SetInputFile(finname);        
+  mPM->SetOutputFile(foutname);  
+  mPM->SetMultLowBound(mult);
+  mPM->SetPercentileCrossSection(percentXsec);
+  mPM->MakePercentiles();
+
+}
+
diff --git a/PWG2/EVCHAR/makeCentralityFit.C b/PWG2/EVCHAR/makeCentralityFit.C
new file mode 100644 (file)
index 0000000..8de50d7
--- /dev/null
@@ -0,0 +1,70 @@
+void makeCentralityFit()
+{
+ //load libraries
+  gSystem->SetBuildDir("/tmp/");
+  gSystem->Load("libCore.so");  
+  gSystem->Load("libTree.so");
+  gSystem->Load("libGeom.so");
+  gSystem->Load("libVMC.so");
+  gSystem->Load("libPhysics.so");
+  gSystem->Load("libSTEERBase.so");
+  gROOT->ProcessLine(".include $ALICE_ROOT/include");
+  gROOT->LoadMacro("AliCentralityGlauberFit.cxx+");
+
+  const char *finnameGlau ="/home/atoia/GlauberNtuple/GlauberMC_PbPb_ntuple_sigma64_mind4_r662_a546.root";
+
+  const char * run="167693";
+  const char * system="TRK";
+  TString finname = Form("/home/atoia/analysis/data2011/multRef/AnalysisResults_%s.root",run);
+  TString foutname = Form("/home/atoia/analysis/data2011/fit/%s_fit_%s.root",system,run);
+  //TString foutnameGlau = Form("/home/atoia/analysis/data2011/fit/%s_ntuple_%s.root",system,run);
+  TString foutnameGlau = Form("test_%s.root",system,run);
+  //const char *histname="fHOutMultV0M";
+  //const char *histname="fHOutMultCL1";
+  const char *histname="fHOutMultTRK";
+
+
+  AliCentralityGlauberFit *mPM = new AliCentralityGlauberFit(finnameGlau);
+  mPM->SetInputFile(finname);        
+  mPM->SetInputNtuple(finnameGlau);     
+  mPM->SetOutputFile(foutname);  
+  mPM->SetOutputNtuple(foutnameGlau);
+  mPM->AddHisto(histname);
+
+  mPM->SetRebin(1);
+  mPM->SetAncestorMode(2);   // If 1 use Npart**alpha, if 2 use alpha*Npart + (1-alpha)*Ncoll
+  mPM->SetFastFitMode(0);    // If 1 or 2 use cruder approximation to compute curve faster 1:NBD, 2:Gauss
+  mPM->UseChi2(kTRUE);       // If TRUE minimize Chi2
+  mPM->UseAverage(kFALSE);    // If TRUE use Average
+  mPM->SetNtrials(1);
+  mPM->SetNevents(1e5);
+
+  // ----------range to fit--------------
+  //mPM->SetRangeToFit(100., 20000.);   // V0M
+  //mPM->SetRangeToFit(40., 5200.);   // CL1
+  mPM->SetRangeToFit(10., 2400.);   // TRK
+  // ----------range to scale--------------
+  //mPM->SetRangeToScale(100.); // V0M  
+  //mPM->SetRangeToScale(40.); // CL1  
+  mPM->SetRangeToScale(10.);  //TRK 
+  // ----------initial parameters--------------
+  //mPM->SetGlauberParam(10,29,31, 10,0.7,1.5, 10,0.85,0.87);
+  //mPM->MakeFitsMinuitNBD(0.801,30.,1.2);          // initial parameters
+  //mPM->SetGlauberParam(1,28,28.5, 1,1.291,1.9, 1,0.801,0.82); // V0M
+  //mPM->SetGlauberParam(1,7.25,7.5, 1,1.291,1.9, 1,0.801,0.82); // Cl1
+  mPM->SetGlauberParam(1,3.5,3.7, 1,1.291,1.5, 1,0.801,0.81); // TRK
+  // ----------done--------------
+
+  mPM->MakeFits();  
+  
+  TFile * f = new TFile (foutname);
+  TH1 * hd = (TH1*) gDirectory->Get("fHOutMultTRK");
+  TH1 * hg = (TH1*) gDirectory->Get("fHOutMultTRK_GLAU");
+  hg->SetLineColor(kRed);
+  hd->Draw("e");
+  hg->Draw("same");
+
+
+
+}
+