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
Naomi Davis
Corryvreckan
Commits
e15fc5bb
Commit
e15fc5bb
authored
2 years ago
by
Simon Spannagel
Browse files
Options
Downloads
Patches
Plain Diff
Formatting fixes
parent
0d13db61
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/modules/EventLoaderALiBaVa/EventLoaderALiBaVa.cpp
+26
-25
26 additions, 25 deletions
src/modules/EventLoaderALiBaVa/EventLoaderALiBaVa.cpp
with
26 additions
and
25 deletions
src/modules/EventLoaderALiBaVa/EventLoaderALiBaVa.cpp
+
26
−
25
View file @
e15fc5bb
...
@@ -45,32 +45,29 @@ void EventLoaderALiBaVa::initialize() {
...
@@ -45,32 +45,29 @@ void EventLoaderALiBaVa::initialize() {
m_chargecut
=
config_
.
get
<
double
>
(
"chargecut"
);
m_chargecut
=
config_
.
get
<
double
>
(
"chargecut"
);
int
polarity
=
config_
.
get
<
int
>
(
"polarity"
);
int
polarity
=
config_
.
get
<
int
>
(
"polarity"
);
// Check if input directory exists
// Check if input directory exists
std
::
filesystem
::
path
directory
=
input_directory
;
std
::
filesystem
::
path
directory
=
input_directory
;
if
(
!
std
::
filesystem
::
exists
(
directory
))
{
if
(
!
std
::
filesystem
::
exists
(
directory
))
{
throw
InvalidValueError
(
config_
,
"input_directory"
,
"The directory could not be found"
);
throw
InvalidValueError
(
config_
,
"input_directory"
,
"The directory could not be found"
);
}
}
std
::
string
datafilename
;
std
::
string
datafilename
;
std
::
string
pedestalfilename
;
std
::
string
pedestalfilename
;
// Read the run-files (data, pedestal and calibration) in the folder
// Read the run-files (data, pedestal and calibration) in the folder
for
(
auto
const
&
dir_entry
:
std
::
filesystem
::
directory_iterator
{
directory
})
for
(
auto
const
&
dir_entry
:
std
::
filesystem
::
directory_iterator
{
directory
})
{
{
std
::
string
entryName
=
dir_entry
.
path
();
std
::
string
entryName
=
dir_entry
.
path
();
if
(
entryName
.
find
(
std
::
to_string
(
run
)
+
".dat"
)
!=
std
::
string
::
npos
||
if
(
entryName
.
find
(
std
::
to_string
(
run
)
+
".dat"
)
!=
std
::
string
::
npos
||
entryName
.
find
(
"dat_run"
+
std
::
to_string
(
run
)
+
".hdf"
)
!=
std
::
string
::
npos
)
{
entryName
.
find
(
"dat_run"
+
std
::
to_string
(
run
)
+
".hdf"
)
!=
std
::
string
::
npos
)
{
datafilename
=
entryName
;
datafilename
=
entryName
;
}
}
if
(
entryName
.
find
(
std
::
to_string
(
run
)
+
".ped"
)
!=
std
::
string
::
npos
||
if
(
entryName
.
find
(
std
::
to_string
(
run
)
+
".ped"
)
!=
std
::
string
::
npos
||
entryName
.
find
(
"ped_run"
+
std
::
to_string
(
run
)
+
".hdf"
)
!=
std
::
string
::
npos
)
{
entryName
.
find
(
"ped_run"
+
std
::
to_string
(
run
)
+
".hdf"
)
!=
std
::
string
::
npos
)
{
pedestalfilename
=
entryName
;
pedestalfilename
=
entryName
;
}
}
}
}
// Log errors in case the files aren't found in the folder.
// Log errors in case the files aren't found in the folder.
// The datafile can also be supplied directly in the config.
// The datafile can also be supplied directly in the config.
if
(
datafilename
.
length
()
==
0
)
{
if
(
datafilename
.
length
()
==
0
)
{
...
@@ -97,28 +94,31 @@ void EventLoaderALiBaVa::initialize() {
...
@@ -97,28 +94,31 @@ void EventLoaderALiBaVa::initialize() {
hNoiseCorrect
=
new
TH1F
(
"noiseCorrect"
,
"Corrected Noise; # channel; Noise[ADC]"
,
256
,
-
0.5
,
255.5
);
hNoiseCorrect
=
new
TH1F
(
"noiseCorrect"
,
"Corrected Noise; # channel; Noise[ADC]"
,
256
,
-
0.5
,
255.5
);
hTimeProfile
=
new
TProfile
(
"timeProfile"
,
"Time profile; Time [ns], Ave. signal highest channel [ADC]"
,
35
,
0
,
35
,
0
,
200
);
hTimeProfile
=
new
TProfile
(
"timeProfile"
,
"Time profile; Time [ns], Ave. signal highest channel [ADC]"
,
35
,
0
,
35
,
0
,
200
);
hPedestalCorrect2D
=
new
TH2F
(
"pedestalCorrect2D"
,
"Corrected pedestal in 2D; # columns; # rows; Pedestal[ADC]"
,
256
,
-
0.5
,
255.5
,
1
,
-
0.5
,
0.5
);
hPedestalCorrect2D
=
new
TH2F
(
hNoiseCorrect2D
=
new
TH2F
(
"noiseCorrect2D"
,
"Corrected Noise in 2D; # columns; # rows; Pedestal[ADC]"
,
256
,
-
0.5
,
255.5
,
1
,
-
0.5
,
0.5
);
"pedestalCorrect2D"
,
"Corrected pedestal in 2D; # columns; # rows; Pedestal[ADC]"
,
256
,
-
0.5
,
255.5
,
1
,
-
0.5
,
0.5
);
hNoiseCorrect2D
=
new
TH2F
(
"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.
// Create a shared pointer with the data file.
m_alibava
.
reset
(
DataFileRoot
::
OpenFile
(
datafilename
.
c_str
()));
m_alibava
.
reset
(
DataFileRoot
::
OpenFile
(
datafilename
.
c_str
()));
// Find all non masked channels from the detector config and put them into a vector
// Find all non masked channels from the detector config and put them into a vector
for
(
int
col
=
0
;
col
<
256
;
col
++
){
for
(
unsigned
int
col
=
0
;
col
<
256
;
col
++
)
{
if
(
!
detector_
->
masked
(
col
,
0
)){
if
(
!
detector_
->
masked
(
static_cast
<
int
>
(
col
)
,
0
))
{
m_roi_ch
.
push_back
(
col
);
m_roi_ch
.
push_back
(
col
);
}
}
}
}
// Set the region of interest
// Set the region of interest
m_alibava
->
set_ROI
(
m_roi_ch
);
m_alibava
->
set_ROI
(
m_roi_ch
);
// Set the polarity of the signal
// Set the polarity of the signal
m_alibava
->
set_polarity
(
polarity
);
m_alibava
->
set_polarity
(
polarity
);
// Create a pointer with the pedestal file
// Create a pointer with the pedestal file
DataFileRoot
*
PedestalPointer
=
DataFileRoot
::
OpenFile
(
pedestalfilename
.
c_str
());
DataFileRoot
*
PedestalPointer
=
DataFileRoot
::
OpenFile
(
pedestalfilename
.
c_str
());
PedestalPointer
->
set_ROI
(
m_roi_ch
);
PedestalPointer
->
set_ROI
(
m_roi_ch
);
...
@@ -223,7 +223,8 @@ StatusCode EventLoaderALiBaVa::run(const std::shared_ptr<Clipboard>& clipboard)
...
@@ -223,7 +223,8 @@ StatusCode EventLoaderALiBaVa::run(const std::shared_ptr<Clipboard>& clipboard)
// Create a pixel for every channel in this event with all the information and put it in the vector.
// 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.
// The value in the pixel reserved for the ADC value is used for the S/N ratio multiplied by 100000.
std
::
shared_ptr
<
Pixel
>
pixel
=
std
::
make_shared
<
Pixel
>
(
detector_
->
getName
(),
chan
,
0
,
SNRatio
*
100000
,
CalSignal
,
trigger_ts
);
std
::
shared_ptr
<
Pixel
>
pixel
=
std
::
make_shared
<
Pixel
>
(
detector_
->
getName
(),
chan
,
0
,
SNRatio
*
100000
,
CalSignal
,
trigger_ts
);
pixels
.
push_back
(
pixel
);
pixels
.
push_back
(
pixel
);
...
...
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