1 #include "common/Name.h"
2 #include "commonmacro/histutil.h"
3 #include "commonmacro/common.h"
8 void yieldVcent(
const char* inName=
9 "links/P01hi.minbias.2000.hist/hianalysis_1000.hist.root",
10 const char* psDir=
"ps",
12 const char* outDir=
"./",
13 const char* more =
"west",
18 cout <<
"--------------------------" << endl;
19 cout <<
"in name=" << inName << endl
20 <<
"ps dir=" << psDir << endl
21 <<
"cut=" << cut << endl;
22 cout <<
"--------------------------" << endl;
24 inRoot =
new TFile(inName);
27 cout <<
"cannot find the infile" << endl;
30 TCanvas c1(
"c1",
"c1",400,500);
31 TString sName,sTitle; TH1* h1a,*h1b; TH3* h3a, *h3b; TH2* h2a,*h2b;
35 int zdcMin[]={0,5,10,20,30,40,50,60,70,80};
36 int zdcMax[]={5,10,20,30,40,50,60,70,80,100};
38 gStyle->SetOptLogy(1); gStyle->SetOptStat(0);
39 sprintf(name,
"raw pt yield, zdc slices (cut %d)",cut);
40 Divide(&c1,3,3,name,inName);
41 h2a=(TH2*)inRoot.Get(
"Plus.h2ZDCCentralityPtPr");
42 h2b=(TH2*)inRoot.Get(
"Minus.h2ZDCCentralityPtPr");
43 for(
int i=1; i<=nSlice; i++){
45 sprintf(name,
"zdc%d%s",i,sPM[0]);
46 h1a=h2a->ProjectionY(name,i,i,
"e");
47 sprintf(name,
"zdc%d%s",i,sPM[1]);
48 h1b=h2b->ProjectionY(name,i,i,
"e");
49 h1a->SetMarkerSize(0.5); h1b->SetMarkerSize(0.5);
50 h1a->SetMarkerStyle(4); h1b->SetMarkerStyle(8);
51 sprintf(title,
"zdc cent %d (%d-%d %)",
52 h2a->GetXaxis()->GetBinCenter(i),zdcMin[i-1],zdcMax[i-1]);
53 h1a->SetTitle(title); SetRange(h1a->GetXaxis(),1.5,6);
55 h1a->Draw(); h1b->Draw(
"same");
56 printHighPtYield(h1a,h1b);
58 Print(&c1,psDir,
"yieldPtZdcSlices");
60 gStyle->SetOptLogy(1); gStyle->SetOptStat(0);
61 sprintf(name,
"raw pt yield, flow slices (cut %d)",cut);
62 Divide(&c1,3,3,name,inName);
63 h2a=(TH2*)inRoot.Get(
"Plus.h2CentralityPtPr");
64 h2b=(TH2*)inRoot.Get(
"Minus.h2CentralityPtPr");
65 for(
int i=1; i<=nSlice; i++){
67 sprintf(name,
"flow%d%s",i,sPM[0]);
68 h1a=h2a->ProjectionY(name,i,i,
"e");
69 sprintf(name,
"flow%d%s",i,sPM[1]);
70 h1b=h2b->ProjectionY(name,i,i,
"e");
71 h1a->SetMarkerStyle(4); h1b->SetMarkerStyle(8);
72 h1a->SetMarkerSize(0.5); h1b->SetMarkerSize(0.5);
73 sprintf(title,
"flow cent %d",h2a->GetXaxis()->GetBinCenter(i));
74 h1a->SetTitle(title); SetRange(h1a->GetXaxis(),1.5,6);
76 h1a->Draw(); h1b->Draw(
"same");
77 printHighPtYield(h1a,h1b);
79 Print(&c1,psDir,
"yieldPtFlowSlices");
82 void printHighPtYield(TH1* ha,TH1* hb)
84 char buf[20]; TH1* h[2]; h[0]=ha; h[1]=hb;
85 int minBin[2],maxBin[2],count(0);
87 float ptBins[]={4,4.5,5,5.5};
89 TText* text =
new TText;
91 for(
int iBin=0;iBin<nBin;iBin++){
93 for(
int i=0; i<2; i++){
95 minBin[i] = h[i]->GetXaxis()->FindBin(ptBins[iBin]);
96 maxBin[i] = h[i]->GetXaxis()->FindBin(ptBins[iBin]);
97 float integral=h[i]->Integral(minBin[i],maxBin[i]);
100 min=h[i]->GetXaxis()->GetBinLowEdge(minBin[i]);
101 max=h[i]->GetXaxis()->GetBinUpEdge(maxBin[i]);
104 sprintf(buf,
"%.1f<pt<%.1f=%d",min,max,count);
105 text->DrawTextNDC(0.55,0.8-iBin*0.1,buf);