Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BFieldMapUtils.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file BFieldMapUtils.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2017-2018 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
15 
16 #include <array>
17 #include <cstddef>
18 #include <functional>
19 #include <utility>
20 #include <vector>
21 
22 // Convenience functions to ease creation of and Acts::InterpolatedBFieldMap
23 // and to avoid code duplication. Currently implemented for the two most common
24 // formats: rz and xyz.
25 
26 namespace Acts {
27 
28 class SolenoidBField;
29 
74 fieldMapRZ(const std::function<size_t(std::array<size_t, 2> binsRZ,
75  std::array<size_t, 2> nBinsRZ)>&
76  localToGlobalBin,
77  std::vector<double> rPos, std::vector<double> zPos,
78  std::vector<Acts::Vector2> bField,
80  double BFieldUnit = UnitConstants::T, bool firstQuadrant = false);
81 
133 fieldMapXYZ(const std::function<size_t(std::array<size_t, 3> binsXYZ,
134  std::array<size_t, 3> nBinsXYZ)>&
135  localToGlobalBin,
136  std::vector<double> xPos, std::vector<double> yPos,
137  std::vector<double> zPos, std::vector<Acts::Vector3> bField,
138  double lengthUnit = UnitConstants::mm,
139  double BFieldUnit = UnitConstants::T, bool firstOctant = false);
140 
154 solenoidFieldMap(std::pair<double, double> rlim, std::pair<double, double> zlim,
155  std::pair<size_t, size_t> nbins, const SolenoidBField& field);
156 
157 } // namespace Acts