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
a228fd1b
Commit
a228fd1b
authored
Aug 25, 2016
by
CLICdp user
Browse files
added compatibility with linux for stod
Former-commit-id: 6f64516a4949bbc66b27c4fa2987eca025f7332b
parent
0ed3e94d
Changes
2
Hide whitespace changes
Inline
Side-by-side
branches/trunk/algorithms/Timepix1EventLoader.C
View file @
a228fd1b
...
...
@@ -13,8 +13,18 @@ Timepix1EventLoader::Timepix1EventLoader(bool debugging)
bool
sortByTime
(
string
filename1
,
string
filename2
){
double
filetime1
=
stod
(
filename1
.
substr
(
filename1
.
length
()
-
13
,
9
));
double
filetime2
=
stod
(
filename2
.
substr
(
filename2
.
length
()
-
13
,
9
));
//double filetime1 = stod(filename1.substr(filename1.length()-13,9));
//double filetime2 = stod(filename2.substr(filename2.length()-13,9));
string
timestring1
=
filename1
.
substr
(
filename1
.
length
()
-
13
,
9
);
string
timestring2
=
filename2
.
substr
(
filename2
.
length
()
-
13
,
9
);
std
::
istringstream
timestream1
(
timestring1
);
std
::
istringstream
timestream2
(
timestring2
);
double
filetime1
,
filetime2
;
timestream1
>>
filetime1
;
timestream2
>>
filetime2
;
return
(
filetime1
<
filetime2
);
}
...
...
@@ -171,7 +181,12 @@ StatusCode Timepix1EventLoader::run(Clipboard* clipboard){
}
void
Timepix1EventLoader
::
processHeader
(
string
header
,
string
&
device
,
long
long
int
&
time
){
time
=
stod
(
header
.
substr
(
header
.
find
(
"Start time : "
)
+
13
,
13
));
//time = stod(header.substr(header.find("Start time : ")+13,13));
string
timestring
=
header
.
substr
(
header
.
find
(
"Start time : "
)
+
13
,
13
);
std
::
istringstream
timestream
(
timestring
);
timestream
>>
time
;
device
=
header
.
substr
(
header
.
find
(
"ChipboardID : "
)
+
14
,
header
.
find
(
" # DACs"
)
-
(
header
.
find
(
"ChipboardID : "
)
+
14
));
}
...
...
branches/trunk/algorithms/Timepix1EventLoader.h
View file @
a228fd1b
...
...
@@ -8,6 +8,7 @@
#include "TCanvas.h"
#include <sstream>
#include <fstream>
#include <string>
class
Timepix1EventLoader
:
public
Algorithm
{
...
...
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