EIC 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 Vector2D& lposition,
44  std::array<size_t, 3>& bins) const = 0;
45 
51  virtual T object(const Vector2D& lposition) const {
52  std::array<size_t, 3> bins;
53  return object(lposition, bins);
54  }
55 
62  virtual T object(const Vector3D& position,
63  std::array<size_t, 3>& bin) const = 0;
64 
70  virtual T object(const Vector3D& position) const {
71  std::array<size_t, 3> bins;
72  return object(position, bins);
73  }
74 
83  virtual std::vector<T> objectCluster(
84  const std::array<size_t, 3>& bin) const = 0;
85 
89  virtual const std::vector<T>& arrayObjects() const = 0;
90 
93  virtual const std::vector<std::vector<std::vector<T>>>& objectGrid()
94  const = 0;
95 
99  virtual const BinUtility* binUtility() const = 0;
100 };
101 
102 } // namespace Acts