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 "Acts/Seeding/LegacyInternalSeed.hpp"
0016 #include "Acts/Seeding/SPForSeed.hpp"
0017
0018 #include <list>
0019 #include <map>
0020 #include <set>
0021 #include <string>
0022 #include <utility>
0023 #include <vector>
0024
0025 namespace Acts::Legacy {
0026 template <typename SpacePoint>
0027 class AtlasSeedFinder {
0028 struct Config {
0029
0030
0031
0032
0033 double bFieldInZ = 0.00208;
0034
0035 double SCT_rMin = 200.;
0036
0037 double beamPosX = 0;
0038 double beamPosY = 0;
0039 double beamPosZ = 0;
0040 double beamTiltX = 0;
0041 double beamTiltY = 0;
0042 };
0043
0044
0045
0046
0047 public:
0048
0049
0050
0051
0052 AtlasSeedFinder();
0053 virtual ~AtlasSeedFinder() {
0054 if (r_index != nullptr) {
0055 delete[] r_index;
0056 }
0057 if (r_map != nullptr) {
0058 delete[] r_map;
0059 }
0060 if (r_Sorted != nullptr) {
0061 delete[] r_Sorted;
0062 }
0063
0064
0065
0066 for (i_seed = l_seeds.begin(); i_seed != l_seeds.end(); ++i_seed) {
0067 delete *i_seed;
0068 }
0069
0070
0071 i_spforseed = l_spforseed.begin();
0072 for (; i_spforseed != l_spforseed.end(); ++i_spforseed) {
0073 delete *i_spforseed;
0074 }
0075 if (m_seedOutput != nullptr) {
0076 delete m_seedOutput;
0077 }
0078
0079 if (m_SP != nullptr) {
0080 delete[] m_SP;
0081 }
0082 if (m_R != nullptr) {
0083 delete[] m_R;
0084 }
0085 if (m_Tz != nullptr) {
0086 delete[] m_Tz;
0087 }
0088 if (m_Er != nullptr) {
0089 delete[] m_Er;
0090 }
0091 if (m_U != nullptr) {
0092 delete[] m_U;
0093 }
0094 if (m_V != nullptr) {
0095 delete[] m_V;
0096 }
0097 if (m_Zo != nullptr) {
0098 delete[] m_Zo;
0099 }
0100 if (m_OneSeeds != nullptr) {
0101 delete[] m_OneSeeds;
0102 }
0103 }
0104
0105
0106
0107
0108
0109 template <class RandIter>
0110 void newEvent(int , RandIter , RandIter );
0111
0112
0113
0114
0115 void find3Sp();
0116
0117
0118
0119
0120
0121
0122 const Seed<SpacePoint>* next();
0123
0124
0125
0126
0127
0128 const Config m_config;
0129
0130 protected:
0131
0132
0133 AtlasSeedFinder(const AtlasSeedFinder<SpacePoint>&) = delete;
0134 AtlasSeedFinder<SpacePoint>& operator=(const AtlasSeedFinder<SpacePoint>&) =
0135 delete;
0136
0137
0138
0139
0140
0141 bool m_endlist = false;
0142 bool m_checketa = false;
0143 bool m_isvertex = false;
0144 int m_nprint = 0;
0145 int m_nlist = 0;
0146 int m_maxsize = 0;
0147 int m_state = 0;
0148
0149 int m_iteration = 0;
0150 float m_etamin = 0, m_etamax = 0;
0151 float m_drmin = 0, m_drminv = 0;
0152 float m_drmax = 0;
0153 float m_dzdrmin0 = 0;
0154 float m_dzdrmax0 = 0;
0155 float m_dzdrmin = 0;
0156 float m_dzdrmax = 0;
0157 float m_zmin = 0;
0158 float m_zmax = 0;
0159 float m_zminU = 0;
0160 float m_zmaxU = 0;
0161 float m_zminB = 0;
0162 float m_zmaxB = 0;
0163 float m_ftrig = 0;
0164 float m_ftrigW = 0;
0165
0166 float r_rmax = 0;
0167
0168 float r_rstep = 0;
0169
0170 float m_dzver = 0;
0171 float m_dzdrver = 0;
0172 float m_diver = 0;
0173 float m_diverpps = 0;
0174 float m_diversss = 0;
0175 float m_divermax = 0;
0176 float m_dazmax = 0;
0177 float m_ptmin = 0;
0178 float m_ipt = 0;
0179 float m_ipt2 = 0;
0180 float m_COF = 0;
0181 float m_K = 0;
0182 float m_ipt2K = 0;
0183 float m_ipt2C = 0;
0184 float m_COFK = 0;
0185 float m_umax = 0;
0186
0187 int r_size = 0;
0188 int r_first = 0;
0189 int rf_size = 0;
0190 int rfz_size = 0;
0191 std::list<SPForSeed<SpacePoint>*>* r_Sorted = nullptr;
0192 std::list<SPForSeed<SpacePoint>*> rfz_Sorted[583];
0193 std::list<SPForSeed<SpacePoint>*> l_spforseed;
0194 typename std::list<SPForSeed<SpacePoint>*>::iterator i_spforseed;
0195 typename std::list<SPForSeed<SpacePoint>*>::iterator m_rMin;
0196
0197 int m_nsaz = 0, m_nsazv = 0;
0198 int m_fNmax = 0, m_fvNmax = 0;
0199 int m_fNmin = 0, m_fvNmin = 0;
0200 int m_zMin = 0;
0201
0202
0203 int m_nr = 0;
0204 int* r_index = nullptr;
0205 int* r_map = nullptr;
0206 int m_nrfz = 0, rfz_index[583] = {}, rfz_map[583] = {};
0207 int rfz_b[583] = {}, rfz_t[593] = {}, rfz_ib[583][9] = {},
0208 rfz_it[583][9] = {};
0209 float m_sF = 0;
0210
0211
0212
0213
0214
0215 int m_maxsizeSP = 0;
0216 SPForSeed<SpacePoint>** m_SP = nullptr;
0217 float* m_Zo = nullptr;
0218 float* m_Tz = nullptr;
0219 float* m_R = nullptr;
0220 float* m_U = nullptr;
0221 float* m_V = nullptr;
0222 float* m_Er = nullptr;
0223
0224 Seed<SpacePoint>* m_seedOutput = nullptr;
0225
0226 std::list<InternalSeed<SpacePoint>*> l_seeds;
0227 typename std::list<InternalSeed<SpacePoint>*>::iterator i_seed;
0228 typename std::list<InternalSeed<SpacePoint>*>::iterator i_seede;
0229
0230 std::multimap<float, InternalSeed<SpacePoint>*> m_seeds;
0231 typename std::multimap<float, InternalSeed<SpacePoint>*>::iterator m_seed;
0232
0233 std::multimap<float, InternalSeed<SpacePoint>*> m_mapOneSeeds;
0234 InternalSeed<SpacePoint>* m_OneSeeds = nullptr;
0235 int m_maxOneSize = 0;
0236 int m_nOneSeeds = 0;
0237 int m_fillOneSeeds = 0;
0238 std::vector<std::pair<float, SPForSeed<SpacePoint>*>> m_CmSp;
0239
0240
0241
0242
0243
0244 float m_xbeam = 0;
0245 float m_ybeam = 0;
0246 float m_zbeam = 0;
0247
0248
0249
0250
0251
0252 void buildFrameWork();
0253 void buildBeamFrameWork();
0254
0255 SPForSeed<SpacePoint>* newSpacePoint(SpacePoint* const& );
0256
0257 void newOneSeed(SPForSeed<SpacePoint>*& ,
0258 SPForSeed<SpacePoint>*& ,
0259 SPForSeed<SpacePoint>*& , float , float );
0260
0261 void newOneSeedWithCurvaturesComparison(SPForSeed<SpacePoint>*& ,
0262 SPForSeed<SpacePoint>*& ,
0263 float );
0264
0265 void fillSeeds();
0266 void fillLists();
0267 void erase();
0268 void production3Sp();
0269 void production3Sp(
0270 typename std::list<SPForSeed<SpacePoint>*>::iterator* ,
0271 typename std::list<SPForSeed<SpacePoint>*>::iterator* ,
0272 typename std::list<SPForSeed<SpacePoint>*>::iterator* ,
0273 typename std::list<SPForSeed<SpacePoint>*>::iterator* , int ,
0274 int , int& );
0275
0276 void findNext();
0277 bool isZCompatible(float& );
0278 void convertToBeamFrameWork(SpacePoint* const& , float* );
0279 };
0280
0281
0282
0283
0284
0285 template <typename SpacePoint>
0286 inline const Seed<SpacePoint>* AtlasSeedFinder<SpacePoint>::next() {
0287 do {
0288 if (i_seed == i_seede) {
0289 findNext();
0290 if (i_seed == i_seede) {
0291 return nullptr;
0292 }
0293 }
0294 ++i_seed;
0295 } while (!(*m_seed++).second->set3(*m_seedOutput));
0296 return (m_seedOutput);
0297 }
0298
0299 template <typename SpacePoint>
0300 inline bool AtlasSeedFinder<SpacePoint>::isZCompatible(float& Zv) {
0301 if (Zv < m_zminU || Zv > m_zmaxU) {
0302 return false;
0303 } else {
0304 return true;
0305 }
0306 }
0307
0308
0309
0310
0311
0312 template <typename SpacePoint>
0313 inline SPForSeed<SpacePoint>* AtlasSeedFinder<SpacePoint>::newSpacePoint(
0314 SpacePoint* const& sp) {
0315 SPForSeed<SpacePoint>* sps = nullptr;
0316
0317 float r[3];
0318 convertToBeamFrameWork(sp, r);
0319
0320 if (m_checketa) {
0321
0322 float z = std::abs(r[2]) + m_zmax;
0323 float x = r[0] * m_dzdrmin;
0324 float y = r[1] * m_dzdrmin;
0325 if ((z * z) < (x * x + y * y)) {
0326 return nullptr;
0327 }
0328 }
0329
0330 if (i_spforseed != l_spforseed.end()) {
0331 sps = (*i_spforseed++);
0332 sps->set(sp, r);
0333 } else {
0334 l_spforseed.push_back((sps = new SPForSeed<SpacePoint>(sp, r)));
0335 i_spforseed = l_spforseed.end();
0336 }
0337
0338 return sps;
0339 }
0340
0341
0342
0343
0344
0345 class comCurvature {
0346 public:
0347 template <typename SpacePoint>
0348 bool operator()(
0349 const std::pair<float, Acts::Legacy::SPForSeed<SpacePoint>*>& i1,
0350 const std::pair<float, Acts::Legacy::SPForSeed<SpacePoint>*>& i2) {
0351 return i1.first < i2.first;
0352 }
0353 };
0354 }
0355 #include "Acts/Seeding/AtlasSeedFinder.ipp"