C
83
trim c
Guest on 26th June 2022 03:55:39 AM
void trim() {
gROOT->SetStyle("Plain");
TCanvas *c1;
c1=new TCanvas("c1","Canvas",600,600);
const unsigned ne(16);
double e[ne]={ 3.9, 10.5, 16.6, 23.3, 33.8, 41.4, 47.7, 55.8,
63.9, 72.2, 80.2, 90.0,105.3,117.7,129.7,145.2};
TF1 *func=new TF1("func","sqrt([0]*[0]+[1]*[1]*x*x)",0.0,2.0);
func->SetParameters(0.01,0.2);
TGraph *tg;
tg=new TGraph(ne);
tg->SetTitle(";Trim value;Pedestal (DTU)");
for(int j(0);j<(int)ne;j++) {
tg->SetPoint(j,j,e[j]);
}
tg->SetMarkerStyle(20);
tg->SetMarkerSize(1.5);
tg->SetMarkerColor(2);
tg->SetLineColor(2);
tg->Fit("pol2");
tg->GetFunction("pol2")->SetLineColor(2);
//tg->GetYaxis()->SetRangeUser(0,15);
tg->GetXaxis()->SetRangeUser(0,15);
tg->GetYaxis()->SetTitleOffset(1.3);
tg->Draw("AP");
c1->Update();
c1->Print("../trim.png");
}