ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
HelloWhiteBoardAlgorithm.cpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file HelloWhiteBoardAlgorithm.cpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2017-2019 CERN for the benefit of the Acts project
4
//
5
// This Source Code Form is subject to the terms of the Mozilla Public
6
// License, v. 2.0. If a copy of the MPL was not distributed with this
7
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
9
#include "
HelloWhiteBoardAlgorithm.hpp
"
10
11
#include "
ACTFW/Framework/WhiteBoard.hpp
"
12
#include "
HelloData.hpp
"
13
14
FW::HelloWhiteBoardAlgorithm::HelloWhiteBoardAlgorithm
(
15
const
Config
& cfg,
Acts::Logging::Level
level)
16
: FW::
BareAlgorithm
(
"HelloWhiteBoard"
, level), m_cfg(cfg) {
17
// non-optional config settings must be checked on construction.
18
if
(
m_cfg
.
input
.empty()) {
19
throw
std::invalid_argument(
"Missing input collection"
);
20
}
21
if
(
m_cfg
.
output
.empty()) {
22
throw
std::invalid_argument(
"Missing output collection"
);
23
}
24
}
25
26
FW::ProcessCode
FW::HelloWhiteBoardAlgorithm::execute
(
27
const
FW::AlgorithmContext
& ctx)
const
{
28
// event-store is append-only and always returns a const reference.
29
ACTS_INFO
(
"Reading HelloDataCollection "
<< m_cfg.input);
30
const
auto
&
in
= ctx.
eventStore
.
get
<
HelloDataCollection
>(m_cfg.input);
31
ACTS_VERBOSE
(
"Read HelloDataCollection with size "
<<
in
.size());
32
33
// create a copy
34
HelloDataCollection
copy
(
in
);
35
36
// transfer the copy to the event store. this always transfers ownership
37
// via r-value reference/ move construction.
38
ACTS_INFO
(
"Writing HelloDataCollection "
<< m_cfg.output);
39
ctx.
eventStore
.
add
(m_cfg.output, std::move(copy));
40
41
return
FW::ProcessCode::SUCCESS
;
42
}
acts
blob
master
Examples
Run
HelloWorld
HelloWhiteBoardAlgorithm.cpp
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:24
using
1.8.2 with
ECCE GitHub integration