1 #include "commonmacro/histutil.h"
2 #include "commonmacro/common.h"
4 void resPtVdcaXYGl(
const char* inName=
"test.hist.root",
5 const char* psDir=
"ps",
7 const char* outDir =
"",
12 cout <<
"--------------------------" << endl;
13 cout <<
"in name=" << inName << endl
14 <<
"ps dir=" << psDir << endl
15 <<
"cut=" << cut << endl;
16 cout <<
"--------------------------" << endl;
18 inRoot =
new TFile(inName);
21 cout <<
"cannot find the infile" << endl;
25 TCanvas c1(
"c1",
"c1",400,500);
27 float ptary[] = {1.5,2,3,4,6};
32 "h3ResPtPrGlPtPrDcaXYGl",
"h3ResPtPrGlPtGlDcaXYGl",
35 TH3* h3; TH2* h2; TH1* h1; TProfile* p;
36 gStyle->SetOptStat(0);
38 for(
int ib=0; ib<nBase; ib++){
39 h3=(TH3*)inRoot.Get(base[ib]);
40 cout << base[ib] << endl;
if(!h3)
return;
45 sprintf(title,
"%s vs dcaXYGl %s slices (cut %d)",
46 h3->GetXaxis()->GetTitle(),h3->GetYaxis()->GetTitle(),cut);
47 Divide(&c1,2,2,title,inName);
48 for(
int ipt=0;ipt<nPt;ipt++){
50 h2=HistSlice(h3,name,
"",0,ptary[ipt],ptary[ipt+1],
"xz");
53 sName=base[ib];getSub(sName);
54 sprintf(title,
"%sVdcaXY%sSlices",sName.Data(),
55 h3->GetYaxis()->GetTitle());
56 Print(&c1,psDir,title);
63 sprintf(title,
"mean %s va dcaXYGl %s slices (cut %d)",
64 h3->GetXaxis()->GetTitle(),h3->GetYaxis()->GetTitle(),cut);
65 Divide(&c1,2,2,title,inName);
66 for(
int ipt=0;ipt<nPt;ipt++){
69 p=Profile(h3,base[ib],
"",0,ptary[ipt],ptary[ipt+1],
"xz",
"x");
70 SetMinMax(p,-0.4,0.4); SetRange(p->GetXaxis(),-1,1);
71 p->Draw(); gPad->SetGridx(); gPad->SetGridy();
73 sName=base[ib];getSub(sName);
74 sprintf(title,
"mean%sVdcaXY%sSlices",sName.Data(),
75 h3->GetYaxis()->GetTitle());
76 Print(&c1,psDir,title);
80 sprintf(title,
"rms %s va dcaXYGl %s slices (cut %d)",
81 h3->GetXaxis()->GetTitle(),h3->GetYaxis()->GetTitle(),cut);
82 Divide(&c1,2,2,title,inName);
83 for(
int ipt=0;ipt<nPt;ipt++){
85 h1=Rms(h3,base[ib],
"",0,ptary[ipt],ptary[ipt+1],
"xz",
"x");
86 h1->SetMarkerStyle(8);
87 SetMinMax(h1,0,0.5); SetRange(h1->GetXaxis(),-0.8,0.8);
90 sName=base[ib];getSub(sName);
91 sprintf(title,
"rms%sVdcaXY%sSlices",sName.Data(),
92 h3->GetYaxis()->GetTitle());
93 Print(&c1,psDir,title);
98 void getSub(TString& ss){
99 ss.Replace(ss.First(
"D")-4,ss.Length(),
"");
100 ss.ReplaceAll(
"h3",
"");