Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BinnedArray.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file BinnedArray.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2016-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 
10 // BinnedArray.h, Acts project
12 
13 #pragma once
16 
17 #include <array>
18 #include <vector>
19 
20 namespace Acts {
21 
30 template <class T>
31 class BinnedArray {
32  public:
34  BinnedArray() = default;
36  virtual ~BinnedArray() = default;
43  virtual T object(const Vector2& lposition,
44  std::array<size_t, 3>& bins) const = 0;
45 
51  virtual T object(const Vector2& lposition) const {
52  std::array<size_t, 3> bins{};
53  return object(lposition, bins);
54  }
55 
62  virtual T object(const Vector3& position,
63  std::array<size_t, 3>& bin) const = 0;
64 
70  virtual T object(const Vector3& position) const {
71  std::array<size_t, 3> bins{};
72  return object(position, bins);
73  }
74 
78  virtual const std::vector<T>& arrayObjects() const = 0;
79 
82  virtual const std::vector<std::vector<std::vector<T>>>& objectGrid()
83  const = 0;
84 
88  virtual const BinUtility* binUtility() const = 0;
89 };
90 
91 } // namespace Acts