void fit1() {
here.
TCanvas *c1 = new TCanvas("c1_fit1","The Fit Canvas",200,10,700,500);
c1->SetGridx();
c1->SetGridy();
c1->GetFrame()->SetFillColor(21);
c1->GetFrame()->SetBorderMode(-1);
c1->GetFrame()->SetBorderSize(5);
gBenchmark->Start("fit1");
Filling histograms with random numbers from a function)
TString dir = gSystem->UnixPathName(gInterpreter->GetCurrentMacroName());
dir.ReplaceAll("fit1.C","");
dir.ReplaceAll("/./","/");
TFile *fill = TFile::Open("fillrandom.root");
if (!fill) {
gROOT->ProcessLine(Form(".x %s../hist/fillrandom.C",dir.Data()));
fill = TFile::Open("fillrandom.root");
if (!fill) return;
}
fill->ls();
sqroot->Print();
h1f->SetFillColor(45);
h1f->Fit("sqroot");
fitlabel = new TPaveText(0.6,0.3,0.9,0.80,"NDC");
fitlabel->SetTextAlign(12);
fitlabel->SetFillColor(42);
fitlabel->ReadFile(Form("%sfit1_C.C",dir.Data()));
fitlabel->Draw();
c1->Update();
gBenchmark->Show("fit1");
}
|
|