diff --git a/reco/L1/L1Algo/L1Algo.cxx b/reco/L1/L1Algo/L1Algo.cxx index c654d67a9452e1b93165d1f7af65bb94262e207a..55bb0822cae9eb4fb6066bf60b0323fa9fbf2104 100644 --- a/reco/L1/L1Algo/L1Algo.cxx +++ b/reco/L1/L1Algo/L1Algo.cxx @@ -34,23 +34,23 @@ void L1Algo::SetNThreads(unsigned int n) fTrackCandidates[i].SetName(std::stringstream() << "L1Algo::fTrackCandidates[" << i << "]"); - fT_3[i].reserve(L1Constants::size::kMaxPortionTripletsP); - - fhitsl_3[i].SetName(std::stringstream() << "L1Algo::fhitsl_3[" << i << "]"); - fhitsm_3[i].SetName(std::stringstream() << "L1Algo::fhitsm_3[" << i << "]"); - fhitsr_3[i].SetName(std::stringstream() << "L1Algo::fhitsr_3[" << i << "]"); - - fhitsl_3[i].reserve(L1Constants::size::kMaxPortionTriplets); - fhitsm_3[i].reserve(L1Constants::size::kMaxPortionTriplets); - fhitsr_3[i].reserve(L1Constants::size::kMaxPortionTriplets); - - fu_front3[i].reserve(L1Constants::size::kMaxPortionTripletsP); - fu_back3[i].reserve(L1Constants::size::kMaxPortionTripletsP); - fz_pos3[i].reserve(L1Constants::size::kMaxPortionTripletsP); - fTimeR[i].reserve(L1Constants::size::kMaxPortionTripletsP); - fTimeER[i].reserve(L1Constants::size::kMaxPortionTripletsP); - du[i].reserve(L1Constants::size::kMaxPortionTripletsP); - dv[i].reserve(L1Constants::size::kMaxPortionTripletsP); + fTripletPar[i].reserve(L1Constants::size::kMaxPortionTripletsP); + + fTripletHitsL[i].SetName(std::stringstream() << "L1Algo::fhitsl_3[" << i << "]"); + fTripletHitsM[i].SetName(std::stringstream() << "L1Algo::fhitsm_3[" << i << "]"); + fTripletHitsR[i].SetName(std::stringstream() << "L1Algo::fhitsr_3[" << i << "]"); + + fTripletHitsL[i].reserve(L1Constants::size::kMaxPortionTriplets); + fTripletHitsM[i].reserve(L1Constants::size::kMaxPortionTriplets); + fTripletHitsR[i].reserve(L1Constants::size::kMaxPortionTriplets); + + fTripletHitR_Ufront[i].reserve(L1Constants::size::kMaxPortionTripletsP); + fTripletHitR_Uback[i].reserve(L1Constants::size::kMaxPortionTripletsP); + fTripletHitR_Z[i].reserve(L1Constants::size::kMaxPortionTripletsP); + fTripletHitR_Time[i].reserve(L1Constants::size::kMaxPortionTripletsP); + fTripletHitR_TimeErr[i].reserve(L1Constants::size::kMaxPortionTripletsP); + fTripletHitR_dUfront[i].reserve(L1Constants::size::kMaxPortionTripletsP); + fTripletHitR_dUback[i].reserve(L1Constants::size::kMaxPortionTripletsP); for (unsigned int j = 0; j < L1Constants::size::kMaxNstations; j++) { fTriplets[j][i].SetName(std::stringstream() << "L1Algo::fTriplets[" << i << "][" << j << "]"); diff --git a/reco/L1/L1Algo/L1Algo.h b/reco/L1/L1Algo/L1Algo.h index b2c0d88e03f4a0ba7811962fbc332840ef64f87d..5dc713f24fb2b09de58005dd51009486acb2c8ca 100644 --- a/reco/L1/L1Algo/L1Algo.h +++ b/reco/L1/L1Algo/L1Algo.h @@ -314,9 +314,7 @@ public: /// Select triplets. Save them into vTriplets. void findTripletsStep3( // input Tindex n3, int istal, int istam, int istar, L1Vector<L1TrackPar>& T_3, L1Vector<L1HitIndex_t>& hitsl_3, - L1Vector<L1HitIndex_t>& hitsm_3, L1Vector<L1HitIndex_t>& hitsr_3, - // output - Tindex& nstaltriplets); + L1Vector<L1HitIndex_t>& hitsm_3, L1Vector<L1HitIndex_t>& hitsr_3); /// Find neighbours of triplets. Calculate level of triplets. @@ -338,10 +336,9 @@ public: Tindex& n_2, L1Vector<L1HitIndex_t>& i1_2, L1Vector<L1HitIndex_t>& hitsm_2); /// Find triplets on station - void TripletsStaPort( // input - int istal, int istam, int istar, Tindex& nstaltriplets, L1TrackPar* T_1, L1FieldRegion* fld_1, - L1HitIndex_t* hitsl_1, Tindex& n_2, L1Vector<L1HitIndex_t>& i1_2, L1Vector<L1HitIndex_t>& hitsm_2, - const L1Vector<char>& mrDoublets + void CreatePortionOfTriplets( // input + int istal, int istam, int istar, L1TrackPar* T_1, L1FieldRegion* fld_1, L1HitIndex_t* hitsl_1, Tindex& n_2, + L1Vector<L1HitIndex_t>& i1_2, L1Vector<L1HitIndex_t>& hitsm_2, const L1Vector<char>& mrDoublets // output ); @@ -500,19 +497,19 @@ public: // fvec zPos[Portion/fvecLen]; // fvec fHitTime[Portion/fvecLen]; - L1Vector<L1TrackPar> fT_3[L1Constants::size::kMaxNthreads] {"fT_3"}; + L1Vector<L1TrackPar> fTripletPar[L1Constants::size::kMaxNthreads] {"fTripletPar"}; - 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"}; + L1Vector<L1HitIndex_t> fTripletHitsL[L1Constants::size::kMaxNthreads] {"L1Algo::fTripletHitsL"}; + L1Vector<L1HitIndex_t> fTripletHitsM[L1Constants::size::kMaxNthreads] {"L1Algo::fTripletHitsM"}; + L1Vector<L1HitIndex_t> fTripletHitsR[L1Constants::size::kMaxNthreads] {"L1Algo::fTripletHitsR"}; - L1Vector<fvec> fu_front3[L1Constants::size::kMaxNthreads] {"L1Algo::fu_front3"}; - L1Vector<fvec> fu_back3[L1Constants::size::kMaxNthreads] {"L1Algo::fu_back3"}; - L1Vector<fvec> fz_pos3[L1Constants::size::kMaxNthreads] {"L1Algo::fz_pos3"}; - L1Vector<fvec> fTimeR[L1Constants::size::kMaxNthreads] {"L1Algo::fTimeR"}; - L1Vector<fvec> fTimeER[L1Constants::size::kMaxNthreads] {"L1Algo::fTimeER"}; - L1Vector<fvec> du[L1Constants::size::kMaxNthreads] {"L1Algo::du"}; - L1Vector<fvec> dv[L1Constants::size::kMaxNthreads] {"L1Algo::dv"}; + L1Vector<fvec> fTripletHitR_Ufront[L1Constants::size::kMaxNthreads] {"L1Algo::fTripletHitR_Ufront"}; + L1Vector<fvec> fTripletHitR_Uback[L1Constants::size::kMaxNthreads] {"L1Algo::fTripletHitR_Uback"}; + L1Vector<fvec> fTripletHitR_Z[L1Constants::size::kMaxNthreads] {"L1Algo::fTripletHitR_Z"}; + L1Vector<fvec> fTripletHitR_Time[L1Constants::size::kMaxNthreads] {"L1Algo::fTripletHitR_Time"}; + L1Vector<fvec> fTripletHitR_TimeErr[L1Constants::size::kMaxNthreads] {"L1Algo::fTripletHitR_TimeErr"}; + L1Vector<fvec> fTripletHitR_dUfront[L1Constants::size::kMaxNthreads] {"L1Algo::fTripletHitR_dUfront"}; + L1Vector<fvec> fTripletHitR_dUback[L1Constants::size::kMaxNthreads] {"L1Algo::fTripletHitR_dUback"}; // Tindex NHits_l[L1Constants::size::kMaxNstations]; diff --git a/reco/L1/L1Algo/L1CATrackFinder.cxx b/reco/L1/L1Algo/L1CATrackFinder.cxx index 9350b6bb22176c80d122b0c1c6d2a057c29ed4d9..32d99760a5746179d9dc564b1e2faefa233318c3 100644 --- a/reco/L1/L1Algo/L1CATrackFinder.cxx +++ b/reco/L1/L1Algo/L1CATrackFinder.cxx @@ -1139,9 +1139,7 @@ inline void L1Algo::findTripletsStep2( // input // TODO not updated after gaps inline void L1Algo::findTripletsStep3( // input Tindex n3, int istal, int istam, int istar, L1Vector<L1TrackPar>& T_3, L1Vector<L1HitIndex_t>& hitsl_3, - L1Vector<L1HitIndex_t>& hitsm_3, L1Vector<L1HitIndex_t>& hitsr_3, - // output - Tindex& nstaltriplets) + L1Vector<L1HitIndex_t>& hitsm_3, L1Vector<L1HitIndex_t>& hitsr_3) { /// Selects good triplets and saves them into fTriplets. /// Finds neighbouring triplets at the next station. @@ -1154,12 +1152,6 @@ inline void L1Algo::findTripletsStep3( // input /// \param hitsl_3 index of the left triplet hit in unused hits on the left station /// \param hitsm_3 index of the middle triplet hit in unused hits on the middle station /// \param hitsr_3 index of the right triplet hit in unused hits on the right station - /// - /// Output: - /// - /// \param nstaltriplets updated number of triplets in fTriplets[istal][Thread] - - // TODO: SG: remove nstaltriplets parameter #ifdef _OPENMP unsigned int Thread = omp_get_thread_num(); @@ -1233,8 +1225,6 @@ inline void L1Algo::findTripletsStep3( // input tr1.SetIsMomentumFitted(isMomentumFitted); tr1.SetLevel(0); - ++nstaltriplets; - fHitNtriplets[ihitl]++; if (istal > (fParameters.GetNstationsActive() - 4)) continue; @@ -1370,8 +1360,8 @@ inline void L1Algo::CreatePortionOfDoublets( /// input: /// @istal - start station number /// @istam - last station number - /// @iPortion - index of portion of left hits - /// @&portionSize - number of left hits in the portion + /// @iSingletPortion - index of portion of left hits + /// @singletPortionSize - number of left hits in the portion /// output: /// @*T_1 - singlets parameters /// @*fld_1 - field aproximation @@ -1453,39 +1443,37 @@ inline void L1Algo::CreatePortionOfDoublets( /// ------------------- Triplets on station ---------------------- -inline void L1Algo::TripletsStaPort( /// creates triplets: +inline void L1Algo::CreatePortionOfTriplets( + /// input + int istal, int istam, int istar, + + /// input / output + L1TrackPar* T_1, L1FieldRegion* fld_1, L1HitIndex_t* hitsl_1, + + Tindex& n_2, L1Vector<L1HitIndex_t>& i1_2, L1Vector<L1HitIndex_t>& hitsm_2, + + const L1Vector<char>& mrDoublets) +{ + + /// creates a portion of triplets: /// input: - /// @istal - start station number, + /// @istal - left station number, /// @istam - middle station number, - /// @istar - last station number, - /// @ip - index of portion, - /// @&n_g - numer of elements in portion, - /// @*portionStopIndex - int istal, int istam, int istar, + /// @istar - right station number, + + /// input / output: - /// @nstaltriplets - , - /// @*portionStopIndex, /// @*T_1 - track parameters for singlets, /// @*fld_1 - field approximation for singlets, /// @&n_2 - number of doublets in portion /// @&n_2 - number of doublets, /// @&i1_2 - index of 1st hit in portion indexed by doublet index, /// @&hitsm_2 - index of middle hit in hits array indexed by doublet index - - - Tindex& nstaltriplets, L1TrackPar* T_1, L1FieldRegion* fld_1, L1HitIndex_t* hitsl_1, - - Tindex& n_2, L1Vector<L1HitIndex_t>& i1_2, L1Vector<L1HitIndex_t>& hitsm_2, - - const L1Vector<char>& mrDoublets - /// output: // @*vTriplets_part - array of triplets, // @*TripStartIndexH, // @*TripStopIndexH - start/stop index of a triplet in the array -) -{ if (istar < fParameters.GetNstationsActive()) { // prepare data const L1Station& stam = fParameters.GetStation(istam); @@ -1507,17 +1495,17 @@ inline void L1Algo::TripletsStaPort( /// creates triplets: int Thread = 0; #endif - L1Vector<L1TrackPar>& T_3 = fT_3[Thread]; - L1Vector<L1HitIndex_t>& hitsl_3 = fhitsl_3[Thread]; - L1Vector<L1HitIndex_t>& hitsm_3 = fhitsm_3[Thread]; - L1Vector<L1HitIndex_t>& hitsr_3 = fhitsr_3[Thread]; - L1Vector<fvec>& u_front3 = fu_front3[Thread]; - L1Vector<fvec>& u_back3 = fu_back3[Thread]; - L1Vector<fvec>& z_pos3 = fz_pos3[Thread]; - L1Vector<fvec>& timeR = fTimeR[Thread]; - L1Vector<fvec>& timeER = fTimeER[Thread]; - L1Vector<fvec>& du3 = du[Thread]; - L1Vector<fvec>& dv3 = dv[Thread]; + L1Vector<L1TrackPar>& T_3 = fTripletPar[Thread]; + L1Vector<L1HitIndex_t>& hitsl_3 = fTripletHitsL[Thread]; + L1Vector<L1HitIndex_t>& hitsm_3 = fTripletHitsM[Thread]; + L1Vector<L1HitIndex_t>& hitsr_3 = fTripletHitsR[Thread]; + L1Vector<fvec>& u_front3 = fTripletHitR_Ufront[Thread]; + L1Vector<fvec>& u_back3 = fTripletHitR_Uback[Thread]; + L1Vector<fvec>& z_pos3 = fTripletHitR_Z[Thread]; + L1Vector<fvec>& timeR = fTripletHitR_Time[Thread]; + L1Vector<fvec>& timeER = fTripletHitR_TimeErr[Thread]; + L1Vector<fvec>& du3 = fTripletHitR_dUfront[Thread]; + L1Vector<fvec>& dv3 = fTripletHitR_dUback[Thread]; T_3.clear(); hitsl_3.clear(); @@ -1584,9 +1572,7 @@ inline void L1Algo::TripletsStaPort( /// creates triplets: /// Fill Triplets. findTripletsStep3( // input - n3, istal, istam, istar, T_3, hitsl_3, hitsm_3, hitsr_3, - // output - nstaltriplets); + n3, istal, istam, istar, T_3, hitsl_3, hitsm_3, hitsr_3); } } @@ -2025,10 +2011,9 @@ void L1Algo::CATrackFinder() n_2, i1_2, hitsm_2); - Tindex nstaltriplets = 0; - TripletsStaPort( // input - istal, istal + 1, istal + 2, nstaltriplets, T_1, fld_1, hitsl_1, + CreatePortionOfTriplets( // input + istal, istal + 1, istal + 2, T_1, fld_1, hitsl_1, n_2, i1_2, hitsm_2, @@ -2053,16 +2038,15 @@ void L1Algo::CATrackFinder() } if ((fMissingHits && (istal == 0)) || !fMissingHits) { - TripletsStaPort( // input - istal, istal + 1, istal + 3, nstaltriplets, T_1, fld_1, hitsl_1, + CreatePortionOfTriplets( // input + istal, istal + 1, istal + 3, T_1, fld_1, hitsl_1, n_2, i1_2, hitsm_2, lmDoubletsG[istal + 1]); } if ((fMissingHits && (istal == 1)) || !fMissingHits) { - TripletsStaPort( // input - istal, istal + 2, istal + 3, nstaltriplets, TG_1, fldG_1, hitslG_1, nG_2, i1G_2, hitsmG_2, - lmDoublets[istal + 2]); + CreatePortionOfTriplets( // input + istal, istal + 2, istal + 3, TG_1, fldG_1, hitslG_1, nG_2, i1G_2, hitsmG_2, lmDoublets[istal + 2]); } } } //