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
1e3c4ce1
Commit
1e3c4ce1
authored
Mar 12, 2021
by
Keerthi Nakkalil
Browse files
Trim dac scan for all 16 values with the legend displayed
parent
f89dde2b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Trim_dac_scan/trimdac_scan.cpp
View file @
1e3c4ce1
...
...
@@ -20,8 +20,8 @@ void trimdac_scan(){
};
std
::
vector
<
int
>
colors
=
{
kTeal
+
3
,
kPink
-
3
,
kOrange
+
8
,
kRed
+
4
,
kCyan
+
2
,
kMagenta
+
1
,
kGreen
-
3
,
kPink
-
6
,
kBlue
+
3
,
kYellow
+
3
,
kPink
+
2
,
kBlue
-
6
,
kRed
-
1
,
kYellow
-
5
,
kRed
-
8
,
kAzure
};
double
data
;
TCanvas
*
c1
=
new
TCanvas
();
THStack
*
hs
=
new
THStack
(
"hs"
,
"Trim dac scan"
);
TCanvas
*
c1
=
new
TCanvas
(
"c1"
);
for
(
int
ctr
=
0
;
ctr
<
16
;
ctr
++
){
std
::
ifstream
datafile
(
filenames
.
at
(
ctr
).
c_str
());
...
...
@@ -37,6 +37,7 @@ void trimdac_scan(){
// cout<<data<<std::endl;
h1
->
Fill
(
data
);
}
h1
->
SetStats
(
0
);
h1
->
SetLineColor
(
colors
.
at
(
ctr
));
histo
.
push_back
(
h1
);
cout
<<
filenames
.
at
(
ctr
)
<<
"histogram is filled..."
<<
std
::
endl
;
...
...
@@ -51,9 +52,23 @@ void trimdac_scan(){
cout
<<
"stacking"
<<
histo
.
at
(
i
)
<<
std
::
endl
;
hs
->
Add
(
histo
.
at
(
i
),
"sames"
);
}
hs
->
Draw
(
"hist nostack"
);
hs
->
GetXaxis
()
->
SetTitle
(
"Threshold [LSB]"
);
hs
->
GetYaxis
()
->
SetTitle
(
" #pixels"
);
hs
->
GetXaxis
()
->
SetTitle
(
"Threshold[LSB]"
);
hs
->
GetYaxis
()
->
SetTitle
(
"# pixels"
);
hs
->
GetXaxis
()
->
SetLabelOffset
(
0.02
);
hs
->
GetXaxis
()
->
SetTitleOffset
(
1.4
);
// hs->GetYaxis()->SetLabelOffset(0.01);
hs
->
GetYaxis
()
->
SetTitleOffset
(
1.4
);
gPad
->
Update
();
TLegend
*
leg
=
new
TLegend
(
0.7
,
0.7
,
0.9
,
0.9
);
for
(
int
k
=
0
;
k
<
histo
.
size
();
k
++
){
leg
->
AddEntry
(
histo
.
at
(
k
),
filenames
.
at
(
k
).
c_str
(),
"l"
);
}
leg
->
Draw
(
"SAME"
);
cout
<<
"Done.."
<<
std
::
endl
;
}
...
...
@@ -64,3 +79,5 @@ void trimdac_scan(){
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