Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Corryvreckan
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Fabian Simon Lex
Corryvreckan
Commits
f516c970
Commit
f516c970
authored
1 year ago
by
Fabian Simon Lex
Browse files
Options
Downloads
Patches
Plain Diff
Changed naming of member variables according to manual
parent
19e3673d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/modules/EventLoaderALiBaVa/EventLoaderALiBaVa.cpp
+25
-25
25 additions, 25 deletions
src/modules/EventLoaderALiBaVa/EventLoaderALiBaVa.cpp
src/modules/EventLoaderALiBaVa/EventLoaderALiBaVa.h
+4
-4
4 additions, 4 deletions
src/modules/EventLoaderALiBaVa/EventLoaderALiBaVa.h
with
29 additions
and
29 deletions
src/modules/EventLoaderALiBaVa/EventLoaderALiBaVa.cpp
+
25
−
25
View file @
f516c970
...
...
@@ -42,8 +42,8 @@ void EventLoaderALiBaVa::initialize() {
double
timecut_low
=
config_
.
get
<
double
>
(
"timecut_low"
);
double
timecut_up
=
config_
.
get
<
double
>
(
"timecut_up"
);
int
ignore_events
=
config_
.
get
<
int
>
(
"ignore_events"
);
m
_calibration_
constant
=
config_
.
get
<
double
>
(
"calibration_constant"
);
m_
chargecut
=
config_
.
get
<
double
>
(
"chargecut"
);
charge
_calibration_
=
config_
.
get
<
double
>
(
"calibration_constant"
);
chargecut
_
=
config_
.
get
<
double
>
(
"chargecut"
);
int
polarity
=
config_
.
get
<
int
>
(
"polarity"
);
// Check if input directory exists
...
...
@@ -105,29 +105,29 @@ void EventLoaderALiBaVa::initialize() {
"noiseCorrect2D"
,
"Corrected Noise in 2D; # columns; # rows; Pedestal[ADC]"
,
256
,
-
0.5
,
255.5
,
1
,
-
0.5
,
0.5
);
// Create a shared pointer with the data file.
m_
alibava
.
reset
(
DataFileRoot
::
OpenFile
(
datafilename
.
c_str
()));
alibava
_
.
reset
(
DataFileRoot
::
OpenFile
(
datafilename
.
c_str
()));
// Find all non masked channels from the detector config and put them into a vector
for
(
unsigned
int
col
=
0
;
col
<
256
;
col
++
)
{
if
(
!
detector_
->
masked
(
static_cast
<
int
>
(
col
),
0
))
{
m_
roi_ch
.
push_back
(
col
);
roi_ch
_
.
push_back
(
col
);
}
}
// Set the region of interest
m_
alibava
->
set_ROI
(
m_
roi_ch
);
alibava
_
->
set_ROI
(
roi_ch
_
);
// Set the polarity of the signal
m_
alibava
->
set_polarity
(
polarity
);
alibava
_
->
set_polarity
(
polarity
);
// Create a pointer with the pedestal file
DataFileRoot
*
PedestalPointer
=
DataFileRoot
::
OpenFile
(
pedestalfilename
.
c_str
());
PedestalPointer
->
set_ROI
(
m_
roi_ch
);
PedestalPointer
->
set_ROI
(
roi_ch
_
);
// Calculate the pedestals, and compute and apply the common mode noise correction
PedestalPointer
->
compute_pedestals_alternative
();
for
(
auto
chan
:
m_
roi_ch
)
{
for
(
auto
chan
:
roi_ch
_
)
{
double
ped_val
,
noise_val
;
ped_val
=
PedestalPointer
->
ped
(
chan
);
noise_val
=
PedestalPointer
->
noise
(
chan
);
...
...
@@ -136,7 +136,7 @@ void EventLoaderALiBaVa::initialize() {
}
PedestalPointer
->
compute_cmmd_alternative
();
for
(
auto
chan
:
m_
roi_ch
)
{
for
(
auto
chan
:
roi_ch
_
)
{
double
ped_val
,
noise_val
;
ped_val
=
PedestalPointer
->
ped
(
chan
);
noise_val
=
PedestalPointer
->
noise
(
chan
);
...
...
@@ -152,14 +152,14 @@ void EventLoaderALiBaVa::initialize() {
PedestalPointer
->
close
();
delete
PedestalPointer
;
// Load the calculated pedestal info into the original datafile
m_
alibava
->
load_pedestals
(
ped_f
.
c_str
(),
kTRUE
);
alibava
_
->
load_pedestals
(
ped_f
.
c_str
(),
kTRUE
);
// Set the timecuts
m_
alibava
->
set_timecut
(
timecut_low
,
timecut_up
);
alibava
_
->
set_timecut
(
timecut_low
,
timecut_up
);
// Ignore the first X events to ensure synchronisation, default is X = 1 which ignores the first event.
for
(
int
ievt
=
0
;
ievt
<
ignore_events
;
ievt
++
)
{
m_
alibava
->
read_event
();
alibava
_
->
read_event
();
}
}
...
...
@@ -173,7 +173,7 @@ StatusCode EventLoaderALiBaVa::run(const std::shared_ptr<Clipboard>& clipboard)
// Read a data event from the ALiBaVa data file
// Give feedback according to return code
int
return_code
=
m_
alibava
->
read_event
();
int
return_code
=
alibava
_
->
read_event
();
if
(
return_code
==
1
)
{
LOG
(
DEBUG
)
<<
"Successfully read event from ALiBaVa file"
;
...
...
@@ -185,13 +185,13 @@ StatusCode EventLoaderALiBaVa::run(const std::shared_ptr<Clipboard>& clipboard)
}
// Calculate the common mode for the signal in this event
m_
alibava
->
calc_common_mode_signal
();
alibava
_
->
calc_common_mode_signal
();
// Process the opened data event, i.e. pedestal correction, common mode noise correction
m_
alibava
->
process_event
();
alibava
_
->
process_event
();
// This gets the TDC time from the event, allowing timecuts around the event peak
// The timecut is set in the ALiBaVa_loader() function.
double
TDCTime
=
m_
alibava
->
time
();
if
(
!
m_
alibava
->
valid_time
(
TDCTime
))
{
double
TDCTime
=
alibava
_
->
time
();
if
(
!
alibava
_
->
valid_time
(
TDCTime
))
{
LOG
(
DEBUG
)
<<
"Event time of "
<<
TDCTime
<<
" ns outside of timecut limits; ignoring event"
;
return
StatusCode
::
DeadTime
;
}
...
...
@@ -209,10 +209,10 @@ StatusCode EventLoaderALiBaVa::run(const std::shared_ptr<Clipboard>& clipboard)
double
max_signal
=
0
;
// This loops over the channels in the current ALiBaVa event
for
(
auto
chan
:
m_
roi_ch
)
{
double
ADCSignal
=
m_
alibava
->
ADC_signal
(
chan
);
double
SNRatio
=
m_
alibava
->
sn
(
chan
);
double
CalSignal
=
ADCSignal
*
m
_calibration_
constant
;
for
(
auto
chan
:
roi_ch
_
)
{
double
ADCSignal
=
alibava
_
->
ADC_signal
(
chan
);
double
SNRatio
=
alibava
_
->
sn
(
chan
);
double
CalSignal
=
ADCSignal
*
charge
_calibration_
;
if
(
ADCSignal
>
max_signal
)
{
max_signal
=
ADCSignal
;
...
...
@@ -220,7 +220,7 @@ StatusCode EventLoaderALiBaVa::run(const std::shared_ptr<Clipboard>& clipboard)
// The chargecut is applied here
// Not needed anymore but left in for now, other wise stuff explodes in Correlation
if
(
CalSignal
>
m_
chargecut
)
{
if
(
CalSignal
>
chargecut
_
)
{
// Create a pixel for every channel in this event with all the information and put it in the vector.
// The value in the pixel reserved for the ADC value is used for the S/N ratio multiplied by 100000.
...
...
@@ -249,7 +249,7 @@ StatusCode EventLoaderALiBaVa::run(const std::shared_ptr<Clipboard>& clipboard)
}
void
EventLoaderALiBaVa
::
finalize
(
const
std
::
shared_ptr
<
ReadonlyClipboard
>&
)
{
m_
alibava
->
close
();
// delete
m_
alibava;
m_
alibava
.
reset
();
alibava
_
->
close
();
// delete alibava
_
;
alibava
_
.
reset
();
}
This diff is collapsed.
Click to expand it.
src/modules/EventLoaderALiBaVa/EventLoaderALiBaVa.h
+
4
−
4
View file @
f516c970
...
...
@@ -48,7 +48,7 @@ namespace corryvreckan {
private:
std
::
shared_ptr
<
Detector
>
detector_
;
std
::
shared_ptr
<
DataFileRoot
>
m_
alibava
;
std
::
shared_ptr
<
DataFileRoot
>
alibava
_
;
TH1F
*
hChargeSignal
{};
TH1F
*
hADCSignal
{};
...
...
@@ -61,9 +61,9 @@ namespace corryvreckan {
TH2F
*
hPedestalCorrect2D
{};
TH2F
*
hNoiseCorrect2D
{};
double
m_
chargecut
{};
double
m
_calibration_
constant
{};
std
::
vector
<
unsigned
int
>
m_
roi_ch
{};
double
chargecut
_
{};
double
charge
_calibration_
{};
std
::
vector
<
unsigned
int
>
roi_ch
_
{};
};
}
// namespace corryvreckan
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment