![]() |
|
|||
File indexing completed on 2025-08-05 08:09:27
0001 // This file is part of the Acts project. 0002 // 0003 // Copyright (C) 2016-2018 CERN for the benefit of the Acts project 0004 // 0005 // This Source Code Form is subject to the terms of the Mozilla Public 0006 // License, v. 2.0. If a copy of the MPL was not distributed with this 0007 // file, You can obtain one at http://mozilla.org/MPL/2.0/. 0008 0009 /////////////////////////////////////////////////////////////////// 0010 // BinnedArray.h, Acts project 0011 /////////////////////////////////////////////////////////////////// 0012 0013 #pragma once 0014 #include "Acts/Definitions/Algebra.hpp" 0015 #include "Acts/Utilities/BinUtility.hpp" 0016 0017 #include <array> 0018 #include <vector> 0019 0020 namespace Acts { 0021 0022 /// @class BinnedArray 0023 /// 0024 /// Pure virtual base class for Binned Array to avoid map searches 0025 /// - there is only one restriction: 0026 /// T must be of pointer type in order to be initialized with nullptr 0027 /// and to allow for nullptr return type 0028 /// 0029 /// - the BinnedArray is designed for 0D, 1D, 2D, and 3D binning 0030 template <class T> 0031 class BinnedArray { 0032 public: 0033 /// Default Constructor - needed for inherited classes 0034 BinnedArray() = default; 0035 /// Virtual Destructor 0036 virtual ~BinnedArray() = default; 0037 /// Returns the object in the associated bin according the local position 0038 /// 0039 /// @param lposition is the local position for the object retrieval 0040 /// @param bins is the bin triple to filled 0041 /// 0042 /// @return the object according to the estimated bin 0043 virtual T object(const Vector2& lposition, 0044 std::array<std::size_t, 3>& bins) const = 0; 0045 0046 /// Same method without bins for backward compatibility 0047 /// 0048 /// @param lposition is the local position for finding the object 0049 /// 0050 /// @return the object according to the estimated bin 0051 virtual T object(const Vector2& lposition) const { 0052 std::array<std::size_t, 3> bins{}; 0053 return object(lposition, bins); 0054 } 0055 0056 /// Returns the object in the associated bin according the local position 0057 /// 0058 /// @param position is the global position for the object retrieval 0059 /// @param bin is the bin triple filled 0060 /// 0061 /// @return the object according to the estimated bin 0062 virtual T object(const Vector3& position, 0063 std::array<std::size_t, 3>& bin) const = 0; 0064 0065 /// Same method without bins for backward compatibility 0066 /// 0067 /// @param position is the global position for the object finding 0068 /// 0069 /// @return the object according to the estimated bin 0070 virtual T object(const Vector3& position) const { 0071 std::array<std::size_t, 3> bins{}; 0072 return object(position, bins); 0073 } 0074 0075 /// Return all unique object 0076 /// @note this is the accessor to the 0077 /// @return the vector of all array objects 0078 virtual const std::vector<T>& arrayObjects() const = 0; 0079 0080 /// Return the object grid multiple entries are allowed 0081 /// @return the object grid 0082 virtual const std::vector<std::vector<std::vector<T>>>& objectGrid() 0083 const = 0; 0084 0085 /// Return the BinUtility 0086 /// - if returned 0 it is a 0D array 0087 /// @return plain pointer to the bin utility 0088 virtual const BinUtility* binUtility() const = 0; 0089 }; 0090 0091 } // namespace Acts
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |