10 plSmdCal(TString hFile=
"R7089008"){
11 inPath=
"/star/u/wissink/cal2006/iter4-pp/";
13 f=
new TFile(inPath+hFile+
".hist.root");
15 gStyle->SetPalette(1,0);
21 plOne(
int sec=1,
float zMax=10.,
int sepSect=1) {
23 TString fname=
"sect01/sum-sect"; fname+=sec;
24 f=
new TFile(inPath+fname+
".hist.root");
27 printf(
"\n MIP yield for sector=%d --------------------\n",sec);
28 char name[100], title[500];
29 sprintf(name,
"mip%02d",sec);
30 cc=
new TCanvas(name,name,1000,700);
33 TPad *c1 =
new TPad(
"pad0",
"apd0",0.0,0.,.35,1.);
38 float x1[]={ -20, 40, 60, 40, -20, -80, -170, -220, -240, -220,-160, -80};
39 float y1[]={ 40, -20, -80, -160,-220,-250, -220, -160, -80, 0, 40, 60};
44 sprintf(name,
"xy%02d",sec);
45 if(i==0) sprintf(name,
"xy%02dm",sec);
47 TH2F* h=(TH2F *)f->Get(name); assert(h);
50 if(i==0) h->SetMaximum(zMax);
51 h->SetAxisRange(x1[is],x1[is]+180,
"X");
52 h->SetAxisRange(y1[is],y1[is]+180,
"Y");
56 c1 =
new TPad(
"pad0",
"apd0",0.35,0.,1.,1.);
63 int binL=5,binH=50;
int ped=20;
char cT=
'T';
66 sprintf(name,
"y%02d",sec);
67 sprintf(title,
"MIP yield per tower, sector=%d; tower ID=sub+eta*5, 1=A12,2=B12,3=C12,...6=A11,..,11=A10, 21=A8, 31=A6, 41=A4, 51=A2",sec);
68 TH1F * hy=
new TH1F(name,title,60,.5,60.5);
69 sprintf(name,
"m%02d",sec);
70 TH1F * hm=
new TH1F(name,
"MIP yiled / UxV yield ; tower ID=sub+eta*5, ....(as above)",60,.5,60.5); hm->SetMarkerStyle(20);
71 hm->SetMarkerColor(kRed);
72 hm->SetMinimum(-0.001);
76 sprintf(name,
"ca%02d",sec);
78 TH1F * huxv=(TH1F *)f->Get(name); assert(huxv);
81 for(eta=12;eta>=1;eta--)
82 for(sub=
'A';sub<=
'E';sub++) {
84 sprintf(name,
"e%02d%c%c%02d",sec,cT,sub,eta);
85 TH1F *h1=(TH1F *)f->Get(name); assert(h1);
87 float nMip=h1->Integral(binL+ped,binH+ped);
90 int iPhi=(sec-1)*5+sub-
'A';
91 int iSpir=iPhi+(eta-1)*60;
92 float nUxV=huxv->GetBinContent(iSpir+1);
94 if(nUxV>0) rat=nMip/nUxV;
96 printf(
"x=%2d %s iSpir=%3d nUxV=%d nMip=%d -->R=%.3f\n",ix,name,iSpir,nUxV,nMip,rat);
101 hm->SetBinContent(ix,rat);
102 hm->SetBinError(ix,sqrt(nMip)/nUxV);
109 hy->SetMinimum(-0.9);
110 hy->SetMarkerStyle(23);
117 sprintf(name,
"mip%02d.ps",sec); cc->Print(name);
121 pl2Dall(
float zMax=10.,
int bestMip=0,
int sepSect=1) {
123 char *tit=
"12secUxV";
124 if(bestMip) tit=
"12secMIP";
125 cc=
new TCanvas(tit,tit,600,630);
126 for(
int sec=1;sec<=12;sec++) {
129 if(sec<10) {TString fname=inPath+
"sect0"; fname+=sec; fname+=
"/sum-sect"; fname+=sec; fname+=
".hist.root";}
130 if(sec>9) {TString fname=inPath+
"sect"; fname+=sec; fname+=
"/sum-sect"; fname+=sec; fname+=
".hist.root";}
131 printf(
"read each sector from different input file=%s\n",fname.Data());
136 if(sec>1) opt+=
" same";
139 sprintf(txt,
"xy%02d",sec);
140 if(bestMip) sprintf(txt,
"xy%02dm",sec);
141 printf(
"=%s=%s\n",txt,opt.Data());
142 TH2F *h=(TH2F *)f->Get(txt);
146 h->SetTitle(
"MIP position, UxV & Tw & pre/post");
148 h->SetTitle(
"MIP position, only UxV");
153 float phi=(75-30*(sec-1))/180.*3.1416;
156 ln=
new TLine(x,y,5*x,5*y);
159 sprintf(txt,
"%02d",sec);
160 tx=
new TText(5*x,5*y,txt);
161 tx->Draw(); tx->SetTextSize(0.03);
171 for(i=1;i<=12;i++) plOne(i,30);