1 #if !defined(__CINT__) || defined(__MAKECINT__)
9 #include <TClassTable.h>
24 #include <TGraphErrors.h>
25 #include "AliCentralityGlauberFit.h"
29 void makeCentralityFit(const char * run="188359", const char *system = "ZNA", int Rebin=1, int Nevt=1e6)
32 gSystem->SetBuildDir("/tmp/");
33 gSystem->Load("libCore");
34 gSystem->Load("libTree");
35 gSystem->Load("libGeom");
36 gSystem->Load("libVMC");
37 gSystem->Load("libPhysics");
38 gSystem->Load("libSTEERBase");
39 gROOT->ProcessLine(".include $ALICE_ROOT/include");
40 gROOT->LoadMacro("AliCentralityGlauberFit.cxx+");
42 const char *finnameGlau ="GlauberMC_pPb_ntuple_sigma70_mind4_r662_a546_Rpro6.root";
45 if((strncmp(system,"ZNA",3))==0){
46 printf("\n Glauber fit on ZNA spectrum\n\n");
47 sprintf(histname,"hZNA");
49 else if((strncmp (system,"ZNs",3)) == 0){
50 printf("\n Glauber fit on ZNA spectrum subtracting ZNC contribution (~SD)\n\n");
51 sprintf(histname,"hZPA");
53 else if((strncmp (system,"ZPA",3)) == 0){
54 printf("\n Glauber fit on ZPA spectrum\n\n");
55 sprintf(histname,"hZPA");
58 TString finname = Form("Histos%s.root",run);
59 TString foutname = Form("%s_fit_%s.root",system,run);
60 TString foutnameGlau = Form("%s_ntuple_%s.root",system,run);
63 AliCentralityGlauberFit *mPM = new AliCentralityGlauberFit(finnameGlau);
64 mPM->SetInputFile(finname);
65 mPM->SetInputNtuple(finnameGlau);
66 mPM->SetOutputFile(foutname);
67 mPM->SetOutputNtuple(foutnameGlau);
68 mPM->AddHisto(histname);
71 mPM->SetNevents(Nevt);
72 mPM->UseChi2(kTRUE); // If TRUE minimize Chi2
74 if (strncmp(system,"ZNA",3) == 0) {
76 mPM->SetRangeToFit(1., 300.);
77 mPM->SetRangeToScale(0);
78 mPM->SetGlauberParam(1,0.,1., 1,0.96,1., 2,0.22,0.25, 1,0.65,0.7, 1,0.56,0.585);
80 else if (strncmp(system,"ZPA",3) == 0) {
82 mPM->SetRangeToFit(1., 25.);
83 mPM->SetRangeToScale(1.);
84 mPM->SetGlauberParam(1,0.0,1., 1,0.6,1, 1,0.25,0.3, 1,0.65,0.8, 1,0.58,0.59);
88 char hnam[10], hnamg[20];
90 if(strncmp(system,"ZNA",3) == 0){
92 sprintf(hnamg,"hZNA_GLAU");
95 else if(strncmp(system,"ZPA",3) == 0) {
97 sprintf(hnamg,"hZPA_GLAU");
101 TFile *f = TFile::Open(foutname);
102 TH1 * hd = dynamic_cast<TH1*> (f->Get((hnam)));
103 TH1 * hg = dynamic_cast<TH1*> (f->Get((hnamg)));
104 hg->SetLineColor(kPink-2);
106 hd->SetMarkerStyle(20);
107 //hd->SetMarkerSize(1.2);
108 hd->SetMarkerColor(kBlue+3);
110 //hd->SetMinimum(10.);
113 hd->SetXTitle("E_{ZNA} (TeV)");
118 text0.SetTextSize(0.04);
119 text0.SetTextColor(kBlue+3);
121 sprintf(ch,"<E_{ZNA}> DATA = %1.2f TeV ",hd->GetMean());
122 text0.DrawLatex(xt,10.,ch);
124 sprintf(chd,"<E_{ZNA}> Glauber = %1.2f TeV",hg->GetMean());
125 text0.SetTextColor(kPink-2);
126 text0.DrawLatex(xt,5.,chd);
129 sprintf(ct,"RUN %s",run);
130 text0.SetTextColor(kAzure);
131 text0.DrawLatex(xt,1.,ct);