File indexing completed on 2025-01-18 09:12:25
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #pragma once
0014
0015 #include <cmath>
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032 namespace Acts::Legacy {
0033
0034 template <typename SpacePoint>
0035 class SPForSeed {
0036
0037
0038
0039
0040 public:
0041 SPForSeed();
0042 SPForSeed(SpacePoint* const& , const float* );
0043 SPForSeed(SpacePoint* const& , const float* , const float* );
0044 SPForSeed(const SPForSeed& );
0045 virtual ~SPForSeed();
0046 SPForSeed& operator=(const SPForSeed& );
0047
0048 void set(SpacePoint* const& , const float* );
0049 void set(SpacePoint* const& , const float* , const float* );
0050 void setQuality(float );
0051 void setParam(const float& );
0052
0053 const SpacePoint* spacepoint = nullptr;
0054 const float& x() const { return m_x; }
0055 const float& y() const { return m_y; }
0056 const float& z() const { return m_z; }
0057 const float& radius() const { return m_r; }
0058 float phi() const { return atan2(m_y, m_x); }
0059 const float& covr() const { return m_covr; }
0060 const float& covz() const { return m_covz; }
0061 const float& param() const { return m_param; }
0062 const float& quality() const { return m_q; }
0063
0064 const int& surface() const { return m_surface; }
0065
0066 protected:
0067 float m_x = 0;
0068 float m_y = 0;
0069 float m_z = 0;
0070 float m_r = 0;
0071 float m_covr = 0;
0072 float m_covz = 0;
0073 float m_param = 0;
0074 float m_q = 0;
0075
0076 int m_surface = 0;
0077 };
0078
0079
0080
0081
0082
0083 template <typename SpacePoint>
0084 inline SPForSeed<SpacePoint>::SPForSeed() {
0085 spacepoint = 0;
0086 m_x = 0.;
0087 m_y = 0.;
0088 m_z = 0.;
0089 m_r = 0.;
0090 m_covr = 0.;
0091 m_covz = 0.;
0092 m_param = 0.;
0093 m_q = 0.;
0094 }
0095
0096 template <typename SpacePoint>
0097 inline SPForSeed<SpacePoint>& SPForSeed<SpacePoint>::operator=(
0098 const SPForSeed<SpacePoint>& sp) {
0099 if (&sp != this) {
0100 spacepoint = sp.spacepoint;
0101 m_x = sp.m_x;
0102 m_y = sp.m_y;
0103 m_z = sp.m_z;
0104 m_r = sp.m_r;
0105 m_covr = sp.m_covr;
0106 m_covz = sp.m_covz;
0107 m_q = sp.m_q;
0108 }
0109 return (*this);
0110 }
0111
0112 template <typename SpacePoint>
0113 inline SPForSeed<SpacePoint>::SPForSeed(SpacePoint* const& sp, const float* r) {
0114 set(sp, r);
0115 m_param = 0.;
0116 }
0117
0118 template <typename SpacePoint>
0119 inline SPForSeed<SpacePoint>::SPForSeed(SpacePoint* const& sp, const float* r,
0120 const float* sc) {
0121 set(sp, r, sc);
0122 m_param = 0.;
0123 }
0124
0125
0126
0127
0128
0129 template <typename SpacePoint>
0130 inline SPForSeed<SpacePoint>::SPForSeed(const SPForSeed& sp) {
0131 *this = sp;
0132 }
0133
0134
0135
0136
0137
0138 template <typename SpacePoint>
0139 inline SPForSeed<SpacePoint>::~SPForSeed() = default;
0140
0141
0142
0143
0144
0145 template <typename SpacePoint>
0146 inline void SPForSeed<SpacePoint>::set(SpacePoint* const& sp, const float* r) {
0147 spacepoint = sp;
0148 m_x = r[0];
0149 m_y = r[1];
0150 m_z = r[2];
0151 m_r = std::hypot(m_x, m_y);
0152 m_surface = sp->surface;
0153 m_q = 100000.;
0154
0155 if (!sp->clusterList().second) {
0156 m_covr = sp->covr * 9.;
0157 m_covz = sp->covz * 9.;
0158 if (m_covr < 0.06) {
0159 m_covr = 0.06;
0160 }
0161 if (m_covz < 0.06) {
0162 m_covz = 0.06;
0163 }
0164 } else {
0165 m_covr = sp->covr * 8.;
0166 m_covz = sp->covz * 8.;
0167 if (m_covr < 0.1) {
0168 m_covr = 0.1;
0169 }
0170 if (m_covz < 0.1) {
0171 m_covz = 0.1;
0172 }
0173 }
0174 }
0175
0176
0177
0178
0179
0180
0181
0182
0183
0184 template <typename SpacePoint>
0185 inline void SPForSeed<SpacePoint>::set(SpacePoint* const& sp, const float* r,
0186 const float* sc) {
0187 spacepoint = sp;
0188 m_x = r[0];
0189 m_y = r[1];
0190 m_z = r[2];
0191 m_r = std::hypot(m_x, m_y);
0192 m_q = 100000.;
0193 if (!sp->clusterList().second) {
0194 m_covr = sp->covr * 9. * sc[0];
0195 m_covz = sp->covz * 9. * sc[1];
0196 if (m_covr < 0.06) {
0197 m_covr = 0.06;
0198 }
0199 if (m_covz < 0.06) {
0200 m_covz = 0.06;
0201 }
0202 } else {
0203 m_covr = sp->covr * 8. * sc[2];
0204 m_covz = sp->covz * 8. * sc[3];
0205 if (m_covr < 0.1) {
0206 m_covr = 0.1;
0207 }
0208 if (m_covz < 0.1) {
0209 m_covz = 0.1;
0210 }
0211 }
0212
0213
0214
0215
0216
0217
0218
0219
0220
0221
0222
0223
0224
0225
0226
0227
0228
0229
0230
0231
0232
0233
0234
0235
0236
0237
0238 }
0239 template <typename SpacePoint>
0240 inline void SPForSeed<SpacePoint>::setParam(const float& p) {
0241 m_param = p;
0242 }
0243 template <typename SpacePoint>
0244 inline void SPForSeed<SpacePoint>::setQuality(float q) {
0245 if (q <= m_q) {
0246 m_q = q;
0247 }
0248 }
0249
0250 }