Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SvgDefaults.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SvgDefaults.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2022 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 
14 
15 namespace {
16 
17 static inline Acts::Svg::Style layerStyle() {
18  Acts::Svg::Style lStyle;
19  lStyle.fillColor = {51, 153, 255};
20  lStyle.fillOpacity = 0.75;
21  lStyle.highlightColor = {255, 153, 51};
22  lStyle.highlights = {"mouseover", "mouseout"};
23  lStyle.strokeColor = {25, 25, 25};
24  lStyle.strokeWidth = 0.5;
25  lStyle.nSegments = 72u;
26 
27  return lStyle;
28 }
29 
30 static inline Acts::Svg::Style infoStyle() {
31  Acts::Svg::Style iStyle;
32  iStyle.fillColor = {0, 0, 180};
33  iStyle.fillOpacity = 0.8;
34  iStyle.highlights = {};
35  iStyle.fontSize = 40.;
36  return iStyle;
37 }
38 
39 static inline Acts::Svg::Style backgroundStyle() {
40  Acts::Svg::Style bgStyle;
41  bgStyle.fillColor = {55, 55, 55};
42  bgStyle.fillOpacity = 0.50;
43  bgStyle.highlights = {};
44  bgStyle.strokeColor = {25, 25, 25};
45  bgStyle.strokeWidth = 0.5;
46  bgStyle.nSegments = 72u;
47  return bgStyle;
48 }
49 
50 static inline Acts::Svg::Style pointStyle() {
51  Acts::Svg::Style pStyle;
52  pStyle.fillColor = {200, 0, 0};
53  pStyle.fillOpacity = 1.0;
54  pStyle.highlightColor = {0, 200, 0};
55  pStyle.highlights = {"mouseover", "mouseout"};
56  pStyle.strokeColor = {0, 0, 0};
57  pStyle.strokeWidth = 0.5;
58  pStyle.nSegments = 72u;
59 
60  return pStyle;
61 }
62 
64 trackingGeometryOptions() {
65  Acts::GeometryIdentifier geoID(0);
66 
68 
69  lOptions.name = "layer";
70  lOptions.surfaceStyles =
71  Acts::GeometryHierarchyMap<Acts::Svg::Style>({{geoID, layerStyle()}});
72 
74  tgOptions.prefix = "";
75  tgOptions.layerOptions =
77  {{geoID, lOptions}});
78 
79  return tgOptions;
80 }
81 
83 backgroundGeometryOptions() {
84  Acts::GeometryIdentifier geoID(0);
85 
87 
88  lOptions.name = "layer";
90  {{geoID, backgroundStyle()}});
91  lOptions.moduleInfo = false;
92  lOptions.gridInfo = false;
93  lOptions.zRange = {-100, 100};
94  lOptions.phiRange = {-0.2, 0.2};
95 
97  tgOptions.prefix = "";
98  tgOptions.layerOptions =
100  {{geoID, lOptions}});
101 
102  return tgOptions;
103 }
104 
105 } // namespace
106 
107 namespace ActsExamples {
108 
109 static Acts::Svg::Style s_layerStyle = layerStyle();
110 
111 static Acts::Svg::Style s_pointStyle = pointStyle();
112 
113 static Acts::Svg::Style s_infoStyle = infoStyle();
114 
116  trackingGeometryOptions();
117 
119  s_backgroundTrackingGeometryOptions = backgroundGeometryOptions();
120 
121 } // namespace ActsExamples