ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DebugOutputActor.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DebugOutputActor.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2018 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 #pragma once
10 
11 namespace Acts {
12 
17 
20  bool mute = false;
21 
25  struct this_result {
26  std::string debugString = "";
27  };
28 
30 
39  template <typename propagator_state_t, typename stepper_t>
40  void operator()(propagator_state_t& state, const stepper_t& /*unused*/,
41  result_type& result) const {
42  // move the debug output from the state to
43  // to the output actor if it is not set to mute
44  // only when the target is reached (or later otherwise triggered)
45  if (!mute &&
46  (state.navigation.targetReached || state.navigation.navigationBreak)) {
47  result.debugString += state.options.debugString;
48  state.options.debugString = "";
49  }
50  }
51 
54  template <typename propagator_state_t, typename stepper_t>
55  void operator()(propagator_state_t& /*state*/,
56  const stepper_t& /*unused*/) const {}
57 };
58 
59 } // namespace Acts