EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PrintParameters.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PrintParameters.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2016-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 
12 
13 #include <ostream>
14 
15 void Acts::detail::printBoundParameters(std::ostream& os,
16  const Acts::Surface& surface,
17  const Acts::BoundVector& params,
18  const Acts::BoundSymMatrix* cov) {
19  // Set stream output format
20  auto oldPrecision = os.precision(7);
21  auto oldFlags = os.setf(std::ios::fixed);
22 
23  os << "BoundTrackParameters:\n";
24  os << " parameters: " << params.transpose() << '\n';
25  if (cov) {
26  os << " covariance:\n";
27  os << *cov << '\n';
28  } else {
29  os << " no covariance stored\n";
30  }
31  os << " on surface: " << surface.geometryId() << ' ' << surface.name()
32  << '\n';
33 
34  // Reset stream format
35  os.setf(oldFlags);
36  os.precision(oldPrecision);
37 }
38 
39 void Acts::detail::printFreeParameters(std::ostream& os,
40  const Acts::FreeVector& params,
41  const Acts::FreeMatrix* cov) {
42  // Set stream output format
43  auto oldPrecision = os.precision(7);
44  auto oldFlags = os.setf(std::ios::fixed);
45 
46  os << "FreeTrackParameters:\n";
47  os << " parameters: " << params.transpose() << '\n';
48  if (cov) {
49  os << " covariance:\n";
50  os << *cov << '\n';
51  } else {
52  os << " no covariance stored\n";
53  }
54 
55  // Reset stream format
56  os.setf(oldFlags);
57  os.precision(oldPrecision);
58 }