1 #include "commonmacro/common.h"
2 #include "common/Name.cc"
3 #include "commonmacro/histutil.h"
5 void compareFitPtsVeta(
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){
24 char* trigger = (strstr(inName,
"central")) ?
"central" :
"minbias";
25 sprintf(name,
"~/wrk/assoc/links/P01hi.central.HighpT_piminus_%d.hist/assoc_cut%d.hist.root",(
int)extraValue,cut);
28 cout <<
"Unknown embed file" << endl;
return;
32 if(strstr(inName,
"east")){ half=
"east"; }
33 if(strstr(inName,
"west")){ half=
"west"; }
35 embedRoot =
new TFile(name);
36 cout <<
"--------------------------" << endl;
37 cout <<
"in name=" << inName << endl
38 <<
"ps dir=" << psDir << endl
39 <<
"cut=" << cut << endl
40 <<
"embed name=" << name << endl
41 <<
"half = " << half << endl;
42 cout <<
"--------------------------" << endl;
45 cout <<
"cannot find the infile" << endl;
49 cout <<
"cannot find " << name << endl;
51 TH3* h3[2]; TH2* h2[2];
57 h3[0]=(TH3*)inRoot.Get(
"Minus.h3VtxZFitPtsEtaPr");
58 h3a=(TH3*)inRoot.Get(
"Plus.h3VtxZFitPtsEtaPr");
59 if(!h3a){cout <<
"cannot find h3a" << endl;
return; }
61 h3[1]=(TH3*)embedRoot.Get(
"Minus.h3VtxZFitPtsEtaPr");
62 h3a=(TH3*)embedRoot.Get(
"Plus.h3VtxZFitPtsEtaPr");
65 char* type[] = {
"real",
"mc"};
int npt=4;
67 char* opt[] = {
"p",
"psame"};
68 char* optp[] = {
"e",
"esame"};
69 char ctitle[100],cname[100];
71 TCanvas c1(
"c1",
"c1",400,500);
73 gStyle->SetOptStat(0);
78 float vtxAry[]= {-150,-125,-100,-75,-50,-25,0,25,50,75,100,125,150};
80 float etaAry[][2] = { { .1,.3 }, {.5,.7}, {-.3,-.1}, {-.7,-.5}};
86 for(
int iEta=0; iEta<nEta; iEta++){
89 sprintf(title,
"fitpts (range %d-45), vtx z slices (%.1f < eta < %.1f) (cut %d)",
90 fitPtsCut,etaAry[iEta][0],etaAry[iEta][1],cut);
91 Divide(&c1,3,4,title,inName);
94 for(
int iVtx=0;iVtx<nVtx; iVtx++){
96 for(
int i=0; i<2; i++){
97 h2[i]=(TH2*)HistSlice(h3[i],
"",
"",0,etaAry[iEta][0],etaAry[iEta][1],
"xy");
98 h1[i]=(TH1*)HistSlice(h2[i],
"",h2[i]->GetTitle(),0,
99 vtxAry[iVtx],vtxAry[iVtx+1],
"x");
100 SetRange(h1[i]->GetXaxis(),fitPtsCut,46);
101 if(h1[i]->Integral()) h1[i]->Scale(1./h1[i]->Integral());
102 h1[i]->SetMarkerSize(0.5); SetMinMax(h1[i],0.001,.12);
103 h1[i]->SetMarkerStyle(marker[i]); h1[i]->Draw(opt[i]);
104 PrintMeanRms(h1[i],0.1,0.8-.2*i,0.06);
107 sprintf(name,
"fitPtsVtxZSlicesEtaBin%d",iEta);
108 Print(&c1,psDir,name);
112 sprintf(title,
"mean fit pts (range %d-45) V vtx z (cut %d)",
114 Divide(&c1,2,2,title,inName);
116 for(
int iEta=0; iEta<nEta; iEta++){
117 c1.cd(iEta+1); gPad->SetGridx(); gPad->SetGridy();
118 TLegend* l=
new TLegend(0.1,0.1,0.3,0.2);
119 for(
int i=0; i<2; i++){
120 h2[i]=(TH2*)HistSlice(h3[i],
"",
"",0,etaAry[iEta][0],etaAry[iEta][1],
"xy",
"e");
121 p[i]=Profile(h2[i],
"",h2[i]->GetTitle(),0,fitPtsCut,46,
"y",
"e");
122 SetMinMax(p[i],30,40);
123 SetRange(p[i]->GetXaxis(),vtxAry[0],vtxAry[nVtx]);
124 p[i]->SetMarkerStyle(marker[i]); p[i]->Draw(optp[i]);
126 l->AddEntry(p[i],type[i],
"p");
131 sprintf(title,
"fitPtsMeanVz");
132 Print(&c1,psDir,title);