00001 plBprsSlope(int id0=1, int page=2 ) {
00002 gStyle->SetOptStat(1110);
00003 gStyle->SetOptFit(1);
00004 gStyle->SetPalette(1,0);
00005
00006 char *fnameO="calib-nov-21-2008/barrelMipSpectV6ok.hist.root";
00007 fd=new TFile(fnameO); assert(fd->IsOpen());
00008 printf("Read %s\n", fd->GetName());
00009
00010
00011
00012 switch(page) {
00013 case 1:
00014 {
00015 c=new TCanvas("aa","aa",1000,600); c->Divide(5,4);
00016 int k=1;
00017 for(int box=1; box<=4; box++)
00018 for(int pmt=1;pmt<=5;pmt++)
00019 { char tt[100];
00020 sprintf(tt,"gainBPM%d_%d",box,pmt);
00021
00022 TH1F *h=fd->Get(tt);
00023 if(h==0) { printf("missing=%s \n",tt); k++; continue;}
00024 c->cd(k);
00025 h->Draw(); h->SetMaximum(10);
00026 k++;
00027 }
00028
00029 } break;
00030
00031
00032 case 2:
00033 { gStyle->SetOptStat(0);
00034 int id1=id0, id2=id1+100;
00035 char tt[100];
00036 sprintf(tt,"BPRS softID [%d,%d]",id1,id2);
00037 TH2F *h2Cr=new TH2F("aa5","BPRS comparison (both axis); slope (raw) ; average MIP (fit)",20,-0.15,-0.015,20,0,40);
00038 h2Cr->SetTitle(tt);
00039 c=new TCanvas(tt,tt,450,350);
00040 h2Cr->Draw("box"); gPad->SetGrid();
00041 for(int id=id1;id<=id2;id++) {
00042 sprintf(tt,"bprs%da",id);
00043 TH1F *h=(TH1F *)fd->Get(tt);
00044 if(h==0) { printf("missing=%s \n",tt);continue;}
00045 TF1 *ffS=h->GetFunction("expo");
00046 if(ffS==0) continue;
00047 float slope=ffS->GetParameter(1);
00048
00049 sprintf(tt,"bprs%dm",id);
00050 h=(TH1F *)fd->Get(tt);
00051 if(h==0) { printf("missing=%s \n",tt);continue;}
00052 ffS=h->GetFunction("gaus");
00053 if(ffS==0) continue;
00054 float mean=ffS->GetParameter(1);
00055
00056 printf("id=%d sl=%f mean=%f\n",id,slope,mean);
00057
00058 h2Cr->Fill(slope,mean);
00059 }
00060
00061 } break;
00062
00063
00064 default:
00065 }
00066 }
00067