File indexing completed on 2025-01-18 09:28:01
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Definitions/Common.hpp"
0013 #include "Acts/EventData/SourceLink.hpp"
0014 #include "ActsExamples/EventData/Index.hpp"
0015 #include "ActsExamples/EventData/IndexSourceLink.hpp"
0016
0017 #include <cmath>
0018 #include <vector>
0019
0020 #include <boost/container/static_vector.hpp>
0021
0022 namespace ActsExamples {
0023
0024
0025 class DriftCircle {
0026 using Scalar = Acts::ActsScalar;
0027
0028 public:
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040 DriftCircle(const Acts::Vector3&& tubePos, float driftRadius,
0041 float driftRadiusError, int stationName, int stationEta,
0042 int stationPhi, int multilayer, int tubeLayer, int tube)
0043 : m_x(tubePos[Acts::ePos0]),
0044 m_y(tubePos[Acts::ePos1]),
0045 m_z(tubePos[Acts::ePos2]),
0046 m_rho(driftRadius),
0047 m_sigmaRho(driftRadiusError),
0048 m_stationName(stationName),
0049 m_stationEta(stationEta),
0050 m_stationPhi(stationPhi),
0051 m_multilayer(multilayer),
0052 m_tubeLayer(tubeLayer),
0053 m_tube(tube) {}
0054
0055 constexpr Scalar x() const { return m_x; }
0056 constexpr Scalar y() const { return m_y; }
0057 constexpr Scalar z() const { return m_z; }
0058 constexpr Scalar rDrift() const { return m_rho; }
0059 constexpr Scalar rDriftError() const { return m_sigmaRho; }
0060 constexpr int stationName() const { return m_stationName; }
0061 constexpr int stationEta() const { return m_stationEta; }
0062 constexpr int stationPhi() const { return m_stationPhi; }
0063 constexpr int multilayer() const { return m_multilayer; }
0064 constexpr int tubeLayer() const { return m_tubeLayer; }
0065 constexpr int tube() const { return m_tube; }
0066
0067 private:
0068
0069 Scalar m_x = 0.0f;
0070 Scalar m_y = 0.0f;
0071 Scalar m_z = 0.0f;
0072 Scalar m_rho = 0.0f;
0073 Scalar m_sigmaRho = 0.0f;
0074 int m_stationName = 0;
0075 int m_stationEta = 0;
0076 int m_stationPhi = 0;
0077 int m_multilayer = 0;
0078 int m_tubeLayer = 0;
0079 int m_tube = 0;
0080 };
0081
0082 inline bool operator==(const DriftCircle& lhs, const DriftCircle& rhs) {
0083 return (lhs.stationName() == rhs.stationName() &&
0084 lhs.stationEta() == rhs.stationEta() &&
0085 lhs.stationPhi() == rhs.stationPhi() &&
0086 lhs.multilayer() == rhs.multilayer() &&
0087 lhs.tubeLayer() == rhs.tubeLayer() && lhs.tube() == rhs.tube() &&
0088 std::abs(rhs.rDrift() - lhs.rDrift()) < 1.e-8 &&
0089 std::abs(rhs.rDriftError() - lhs.rDriftError()) < 1.e-8);
0090 }
0091
0092
0093 using DriftCircleContainer = std::vector<DriftCircle>;
0094
0095 }