Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RootBFieldWriter.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file RootBFieldWriter.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2017-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 <array>
17 #include <cstddef>
18 #include <ios>
19 #include <memory>
20 #include <mutex>
21 #include <optional>
22 #include <sstream>
23 #include <stdexcept>
24 #include <string>
25 
26 #include <TFile.h>
27 #include <TTree.h>
28 #include <boost/optional.hpp>
29 
30 namespace Acts {
31 class InterpolatedMagneticField;
32 } // namespace Acts
33 
34 namespace ActsExamples {
35 
41  public:
43  enum class GridType { rz = 0, xyz = 1 };
44 
45  struct Config {
47  std::string treeName = "TTree";
49  std::string fileName = "TFile.root";
51  std::string fileMode = "recreate";
53  std::shared_ptr<const Acts::InterpolatedMagneticField> bField;
55  GridType gridType = GridType::xyz;
60  std::optional<std::array<double, 2>> rBounds;
64  std::optional<std::array<double, 2>> zBounds;
68  size_t rBins = 200;
70  // @note setting this parameter is optional, in case no bin numbers are
72  size_t zBins = 300;
74  // @note setting this parameter is optional, in case no bin numbers are
76  size_t phiBins = 100;
77  };
78 
80  static void run(const Config& config,
81  std::unique_ptr<const Acts::Logger> p_logger =
82  Acts::getDefaultLogger("RootBFieldWriter",
84 };
85 
86 } // namespace ActsExamples