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
387f13ed
Commit
387f13ed
authored
Mar 13, 2021
by
Keerthi Nakkalil
Browse files
The noise edge positions for each trim dac setting is plotted in a separate pad
parent
1e3c4ce1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Trim_dac_scan/trimdacs.cpp
0 → 100644
View file @
387f13ed
void
trimdacs
(){
std
::
vector
<
std
::
string
>
filenames
=
{
std
::
string
(
"dacs0x0_bl_thr.dat"
),
std
::
string
(
"dacs0x1_bl_thr.dat"
),
std
::
string
(
"dacs0x2_bl_thr.dat"
),
std
::
string
(
"dacs0x3_bl_thr.dat"
),
std
::
string
(
"dacs0x4_bl_thr.dat"
),
std
::
string
(
"dacs0x5_bl_thr.dat"
),
std
::
string
(
"dacs0x6_bl_thr.dat"
),
std
::
string
(
"dacs0x7_bl_thr.dat"
),
std
::
string
(
"dacs0x8_bl_thr.dat"
),
std
::
string
(
"dacs0x9_bl_thr.dat"
),
std
::
string
(
"dacs0xA_bl_thr.dat"
),
std
::
string
(
"dacs0xB_bl_thr.dat"
),
std
::
string
(
"dacs0xC_bl_thr.dat"
),
std
::
string
(
"dacs0xD_bl_thr.dat"
),
std
::
string
(
"dacs0xE_bl_thr.dat"
),
std
::
string
(
"dacs0xF_bl_thr.dat"
)
};
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
};
std
::
vector
<
TH1D
*>
histo
;
for
(
int
ctr
=
0
;
ctr
<
16
;
ctr
++
){
std
::
ifstream
datafile
(
filenames
.
at
(
ctr
).
c_str
());
std
::
string
histo_name
=
"h"
+
filenames
.
at
(
ctr
);
TH1D
*
h1
=
new
TH1D
(
histo_name
.
c_str
(),
filenames
.
at
(
ctr
).
c_str
(),
175
,
950
,
1300
);
if
(
datafile
.
is_open
()){
cout
<<
" The data file "
<<
filenames
.
at
(
ctr
)
<<
" is opened ..."
<<
std
::
endl
;
while
(
!
datafile
.
eof
()){
double
data
;
datafile
>>
data
;
h1
->
Fill
(
data
);
}
gStyle
->
SetOptStat
(
1100
);
//mean and std dev displayed
h1
->
SetLineColor
(
colors
.
at
(
ctr
));
histo
.
push_back
(
h1
);
cout
<<
filenames
.
at
(
ctr
)
<<
"histogram is filled..."
<<
std
::
endl
;
}
}
cout
<<
"size of the histo vector is "
<<
histo
.
size
()
<<
std
::
endl
;
TCanvas
*
c1
=
new
TCanvas
(
"c1"
,
" "
,
1000
,
1000
);
c1
->
Divide
(
4
,
4
);
// TLegend *leg = new TLegend(0.7,0.7,0.9,0.9);
for
(
int
i
=
0
;
i
<
histo
.
size
();
i
++
){
c1
->
cd
(
i
+
1
);
histo
.
at
(
i
)
->
GetXaxis
()
->
SetTitle
(
"Threshold[LSB]"
);
histo
.
at
(
i
)
->
GetYaxis
()
->
SetTitle
(
"# pixels"
);
histo
.
at
(
i
)
->
GetXaxis
()
->
SetLabelOffset
(
0.02
);
histo
.
at
(
i
)
->
GetXaxis
()
->
SetTitleOffset
(
1.4
);
// hs->GetYaxis()->SetLabelOffset(0.01);
histo
.
at
(
i
)
->
GetYaxis
()
->
SetTitleOffset
(
1.4
);
gPad
->
Update
();
histo
.
at
(
i
)
->
Draw
();
// leg->AddEntry(histo.at(i),filenames.at(i).c_str(),"l");
// leg->Draw();
}
cout
<<
"Done..."
<<
std
::
endl
;
}
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