4 fitSlope5(
char *core=
"08TD09") {
8 printf(
"core=%s, sect=%d eta=%d\n",core,sec,eta);
11 char *path=
"/star/data05/scratch/balewski/2005-eemcCal/day49-hist/iter2-out/";
13 sprintf(txt,
"%ssum-sect%d.hist.root",path,sec);
15 fdA=
new TFile(txt); assert(fdA->IsOpen());
19 printf(
"eta=%d x1=%d\n",eta,x1);
20 sprintf(txt,
"%s.slope",core);
23 fitOneSl(core,x1,x1+35);
30 void fitOneSl(
char *core,
float x1=20,
float x2=70){
32 c=
new TCanvas(core,core,600,700);
38 TString name=
"a"; name+=core;
39 TH1F *h=(TH1F*) fdA->Get(name); assert(h);
42 h->SetLineColor(kBlack+k);
43 h->SetAxisRange(-10.,100.);
44 if(strstr(core,core0.Data())) {
50 TH1F* h1=(TH1F*)h->Clone();
51 h->Fit(
"expo",
"R",
"",x1,x2);
52 TF1*ff=h->GetFunction(
"expo");
53 ff->SetLineColor(kBlack+k);
54 ff->SetLineColor(kRed);
56 float sl=ff->GetParameter(1);
57 float slEr=ff->GetParError(1);
58 fprintf(fdo,
"%s %.4f %.4f\n",name.Data()+1,sl,slEr);
63 if(!strstr(core,core0.Data())) h1->SetLineStyle(2);
64 printf(
"=%s=%s=%d\n",core,core0.Data(),strstr(core,core0.Data()));
65 if(k==0)h1->Draw();
else h1->Draw(
"same");