7 const int nSec=8;
char *secL[nSec]={
"03V",
"04U",
"06V",
"07U",
"09V",
"10U",
"12V",
"01U"}; TString tit=
"smd-Layer-3";
char *fncN=
"pol4";
12 TString iPath=
"/star/u/wissink/cal2006/";
17 TString fname=iPath+
"smd"+secL[j]+
".hist.root";
18 fdA[j]=
new TFile(fname);
19 assert(fdA[j]->IsOpen());
23 fdG=
new TFile(
"/star/u/wissink/cal2006/iter5-pp/R7089008.hist.root");
24 assert(fdG->IsOpen());
28 h=
new TH1F(tit,tit+
" Average recon MIP energy from pair of strips; strip ID; MIP energy [MeV]",290,.5,290.5);
30 c=
new TCanvas(tit,tit,600,400);
36 gStyle->SetOptStat(0);
38 lg=
new TLegend(.2,.11,.35,.41);
40 TGraphErrors *grS=
new TGraphErrors;
41 grS->SetMarkerStyle(3);
45 TString grN=
"mpvN"; grN+=secL[j];
46 TGraphErrors *gr=(TGraphErrors *)fdA[j]->Get(grN);
49 Double_t* eyA=gr->GetEY();
50 Double_t* yA=gr->GetY();
51 Double_t* xA=gr->GetX();
54 if(fabs(yA[i]-1.3)>0.5)
continue;
55 if(fabs(eyA[i])>0.5)
continue;
57 grS->SetPoint(nS,xA[i],yA[i]);
58 grS->SetPointError(nS,0.,eyA[i]);
62 gr->SetMarkerStyle(24+j);
63 lg->AddEntry(gr,secL[j],
"lpe");
76 TF1* f=grS->GetFunction(fncN); assert(f);
79 f->SetRange(0.5,288.);
89 TString gnN=
"ug"; gnN+=secL[j];
90 TH1F * hg=( TH1F *)fdG->Get(gnN);
92 c3->cd(j+1); hg->Draw();
94 int ns=hg->GetNbinsX();
96 TString ogN=
"gains"; ogN+=secL[j]; ogN+=
"smd.dat";
97 FILE *fog=fopen(ogN.Data(),
"w"); assert(fog);
98 fprintf(fog,
"# absolute gains for SMD plain %s,\n# stripName, gain[ch/GeV], erGain=dumm, correction, old gain\n",secL[j]);
102 float g1=hg->GetBinContent(i);
103 float gc=goalMipEne/f->Eval(i);
107 fprintf(fog,
"%s%03d %8.1f 0.1 (corr= %.3f) old=%.1f \n",secL[j],i,g2,gc,g1);
128 const int nSec=2;
char *secL[nSec]={
"01U",
"01V"};
int symA[nSec]={26,28}; TString tit=
"SMD-L3";
131 TString iPath=
"/star/u/wissink/cal2006/";
135 for(j=0;j<nSec;j++) {
136 TString fname=iPath+
"smd"+secL[j]+
".hist.root";
137 fdA[j]=
new TFile(fname);
138 assert(fdA[j]->IsOpen());
143 h=
new TH1F(tit,tit+
" Average recon MIP energy from pair of strips; strip ID; MIP energy [MeV]",290,.5,290.5);
145 c=
new TCanvas(tit,tit,600,400);
151 gStyle->SetOptFit(0);
152 gStyle->SetOptStat(0);
154 lg=
new TLegend(.2,.15,.4,.45);
156 for(j=0;j<nSec;j++) {
158 TString grN=
"mpvN"; grN+=secL[j];
159 TGraphErrors *gr=(TGraphErrors *)fdA[j]->Get(grN);
162 gr->SetMarkerStyle(symA[j]);
163 gr->SetLineColor(col);
164 gr->SetMarkerColor(col);
169 TF1* f=gr->GetFunction(fncN); assert(f);
170 f->SetLineColor(col);
173 lg->AddEntry(gr,secL[j],
"lpe");