Commit ba5e38a5 authored by Keerthi Nakkalil's avatar Keerthi Nakkalil
Browse files

The mean values for the pixel 255_255 is stored in a text file and a linear fit is perforemd

parent 216fd1d5
void gain_4()
{
auto *injected_data = new TGraph("mean_values.txt");
auto *noise_data = new TGraph("noise_mean.txt");
injected_data->SetMarkerColor(4);
injected_data->SetMarkerStyle(20);
// Define Linear fit function
auto linear_fit = new TF1("linear_fit","[0]*x +[1]",0,300);
linear_fit->SetParNames("slope","offset");
linear_fit->SetParameter(0,2);
linear_fit->SetParameter(1,1200);
linear_fit->SetLineColor(2);
injected_data->Fit(linear_fit);
// gr->Draw("AP");
noise_data->SetMarkerColor(6);
noise_data->SetMarkerStyle(21);
TMultiGraph *g = new TMultiGraph();
g->Add(injected_data);
g->Add(noise_data);
g->Draw("AP");
g->GetXaxis()->SetTitle("Injected voltage");
g->GetYaxis()->SetTitle("Threshold");
TLegend *leg = new TLegend(0.2,0.2,0.4,0.4);
leg->SetBorderSize(0);
leg->AddEntry(injected_data,"Injected data","p");
leg->AddEntry(linear_fit,"linear fit","l");
leg->AddEntry(noise_data,"noise","p");
gStyle->SetOptFit();
// gStyle->SetBorderSize(0);
leg->Draw();
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment