Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sds
HEP
HEPnOS
Commits
b504b7d1
Commit
b504b7d1
authored
Mar 17, 2020
by
Matthieu Dorier
Browse files
corrected examples
parent
e325416c
Changes
2
Show whitespace changes
Inline
Side-by-side
examples/07_events_from_dataset/main.cpp
View file @
b504b7d1
...
...
@@ -19,6 +19,7 @@ int main(int argc, char** argv) {
// Create a DataSet
DataSet
example7
=
root
.
createDataSet
(
"example7"
);
// Create 5 Runs with 5 SubRuns with 5 Events
std
::
cout
<<
"Creating Runs, SubRuns, and Events"
<<
std
::
endl
;
for
(
unsigned
i
=
0
;
i
<
5
;
i
++
)
{
auto
run
=
example7
.
createRun
(
i
);
for
(
unsigned
j
=
0
;
j
<
5
;
j
++
)
{
...
...
@@ -29,6 +30,7 @@ int main(int argc, char** argv) {
}
}
// Iterate over the events directly from the example7 DataSet
std
::
cout
<<
"Iterating over all Events"
<<
std
::
endl
;
for
(
auto
&
event
:
example7
.
events
())
{
SubRun
subrun
=
event
.
subrun
();
Run
run
=
subrun
.
run
();
...
...
@@ -38,9 +40,11 @@ int main(int argc, char** argv) {
<<
std
::
endl
;
}
// Iterate target by target
std
::
cout
<<
"Iterating over all Events target by target"
<<
std
::
endl
;
unsigned
numTargets
=
datastore
.
numTargets
(
ItemType
::
EVENT
);
for
(
unsigned
target
=
0
;
target
<
numTargets
;
target
++
)
{
for
(
auto
&
event
:
example7
.
events
())
{
std
::
cout
<<
"Target "
<<
target
<<
std
::
endl
;
for
(
auto
&
event
:
example7
.
events
(
target
))
{
SubRun
subrun
=
event
.
subrun
();
Run
run
=
subrun
.
run
();
std
::
cout
<<
"Run "
<<
run
.
number
()
...
...
examples/13_async/main.cpp
View file @
b504b7d1
...
...
@@ -34,7 +34,7 @@ int main(int argc, char** argv) {
std
::
string
configFile
(
argv
[
1
]);
DataStore
datastore
=
DataStore
::
connect
(
configFile
);
DataStore
datastore
=
DataStore
::
connect
(
configFile
,
true
);
// Get the root of the DataStore
DataSet
root
=
datastore
.
root
();
// Create a DataSet
...
...
Write
Preview
Markdown
is supported
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