Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
JsonSurfacesWriter.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file JsonSurfacesWriter.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2021 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 
15 
16 #include <cstddef>
17 #include <limits>
18 #include <memory>
19 #include <string>
20 
21 namespace Acts {
22 class TrackingVolume;
23 class TrackingGeometry;
24 } // namespace Acts
25 
26 namespace ActsExamples {
27 struct AlgorithmContext;
28 
40 class JsonSurfacesWriter : public IWriter {
41  public:
42  struct Config {
44  std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry;
48  std::size_t outputPrecision = std::numeric_limits<float>::max_digits10;
50  bool writeLayer = false;
52  bool writeApproach = false;
54  bool writeSensitive = false;
56  bool writeBoundary = false;
58  bool writePerEvent = false;
60  bool writeOnlyNames = false;
61  };
62 
68 
69  std::string name() const override;
70 
72  ProcessCode write(const AlgorithmContext& ctx) override;
73 
75  ProcessCode finalize() override;
76 
78  const Config& config() const { return m_cfg; }
79 
80  private:
82  const Acts::TrackingVolume* m_world = nullptr;
83  std::unique_ptr<const Acts::Logger> m_logger;
84 
85  const Acts::Logger& logger() const { return *m_logger; }
86 };
87 
88 } // namespace ActsExamples