1 plBprsSlope(
int id0=1,
int page=2 ) {
2 gStyle->SetOptStat(1110);
4 gStyle->SetPalette(1,0);
6 char *fnameO=
"calib-nov-21-2008/barrelMipSpectV6ok.hist.root";
7 fd=
new TFile(fnameO); assert(fd->IsOpen());
8 printf(
"Read %s\n", fd->GetName());
15 c=
new TCanvas(
"aa",
"aa",1000,600); c->Divide(5,4);
17 for(
int box=1; box<=4; box++)
18 for(
int pmt=1;pmt<=5;pmt++)
20 sprintf(tt,
"gainBPM%d_%d",box,pmt);
23 if(h==0) { printf(
"missing=%s \n",tt); k++;
continue;}
25 h->Draw(); h->SetMaximum(10);
33 { gStyle->SetOptStat(0);
34 int id1=id0, id2=id1+100;
36 sprintf(tt,
"BPRS softID [%d,%d]",id1,id2);
37 TH2F *h2Cr=
new TH2F(
"aa5",
"BPRS comparison (both axis); slope (raw) ; average MIP (fit)",20,-0.15,-0.015,20,0,40);
39 c=
new TCanvas(tt,tt,450,350);
40 h2Cr->Draw(
"box"); gPad->SetGrid();
41 for(
int id=id1;
id<=id2;
id++) {
42 sprintf(tt,
"bprs%da",
id);
43 TH1F *h=(TH1F *)fd->Get(tt);
44 if(h==0) { printf(
"missing=%s \n",tt);
continue;}
45 TF1 *ffS=h->GetFunction(
"expo");
47 float slope=ffS->GetParameter(1);
49 sprintf(tt,
"bprs%dm",
id);
50 h=(TH1F *)fd->Get(tt);
51 if(h==0) { printf(
"missing=%s \n",tt);
continue;}
52 ffS=h->GetFunction(
"gaus");
54 float mean=ffS->GetParameter(1);
56 printf(
"id=%d sl=%f mean=%f\n",
id,slope,mean);
58 h2Cr->Fill(slope,mean);