1 #include "commonmacro/common.h"
2 #include "common/Name.cc"
3 #include "commonmacro/histutil.h"
5 void yieldVphiEW(
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 =
"west",
15 cout <<
"--------------------------" << endl;
16 cout <<
"in name=" << inName << endl
17 <<
"ps dir=" << psDir << endl
18 <<
"cut=" << cut << endl;
19 cout <<
"--------------------------" << endl;
22 if(strstr(inName,
"west")){ side=
"west"; }
23 else if(strstr(inName,
"east")){ side=
"east"; }
26 inRoot =
new TFile(inName);
29 cout <<
"cannot find the infile" << endl;
32 TCanvas c1(
"c1",
"c1",400,500);
34 float dcaMin=-1.5,dcaMax=1.5;
37 gStyle->SetOptStat(0);
46 float ptary[]={1.5,2,3,4,6};
52 for(
int i=0; i<nBase; i++){
53 cout << border << endl;
57 TLegend legend(.1,.1,.25,.2);
58 legend.SetFillColor(kWhite); legend.SetBorderSize(0);
60 for(
int ic=0; ic<2; ic++){
62 setName(name,baseName[i],sPM[ic].Data());
63 h3 = (TH3D*) inRoot.Get(name);
67 HistSlice(h3,
"dummy2d",
"",0,dcaMin,dcaMax,
"zx",
"e");
70 for(
int is=0; is<nPt; is++){
71 h1[ic][is]=HistSlice(h2,
"dummy1d",
"",0,
72 ptary[is],ptary[is+1],
"x",
"e");
77 sprintf(title,
"yield v phi %s %s slices (%s) (cut %d)",
78 h2->GetTitle(),h3->GetZaxis()->GetTitle(),side.Data(),cut);
80 sprintf(name,
"yieldVphi%s%s",h3->GetZaxis()->GetTitle(),side.Data());
83 Divide(&c1,2,2,sTitle.Data(),inName);
84 for(
int iSlice=0; iSlice<nPt;iSlice++){
87 ha->SetMarkerStyle(4);
88 hb->SetMarkerStyle(8);
92 SetMinMax(ha,min*0.5,max*1.2);
94 c1.cd(iSlice+1); ha->Draw(
"e");
96 gPad->SetGridx(); gPad->SetGridy();
99 legend.AddEntry(h1[0][0],
"plus",
"p");
100 legend.AddEntry(h1[1][0],
"minus",
"p");
104 Print(&c1,psDir,sName.Data());
107 sName +=
"_sum"; sTitle +=
"sum";
108 Divide(&c1,2,2,sTitle.Data(),inName);
109 for(
int iSlice=0; iSlice<nPt;iSlice++){
110 TH1* ha = (TH1*)h1[0][iSlice]->Clone();
111 ha->Add(h1[1][iSlice]);
113 SetMinMax(ha,ha->GetMinimum()*0.5,ha->GetMaximum()*2.2);
115 c1.cd(iSlice+1); ha->Draw(
"e");
117 gPad->SetGridx(); gPad->SetGridy();
120 Print(&c1,psDir,sName.Data());