Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CsvBFieldWriter.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file CsvBFieldWriter.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 #include <array>
16 #include <cstddef>
17 #include <memory>
18 #include <optional>
19 #include <string>
20 #include <type_traits>
21 
22 namespace Acts {
23 class InterpolatedMagneticField;
24 class MagneticFieldProvider;
25 } // namespace Acts
26 
27 namespace ActsExamples {
33  public:
39  enum class CoordinateType { XYZ, RZ };
40 
48  template <CoordinateType Coord, bool Grid>
49  struct Config {
55  template <typename T>
56  using Functor = std::conditional_t<Grid, std::optional<T>, T>;
57 
62  static constexpr std::size_t NDims = Coord == CoordinateType::RZ ? 2 : 3;
63 
65  std::string fileName = "bfield.csv";
66 
72  std::array<std::array<Functor<double>, 2>, NDims> range{};
73 
78  std::array<Functor<std::size_t>, NDims> bins{};
79 
85  std::shared_ptr<std::add_const_t<std::conditional_t<
88  };
89 
99  template <CoordinateType Coord, bool Grid>
100  static void run(const Config<Coord, Grid>& config,
102 };
103 } // namespace ActsExamples