ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EventDataVisualizationBase.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file EventDataVisualizationBase.hpp
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 
9 #pragma once
10 
24 
25 #include <fstream>
26 #include <optional>
27 #include <sstream>
28 #include <string>
29 
30 namespace Acts {
31 namespace EventDataVisualization {
32 
38 static inline std::string test(IVisualization& helper) {
39  std::stringstream ss;
40 
41  const IVisualization::ColorType pcolor = {20, 120, 20};
42  const IVisualization::ColorType scolor = {235, 198, 52};
43 
44  auto gctx = GeometryContext();
45  auto identity = std::make_shared<Transform3D>(Transform3D::Identity());
46 
47  // rectangle and plane
48  auto rectangle = std::make_shared<RectangleBounds>(15., 15.);
49  auto plane = Surface::makeShared<PlaneSurface>(identity, rectangle);
50 
51  double momentumScale = 0.005;
52  double localErrorScale = 10.;
53  double directionErrorScale = 100.;
54 
55  // now create parameters on this surface
56  // l_x, l_y, phi, theta, q/p (1/p), t
57  std::array<double, 6> pars_array = {
58  {-0.1234, 4.8765, 0.45, 0.128, 0.001, 21.}};
59 
60  BoundParameters::ParVector_t pars = BoundParameters::ParVector_t::Zero();
61  pars << pars_array[0], pars_array[1], pars_array[2], pars_array[3],
62  pars_array[4], pars_array[5];
63 
64  BoundSymMatrix cov = BoundSymMatrix::Zero();
65  cov << 0.25, 0.0042, -0.00076, 6.156e-06, -2.11e-07, 0, 0.0042, 0.859,
66  -0.000173, 0.000916, -4.017e-08, 0, -0.00076, -0.000173, 2.36e-04,
67  -2.76e-07, 1.12e-08, 0, 6.15e-06, 0.000916, -2.76e-07, 8.84e-04,
68  -2.85e-11, 0, -2.11 - 07, -4.017e-08, 1.123e-08, -2.85 - 11, 1.26e-10, 0,
69  0, 0, 0, 0, 0, 1;
70 
72  helper, BoundParameters(gctx, std::move(cov), pars, plane), gctx,
73  momentumScale, localErrorScale, directionErrorScale, true, 72, pcolor,
74  scolor);
75 
76  helper.write("EventData_BoundAtPlaneParameters");
77  helper.write(ss);
78 
79  return ss.str();
80 }
81 
82 } // namespace EventDataVisualization
83 } // namespace Acts