1 #include "commonmacro/common.h"
2 #include "common/Name.cc"
3 #include "commonmacro/histutil.h"
5 void compareDca(
const char* inName=
6 "links/P01hi.minbias.2000.hist/hianalysis_1000.hist.root",
7 const char* psDir=
"ps",
9 const char* outDir=
"./",
10 const char* more =
"embeddingfile",
14 gSystem->Load(
"StHiMicroEvent");
15 gSystem->Load(
"StHiMicroAnalysis");
17 TFile* inRoot =
new TFile(inName);
22 else if(extraValue>0){
25 char* trigger = (s.Contains(
"central")) ?
"central" :
"minbias";
26 sprintf(name,
"~/wrk/assoc/links/P01hi.central.HighpT_piminus_%d.hist/assoc_cut%d.hist.root",(
int)extraValue,cut);
29 cout <<
"Unknown embed file" << endl;
return;
32 embedRoot =
new TFile(name);
33 cout <<
"--------------------------" << endl;
34 cout <<
"in name=" << inName << endl
35 <<
"ps dir=" << psDir << endl
36 <<
"cut=" << cut << endl
37 <<
"embed name=" << name << endl;
38 cout <<
"--------------------------" << endl;
41 cout <<
"cannot find the infile" << endl;
45 cout <<
"cannot find " << name << endl;
47 TH3* h3[2]; TH2* h2[2];
52 h3[0]=(TH3*)inRoot.Get(
"Minus.h3DcaGlDcaXYGlPtPr");
57 h3[1]=(TH3*)embedRoot.Get(
"Minus.h3DcaGlDcaXYGlPtPr");
58 if(!h3[1]) { cout <<
"huh" << endl;
return; }
63 char* type[] = {
"real",
"embed"};
int npt=4;
64 float ptary[] = {2,3,4,5,6};
67 sprintf(name,
"%s",type[i]);
68 h2[i]=HistSlice(h3[i],
"",
"",0,0,3,
"zy");
71 TCanvas c1(
"c1",
"c1",400,500);
73 gStyle->SetOptStat(0);
77 float dcaCutAry[] = { 3,1};
78 char* dcatitle[] = {
"Wide",
"Cut"};
82 for(
int id=0;
id<2;
id++){
84 sprintf(title,
"dcaXY |dca|<%.f (cut %d)",dcaary[
id],cut);
85 Divide(&c1,2,2,title,inName);
86 for(
int ipt=0;ipt<npt;ipt++){
87 c1.cd(ipt+1); gPad->SetLogy();
89 h1[i]= HistSlice(h2[i],
"",
"",0,ptary[ipt],ptary[ipt+1],
"x");
90 SetRange(h1[i]->GetXaxis(),-dcaary[
id],dcaary[
id]);
91 if(nRebin>1)h1[i]->Rebin(nRebin);
92 h1[i]->Scale(1./h1[i]->Integral());
93 h1[i]->SetMaximum(.40);
94 h1[i]->SetMarkerStyle(4+4*i);
96 h1[i]->SetLineColor(kBlue); h1[i]->Draw(
"");
99 h1[i]->SetLineColor(kRed); h1[i]->Draw(
"same");
101 PrintMeanRms(h1[i],0.15,0.8-.1*i);
105 TLegend l(0.15,0.4,0.3,0.5); l.SetFillColor(kWhite);
107 l.AddEntry(h1[0],
"real",
"l"); l.AddEntry(h1[1],
"mc",
"l");
111 sprintf(title,
"dcaXYGl%s",dcatitle[
id]);
112 Print(&c1,psDir,title);