File indexing completed on 2025-05-14 07:56:51
0001
0002
0003
0004
0005
0006
0007
0008 #pragma once
0009
0010 #include "Acts/Definitions/Algebra.hpp"
0011 #include "Acts/Definitions/Common.hpp"
0012
0013 #include <cstdint>
0014 #include <iostream>
0015 #include <memory>
0016 #include <vector>
0017
0018 namespace ActsExamples {
0019
0020
0021
0022
0023 class MuonSpacePoint {
0024 public:
0025
0026 class MuonId {
0027 public:
0028
0029 enum class TechField : std::int8_t {
0030 UnDef = -1,
0031 Mdt = 0,
0032 Rpc = 2,
0033 Tgc = 3,
0034 sTgc = 4,
0035 Mm = 5
0036 };
0037
0038 enum class StationName : std::int8_t {
0039 UnDef = -1,
0040 BIS,
0041 BIL,
0042 BMS,
0043 BML,
0044 BOS,
0045 BOL,
0046 BEE,
0047 EIS,
0048 EIL,
0049 EMS,
0050 EML,
0051 EOS,
0052 EOL,
0053 EES,
0054 EEL
0055 };
0056
0057 enum class DetSide : std::int8_t { UnDef = 0, A = 1, C = -1 };
0058
0059 explicit MuonId() = default;
0060
0061 MuonId(const MuonId& other) = default;
0062
0063 MuonId(MuonId&& other) = default;
0064
0065 MuonId& operator=(const MuonId& other) = default;
0066
0067 MuonId& operator=(MuonId&& other) = default;
0068
0069
0070 TechField technology() const { return m_tech; }
0071
0072 StationName msStation() const { return m_stName; }
0073
0074 std::uint8_t sector() const { return m_sector; }
0075
0076 DetSide side() const { return m_side; }
0077
0078 std::uint8_t detLayer() const { return m_layer; }
0079
0080 std::uint16_t channel() const { return m_channel; }
0081
0082 bool measuresEta() const { return m_measEta; }
0083
0084 bool measuresPhi() const { return m_measPhi; }
0085
0086
0087
0088 bool sameStation(const MuonId& other) const {
0089 return msStation() == other.msStation() && sector() == other.sector() &&
0090 side() == other.side();
0091 }
0092
0093
0094
0095
0096
0097 void setChamber(StationName stName, DetSide side, int sector,
0098 TechField tech);
0099
0100 void setLayAndCh(std::uint8_t layer, std::uint16_t ch);
0101
0102
0103
0104 void setCoordFlags(bool measEta, bool measPhi);
0105
0106 private:
0107 TechField m_tech{TechField::UnDef};
0108 StationName m_stName{StationName::UnDef};
0109 DetSide m_side{DetSide::UnDef};
0110 std::uint8_t m_sector{0};
0111 std::uint8_t m_layer{0};
0112 std::uint16_t m_channel{0};
0113 bool m_measEta{false};
0114 bool m_measPhi{false};
0115 };
0116
0117 MuonSpacePoint() = default;
0118
0119 MuonSpacePoint(const MuonSpacePoint& other) = default;
0120
0121 MuonSpacePoint(MuonSpacePoint&& other) = default;
0122
0123 const MuonId& id() const { return m_id; }
0124
0125 const Acts::Vector3& localPosition() const { return m_pos; }
0126
0127 const Acts::Vector3& sensorDirection() const { return m_dir; }
0128
0129 const Acts::Vector3& stripPlaneNormal() const { return m_norm; }
0130
0131 const Acts::ActsSquareMatrix<3>& covariance() const { return m_cov; }
0132
0133 double driftRadius() const { return m_radius; }
0134
0135 double time() const { return m_time; }
0136
0137 void setId(const MuonId& id);
0138
0139
0140
0141 void defineCoordinates(Acts::Vector3&& pos, Acts::Vector3&& sensorDir);
0142
0143 void defineNormal(Acts::Vector3&& norm);
0144
0145 void setRadius(const double r);
0146
0147 void setTime(const double t);
0148
0149 void setSpatialCov(const double xx, const double xy, const double yx,
0150 const double yy);
0151
0152 private:
0153 MuonId m_id{};
0154 Acts::Vector3 m_pos{Acts::Vector3::Zero()};
0155 Acts::Vector3 m_dir{Acts::Vector3::Zero()};
0156 Acts::Vector3 m_norm{Acts::Vector3::Zero()};
0157 Acts::ActsSquareMatrix<3> m_cov{Acts::ActsSquareMatrix<3>::Identity()};
0158 double m_radius{0.};
0159 double m_time{0.};
0160 };
0161
0162
0163
0164
0165 using MuonSpacePointBucket = std::vector<MuonSpacePoint>;
0166 using MuonSpacePointContainer = std::vector<MuonSpacePointBucket>;
0167
0168
0169 std::string to_string(const MuonSpacePoint::MuonId::StationName st);
0170
0171 std::string to_string(const MuonSpacePoint::MuonId::TechField tech);
0172
0173 std::string to_string(const MuonSpacePoint::MuonId::DetSide side);
0174
0175 }
0176
0177
0178 std::ostream& operator<<(std::ostream& ostr,
0179 const ActsExamples::MuonSpacePoint::MuonId& id);
0180
0181 std::ostream& operator<<(std::ostream& ostr,
0182 const ActsExamples::MuonSpacePoint& sp);