forked from sPHENIX-Collaboration/acts
/
TrackingVolumeArrayCreator.hpp
74 lines (61 loc) · 2.31 KB
/
TrackingVolumeArrayCreator.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// This file is part of the Acts project.
//
// Copyright (C) 2016-2018 CERN for the benefit of the Acts project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#pragma once
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Geometry/ITrackingVolumeArrayCreator.hpp"
#include "Acts/Utilities/BinnedArray.hpp"
#include "Acts/Utilities/Definitions.hpp"
#include "Acts/Utilities/Logger.hpp"
#include <algorithm>
namespace Acts {
class Layer;
class TrackingVolume;
using TrackingVolumeOrderPosition = std::pair<TrackingVolumePtr, Vector3D>;
///@class TrackingVolumeArrayCreator
///
/// The TrackingVolumeArrayCreator is a simple Tool that helps to construct
/// binned arrays of TrackingVolumes for both, confinement in another volume
/// and navigation issues.
///
class TrackingVolumeArrayCreator : public ITrackingVolumeArrayCreator {
public:
/// @brief This struct stores the configuration of the tracking geometry
struct Config {};
/// Constructor
///
/// @param logger logging instance
TrackingVolumeArrayCreator(const Config& /*cfg*/,
std::unique_ptr<const Logger> logger =
getDefaultLogger("LayerArrayCreator",
Logging::INFO))
: m_logger(std::move(logger)) {}
/// Destructor
~TrackingVolumeArrayCreator() override = default;
/// create a tracking volume array
///
/// @param [in] gctx the geometry context for this building
/// @param [in] tVolumes is the vector of TrackingVolumes to be
/// @param [in] bValue is the binning value
///
/// @return new created volume array
std::shared_ptr<const TrackingVolumeArray> trackingVolumeArray(
const GeometryContext& gctx, const TrackingVolumeVector& tVolumes,
BinningValue bValue) const override;
/// Set logging instance
///
/// @param logger is the logging instance to be set
void setLogger(std::unique_ptr<const Logger> logger) {
m_logger = std::move(logger);
}
private:
// Private access to the logger method
const Logger& logger() const { return *m_logger; }
/// logging instance
std::unique_ptr<const Logger> m_logger;
};
} // namespace Acts