Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Riccardo Longo
JZCaPA
Commits
bda8d19f
Commit
bda8d19f
authored
Apr 21, 2022
by
Chad Lantz
Browse files
Implemented ADC to mV conversion
parent
2cc74090
Changes
3
Hide whitespace changes
Inline
Side-by-side
Analysis/include/Containers.h
View file @
bda8d19f
...
...
@@ -62,6 +62,8 @@ class Channel {
bool
pos_polarity
;
/** Gain of the PMT for this channel */
float
gain
;
/** ADC to mV conversion factor */
double
adc_mV
;
/*
* Waveform storage
*/
...
...
Analysis/src/DataReader2021.cpp
View file @
bda8d19f
...
...
@@ -229,13 +229,16 @@ void DataReader2021::LoadConfigurationFile(std::string _inFile ){
m_XMLparser
->
getChildValue
(
"channel"
,
i
,
"is_pos_polarity"
,
buffer_ch
->
pos_polarity
);
m_XMLparser
->
getChildValue
(
"channel"
,
i
,
"is_on"
,
buffer_ch
->
is_on
);
m_XMLparser
->
getChildValue
(
"channel"
,
i
,
"Vop"
,
buffer_ch
->
Vop
);
m_XMLparser
->
getChildValue
(
"channel"
,
i
,
"adc_per_mv"
,
buffer_ch
->
adc_mV
);
//Get the voltage vs gain plot for this PMT. If it exists, set the gain value for the channel
TGraph
*
gainPlot
=
(
TGraph
*
)
gainFile
.
Get
(
buffer_ch
->
PMTcode
.
c_str
());
if
(
!
gainPlot
){
if
(
gainPlot
){
buffer_ch
->
gain
=
gainPlot
->
Eval
(
buffer_ch
->
HV
);
}
else
{
buffer_ch
->
gain
=
0
;
std
::
cout
<<
Form
(
"No gain plot found for %s row %d col %d"
,
buffer_ch
->
detector
.
c_str
(),
buffer_ch
->
mapping_row
,
buffer_ch
->
mapping_column
)
<<
std
::
endl
;
}
buffer_ch
->
gain
=
(
gainPlot
)
?
gainPlot
->
Eval
(
buffer_ch
->
HV
)
:
0
;
bool
isNew
(
true
);
for
(
int
k
=
0
;
k
<
channelEntries
.
size
();
k
++
){
...
...
Analysis/src/WFAnalysis.cpp
View file @
bda8d19f
...
...
@@ -211,7 +211,7 @@ void WFAnalysis::AnalyzeEvent( const std::vector< Channel* > vCh ){
//Get peak information from the waveform using the hit window
Ch
->
Peak_center
.
push_back
(
GetMaximumBin
(
hProcessed
,
Ch
->
hit_window
.
first
[
hit
],
Ch
->
hit_window
.
second
[
hit
]
)
);
Ch
->
Peak_max
.
push_back
(
hProcessed
->
GetBinContent
(
Ch
->
Peak_center
.
back
()
)
);
Ch
->
Peak_max
.
push_back
(
Ch
->
adc_mV
*
hProcessed
->
GetBinContent
(
Ch
->
Peak_center
.
back
()
)
);
Ch
->
Peak_time
.
push_back
(
Ch
->
pTimeVec
->
at
(
Ch
->
Peak_center
.
back
()
)
);
//Set the range of the fit function to just around the peak and feed it some starting parameters
...
...
@@ -602,7 +602,7 @@ double WFAnalysis::GetCharge( Channel* ch, int start, int end){
for
(
int
bin
=
start
;
bin
<
end
;
bin
++
){
//Charge for a given time bin = dt*I = (t(bin+1)-t(bin))*V/R
//Units are Charge(pC), time(ns), Voltage(mV), resistance(ohm), current(Amp = C/s)
charge
+=
(
ch
->
pTimeVec
->
at
(
bin
+
1
)
-
ch
->
pTimeVec
->
at
(
bin
))
*
ch
->
PWF_histo
->
GetBinContent
(
bin
)
/
Rin
;
charge
+=
(
ch
->
pTimeVec
->
at
(
bin
+
1
)
-
ch
->
pTimeVec
->
at
(
bin
))
*
ch
->
adc_mV
*
ch
->
PWF_histo
->
GetBinContent
(
bin
)
/
Rin
;
}
//end hit window
return
charge
;
}
//end GetCharge
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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