Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TrackParametersPrinter.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TrackParametersPrinter.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2020 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 
10 
15 
16 #include <cstddef>
17 #include <ostream>
18 #include <stdexcept>
19 #include <vector>
20 
23  : IAlgorithm("TrackParametersPrinter", level), m_cfg(cfg) {
24  if (m_cfg.inputTrackParameters.empty()) {
25  throw std::invalid_argument(
26  "Input track parameters collection is not configured");
27  }
28 
30 }
31 
33  const ActsExamples::AlgorithmContext& ctx) const {
34  const auto& trackParameters = m_inputTrackParameters(ctx);
35 
36  ACTS_INFO("event " << ctx.eventNumber << " collection '"
37  << m_cfg.inputTrackParameters << "' contains "
38  << trackParameters.size() << " track parameters");
39  std::size_t i = 0;
40  for (const auto& params : trackParameters) {
41  ACTS_INFO(" track " << i++ << "\n" << params);
42  }
43  return ProcessCode::SUCCESS;
44 }