EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HelloService.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file HelloService.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 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 "HelloService.hpp"
10 
12 
13 namespace ActsExamples {
14 
16  : BareService("HelloService", level), m_cfg(cfg) {}
17 
19  // nothing to do for this example service.
20  // in a real service this is would be a good place to run costly one-time
21  // initialization.
22 }
23 
25  // integer division should round down
26  std::size_t blockIndex = ctx.eventNumber / m_cfg.eventsPerBlock;
27  // add block index to the event store
28  ctx.eventStore.add(m_cfg.blockIndexName, std::move(blockIndex));
29 }
30 
31 } // namespace ActsExamples