From 18fdbc902a8b5a6f8be8ef70d87ad89bb5e39b31 Mon Sep 17 00:00:00 2001 From: "s.zharko@gsi.de" <s.zharko@gsi.de> Date: Thu, 2 Jun 2022 13:24:10 +0200 Subject: [PATCH] L1Algo: constexpr constants moved from L1Parameters class to the L1Constants namespace (L1Constants.h) --- reco/L1/CMakeLists.txt | 1 + reco/L1/CbmL1.cxx | 8 +-- reco/L1/L1Algo/L1Algo.cxx | 10 +-- reco/L1/L1Algo/L1Algo.h | 83 ++++++++++++------------ reco/L1/L1Algo/L1BaseStationInfo.cxx | 6 +- reco/L1/L1Algo/L1CATrackFinder.cxx | 30 ++++----- reco/L1/L1Algo/L1Constants.h | 65 +++++++++++++++++++ reco/L1/L1Algo/L1Field.cxx | 5 +- reco/L1/L1Algo/L1Field.h | 8 +-- reco/L1/L1Algo/L1InitManager.cxx | 15 +++-- reco/L1/L1Algo/L1InitManager.h | 11 ++-- reco/L1/L1Algo/L1Parameters.cxx | 12 ++-- reco/L1/L1Algo/L1Parameters.h | 59 +++-------------- reco/L1/L1Algo/L1TrackFitter.cxx | 52 +++++++-------- reco/L1/L1AlgoInputData.h | 2 +- reco/L1/ParticleFinder/CbmL1PFFitter.cxx | 4 +- 16 files changed, 199 insertions(+), 172 deletions(-) create mode 100644 reco/L1/L1Algo/L1Constants.h diff --git a/reco/L1/CMakeLists.txt b/reco/L1/CMakeLists.txt index 1288268fe7..925198d644 100644 --- a/reco/L1/CMakeLists.txt +++ b/reco/L1/CMakeLists.txt @@ -286,6 +286,7 @@ Install(FILES CbmL1Counters.h L1Algo/L1InitManager.h L1Algo/L1CAIteration.h L1Algo/L1Parameters.h + L1Algo/L1Constants.h L1Algo/L1Utils.h vectors/vec_arithmetic.h vectors/std_alloc.h diff --git a/reco/L1/CbmL1.cxx b/reco/L1/CbmL1.cxx index 8dbde85736..a613fa9c3b 100644 --- a/reco/L1/CbmL1.cxx +++ b/reco/L1/CbmL1.cxx @@ -1503,13 +1503,13 @@ void CbmL1::WriteSTAPAlgoData() // must be called after ReadEvent // write StsHitsStartIndex and StsHitsStopIndex n = 20; for (int i = 0; i < n; i++) { - if (int(L1Parameters::kMaxNstations) + 1 > i) { fadata << algo->StsHitsStartIndex[i] << endl; } + if (int(L1Constants::size::kMaxNstations) + 1 > i) { fadata << algo->StsHitsStartIndex[i] << endl; } else { fadata << 0 << endl; } }; for (int i = 0; i < n; i++) { - if (int(L1Parameters::kMaxNstations) + 1 > i) fadata << algo->StsHitsStopIndex[i] << endl; + if (int(L1Constants::size::kMaxNstations) + 1 > i) fadata << algo->StsHitsStopIndex[i] << endl; else fadata << 0 << endl; }; @@ -1764,12 +1764,12 @@ void CbmL1::ReadSTAPAlgoData() for (int i = 0; i < n; i++) { int tmp; fadata >> tmp; - if (int(L1Parameters::kMaxNstations) + 1 > i) (const_cast<unsigned int&>(algo->StsHitsStartIndex[i]) = tmp); + if (int(L1Constants::size::kMaxNstations) + 1 > i) (const_cast<unsigned int&>(algo->StsHitsStartIndex[i]) = tmp); } for (int i = 0; i < n; i++) { int tmp; fadata >> tmp; - if (int(L1Parameters::kMaxNstations) + 1 > i) (const_cast<unsigned int&>(algo->StsHitsStopIndex[i]) = tmp); + if (int(L1Constants::size::kMaxNstations) + 1 > i) (const_cast<unsigned int&>(algo->StsHitsStopIndex[i]) = tmp); } cout << "-I- CbmL1: CATrackFinder data for event " << nEvent << " has been read from file " << fadata_name diff --git a/reco/L1/L1Algo/L1Algo.cxx b/reco/L1/L1Algo/L1Algo.cxx index 90bec5be14..5508772a0a 100644 --- a/reco/L1/L1Algo/L1Algo.cxx +++ b/reco/L1/L1Algo/L1Algo.cxx @@ -10,16 +10,16 @@ L1Algo::L1Algo(unsigned int nThreads) { SetNThreads(nThreads); - for (unsigned int i = 0; i < L1Parameters::kMaxNstations; i++) { + for (unsigned int i = 0; i < L1Constants::size::kMaxNstations; i++) { vGridTime[i].AllocateMemory(fNThreads); } } void L1Algo::SetNThreads(unsigned int n) { - if (n > static_cast<unsigned int>(L1Parameters::kMaxNthreads)) { + if (n > static_cast<unsigned int>(L1Constants::size::kMaxNthreads)) { LOG(fatal) << "L1Algo: n threads " << n << " is greater than the maximum " - << static_cast<unsigned int>(L1Parameters::kMaxNthreads); + << static_cast<unsigned int>(L1Constants::size::kMaxNthreads); } fNThreads = n; @@ -52,7 +52,7 @@ void L1Algo::SetNThreads(unsigned int n) du[i].reserve(MaxPortionTriplets / fvecLen); dv[i].reserve(MaxPortionTriplets / fvecLen); - for (unsigned int j = 0; j < L1Parameters::kMaxNstations; j++) { + for (unsigned int j = 0; j < L1Constants::size::kMaxNstations; j++) { fTriplets[j][i].SetName(std::stringstream() << "L1Algo::fTriplets[" << i << "][" << j << "]"); } } @@ -198,7 +198,7 @@ void L1Algo::SetData(L1Vector<L1Hit>& StsHits_, int nStsStrips_, L1Vector<unsign fRecoHits_local[i].reserve(nHits); fTrackCandidates[i].clear(); fTrackCandidates[i].reserve(nHits / 10); - for (unsigned int j = 0; j < L1Parameters::kMaxNstations; j++) { + for (unsigned int j = 0; j < L1Constants::size::kMaxNstations; j++) { fTriplets[j][i].clear(); fTriplets[j][i].reserve(2 * nHits); } diff --git a/reco/L1/L1Algo/L1Algo.h b/reco/L1/L1Algo/L1Algo.h index 22f447e9b4..39ee43de7e 100644 --- a/reco/L1/L1Algo/L1Algo.h +++ b/reco/L1/L1Algo/L1Algo.h @@ -79,8 +79,8 @@ class L1AlgoEfficiencyPerformance; #endif typedef int Tindex; -using L1StationsArray_t = std::array<L1Station, L1Parameters::kMaxNstations>; -using L1MaterialArray_t = std::array<L1Material, L1Parameters::kMaxNstations>; +using L1StationsArray_t = std::array<L1Station, L1Constants::size::kMaxNstations>; +using L1MaterialArray_t = std::array<L1Material, L1Constants::size::kMaxNstations>; /// Central class of L1 tracking /// @@ -112,46 +112,46 @@ public: static unsigned int PackTripletId(unsigned int Station, unsigned int Thread, unsigned int Triplet) { #ifndef FAST_CODE - assert(Station < L1Parameters::kMaxNstations); - assert(Thread < L1Parameters::kMaxNthreads); - assert(Triplet < L1Parameters::kMaxNtriplets); + assert(Station < L1Constants::size::kMaxNstations); + assert(Thread < L1Constants::size::kMaxNthreads); + assert(Triplet < L1Constants::size::kMaxNtriplets); #endif - constexpr unsigned int kMoveThread = L1Parameters::kTripletBits; - constexpr unsigned int kMoveStation = L1Parameters::kTripletBits + L1Parameters::kThreadBits; + constexpr unsigned int kMoveThread = L1Constants::size::kTripletBits; + constexpr unsigned int kMoveStation = L1Constants::size::kTripletBits + L1Constants::size::kThreadBits; return (Station << kMoveStation) + (Thread << kMoveThread) + Triplet; } /// unpack the triplet ID to its station index static unsigned int TripletId2Station(unsigned int ID) { - constexpr unsigned int kMoveStation = L1Parameters::kTripletBits + L1Parameters::kThreadBits; + constexpr unsigned int kMoveStation = L1Constants::size::kTripletBits + L1Constants::size::kThreadBits; return ID >> kMoveStation; } /// unpack the triplet ID to its thread index static unsigned int TripletId2Thread(unsigned int ID) { - constexpr unsigned int kMoveThread = L1Parameters::kTripletBits; - constexpr unsigned int kThreadMask = (1u << L1Parameters::kThreadBits) - 1u; + constexpr unsigned int kMoveThread = L1Constants::size::kTripletBits; + constexpr unsigned int kThreadMask = (1u << L1Constants::size::kThreadBits) - 1u; return (ID >> kMoveThread) & kThreadMask; } /// unpack the triplet ID to its triplet index static unsigned int TripletId2Triplet(unsigned int ID) { - constexpr unsigned int kTripletMask = (1u << L1Parameters::kTripletBits) - 1u; + constexpr unsigned int kTripletMask = (1u << L1Constants::size::kTripletBits) - 1u; return ID & kTripletMask; } - L1Vector<L1Triplet> fTriplets[L1Parameters::kMaxNstations][L1Parameters::kMaxNthreads] { + L1Vector<L1Triplet> fTriplets[L1Constants::size::kMaxNstations][L1Constants::size::kMaxNthreads] { {"L1Algo::fTriplets"}}; // created triplets at station + thread // Track candidates created out of adjacent triplets before the final track selection. // The candidates may share any amount of hits. - L1Vector<L1Branch> fTrackCandidates[L1Parameters::kMaxNthreads] {"L1Algo::fTrackCandidates"}; + L1Vector<L1Branch> fTrackCandidates[L1Constants::size::kMaxNthreads] {"L1Algo::fTrackCandidates"}; - Tindex fDupletPortionStopIndex[L1Parameters::kMaxNstations] {0}; // end of the duplet portions for the station + Tindex fDupletPortionStopIndex[L1Constants::size::kMaxNstations] {0}; // end of the duplet portions for the station L1Vector<Tindex> fDupletPortionSize {"L1Algo::fDupletPortionSize"}; // N duplets in a portion /********************************************************************************************/ /** @@ -264,8 +264,8 @@ public: int NStsStrips {0}; ///> number of strips L1Vector<L1Hit>* vStsHits {nullptr}; ///> hits as a combination of front-, backstrips and z-position - L1Grid vGrid[L1Parameters::kMaxNstations]; ///> hits as a combination of front-, backstrips and z-position - L1Grid vGridTime[L1Parameters::kMaxNstations]; ///> + L1Grid vGrid[L1Constants::size::kMaxNstations]; ///> hits as a combination of front-, backstrips and z-position + L1Grid vGridTime[L1Constants::size::kMaxNstations]; ///> L1Vector<unsigned char>* fStripFlag {nullptr}; // information of hits station & using hits in tracks; @@ -287,8 +287,8 @@ public: L1Vector<L1HitPoint> vStsDontUsedHitsxy_A {"L1Algo::vStsDontUsedHitsxy_A"}; L1Vector<L1HitPoint> vStsDontUsedHitsxy_buf {"L1Algo::vStsDontUsedHitsxy_buf"}; L1Vector<L1HitPoint> vStsDontUsedHitsxy_B {"L1Algo::vStsDontUsedHitsxy_B"}; - L1Vector<L1Track> fTracks_local[L1Parameters::kMaxNthreads] {"L1Algo::fTracks_local"}; - L1Vector<L1HitIndex_t> fRecoHits_local[L1Parameters::kMaxNthreads] {"L1Algo::fRecoHits_local"}; + L1Vector<L1Track> fTracks_local[L1Constants::size::kMaxNthreads] {"L1Algo::fTracks_local"}; + L1Vector<L1HitIndex_t> fRecoHits_local[L1Constants::size::kMaxNthreads] {"L1Algo::fRecoHits_local"}; L1Vector<L1HitIndex_t> RealIHit_v {"L1Algo::RealIHit_v"}; L1Vector<L1HitIndex_t> RealIHit_v_buf {"L1Algo::RealIHit_v_buf"}; @@ -307,8 +307,8 @@ public: bool fMissingHits {0}; ///< TODO ??? TrackingMode fTrackingMode {kSts}; - fvec EventTime[L1Parameters::kMaxNthreads][L1Parameters::kMaxNthreads] {{0}}; - fvec Err[L1Parameters::kMaxNthreads][L1Parameters::kMaxNthreads] {{0}}; + fvec EventTime[L1Constants::size::kMaxNthreads][L1Constants::size::kMaxNthreads] {{0}}; + fvec Err[L1Constants::size::kMaxNthreads][L1Constants::size::kMaxNthreads] {{0}}; /// standard sizes of the arrays @@ -326,9 +326,8 @@ public: MaxNPortion = 40 * coeff / multiCoeff, - MaxArrSize = MaxNPortion * MaxPortionDoublets - / L1Parameters:: - kMaxNstations //200000, // standart size of big arrays // mas be 40000 for normal work in cbmroot! + MaxArrSize = MaxNPortion * MaxPortionDoublets / L1Constants::size::kMaxNstations + //200000, // standart size of big arrays // mas be 40000 for normal work in cbmroot! }; @@ -341,10 +340,10 @@ public: L1Vector<L1HitPoint>* vStsHitPointsUnused {nullptr}; L1HitIndex_t* RealIHit {nullptr}; // index in vStsHits indexed by index in vStsHitsUnused - L1HitIndex_t StsHitsUnusedStartIndex[L1Parameters::kMaxNstations + 1] {0}; - L1HitIndex_t StsHitsUnusedStopIndex[L1Parameters::kMaxNstations + 1] {0}; - L1HitIndex_t StsHitsUnusedStartIndexEnd[L1Parameters::kMaxNstations + 1] {0}; - L1HitIndex_t StsHitsUnusedStopIndexEnd[L1Parameters::kMaxNstations + 1] {0}; + L1HitIndex_t StsHitsUnusedStartIndex[L1Constants::size::kMaxNstations + 1] {0}; + L1HitIndex_t StsHitsUnusedStopIndex[L1Constants::size::kMaxNstations + 1] {0}; + L1HitIndex_t StsHitsUnusedStartIndexEnd[L1Constants::size::kMaxNstations + 1] {0}; + L1HitIndex_t StsHitsUnusedStopIndexEnd[L1Constants::size::kMaxNstations + 1] {0}; L1Vector<int> TripForHit[2] {"L1Algo::TripForHit"}; // TODO: what does '2' stand for? @@ -354,25 +353,25 @@ public: // fvec zPos[Portion/fvecLen]; // fvec fHitTime[Portion/fvecLen]; - nsL1::vector<L1TrackPar>::TSimd fT_3[L1Parameters::kMaxNthreads]; + nsL1::vector<L1TrackPar>::TSimd fT_3[L1Constants::size::kMaxNthreads]; - L1Vector<L1HitIndex_t> fhitsl_3[L1Parameters::kMaxNthreads] {"L1Algo::fhitsl_3"}; - L1Vector<L1HitIndex_t> fhitsm_3[L1Parameters::kMaxNthreads] {"L1Algo::fhitsm_3"}; - L1Vector<L1HitIndex_t> fhitsr_3[L1Parameters::kMaxNthreads] {"L1Algo::fhitsr_3"}; + L1Vector<L1HitIndex_t> fhitsl_3[L1Constants::size::kMaxNthreads] {"L1Algo::fhitsl_3"}; + L1Vector<L1HitIndex_t> fhitsm_3[L1Constants::size::kMaxNthreads] {"L1Algo::fhitsm_3"}; + L1Vector<L1HitIndex_t> fhitsr_3[L1Constants::size::kMaxNthreads] {"L1Algo::fhitsr_3"}; - nsL1::vector<fvec>::TSimd fu_front3[L1Parameters::kMaxNthreads]; - nsL1::vector<fvec>::TSimd fu_back3[L1Parameters::kMaxNthreads]; - nsL1::vector<fvec>::TSimd fz_pos3[L1Parameters::kMaxNthreads]; - nsL1::vector<fvec>::TSimd fTimeR[L1Parameters::kMaxNthreads]; - nsL1::vector<fvec>::TSimd fTimeER[L1Parameters::kMaxNthreads]; - nsL1::vector<fvec>::TSimd dx[L1Parameters::kMaxNthreads]; - nsL1::vector<fvec>::TSimd dy[L1Parameters::kMaxNthreads]; - nsL1::vector<fvec>::TSimd du[L1Parameters::kMaxNthreads]; - nsL1::vector<fvec>::TSimd dv[L1Parameters::kMaxNthreads]; + nsL1::vector<fvec>::TSimd fu_front3[L1Constants::size::kMaxNthreads]; + nsL1::vector<fvec>::TSimd fu_back3[L1Constants::size::kMaxNthreads]; + nsL1::vector<fvec>::TSimd fz_pos3[L1Constants::size::kMaxNthreads]; + nsL1::vector<fvec>::TSimd fTimeR[L1Constants::size::kMaxNthreads]; + nsL1::vector<fvec>::TSimd fTimeER[L1Constants::size::kMaxNthreads]; + nsL1::vector<fvec>::TSimd dx[L1Constants::size::kMaxNthreads]; + nsL1::vector<fvec>::TSimd dy[L1Constants::size::kMaxNthreads]; + nsL1::vector<fvec>::TSimd du[L1Constants::size::kMaxNthreads]; + nsL1::vector<fvec>::TSimd dv[L1Constants::size::kMaxNthreads]; - // Tindex NHits_l[L1Parameters::kMaxNstations]; - // Tindex NHits_l_P[L1Parameters::kMaxNstations]; + // Tindex NHits_l[L1Constants::size::kMaxNstations]; + // Tindex NHits_l_P[L1Constants::size::kMaxNstations]; /// ----- Output data ----- friend class CbmL1; diff --git a/reco/L1/L1Algo/L1BaseStationInfo.cxx b/reco/L1/L1Algo/L1BaseStationInfo.cxx index e52b621c17..dac4c26e53 100644 --- a/reco/L1/L1Algo/L1BaseStationInfo.cxx +++ b/reco/L1/L1Algo/L1BaseStationInfo.cxx @@ -20,7 +20,7 @@ #include "L1Assert.h" #include "L1BaseStationInfo.h" #include "L1Def.h" -#include "L1Parameters.h" +#include "L1Constants.h" // C++ STL #include <iomanip> #include <sstream> @@ -212,8 +212,8 @@ void L1BaseStationInfo::SetFieldFunction( L1MASSERT(0, fInitController.GetFlag(EInitKey::kYmax), "Attempt to set magnetic field slice before Ymax size of the station"); // TODO: Change names of variables according to convention (S.Zh.) - constexpr int M = L1Parameters::kMaxFieldApproxPolynomialOrder; - constexpr int N = L1Parameters::kMaxNFieldApproxCoefficients; + constexpr int M = L1Constants::size::kMaxFieldApproxPolynomialOrder; + constexpr int N = L1Constants::size::kMaxNFieldApproxCoefficients; constexpr int D = 3; ///> number of dimensions // SLE initialization diff --git a/reco/L1/L1Algo/L1CATrackFinder.cxx b/reco/L1/L1Algo/L1CATrackFinder.cxx index 6e96d7217b..f2d7f8da96 100644 --- a/reco/L1/L1Algo/L1CATrackFinder.cxx +++ b/reco/L1/L1Algo/L1CATrackFinder.cxx @@ -324,7 +324,7 @@ inline void L1Algo::f11( /// input 1st stage of singlet search } for (int ista = 0; ista <= istal - 1; ista++) { - if constexpr (L1Parameters::kIfUseRadLengthTable) { + if constexpr (L1Constants::control::kIfUseRadLengthTable) { fit.L1AddMaterial(T, fRadThick[ista].GetRadThick(T.x, T.y), fMaxInvMom, 1); } else { @@ -364,7 +364,7 @@ inline void L1Algo::f11( /// input 1st stage of singlet search #endif // BEGIN_FROM_TARGET - if constexpr (L1Parameters::kIfUseRadLengthTable) { + if constexpr (L1Constants::control::kIfUseRadLengthTable) { if (kGlobal == fTrackingMode || kMcbm == fTrackingMode) { fit.L1AddThickMaterial(T, fRadThick[istal].GetRadThick(T.x, T.y), fMaxInvMom, 1, stal.materialInfo.thick, 1); } @@ -691,7 +691,7 @@ inline void L1Algo::f30( // input } FilterTime(T2, timeM, timeMEr, stam.timeInfo); - if constexpr (L1Parameters::kIfUseRadLengthTable) { + if constexpr (L1Constants::control::kIfUseRadLengthTable) { if (kGlobal == fTrackingMode || kMcbm == fTrackingMode) { fit.L1AddThickMaterial(T2, fRadThick[istam].GetRadThick(T2.x, T2.y), fMaxInvMom, 1, stam.materialInfo.thick, 1); @@ -1043,7 +1043,7 @@ inline void L1Algo::f32( // input // TODO not updated after gaps introduction // fit for (int ih = 1; ih < NHits; ++ih) { L1Extrapolate(T, z[ih], T.qp, fld); - if constexpr (L1Parameters::kIfUseRadLengthTable) { + if constexpr (L1Constants::control::kIfUseRadLengthTable) { fit.L1AddMaterial(T, fRadThick[ista[ih]].GetRadThick(T.x, T.y), T.qp, 1); } else { @@ -1079,7 +1079,7 @@ inline void L1Algo::f32( // input // TODO not updated after gaps introduction // L1Filter( T, sta[ih].backInfo, v[ih] ); for (ih = NHits - 2; ih >= 0; ih--) { L1Extrapolate(T, z[ih], T.qp, fld); - if constexpr (L1Parameters::kIfUseRadLengthTable) { + if constexpr (L1Constants::control::kIfUseRadLengthTable) { fit.L1AddMaterial(T, fRadThick[ista[ih]].GetRadThick(T.x, T.y), T.qp, 1); } else { @@ -1111,7 +1111,7 @@ inline void L1Algo::f32( // input // TODO not updated after gaps introduction // L1Filter( T, sta[ih].backInfo, v[ih] ); for (ih = 1; ih < NHits; ++ih) { L1Extrapolate(T, z[ih], T.qp, fld); - if constexpr (L1Parameters::kIfUseRadLengthTable) { + if constexpr (L1Constants::control::kIfUseRadLengthTable) { fit.L1AddMaterial(T, fRadThick[ista[ih]].GetRadThick(T.x, T.y), T.qp, 1); } else { @@ -1664,9 +1664,9 @@ void L1Algo::CATrackFinder() // static Tindex stat_nDoublets[fNFindIterations] = {0}; static Tindex stat_nTriplets[fNFindIterations] = {0}; - static Tindex stat_nLevels[L1Parameters::kMaxNstations - 2][fNFindIterations] = {{0}}; - static Tindex stat_nCalls[fNFindIterations] = {0}; // n calls of CAFindTrack - static Tindex stat_nTrCandidates[fNFindIterations] = {0}; + static Tindex stat_nLevels[L1Constants::size::kMaxNstations - 2][fNFindIterations] = {{0}}; + static Tindex stat_nCalls[fNFindIterations] = {0}; // n calls of CAFindTrack + static Tindex stat_nTrCandidates[fNFindIterations] = {0}; #endif /********************************/ /** @@ -1939,7 +1939,7 @@ void L1Algo::CATrackFinder() // fMaxDZ = 0.1; // TODO: to be removed, because this condition is checked in L1InitManager (S.Zharko) - if (fNstations > (int) L1Parameters::kMaxNstations) cout << " CATrackFinder: Error: Too many Stations" << endl; + if (fNstations > (int) L1Constants::size::kMaxNstations) cout << " CATrackFinder: Error: Too many Stations" << endl; } #ifndef L1_NO_ASSERT @@ -2025,9 +2025,9 @@ void L1Algo::CATrackFinder() "L1CATrackFinder::hitsmG_2"); /// middle hits indexed by number of doublets in portion(i2) L1Vector<L1HitIndex_t> i1G_2( "L1CATrackFinder::i1G_2"); /// index in portion of singlets(i1) indexed by index in portion of doublets(i2) - L1Vector<char> lmDuplets[L1Parameters::kMaxNstations] { + L1Vector<char> lmDuplets[L1Constants::size::kMaxNstations] { "L1CATrackFinder::lmDuplets"}; // is exist a doublet started from indexed by left hit - L1Vector<char> lmDupletsG[L1Parameters::kMaxNstations] { + L1Vector<char> lmDupletsG[L1Constants::size::kMaxNstations] { "L1CATrackFinder::lmDupletsG"}; // is exist a doublet started from indexed by left hit for (int i = 0; i < fNstations; i++) { @@ -2110,7 +2110,7 @@ void L1Algo::CATrackFinder() } // } - // int nlevels[L1Parameters::kMaxNstations]; // number of triplets with some number of neighbours. + // int nlevels[L1Constants::size::kMaxNstations]; // number of triplets with some number of neighbours. // for (int il = 0; il < fNstations; ++il) nlevels[il] = 0; // // f5( // input @@ -2153,7 +2153,7 @@ void L1Algo::CATrackFinder() L1Branch curr_tr; - L1Branch new_tr[L1Parameters::kMaxNstations]; + L1Branch new_tr[L1Constants::size::kMaxNstations]; L1Branch best_tr; fscal curr_chi2 = 0; @@ -2543,7 +2543,7 @@ void L1Algo::CATrackFinder() c_timerG.Start(); #endif - if constexpr (L1Parameters::kIfMergeClones) { CAMergeClones(); } + if constexpr (L1Constants::control::kIfMergeClones) { CAMergeClones(); } #ifdef XXX c_timerG.Stop(); diff --git a/reco/L1/L1Algo/L1Constants.h b/reco/L1/L1Algo/L1Constants.h new file mode 100644 index 0000000000..92ac3e1c10 --- /dev/null +++ b/reco/L1/L1Algo/L1Constants.h @@ -0,0 +1,65 @@ +/* Copyright (C) 2016-2021 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt + SPDX-License-Identifier: GPL-3.0-only + Authors: Sergey Gorbunov, Sergei Zharko [committer] */ + +/************************************************************************************************************ + * @file L1Constants.h + * @brief Compile-time constants definition for the L1 tracking algorithm + * @since 02.06.2022 + * @author S.Zharko <s.zharko@gsi.de> + ***********************************************************************************************************/ + +#ifndef L1Constants_h +#define L1Constants_h 1 + +/// Namespace contains compile-time constants definition for the L1 tracking algorithm +namespace L1Constants { + + /// Array sizes + namespace size { + /// Amount of coefficients in field approximations + constexpr int kMaxNFieldApproxCoefficients {21}; // TODO: May be it is better to use the polynomial + // order instead of this? + /// Order of polynomial to approximate field in the vicinity of station plane + constexpr int kMaxFieldApproxPolynomialOrder {5}; + + /// Amount of bits to code a station, thread or triplet. This values determine the ma + constexpr unsigned int kStationBits {6u}; ///< Amount of bits to code one station + constexpr unsigned int kThreadBits {6u}; ///< Amount of bits to code one thread + constexpr unsigned int kTripletBits {32u - kStationBits - kThreadBits}; ///< Amount of bits to code one triplet + + constexpr int kMaxNdetectors {5}; ///< Max number of tracking detectors + constexpr int kMaxNstations {1u << kStationBits}; ///< Max number of stations, 2^6 = 64 + constexpr int kMaxNthreads {1u << kThreadBits}; ///< Max number of threads, 2^6 = 64 + constexpr int kMaxNtriplets {1u << kTripletBits}; ///< Max number of triplets, 2^20 = 1,048,576 + } // end namespace size + + /// Control flags + namespace control { + /// Flag for the radiation length tables usage + /// true - Radiational tables will be used, + /// false - basic station material info is used + constexpr bool kIfUseRadLengthTable {true}; + + /// Flag for calling the CAMergeClones procedure ... TODO + constexpr bool kIfMergeClones {true}; + + /// Flag: debug mode for analyzing the doublets pergormance efficiencies + //constexpr bool kIfDebugDoubletsPerformance {false}; + + /// Flag: debug mode for analyzing the tiplets pergormance efficiencies + //constexpr bool kIfDebugTripletsPerformance {false}; + + /// Flag: debug mode for creating pools for triplets. + /// NOTE: this feature will work only if the L1Parameters::kIfDebugTipletsPerformace is true! + //constexpr bool kIfCreateTripletPulls {false}; + } + + /// Miscellaneous constants + namespace misc { + constexpr int kAssertionLevel {0}; ///< Assertion level + } // end namespace control +} // end namespace L1Constants + + +#endif // L1Constants_h diff --git a/reco/L1/L1Algo/L1Field.cxx b/reco/L1/L1Algo/L1Field.cxx index c7c3f83c0b..8816d409ac 100644 --- a/reco/L1/L1Algo/L1Field.cxx +++ b/reco/L1/L1Algo/L1Field.cxx @@ -27,7 +27,6 @@ void L1FieldValue::Combine(L1FieldValue& B, fvec w) std::string L1FieldValue::ToString(int indentLevel) const { std::stringstream aStream {}; - // TODO: possibly it is better to place the indentChar into L1Parameters (S.Zharko) constexpr char indentChar = '\t'; std::string indent(indentLevel, indentChar); aStream << indent << "Bx [kG]: " << std::setw(12) << std::setfill(' ') << x[0] << '\n'; @@ -49,7 +48,7 @@ std::ostream& operator<<(std::ostream& out, const L1FieldValue& B) // L1FieldSlice::L1FieldSlice() noexcept { - for (int i = 0; i < L1Parameters::kMaxNFieldApproxCoefficients; ++i) { + for (int i = 0; i < L1Constants::size::kMaxNFieldApproxCoefficients; ++i) { cx[i] = 0.f; cy[i] = 0.f; cz[i] = 0.f; @@ -104,7 +103,7 @@ std::string L1FieldSlice::ToString(int indentLevel) const constexpr char indentChar = '\t'; std::string indent(indentLevel, indentChar); aStream << indent << "idx CX CY CZ"; - for (int i = 0; i < L1Parameters::kMaxNFieldApproxCoefficients; ++i) { + for (int i = 0; i < L1Constants::size::kMaxNFieldApproxCoefficients; ++i) { aStream << '\n' << indent; aStream << std::setw(3) << std::setfill(' ') << i << ' '; aStream << std::setw(12) << std::setfill(' ') << cx[i][0] << ' '; diff --git a/reco/L1/L1Algo/L1Field.h b/reco/L1/L1Algo/L1Field.h index 3c0527548a..9557670838 100644 --- a/reco/L1/L1Algo/L1Field.h +++ b/reco/L1/L1Algo/L1Field.h @@ -8,7 +8,7 @@ #include <string> #include "L1Def.h" -#include "L1Parameters.h" +#include "L1Constants.h" class L1FieldValue { public: @@ -47,9 +47,9 @@ public: // NOTE: We don't use an initialization of arrays here because we cannot be sure // if the underlying type (fvec) has a default constructor, but // we are sure, that it can be initialized with a float. (S.Zharko) - fvec cx[L1Parameters::kMaxNFieldApproxCoefficients]; ///< Polynomial coefficients for x-component of the field value - fvec cy[L1Parameters::kMaxNFieldApproxCoefficients]; ///< Polynomial coefficients for y-component of the field value - fvec cz[L1Parameters::kMaxNFieldApproxCoefficients]; ///< Polynomial coefficients for z-component of the field value + fvec cx[L1Constants::size::kMaxNFieldApproxCoefficients]; ///< Polynomial coefficients for x-component of the field value + fvec cy[L1Constants::size::kMaxNFieldApproxCoefficients]; ///< Polynomial coefficients for y-component of the field value + fvec cz[L1Constants::size::kMaxNFieldApproxCoefficients]; ///< Polynomial coefficients for z-component of the field value } _fvecalignment; diff --git a/reco/L1/L1Algo/L1InitManager.cxx b/reco/L1/L1Algo/L1InitManager.cxx index 7db48bd4a5..9df4a30def 100644 --- a/reco/L1/L1Algo/L1InitManager.cxx +++ b/reco/L1/L1Algo/L1InitManager.cxx @@ -10,6 +10,7 @@ #include "L1InitManager.h" + #include <algorithm> #include <sstream> @@ -266,9 +267,9 @@ void L1InitManager::SetNstations(L1DetectorID detectorID, int nStations) fInitController.SetFlag(EInitKey::kStationsNumberCrosscheck, ifInitialized); } if (fInitController.GetFlag(EInitKey::kStationsNumberCrosscheck)) { - fNstationsGeometry[L1Parameters::kMaxNdetectors] = + fNstationsGeometry[L1Constants::size::kMaxNdetectors] = std::accumulate(fNstationsGeometry.begin(), fNstationsGeometry.end() - 1, 0); - fNstationsActive[L1Parameters::kMaxNdetectors] = fNstationsGeometry[L1Parameters::kMaxNdetectors]; + fNstationsActive[L1Constants::size::kMaxNdetectors] = fNstationsGeometry[L1Constants::size::kMaxNdetectors]; } } @@ -301,7 +302,7 @@ void L1InitManager::SetTrackingLevel(int trackingLevel) //----------------------------------------------------------------------------------------------------------------------- // -void L1InitManager::TransferL1StationArray(std::array<L1Station, L1Parameters::kMaxNstations>& destinationArray) +void L1InitManager::TransferL1StationArray(std::array<L1Station, L1Constants::size::kMaxNstations>& destinationArray) { // // 1) Check, if all fields of this were initialized @@ -333,7 +334,7 @@ void L1InitManager::TransferL1StationArray(std::array<L1Station, L1Parameters::k //----------------------------------------------------------------------------------------------------------------------- // -void L1InitManager::TransferL1MaterialArray(std::array<L1Material, L1Parameters::kMaxNstations>& destinationArray) +void L1InitManager::TransferL1MaterialArray(std::array<L1Material, L1Constants::size::kMaxNstations>& destinationArray) { // // 1) Check, if all fields of this were initialized @@ -419,12 +420,12 @@ void L1InitManager::CheckStationsInfoInit() // 2) Check for maximum allowed number of stations // int nStationsTotal = fNstationsGeometry[fNstationsGeometry.size() - 1]; - if (nStationsTotal > L1Parameters::kMaxNstations) { + if (nStationsTotal > L1Constants::size::kMaxNstations) { std::stringstream aStream; aStream << "Actual total number of registered stations in geometry (" << nStationsTotal - << ") is larger then possible (" << L1Parameters::kMaxNstations + << ") is larger then possible (" << L1Constants::size::kMaxNstations << "). Please, select another set of active tracking detectors or recompile the code with enlarged" - << " L1Parameters::kMaxNstations value"; + << " L1Constants::size::kMaxNstations value"; // TODO: We have to provide an instruction of how to increase the kMaxNstations // number keeping the code consistent (S.Zharko) ifInitPassed = false; diff --git a/reco/L1/L1Algo/L1InitManager.h b/reco/L1/L1Algo/L1InitManager.h index 011306165b..80d523763c 100644 --- a/reco/L1/L1Algo/L1InitManager.h +++ b/reco/L1/L1Algo/L1InitManager.h @@ -12,6 +12,7 @@ #include "L1BaseStationInfo.h" #include "L1CAIteration.h" +#include "L1Constants.h" #include "L1Field.h" #include "L1ObjectInitController.h" #include "L1Parameters.h" @@ -235,11 +236,11 @@ public: /// Transfers an array of L1Stations formed inside a set of L1BaseStationInfo to a destination std::array /// \param destinationArray Reference to the destination array of L1Station objects in the L1Algo core - void TransferL1StationArray(std::array<L1Station, L1Parameters::kMaxNstations>& destinationArray); + void TransferL1StationArray(std::array<L1Station, L1Constants::size::kMaxNstations>& destinationArray); /// Transfers an array of L1Material tables formed inside a set of L1BaseStationInfo to a destination std::array /// \param destinationArray Reference to the destination array of L1Material objects in the L1Algo core - void TransferL1MaterialArray(std::array<L1Material, L1Parameters::kMaxNstations>& destinationArray); + void TransferL1MaterialArray(std::array<L1Material, L1Constants::size::kMaxNstations>& destinationArray); private: @@ -266,18 +267,18 @@ private: /// Numbers of stations, which are active in tracking. Index of an array element (except the last one) corresponds to a given /// L1DetectorID of the detector subystem. The last array element corresponds to the total number of stations. - std::array<int, L1Parameters::kMaxNdetectors + 1> fNstationsActive {}; + std::array<int, L1Constants::size::kMaxNdetectors + 1> fNstationsActive {}; /// Actual numbers of stations, provided by geometry. Index of an array element (except the last one) corresponds to a given /// L1DetectorID of the detector subystem. The last array element corresponds to the total number of stations. - std::array<int, L1Parameters::kMaxNdetectors + 1> fNstationsGeometry {}; + std::array<int, L1Constants::size::kMaxNdetectors + 1> fNstationsGeometry {}; /// Map of the actual detector indeces to the active detector indeces /// The vector maps actual station index (which is defined by ) to the index of station in tracking. If the station is inactive, /// its index is equal to -1. Example: let stations 1 and 4 be inactive. Then: /// actual index: 0 1 2 3 4 5 6 7 8 9 0 0 0 0 /// active index: 0 -1 1 2 -1 3 4 5 6 7 0 0 0 0 - std::array<int, L1Parameters::kMaxNstations> fActiveStationGlobalIDs {}; + std::array<int, L1Constants::size::kMaxNstations> fActiveStationGlobalIDs {}; /// A function which returns magnetic field vector B in a radius-vector xyz L1FieldFunction_t fFieldFunction {[](const double (&)[3], double (&)[3]) {}}; diff --git a/reco/L1/L1Algo/L1Parameters.cxx b/reco/L1/L1Algo/L1Parameters.cxx index a9fa4909ac..888d069e59 100644 --- a/reco/L1/L1Algo/L1Parameters.cxx +++ b/reco/L1/L1Algo/L1Parameters.cxx @@ -26,12 +26,12 @@ std::string L1Parameters::ToString(int indentLevel) const std::string indent(indentLevel, indentChar); aStream << '\n'; aStream << indent << "COMPILE TIME CONSTANTS:\n"; - aStream << indent << indentChar << "Bits to code one station: " << kStationBits << '\n'; - aStream << indent << indentChar << "Bits to code one thread: " << kThreadBits << '\n'; - aStream << indent << indentChar << "Bits to code one triplet: " << kTripletBits << '\n'; - aStream << indent << indentChar << "Max number of stations: " << kMaxNstations << '\n'; - aStream << indent << indentChar << "Max number of threads: " << kMaxNthreads << '\n'; - aStream << indent << indentChar << "Max number of triplets: " << kMaxNtriplets << '\n'; + aStream << indent << indentChar << "Bits to code one station: " <<L1Constants::size::kStationBits << '\n'; + aStream << indent << indentChar << "Bits to code one thread: " <<L1Constants::size::kThreadBits << '\n'; + aStream << indent << indentChar << "Bits to code one triplet: " <<L1Constants::size::kTripletBits << '\n'; + aStream << indent << indentChar << "Max number of stations: " <<L1Constants::size::kMaxNstations << '\n'; + aStream << indent << indentChar << "Max number of threads: " <<L1Constants::size::kMaxNthreads << '\n'; + aStream << indent << indentChar << "Max number of triplets: " <<L1Constants::size::kMaxNtriplets << '\n'; aStream << indent << "RUNTIME CONSTANTS:\n"; aStream << indent << indentChar << "Max number of doublets per singlet: " << fMaxDoubletsPerSinglet << '\n'; aStream << indent << indentChar << "Max number of triplets per doublet: " << fMaxTripletPerDoublets << '\n'; diff --git a/reco/L1/L1Algo/L1Parameters.h b/reco/L1/L1Algo/L1Parameters.h index 8f96f574fb..1d53ba3c8b 100644 --- a/reco/L1/L1Algo/L1Parameters.h +++ b/reco/L1/L1Algo/L1Parameters.h @@ -14,71 +14,32 @@ #include "L1CAIteration.h" +#include "L1Constants.h" #include "L1Vector.h" -//#include "utils/L1AlgoFunctions.h" +//#include "utils/L1AlgoFunctions.h" +/// Class L1Parameters represents a container for all external parameters of the L1 tracking algorithm, +/// including geometry parameters and physics cuts. The instance of the L1Parameters is constructed inside +/// L1InitManager class and then moved to the L1Algo instance. class L1Parameters { public: - /**********************/ /** - * COMPILE TIME CONSTANTS * - **************************/ - - // - // Array sizes - // - - /// Amount of coefficients in field approximations - static constexpr int kMaxNFieldApproxCoefficients {21}; // TODO: May be it is better to use the polynomial - // order instead of this? - /// Order of polynomial to approximate field in the vicinity of station plane - static constexpr int kMaxFieldApproxPolynomialOrder {5}; - - static constexpr unsigned int kStationBits {6u}; ///< Amount of bits to code one station - static constexpr unsigned int kThreadBits {6u}; ///< Amount of bits to code one thread - static constexpr unsigned int kTripletBits {32u - kStationBits - kThreadBits}; ///< Amount of bits to code one triple - - static constexpr int kMaxNdetectors {5}; ///< Max number of tracking detectors - static constexpr int kMaxNstations {1u << kStationBits}; ///< Max number of stations, 2^6 = 64 - static constexpr int kMaxNthreads {1u << kThreadBits}; ///< Max number of threads, 2^6 = 64 - static constexpr int kMaxNtriplets {1u << kTripletBits}; ///< Max number of triplets, 2^20 = 1,048,576 - - static constexpr int kStandardIOWidth {15}; ///< Width of one output entry, passed to the std::setw() - static constexpr int kAssertionLevel {0}; ///< Assertion level - - // - // Compile control flags - // - - /// Flag for the radiation length tables usage - /// true - Radiational tables will be used, - /// false - basic station material info is used - static constexpr bool kIfUseRadLengthTable {true}; - - /// Flag for calling the CAMergeClones procedure ... TODO - static constexpr bool kIfMergeClones {true}; - - /// Flag: debug mode for analyzing the doublets pergormance efficiencies - static constexpr bool kIfDebugDoubletsPerformance {false}; - /// Flag: debug mode for analyzing the tiplets pergormance efficiencies - static constexpr bool kIfDebugTripletsPerformance {false}; - /// Flag: debug mode for creating pools for triplets. - /// NOTE: this feature will work only if the L1Parameters::kIfDebugTipletsPerformace is true! - static constexpr bool kIfCreateTipletPulls {false}; - - -public: /// Default constructor L1Parameters() = default; + /// Destructor ~L1Parameters() = default; + /// Copy constructor L1Parameters(const L1Parameters& other) = default; + /// Copy assignment operator L1Parameters& operator=(const L1Parameters& other) = default; + /// Move constructor L1Parameters(L1Parameters&& other) = default; + /// Move assignment operator L1Parameters& operator=(L1Parameters&& other) = default; diff --git a/reco/L1/L1Algo/L1TrackFitter.cxx b/reco/L1/L1Algo/L1TrackFitter.cxx index 2f9528a9dc..e2573416c3 100644 --- a/reco/L1/L1Algo/L1TrackFitter.cxx +++ b/reco/L1/L1Algo/L1TrackFitter.cxx @@ -135,7 +135,7 @@ void L1Algo::KFTrackFitter_simple() // TODO: Add pipe. L1ExtrapolateLine(T, hit.z); // T.L1Extrapolate( sta.z, qp0, fld ); // L1Extrapolate( T, hit.z, qp0, fld ); - if constexpr (L1Parameters::kIfUseRadLengthTable) { + if constexpr (L1Constants::control::kIfUseRadLengthTable) { fit.L1AddMaterial(T, fRadThick[i].GetRadThick(T.x, T.y), qp0, ONE); } else { @@ -274,7 +274,7 @@ void L1Algo::KFTrackFitter_simple() // TODO: Add pipe. L1ExtrapolateLine(T, hit.z); // T.L1Extrapolate( sta.z, qp0, fld ); // L1Extrapolate( T, hit.z, qp0, fld ); - if constexpr (L1Parameters::kIfUseRadLengthTable) { + if constexpr (L1Constants::control::kIfUseRadLengthTable) { fit.L1AddMaterial(T, fRadThick[i].GetRadThick(T.x, T.y), qp0, ONE); } else { @@ -354,19 +354,19 @@ void L1Algo::L1KFTrackFitter() L1Station* sta = fStations.begin(); L1Station staFirst, staLast; - fvec x[L1Parameters::kMaxNstations], u[L1Parameters::kMaxNstations], v[L1Parameters::kMaxNstations], - y[L1Parameters::kMaxNstations], time[L1Parameters::kMaxNstations], timeEr[L1Parameters::kMaxNstations], - z[L1Parameters::kMaxNstations]; - fvec d_x[L1Parameters::kMaxNstations], d_y[L1Parameters::kMaxNstations], d_xy[L1Parameters::kMaxNstations], - d_u[L1Parameters::kMaxNstations], d_v[L1Parameters::kMaxNstations]; + fvec x[L1Constants::size::kMaxNstations], u[L1Constants::size::kMaxNstations], v[L1Constants::size::kMaxNstations], + y[L1Constants::size::kMaxNstations], time[L1Constants::size::kMaxNstations], timeEr[L1Constants::size::kMaxNstations], + z[L1Constants::size::kMaxNstations]; + fvec d_x[L1Constants::size::kMaxNstations], d_y[L1Constants::size::kMaxNstations], d_xy[L1Constants::size::kMaxNstations], + d_u[L1Constants::size::kMaxNstations], d_v[L1Constants::size::kMaxNstations]; fvec x_first, y_first, time_first, x_last, y_last, time_last, time_er_first, time_er_last, d_x_fst, d_y_fst, d_xy_fst, time_er_lst, d_x_lst, d_y_lst, d_xy_lst; - fvec Sy[L1Parameters::kMaxNstations], w[L1Parameters::kMaxNstations], w_time[L1Parameters::kMaxNstations]; + fvec Sy[L1Constants::size::kMaxNstations], w[L1Constants::size::kMaxNstations], w_time[L1Constants::size::kMaxNstations]; fvec y_temp, x_temp; fvec fldZ0, fldZ1, fldZ2, z_start, z_end; - L1FieldValue fB[L1Parameters::kMaxNstations], fB_temp _fvecalignment; + L1FieldValue fB[L1Constants::size::kMaxNstations], fB_temp _fvecalignment; - fvec ZSta[L1Parameters::kMaxNstations]; + fvec ZSta[L1Constants::size::kMaxNstations]; for (int iHit = 0; iHit < nHits; iHit++) { ZSta[iHit] = sta[iHit].z; } @@ -388,7 +388,7 @@ void L1Algo::L1KFTrackFitter() for (iVec = 0; iVec < nTracks_SIMD; iVec++) { int nHitsTrack = t[iVec]->NHits; - int iSta[L1Parameters::kMaxNstations]; + int iSta[L1Constants::size::kMaxNstations]; for (i = 0; i < nHitsTrack; i++) { const L1Hit& hit = (*vStsHits)[fRecoHits[start_hit++]]; const int ista = (*fStripFlag)[hit.f] / 4; @@ -521,7 +521,7 @@ void L1Algo::L1KFTrackFitter() T1.L1AddPipeMaterial(qp01, wIn); T1.EnergyLossCorrection(fit.PipeRadThick, qp01, fvec(1.f), wIn); } - if constexpr (L1Parameters::kIfUseRadLengthTable) { + if constexpr (L1Constants::control::kIfUseRadLengthTable) { fit.L1AddMaterial(T, fRadThick[i].GetRadThick(T.x, T.y), qp0, wIn); fit.EnergyLossCorrection(T, fRadThick[i].GetRadThick(T.x, T.y), qp0, fvec(1.f), wIn); @@ -681,7 +681,7 @@ void L1Algo::L1KFTrackFitter() T1.L1AddPipeMaterial(qp01, wIn); T1.EnergyLossCorrection(fit.PipeRadThick, qp01, fvec(-1.f), wIn); } - if constexpr (L1Parameters::kIfUseRadLengthTable) { + if constexpr (L1Constants::control::kIfUseRadLengthTable) { fit.L1AddMaterial(T, fRadThick[i].GetRadThick(T.x, T.y), qp0, wIn); fit.EnergyLossCorrection(T, fRadThick[i].GetRadThick(T.x, T.y), qp0, fvec(-1.f), wIn); @@ -780,20 +780,20 @@ void L1Algo::L1KFTrackFitterMuch() L1Station* sta = fStations.begin(); L1Station staFirst, staLast; - fvec x[L1Parameters::kMaxNstations], u[L1Parameters::kMaxNstations], v[L1Parameters::kMaxNstations], - y[L1Parameters::kMaxNstations], time[L1Parameters::kMaxNstations], timeEr[L1Parameters::kMaxNstations], - z[L1Parameters::kMaxNstations]; - fvec d_x[L1Parameters::kMaxNstations], d_y[L1Parameters::kMaxNstations], d_xy[L1Parameters::kMaxNstations], - d_u[L1Parameters::kMaxNstations], d_v[L1Parameters::kMaxNstations]; + fvec x[L1Constants::size::kMaxNstations], u[L1Constants::size::kMaxNstations], v[L1Constants::size::kMaxNstations], + y[L1Constants::size::kMaxNstations], time[L1Constants::size::kMaxNstations], timeEr[L1Constants::size::kMaxNstations], + z[L1Constants::size::kMaxNstations]; + fvec d_x[L1Constants::size::kMaxNstations], d_y[L1Constants::size::kMaxNstations], d_xy[L1Constants::size::kMaxNstations], + d_u[L1Constants::size::kMaxNstations], d_v[L1Constants::size::kMaxNstations]; fvec x_first, y_first, time_first, x_last, y_last, time_last, time_er_fst, d_x_fst, d_y_fst, d_xy_fst, time_er_lst, d_x_lst, d_y_lst, d_xy_lst, dz; - int iSta[L1Parameters::kMaxNstations]; - fvec Sy[L1Parameters::kMaxNstations], w[L1Parameters::kMaxNstations]; + int iSta[L1Constants::size::kMaxNstations]; + fvec Sy[L1Constants::size::kMaxNstations], w[L1Constants::size::kMaxNstations]; fvec y_temp, x_temp; fvec fldZ0, fldZ1, fldZ2, z_start, z_end; - L1FieldValue fB[L1Parameters::kMaxNstations], fB_temp _fvecalignment; + L1FieldValue fB[L1Constants::size::kMaxNstations], fB_temp _fvecalignment; - fvec ZSta[L1Parameters::kMaxNstations]; + fvec ZSta[L1Constants::size::kMaxNstations]; for (int iHit = 0; iHit < nHits; iHit++) { ZSta[iHit] = sta[iHit].z; } @@ -965,7 +965,7 @@ void L1Algo::L1KFTrackFitterMuch() fldB1 = fldB0; fldZ1 = fldZ0; - if constexpr (L1Parameters::kIfUseRadLengthTable) { + if constexpr (L1Constants::control::kIfUseRadLengthTable) { T1.EnergyLossCorrection(fRadThick[i].GetRadThick(T1.fx, T1.fy), qp01, fvec(-1.f), wIn); T1.L1AddThickMaterial(fRadThick[i].GetRadThick(T1.fx, T1.fy), qp01, wIn, sta[i].materialInfo.thick, 1); @@ -1039,7 +1039,7 @@ void L1Algo::L1KFTrackFitterMuch() // T1.ExtrapolateLine( z_last, &w1); // L1ExtrapolateLine( T, z_last); - if constexpr (L1Parameters::kIfUseRadLengthTable) { + if constexpr (L1Constants::control::kIfUseRadLengthTable) { if (i == 11 || i == 14 || i == 17) T1.EnergyLossCorrectionIron(fRadThick[i].GetRadThick(T1.fx, T1.fy) / (nofSteps + 1), qp01, fvec(-1.f), wIn); @@ -1180,7 +1180,7 @@ void L1Algo::L1KFTrackFitterMuch() T1.ExtrapolateLine(z_cur, &w2); nofSteps1 = nofSteps1 + (one - mask1); - if constexpr (L1Parameters::kIfUseRadLengthTable) { + if constexpr (L1Constants::control::kIfUseRadLengthTable) { if (i == 11 || i == 14 || i == 17) T1.EnergyLossCorrectionIron(fRadThick[i].GetRadThick(T1.fx, T1.fy) / (nofSteps + 1), qp01, fvec(1.f), w2); @@ -1254,7 +1254,7 @@ void L1Algo::L1KFTrackFitterMuch() // L1Extrapolate( T, z[i], qp0, fld,&w1 ); - if constexpr (L1Parameters::kIfUseRadLengthTable) { + if constexpr (L1Constants::control::kIfUseRadLengthTable) { T1.EnergyLossCorrection(fRadThick[i].GetRadThick(T1.fx, T1.fy), qp01, fvec(1.f), wIn); T1.L1AddThickMaterial(fRadThick[i].GetRadThick(T1.fx, T1.fy), qp01, wIn, sta[i].materialInfo.thick, 0); } diff --git a/reco/L1/L1AlgoInputData.h b/reco/L1/L1AlgoInputData.h index cbb7ed0960..258f7e937b 100644 --- a/reco/L1/L1AlgoInputData.h +++ b/reco/L1/L1AlgoInputData.h @@ -22,7 +22,7 @@ struct L1AlgoInputData { */ static constexpr int kMaxNStations {25}; ///> max number of stations to be passed to the L1AlgoInputData object - // TODO: Why is it different to the value used in L1Algo (L1Parameters::kMaxNstations)? (S.Zharko) + // TODO: Why is it different to the value used in L1Algo (L1Constants::size::kMaxNstations)? (S.Zharko) /// Default constructor L1AlgoInputData() = default; diff --git a/reco/L1/ParticleFinder/CbmL1PFFitter.cxx b/reco/L1/ParticleFinder/CbmL1PFFitter.cxx index f8afa2a532..1e431d1713 100644 --- a/reco/L1/ParticleFinder/CbmL1PFFitter.cxx +++ b/reco/L1/ParticleFinder/CbmL1PFFitter.cxx @@ -261,7 +261,7 @@ void CbmL1PFFitter::Fit(vector<CbmStsTrack>& Tracks, vector<int>& pidHypo) fit.L1AddPipeMaterial(T, qp0, wIn); fit.EnergyLossCorrection(T, fit.PipeRadThick, qp0, fvec(-1.f), wIn); } - if constexpr (L1Parameters::kIfUseRadLengthTable) { + if constexpr (L1Constants::control::kIfUseRadLengthTable) { fit.L1AddMaterial(T, CbmL1::Instance()->algo->GetMaterialThickness(i, T.x, T.y), qp0, wIn); fit.EnergyLossCorrection(T, CbmL1::Instance()->algo->GetMaterialThickness(i, T.x, T.y), qp0, -1, wIn); } @@ -337,7 +337,7 @@ void CbmL1PFFitter::Fit(vector<CbmStsTrack>& Tracks, vector<int>& pidHypo) fit.L1AddPipeMaterial(T, qp0, wIn); fit.EnergyLossCorrection(T, fit.PipeRadThick, qp0, fvec(1.f), wIn); } - if constexpr (L1Parameters::kIfUseRadLengthTable) { + if constexpr (L1Constants::control::kIfUseRadLengthTable) { fit.L1AddMaterial(T, CbmL1::Instance()->algo->GetMaterialThickness(i, T.x, T.y), qp0, wIn); fit.EnergyLossCorrection(T, CbmL1::Instance()->algo->GetMaterialThickness(i, T.x, T.y), qp0, 1, wIn); } -- GitLab