Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Keerthi Nakkalil
gain_measurement
Commits
ba5e38a5
Commit
ba5e38a5
authored
Dec 03, 2020
by
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
linear_fit.cpp
0 → 100644
View file @
ba5e38a5
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
();
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment