Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Corryvreckan
Corryvreckan
Commits
8d67d6d0
Commit
8d67d6d0
authored
Nov 14, 2017
by
Simon Spannagel
Browse files
TPX3reader: go back to read "SPDR" as int and compare directly. No mess with char arrays
parent
a153471c
Pipeline
#238189
failed with stages
in 1 minute and 37 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/algorithms/Timepix3EventLoader/Timepix3EventLoader.cpp
View file @
8d67d6d0
...
...
@@ -145,13 +145,12 @@ void Timepix3EventLoader::initialise() {
LOG
(
DEBUG
)
<<
"Opened data file for "
<<
detectorID
<<
": "
<<
filename
;
// The header is repeated in every new data file, thus skip it for all.
char
buffer
[
4
]
;
if
(
!
new_file
->
read
(
reinterpret_cast
<
char
*>
(
&
buffer
),
sizeof
4
))
{
uint32_t
headerID
;
if
(
!
new_file
->
read
(
reinterpret_cast
<
char
*>
(
&
headerID
),
sizeof
headerID
))
{
throw
AlgorithmError
(
"Cannot read header ID for "
+
detectorID
+
" in file "
+
filename
);
}
std
::
string
headerID
(
buffer
);
if
(
headerID
!=
"SPDR"
)
{
throw
AlgorithmError
(
"Incorrect header ID for "
+
detectorID
+
" in file "
+
filename
+
": "
+
headerID
);
if
(
headerID
!=
1380208723
)
{
throw
AlgorithmError
(
"Incorrect header ID for "
+
detectorID
+
" in file "
+
filename
+
": "
+
std
::
to_string
(
headerID
));
}
LOG
(
TRACE
)
<<
"Header ID:
\"
"
<<
headerID
<<
"
\"
"
;
...
...
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