Go to the documentation of this file.
25 #define LAST_ITERATION kAllSecIter
26 #define FIND_GAPED_TRACKS // use triplets with gaps
28 #ifndef TRACKS_FROM_TRIPLETS
65 #define TRIP_PERFORMANCE
68 #ifdef TRIP_PERFORMANCE
69 template<Tindex NHits>
72 #ifdef DOUB_PERFORMANCE
73 template<Tindex NHits>
82 L1Algo(
int nThreads = 1,
int TypicalSize = 200000)
132 hitToBestTrackF(TypicalSize)
133 , hitToBestTrackB(TypicalSize)
227 for (
unsigned int j = 0; j < hitToBestTrackB.size(); j++) {
228 omp_init_lock(&hitToBestTrackB[j]);
229 omp_init_lock(&hitToBestTrackF[j]);
235 for (
int i = 0;
i < nThreads;
i++)
288 void DrawRecoTracksTime(
const vector<CbmL1Track>&
tracks);
293 Init(
const vector<fscal>& geo,
const bool UseHitErrors,
const bool mCBMmode);
304 void SetData(
const vector<L1StsHit>& StsHits_,
305 const vector<L1Strip>& StsStrips_,
306 const vector<L1Strip>& StsStripsB_,
307 const vector<fscal>& StsZPos_,
308 const vector<unsigned char>& SFlag_,
309 const vector<unsigned char>& SFlagB_,
310 const THitI* StsHitsStartIndex_,
311 const THitI* StsHitsStopIndex_
339 const vector<L1Strip>
343 const vector<L1StsHit>*
349 const vector<unsigned char>
493 inline int PackIndex(
const int& a,
const int& b,
const int& c);
498 GetFStation(
unsigned char flag) {
502 GetFUsed(
unsigned char flag) {
503 return (flag & 0x02) != 0;
514 unsigned char& best_L,
518 unsigned char& curr_L,
520 unsigned char min_best_l,
534 const bool initParams =
true);
541 const bool initParams =
true);
551 const fvec qp0 = 0.0);
573 PackLocation(
unsigned int& location,
581 UnPackStation(
unsigned int& location,
unsigned int&
iStation) {
586 UnPackThread(
unsigned int& location,
unsigned int&
thread) {
587 thread = (location >> 3) & 0xFF;
591 UnPackTriplet(
unsigned int& location,
unsigned int&
triplet) {
596 SetFStation(
unsigned char& flag,
unsigned int iStation) {
603 inline __attribute__((always_inline))
void SetFUnUsed(
unsigned char& flag) {
659 #ifdef DOUB_PERFORMANCE
660 vector<THitI>& hitsl_2,
662 vector<THitI>& hitsm_2,
664 vector<bool>& lmDuplets);
681 vector<THitI>& hitsm_2,
684 const vector<bool>& mrDuplets,
688 vector<THitI>& hitsl_3,
689 vector<THitI>& hitsm_3,
690 vector<THitI>& hitsr_3,
722 vector<THitI>& hitsl_3,
723 vector<THitI>& hitsm_3,
724 vector<THitI>& hitsr_3,
725 int nIterations = 0);
734 vector<THitI>& hitsl_3,
735 vector<THitI>& hitsm_3,
736 vector<THitI>& hitsr_3,
739 vector<THitI>* hitsn_3 = 0,
740 vector<THitI>* hitsr_5 = 0
760 Tindex* portionStopIndex_,
767 vector<bool>& lmDuplets,
772 vector<THitI>& hitsm_2);
786 vector<THitI>& hitsm_2,
788 const vector<bool>& mrDuplets
853 friend class ParalleledDup;
854 friend class ParalleledTrip;
869 #ifdef FIND_GAPED_TRACKS
882 #ifdef TRACKS_FROM_TRIPLETS
906 #endif // FIND_GAPED_TRACKS
950 #ifdef TRIP_PERFORMANCE
954 #ifdef DOUB_PERFORMANCE
const vector< fscal > * vStsZPos
vector< L1StsHit > * vStsHitsUnused
const vector< L1StsHit > * vStsHits
L1Vector< L1Triplet > TripletsLocal1[nSta][nTh]
void f4(Tindex n3, int istal, int istam, int istar, nsL1::vector< L1TrackPar >::TSimd &T_3, vector< THitI > &hitsl_3, vector< THitI > &hitsm_3, vector< THitI > &hitsr_3, Tindex &nstaltriplets, vector< THitI > *hitsn_3=0, vector< THitI > *hitsr_5=0)
Select triplets. Save them into vTriplets.
L1Vector< unsigned short > LastHit
contain strips positions and coordinates of hit
L1Grid vGridTime[MaxNStations]
L1FieldValue targB _fvecalignment
nsL1::vector< fvec >::TSimd fz_pos3[nTh]
void GuessVec(L1TrackPar &t, fvec *xV, fvec *yV, fvec *zV, fvec *Sy, fvec *wV, int NHits, fvec *zCur=0)
---— Subroutines used by L1Algo::KFTrackFitter() ---—
vector< L1StsHit > vStsDontUsedHits_Buf
void dUdV_to_dY(const fvec &u, const fvec &v, fvec &_y, const L1Station &sta)
void FindMoreHits(L1Branch &t, L1TrackPar &T, const bool dir, const fvec qp0=0.0)
nsL1::vector< fvec >::TSimd fu_back3[nTh]
void f20(Tindex n1, L1Station &stam, L1HitPoint *vStsHits_m, L1TrackPar *T_1, THitI *hitsl_1, Tindex &n2, vector< THitI > &i1_2, vector< THitI > &hitsm_2, fvec *Event, vector< bool > &lmDuplets)
Find the doublets. Reformat data in the portion of doublets.
L1Vector< int > vStripToTrackB
L1Vector< L1Branch > CandidatesTrack[nTh]
void StripsToCoor(const fscal &u, const fscal &v, fscal &x, fscal &y, const L1Station &sta) const
L1Vector< THitI > FirstHitIndex
void MultiplySS(fvec const C[15], fvec const V[15], fvec K[5][5])
__attribute__((always_inline)) void PackLocation(unsigned int &location
float Pick_gather
parameters which are different for different iterations. Set in the begin of CAL1TrackFinder
const L1FieldValue & GetVtxFieldValue() const
int UnPackIndex(const int &i, int &a, int &b, int &c)
THitI StsHitsUnusedStopIndex[MaxNStations+1]
void f30(L1HitPoint *vStsHits_r, L1Station &stam, L1Station &star, int istam, int istar, L1HitPoint *vStsHits_m, L1TrackPar *T_1, L1FieldRegion *fld_1, THitI *hitsl_1, Tindex n2, vector< THitI > &hitsm_2, vector< THitI > &i1_2, const vector< bool > &mrDuplets, Tindex &n3, nsL1::vector< L1TrackPar >::TSimd &T_3, vector< THitI > &hitsl_3, vector< THitI > &hitsm_3, vector< THitI > &hitsr_3, nsL1::vector< fvec >::TSimd &u_front_3, nsL1::vector< fvec >::TSimd &u_back_3, nsL1::vector< fvec >::TSimd &z_Pos_3, nsL1::vector< fvec >::TSimd &du_, nsL1::vector< fvec >::TSimd &dv_, nsL1::vector< fvec >::TSimd &timeR, nsL1::vector< fvec >::TSimd &timeER)
unsigned int unsigned int iStation
vector< L1HitPoint > vStsDontUsedHitsxy_B
L1Vector< unsigned short > Neighbour
vector< L1StsHit > vStsDontUsedHits_B
L1Vector< THitI > vRecoHits_local[nTh]
const THitI * StsHitsStartIndex
vector< L1HitPoint > vStsDontUsedHitsxy_A
void dUdV_to_dX(const fvec &u, const fvec &v, fvec &_x, const L1Station &sta)
L1Algo(const L1Algo &)=delete
void MultiplySR(fvec const C[15], fvec const r_in[5], fvec r_out[5])
nsL1::vector< fvec >::TSimd dx[nTh]
vector< L1StsHit > vStsDontUsedHits_A
Tindex portionStopIndex[nSta]
nsL1::vector< fvec >::TSimd fTimeR[nTh]
unsigned int unsigned int unsigned int & thread
const vector< L1Strip > * vStsStrips
vector< THitI > * RealIHitPBuf
void KFTrackFitter_simple()
Track fitting procedures.
const THitI * StsHitsStopIndex
L1Vector< L1Track > vTracks_local[nTh]
THitI StsHitsUnusedStartIndex[MaxNStations+1]
nsL1::vector< fvec >::TSimd fu_front3[nTh]
L1Vector< float > TrackChi2
L1Vector< THitI > vRecoHitsNew
int nTripletsThread[nSta][nTh]
void TripletsStaPort(int istal, int istam, int istar, Tindex &nstaltriplets, L1TrackPar *T_1, L1FieldRegion *fld_1, THitI *hitsl_1, Tindex &n_2, vector< THitI > &i1_2, vector< THitI > &hitsm_2, const vector< bool > &mrDuplets)
Find triplets on station.
const vector< L1Strip > * vStsStripsB
THitI StsHitsUnusedStartIndexEnd[MaxNStations+1]
L1Algo operator=(const L1Algo &)=delete
__attribute__((always_inline)) void UnPackStation(unsigned int &location
const L1FieldRegion & GetVtxFieldRegion() const
L1FieldRegion vtxFieldRegion _fvecalignment
L1Vector< unsigned short > FirstHit
fscal BranchExtender(L1Branch &t)
Try to extrapolate and find additional hits on other stations.
vector< L1HitPoint > * vStsHitPointsUnused
L1FieldValue vtxFieldValue _fvecalignment
unsigned int NTracksIsecAll
__attribute__((always_inline)) void SetFUnUsed(unsigned char &flag)
L1Vector< L1Track > vTracksNew
void L1KFTrackFitterMuch()
const vector< unsigned char > * vSFlagB
class L1Algo _fvecalignment
void FilterFirstL(L1TrackParFit &track, fvec &x, fvec &y, fvec &t, fvec &t_er, L1Station &st, fvec &dx, fvec &dy, fvec &dxy)
nsL1::vector< L1TrackPar >::TSimd fT_3[nTh]
__attribute__((always_inline)) void UnPackTriplet(unsigned int &location
unsigned int NHitsIsecAll
vector< THitI > RealIHit_v_buf2
void InvertCholetsky(fvec a[15])
--— Subroutines used by L1Algo::CAMergeClones() ---—
L1Algo(int nThreads=1, int TypicalSize=200000)
__attribute__((always_inline)) void UnPackThread(unsigned int &location
nsL1::vector< fvec >::TSimd fTimeER[nTh]
vector< L1HitPoint > vStsDontUsedHitsxy_buf
nsL1::vector< fvec >::TSimd dv[nTh]
int numberCandidateThread[nTh]
void f10(Tindex start_lh, Tindex n1_l, L1HitPoint *StsHits_l, fvec *u_front_l, fvec *u_back_l, fvec *zPos_l, THitI *hitsl, fvec *HitTime_l, fvec *HitTimeEr, fvec *Event_l, fvec *d_x, fvec *d_y, fvec *d_xy, fvec *d_u, fvec *d_v)
Prepare the portion of left hits data.
vector< THitI > fhitsm_3[nTh]
void CAFindTrack(int ista, L1Branch &best_tr, unsigned char &best_L, fscal &best_chi2, const L1Triplet *curr_trip, L1Branch &curr_tr, unsigned char &curr_L, fscal &curr_chi2, unsigned char min_best_l, L1Branch *new_tr)
================================= FUNCTIONAL PART =================================
const vector< unsigned char > * vSFlag
L1Vector< L1Track > vTracks
THitI StsHitsUnusedStopIndexEnd[MaxNStations+1]
__attribute__((always_inline)) void SetFUsed(unsigned char &flag)
void BranchFitter(const L1Branch &t, L1TrackPar &T, const bool dir, const fvec qp0=0., const bool initParams=true)
Fit track. more precise than FitterFast.
L1XYMeasurementInfo TargetXYInfo _fvecalignment
L1Vector< int > vStripToTrack
vector< THitI > RealIHit_v_buf
Tindex FIRSTCASTATION
================================= DATA PART =================================
nsL1::vector< fvec >::TSimd dy[nTh]
vector< L1Triplet * > * TripletsLocal[MaxNStations - 2]
vector< THitI > fhitsl_3[nTh]
__attribute__((always_inline)) void SetFStation(unsigned char &flag
vector< THitI > fhitsr_3[nTh]
void Init(const vector< fscal > &geo, const bool UseHitErrors, const bool mCBMmode)
map< int, int > threadNumberToCpuMap
vector< THitI > RealIHit_v
vector< int > TripForHit[2]
__attribute__((always_inline)) static bool GetFUsed(unsigned char flag)
void DupletsStaPort(int istal, int istam, Tindex ip, vector< Tindex > &n_g, Tindex *portionStopIndex_, L1TrackPar *T_1, L1FieldRegion *fld_1, THitI *hitsl_1, vector< bool > &lmDuplets, Tindex &n_2, vector< THitI > &i1_2, vector< THitI > &hitsm_2)
Find doublets on station.
L1Vector< THitI > vRecoHits
vector< THitI > * RealIHitP
L1Grid vGrid[MaxNStations]
L1Station vStations[MaxNStations] _fvecalignment
void FilterTracks(fvec const r[5], fvec const C[15], fvec const m[5], fvec const V[15], fvec R[5], fvec W[15], fvec *chi2)
int PackIndex(const int &a, const int &b, const int &c)
void f31(Tindex n3_V, L1Station &star, nsL1::vector< fvec >::TSimd &u_front_3, nsL1::vector< fvec >::TSimd &u_back_3, nsL1::vector< fvec >::TSimd &z_Pos_3, nsL1::vector< fvec >::TSimd &du_, nsL1::vector< fvec >::TSimd &dv_, nsL1::vector< fvec >::TSimd &timeR, nsL1::vector< fvec >::TSimd &timeER, nsL1::vector< L1TrackPar >::TSimd &T_3)
Add the right hits to parameters estimation.
__attribute__((always_inline)) static unsigned char GetFStation(unsigned char flag)
– Flags routines –
void dUdV_to_dXdY(const fvec &u, const fvec &v, fvec &_xy, const L1Station &sta)
void MultiplyMS(fvec const C[5][5], fvec const V[15], fvec K[15])
nsL1::vector< fvec >::TSimd du[nTh]
void f11(int istal, int istam, Tindex n1_V, fvec *u_front_l, fvec *u_back_l, fvec *zPos_l, fvec *HitTime_l, fvec *HitTimeEr, L1TrackPar *T_1, L1FieldRegion *fld_1, fvec *d_x, fvec *d_y, fvec *d_xy, fvec *d_u, fvec *d_v)
Get the field approximation. Add the target to parameters estimation. Propagate to middle station.
void f32(Tindex n3, int istal, nsL1::vector< L1TrackPar >::TSimd &T_3, vector< THitI > &hitsl_3, vector< THitI > &hitsm_3, vector< THitI > &hitsr_3, int nIterations=0)
Refit Triplets.
int isec
— data used during finding iterations
void SetNThreads(int n=1)
--— Input data --—
vector< L1Material > fRadThick
void GetHitCoor(const L1StsHit &_h, fscal &_x, fscal &_y, fscal &_z, const L1Station &sta)
--— Hit-point-strips conversion routines ---—
L1HitPoint CreateHitPoint(const L1StsHit &hit, char ista)
full the hit point by hit information: takes hit as input (2 strips) and creates hit_point with all c...
void CATrackFinder()
The main procedure - find tracks.
void SetData(const vector< L1StsHit > &StsHits_, const vector< L1Strip > &StsStrips_, const vector< L1Strip > &StsStripsB_, const vector< fscal > &StsZPos_, const vector< unsigned char > &SFlag_, const vector< unsigned char > &SFlagB_, const THitI *StsHitsStartIndex_, const THitI *StsHitsStopIndex_)
L1Vector< THitI > LastHitIndex
void BranchFitterFast(const L1Branch &t, L1TrackPar &T, const bool dir, const fvec qp0=0., const bool initParams=true)
void f5(int *nlevel)
Find neighbours of triplets. Calculate level of triplets.
void FilterFirst(L1TrackPar &track, fvec &x, fvec &y, L1Station &st)