46 #ifdef TRIP_PERFORMANCE
49 #ifdef DOUB_PERFORMANCE
90 const Tindex& end_lh = start_lh + n1_l;
93 for (
Tindex ilh = start_lh, i1 = 0; ilh < end_lh; ++ilh, ++i1) {
99 #ifdef USE_EVENT_NUMBER
100 Event_l[i1_V][i1_4] = hitl.track;
103 HitTime_l[i1_V][i1_4] = hitl.
time;
104 HitTimeEr[i1_V][i1_4] = hitl.
timeEr;
107 u_front_l[i1_V][i1_4] = hitl.
U();
108 u_back_l[i1_V][i1_4] = hitl.
V();
114 d_u[i1_V][i1_4] = hitl.
dU();
115 d_v[i1_V][i1_4] = hitl.
dV();
118 zPos_l[i1_V][i1_4] = hitl.
Z();
148 int istal_global = 5;
149 int istam_global = 6;
150 L1Station& stal_global = vStations[istal_global];
151 L1Station& stam_global = vStations[istam_global];
152 fvec zstal_global = stal_global.
z;
153 fvec zstam_global = stam_global.
z;
162 for (
int i1_V = 0; i1_V < n1_V; i1_V++) {
169 fvec& u = u_front_l[i1_V];
170 fvec&
v = u_back_l[i1_V];
172 fvec zl = zPos_l[i1_V];
173 fvec& time = HitTime_l[i1_V];
174 fvec& timeEr = HitTimeEr[i1_V];
177 fvec dx1, dy1, dxy1 = 0;
189 int istac = istal / 2;
195 int istac_global = istal_global / 2;
197 L1Station& stac_global = vStations[istac_global];
198 fvec zstac_global = stac.
z;
216 fld0.
Set(l_B, stal.
z, centB, stac.
z, targB,
targZ);
225 fld1.
Set(m_B, zstam, l_B, zstal, centB, zstac);
227 fld1.
Set(m_B, zstam, l_B, zstal, targB,
targZ);
228 #else // if USE_3HITS // the best now
234 fld1.
Set(r_B, zstar, m_B, zstam, l_B, zstal);
259 T.
C55 = timeEr * timeEr;
264 #ifndef BEGIN_FROM_TARGET
285 fvec eX, eY, J04, J14;
307 fvec eX, eY, J04, J14;
322 #else // TODO: doesn't work. Why?
328 T.
C00 = TargetXYInfo.C00;
329 T.
C10 = TargetXYInfo.C10;
330 T.
C11 = TargetXYInfo.C11;
342 for (
int ista = 0; ista <= istal - 1; ista++) {
356 0.000511f * 0.000511f);
360 T, vStations[ista].materialInfo,
MaxInvMom, 1, 0.000511
f * 0.000511
f);
410 0.000511f * 0.000511f);
417 fvec dz = zstam - T.
z;
446 #ifdef DOUB_PERFORMANCE
447 vector<THitI>& hitsl_2,
449 vector<THitI>& hitsm_2,
451 vector<bool>& lmDuplets) {
453 for (
Tindex i1 = 0; i1 < n1; ++i1)
459 const int n2Saved = n2;
461 const fvec& Pick_m22 =
467 const fscal& iz = 1 / T1.
z[i1_4];
468 const float& timeError = T1.
C55[i1_4];
469 const float& time = T1.
t[i1_4];
480 sqrt(timeError) * 5);
496 if (
fabs(time - hitm.
time) > 40)
continue;
498 #ifdef USE_EVENT_NUMBER
499 if ((Event[i1_V][i1_4] != hitm.n))
continue;
502 const fscal& zm = hitm.
Z();
523 dy_est2 = Pick_m22[i1_4] *
fabs(C11[i1_4] + dym[0] * dym[0]);
530 const fscal& dY = ym[i1_4] -
y[i1_4];
532 if (dY * dY > dy_est2 && dY < 0)
continue;
543 dx_est2 = Pick_m22[i1_4] *
fabs(C00[i1_4] + dxm[0] * dxm[0]);
546 const fscal& dX = xm[i1_4] -
x[i1_4];
547 if (dX * dX > dx_est2)
continue;
559 #ifdef DO_NOT_SELECT_TRIPLETS
560 if (
isec != TRACKS_FROM_TRIPLETS_ITERATION)
565 #ifdef USE_EVENT_NUMBER
577 #ifdef DO_NOT_SELECT_TRIPLETS
578 if (
isec != TRACKS_FROM_TRIPLETS_ITERATION)
583 #ifdef DOUB_PERFORMANCE
584 hitsl_2.push_back(hitsl_1[i1]);
585 #endif // DOUB_PERFORMANCE
586 hitsm_2.push_back(imh);
598 if (n2 > 8000)
return;
602 lmDuplets[hitsl_1[i1]] = (n2Saved < n2);
620 vector<THitI>& hitsm_2,
622 const vector<bool>& ,
626 vector<THitI>& hitsl_3,
627 vector<THitI>& hitsm_3,
628 vector<THitI>& hitsr_3,
643 Tindex n3_V = 0, n3_4 = 0;
645 T_3.push_back(L1TrackPar_0);
646 u_front_3.push_back(fvec_0);
647 u_back_3.push_back(fvec_0);
648 z_Pos_3.push_back(fvec_0);
651 du_.push_back(fvec_0);
652 dv_.push_back(fvec_0);
653 timeR.push_back(fvec_0);
654 timeER.push_back(fvec_0);
674 for (
Tindex i2 = 0; i2 < n2;) {
676 for (; n2_4 <
fvecLen && i2 < n2; n2_4++, i2++) {
681 const Tindex& i1 = i1_2[i2];
691 const Tindex& imh = hitsm_2[i2];
693 u_front_2[n2_4] = hitm.
U();
694 u_back_2[n2_4] = hitm.
V();
695 zPos_2[n2_4] = hitm.
Z();
696 timeM[n2_4] = hitm.
time;
697 timeMEr[n2_4] = hitm.
timeEr;
699 du2[n2_4] = hitm.
dU();
700 dv2[n2_4] = hitm.
dV();
702 hitsl_2[n2_4] = hitsl_1[i1];
703 hitsm_2_tmp[n2_4] = hitsm_2[i2];
709 fvec dz = zPos_2 - T2.
z;
754 0.000511f * 0.000511f);
777 for (
Tindex i2_4 = 0; i2_4 < n2_4; ++i2_4) {
781 if (T2.
C00[i2_4] < 0 || T2.
C11[i2_4] < 0 || T2.
C22[i2_4] < 0
786 const float& timeError = T2.
C55[i2_4];
787 const float& time = T2.
t[i2_4];
791 #ifdef DO_NOT_SELECT_TRIPLETS
792 if (
isec == TRACKS_FROM_TRIPLETS_ITERATION) Pick_r22 = Pick_r2 + 1;
794 const fscal& iz = 1 / T2.
z[i2_4];
805 sqrt(timeError) * 5);
812 #ifdef USE_EVENT_NUMBER
813 if ((T2.n[i2_4] != hitr.n))
continue;
815 const fscal& zr = hitr.
Z();
822 fvec dz3 = zr - T2.
z;
829 if (
fabs(T2.
t[i2_4] - hitr.
time) > 40)
continue;
848 dy_est2 = (Pick_r22[i2_4] * (
fabs(C11[i2_4] + dyr[0] * dyr[0])));
851 const fscal& dY = yr[i2_4] -
y[i2_4];
852 const fscal& dY2 = dY * dY;
853 if (dY2 > dy_est2 && dY2 < 0)
864 (Pick_r22[i2_4] * (
fabs(C00[i2_4] + star.
XYInfo.
C00[i2_4])));
869 dx_est2 = (Pick_r22[i2_4] * (
fabs(C00[i2_4] + dxr[0] * dxr[0])));
872 const fscal& dX = xr[i2_4] -
x[i2_4];
873 if (dX * dX > dx_est2)
continue;
893 #ifdef DO_NOT_SELECT_TRIPLETS
894 if (
isec != TRACKS_FROM_TRIPLETS_ITERATION)
902 || C11[i2_4] < 0 || T.
C55[i2_4] < 0)
909 hitsl_3.push_back(hitsl_2[i2_4]);
910 hitsm_3.push_back(hitsm_2_tmp[i2_4]);
911 hitsr_3.push_back(irh);
915 u_front_3[n3_V][n3_4] = hitr.
U();
916 u_back_3[n3_V][n3_4] = hitr.
V();
919 du_[n3_V][n3_4] = hitr.
dU();
920 dv_[n3_V][n3_4] = hitr.
dV();
921 z_Pos_3[n3_V][n3_4] = zr;
922 timeR[n3_V][n3_4] = hitr.
time;
923 timeER[n3_V][n3_4] = hitr.
timeEr;
930 T_3.push_back(L1TrackPar_0);
931 u_front_3.push_back(fvec_0);
932 u_back_3.push_back(fvec_0);
933 z_Pos_3.push_back(fvec_0);
936 du_.push_back(fvec_0);
937 dv_.push_back(fvec_0);
938 timeR.push_back(fvec_0);
939 timeER.push_back(fvec_0);
942 if (n3 > 4000)
return;
965 for (
Tindex i3_V = 0; i3_V < n3_V; ++i3_V) {
966 fvec dz = z_Pos[i3_V] - T_3[i3_V].z;
978 L1Filter(T_3[i3_V], info, u_front_[i3_V]);
983 L1Filter(T_3[i3_V], info, u_front_[i3_V]);
992 L1Filter(T_3[i3_V], info, u_back_[i3_V]);
996 L1Filter(T_3[i3_V], info, u_back_[i3_V]);
998 FilterTime(T_3[i3_V], timeR[i3_V], timeER[i3_V]);
1008 vector<THitI>& hitsl_3,
1009 vector<THitI>& hitsm_3,
1010 vector<THitI>& hitsr_3,
1012 const int NHits = 3;
1015 int ista[NHits] = {istal, istal + 1, istal + 2};
1018 for (
int is = 0; is < NHits; ++is) {
1019 sta[is] = vStations[ista[is]];
1022 for (
int i3 = 0; i3 < n3; ++i3) {
1030 THitI ihit[NHits] = {
1035 fscal u[NHits],
v[NHits],
x[NHits],
y[NHits], z[NHits];
1036 for (
int ih = 0; ih < NHits; ++ih) {
1037 const L1StsHit& hit = (*vStsHits)[ihit[ih]];
1038 u[ih] = (*vStsStrips)[hit.
f];
1039 v[ih] = (*vStsStripsB)[hit.
b];
1041 z[ih] = (*vStsZPos)[hit.
iz];
1051 fvec dz01 = 1. / (z[1] - z[0]);
1052 T.
tx = (
x[1] -
x[0]) * dz01;
1053 T.
ty = (
y[1] -
y[0]) * dz01;
1073 fvec tx[3] = {(
x[1] -
x[0]) / (z[1] - z[0]),
1074 (
x[2] -
x[0]) / (z[2] - z[0]),
1075 (
x[2] -
x[1]) / (z[2] - z[1])};
1076 fvec ty[3] = {(
y[1] -
y[0]) / (z[1] - z[0]),
1077 (
y[2] -
y[0]) / (z[2] - z[0]),
1078 (
y[2] -
y[1]) / (z[2] - z[1])};
1079 for (
int ih = 0; ih < NHits; ++ih) {
1080 fvec dz = (sta[ih].
z - z[ih]);
1082 x[ih] + tx[ih] * dz,
y[ih] + ty[ih] * dz, B[ih]);
1084 fld.Set(B[0], sta[0].z, B[1], sta[1].z, B[2], sta[2].z);
1087 for (
int ih = 1; ih < NHits; ++ih) {
1096 L1Filter(T, sta[ih].frontInfo, u[ih]);
1101 for (
int iiter = 0; iiter < nIterations; ++iiter) {
1122 for (ih = NHits - 2; ih >= 0; ih--) {
1131 L1Filter(T, sta[ih].frontInfo, u[ih]);
1153 for (ih = 1; ih < NHits; ++ih) {
1162 L1Filter(T, sta[ih].frontInfo, u[ih]);
1179 vector<THitI>& hitsl_3,
1180 vector<THitI>& hitsm_3,
1181 vector<THitI>& hitsr_3,
1187 THitI ihitl_priv = 0;
1189 unsigned int Station = 0;
1190 unsigned int Thread = 0;
1191 unsigned int Triplet = 0;
1193 unsigned int Location = 0;
1195 unsigned char level = 0;
1198 for (
Tindex i3 = 0; i3 < n3; ++i3) {
1212 Thread = omp_get_thread_num();
1227 Location = Triplet + Station * 100000000 + Thread * 1000000;
1229 if (ihitl_priv == 0 || ihitl_priv != hitsl_3[i3]) {
1235 ihitl_priv = hitsl_3[i3];
1238 #ifdef DO_NOT_SELECT_TRIPLETS
1239 if (
isec != TRACKS_FROM_TRIPLETS_ITERATION)
1246 fscal qp = MaxInvMomS + T3.
qp[i3_4];
1248 if (qp > MaxInvMomS * 2) qp = MaxInvMomS * 2;
1254 qp = (
static_cast<unsigned int>(qp * scale)) % 256;
1255 Cqp = (
static_cast<unsigned int>(Cqp * scale)) % 256;
1258 if (Cqp < 0) Cqp = 0;
1259 if (Cqp > 20) Cqp = 20;
1260 qp =
static_cast<unsigned char>(qp);
1273 fscal& time = T3.
t[i3_4];
1285 ihitl, ihitm, ihitr, istal, istam, istar, 0, qp, chi2, time, Cqp, 0);
1300 Location = Triplet + Station * 100000000 + Thread * 1000000;
1313 for (
unsigned int iN = 0; iN < Neighbours; ++iN) {
1317 Station = Location / 100000000;
1318 Thread = (Location - Station * 100000000) / 1000000;
1319 Triplet = (Location - Station * 100000000 - Thread * 1000000);
1323 if ((curNeighbour.
GetMHit() != ihitr))
continue;
1329 const unsigned char& jlevel = curNeighbour.
GetLevel();
1331 if (level <= jlevel) level = jlevel + 1;
1342 #ifdef TRACKS_FROM_TRIPLETS
1343 if (
isec != TRACKS_FROM_TRIPLETS_ITERATION)
1348 int tripType = 0; tripType < 3;
1356 && (tripType != 0) && (istal ==
NStations - 4)))
1359 int istam = istal + 1;
1360 int istar = istal + 2;
1362 case 1: istar++;
break;
1372 if (istam != trip->
GetMSta())
continue;
1373 if (istar != trip->
GetRSta())
continue;
1375 unsigned char level = 0;
1377 unsigned char qp = trip->
GetQp();
1389 vector<unsigned int> neighCands;
1390 neighCands.reserve(8);
1392 unsigned int Neighbours =
1395 for (
unsigned int iN = 0; iN < Neighbours; ++iN) {
1400 int Station = Location / 100000000;
1401 int Thread = (Location - Station * 100000000) / 1000000;
1402 int Triplet = (Location - Station * 100000000 - Thread * 1000000);
1418 unsigned char jlevel = tripn->
GetLevel();
1419 if (level <= jlevel) level = jlevel + 1;
1420 if (level == jlevel + 1) neighCands.push_back(Location);
1450 vector<Tindex>& n_g,
1451 Tindex* portionStopIndex_,
1458 vector<bool>& lmDuplets,
1460 vector<THitI>& i1_2,
1461 vector<THitI>& hitsm_2) {
1484 (ip - portionStopIndex_[istal + 1]) *
Portion,
1532 #ifdef DOUB_PERFORMANCE
1533 vector<THitI> hitsl_2;
1534 #endif // DOUB_PERFORMANCE
1545 #ifdef DOUB_PERFORMANCE
1552 for (
Tindex i = 0; i < static_cast<Tindex>(hitsm_2.size()); ++
i)
1559 #ifdef DOUB_PERFORMANCE
1565 THitI iHits[2] = {RealIHitL[hitsl_2[
i]], RealIHitM[hitsm_2[
i]]};
1566 fL1Eff_doublets->AddOne(iHits);
1568 #endif // DOUB_PERFORMANCE
1591 vector<THitI>& i1_2,
1592 vector<THitI>& hitsm_2,
1594 const vector<bool>& mrDuplets
1616 int Thread = omp_get_thread_num();
1622 vector<THitI>& hitsl_3 =
fhitsl_3[Thread];
1623 vector<THitI>& hitsm_3 =
fhitsm_3[Thread];
1624 vector<THitI>& hitsr_3 =
fhitsr_3[Thread];
1687 for (
Tindex i = 0; i < static_cast<Tindex>(hitsl_3.size()); ++
i)
1690 for (
Tindex i = 0; i < static_cast<Tindex>(hitsm_3.size()); ++
i)
1693 for (
Tindex i = 0; i < static_cast<Tindex>(hitsr_3.size()); ++
i)
1719 #ifdef TRIP_PERFORMANCE
1727 RealIHitL[hitsl_3[
i]], RealIHitM[hitsm_3[
i]], RealIHitR[hitsr_3[
i]]};
1729 if (fL1Eff_triplets->AddOne(iHits))
1730 fL1Pulls->AddOne(T_3[i_V], i_4, iHits[2]);
1732 fL1Eff_triplets->AddOne(iHits);
1735 fL1Eff_triplets2->AddOne(iHits);
1737 #endif // TRIP_PERFORMANCE
1795 fL1Pulls = l1Pulls_;
1798 #ifdef TRIP_PERFORMANCE
1801 fL1Eff_triplets = l1Eff_triplets_;
1802 fL1Eff_triplets->
Init();
1805 fL1Eff_triplets2 = l1Eff_triplets2_;
1806 fL1Eff_triplets2->
Init();
1808 #ifdef DOUB_PERFORMANCE
1811 fL1Eff_doublets = l1Eff_doublets_;
1812 fL1Eff_doublets->
Init();
1821 #if defined(XXX) || defined(COUNTERS)
1822 static unsigned int stat_N = 0;
1827 TStopwatch c_timerG;
1828 TStopwatch c_timerI;
1857 static Tindex stat_nStartHits = 0;
1873 vector<L1StsHit>* vStsHitsUnused_buf =
1883 int nDontUsedHits = 0;
1886 for (
int ista = 0; ista <
NStations; ++ista) {
1894 for (
int ist = 0; ist <
NStations; ++ist)
1896 if ((lasttime < (*
vStsHits)[ih].t_reco)
1897 && (!isinf((*
vStsHits)[ih].t_reco)))
1898 lasttime = (*vStsHits)[ih].t_reco;
1913 float yStep = 1.5 /
sqrt(nDontUsedHits);
1917 if (yStep > 0.3) yStep = 0.3;
1918 float xStep = yStep * 3;
1932 for (
int iS = 0; iS <
NStations; ++iS) {
1934 -1, 1, -0.6, 0.6, 0, lasttime, xStep, yStep, (lasttime + 1) / 35);
1947 for (
int ist = 0; ist <
NStations; ++ist)
1950 SetFUnUsed(
const_cast<unsigned char&
>((*
vSFlag)[
h.f]));
1951 SetFUnUsed(
const_cast<unsigned char&
>((*
vSFlagB)[
h.b]));
1954 for (
int ista = 0; ista <
NStations; ++ista) {
1958 #pragma omp parallel for schedule(dynamic, 5)
1965 stat_nStartHits += nDontUsedHits;
1970 gti[
"init "] = c_timerG;
1980 if (
isec != 0)
continue;
1984 for (
int n = 0; n <
nTh; n++)
1985 for (
int j = 0; j < 12; j++)
1994 vector<THitI>* RealIHitPTmp =
RealIHitP;
2000 vStsHitsUnused_buf = vStsHitsUnused_temp;
2004 vStsHitPointsUnused_buf = vStsHitsUnused_temp2;
2068 float SigmaTargetX = 0, SigmaTargetY = 0;
2073 targB = vtxFieldValue;
2076 SigmaTargetX = SigmaTargetY = 1;
2078 SigmaTargetX = SigmaTargetY = 5;
2085 SigmaTargetX = SigmaTargetY = 10;
2090 TargetXYInfo.C00 = SigmaTargetX * SigmaTargetX;
2091 TargetXYInfo.C10 = 0;
2092 TargetXYInfo.C11 = SigmaTargetY * SigmaTargetY;
2104 cout <<
" CATrackFinder: Error: Too many Stantions" << endl;
2107 #ifndef L1_NO_ASSERT
2108 for (
int istal =
NStations - 1; istal >= 0; istal--) {
2115 << (*vStsHitsUnused).size());
2117 #endif // L1_NO_ASSERT
2124 unsigned int ip = 0;
2131 int NHits_l_P = NHits_l /
Portion;
2133 for (
int ipp = 0; ipp < NHits_l_P; ipp++) {
2149 stat_nSinglets[
isec] += nSinglets;
2204 vector<bool> lmDuplets
2206 vector<bool> lmDupletsG
2208 hitsm_2.reserve(3500);
2211 hitsmG_2.reserve(800);
2219 #pragma omp parallel for firstprivate(T_1, \
2228 i1G_2) //schedule(dynamic, 2)
2235 lmDuplets[istal].resize(NHitsSta);
2236 lmDupletsG[istal].resize(NHitsSta);
2261 Tindex nstaltriplets = 0;
2276 lmDuplets[istal + 1]
2316 lmDupletsG[istal + 1]);
2330 lmDuplets[istal + 2]
2348 ti[
isec][
"tripl1"] = c_timer;
2369 #ifdef TRACKS_FROM_TRIPLETS
2370 if (
isec == TRACKS_FROM_TRIPLETS_ITERATION) min_level = 0;
2382 fscal curr_chi2 = 0;
2384 fscal best_chi2 = 0;
2385 unsigned char best_L = 0;
2387 unsigned char curr_L = 1;
2394 for (
int ilev =
NStations - 3; ilev >= min_level; ilev--) {
2399 int nlevel = (
NStations - 2) - ilev + 1;
2401 const unsigned char min_best_l =
2402 (ilev > min_level) ? ilev + 2 : min_level + 3;
2410 #pragma omp parallel for firstprivate(curr_tr, \
2417 ndf) // schedule(dynamic, 10)
2423 int thread_num = omp_get_thread_num();
2436 #ifndef FIND_GAPED_TRACKS
2447 #ifdef TRACKS_FROM_TRIPLETS
2448 if (
isec != TRACKS_FROM_TRIPLETS_ITERATION)
2475 (curr_tr).NHits = 1;
2478 curr_chi2 = first_trip.
GetChi2();
2480 best_tr = (curr_tr);
2482 best_chi2 = curr_chi2;
2498 if (best_L < ilev + 2)
continue;
2500 if (best_L < min_level + 3)
2503 ndf = best_L * 2 - 5;
2504 best_chi2 = best_chi2 / ndf;
2506 #ifndef TRACKS_FROM_TRIPLETS
2520 best_tr.
Set(istaF, best_L, best_chi2, first_trip.
GetQpOrig());
2529 for (vector<THitI>::iterator phitIt =
2533 const L1StsHit&
h = (*vStsHits)[*phitIt];
2535 omp_set_lock(&hitToBestTrackB[
h.b]);
2540 int thread = strip1 / 100000;
2541 int num = (strip1 -
thread * 100000);
2549 omp_unset_lock(&hitToBestTrackB[
h.b]);
2556 omp_unset_lock(&hitToBestTrackB[
h.b]);
2561 omp_set_lock(&hitToBestTrackF[
h.f]);
2565 int thread = strip2 / 100000;
2566 int num = (strip2 -
thread * 100000);
2575 omp_unset_lock(&hitToBestTrackF[
h.f]);
2582 omp_unset_lock(&hitToBestTrackF[
h.f]);
2592 if (--nlevel == 0)
break;
2603 #pragma omp parallel for schedule(dynamic, 10) firstprivate(t)
2612 for (vector<THitI>::iterator phIt =
2616 const L1StsHit&
h = (((*vStsHits))[*phIt]);
2624 if (tr.
NHits < 3) check = 0;
2627 #ifdef EXTEND_TRACKS
2636 int num_thread = omp_get_thread_num();
2644 for (vector<THitI>::iterator phIt =
2651 SetFUsed(
const_cast<unsigned char&
>((*
vSFlag)[
h.f]));
2652 SetFUsed(
const_cast<unsigned char&
>((*
vSFlagB)[
h.b]));
2659 const L1StsHit& hit = (*vStsHits)[*phIt];
2665 float xcoor, ycoor = 0;
2668 float zcoor = tempPoint.
Z();
2671 sqrt(xcoor * xcoor + ycoor * ycoor + zcoor * zcoor)
2673 sumTime += (hit.
t_reco - timeFlight);
2690 ti[
isec][
"table"] += Time;
2703 for (
int i = 1;
i <
nTh; ++
i) {
2704 offset_tracks[
i] = offset_tracks[
i - 1] +
SavedCand[
i - 1];
2705 offset_hits[
i] = offset_hits[
i - 1] +
SavedHits[
i - 1];
2711 #pragma omp parallel for
2713 for (
int i = 0;
i <
nTh; ++
i) {
2724 ti[
isec][
"tracks"] = c_timer;
2730 int NHitsOnStation = 0;
2732 for (
int ista = 0; ista <
NStations; ++ista) {
2735 int NHitsOnStationTmp = NHitsOnStation;
2742 vStsHitPointsUnused_buf,
2755 ti[
isec][
"finish"] = c_timer;
2778 cout <<
"iter = " <<
isec << endl;
2779 cout <<
" NSinglets = " << stat_nSinglets[
isec] / stat_N << endl;
2781 cout <<
" NTriplets = " << stat_nTriplets[
isec] / stat_N << endl;
2782 cout <<
" NHitsUnused = " << stat_nHits[
isec] / stat_N << endl;
2790 gti[
"iterts"] = c_timerG;
2800 gti[
"merge "] = c_timerG;
2809 CATime = (double(c_time.RealTime()));
2814 cout << endl <<
" --- Timers, ms --- " << endl;
2824 filestr.open(
"speedUp.log", fstream::out | fstream::app);
2825 float tripl_speed = 1000. / (tmp_ti.
GetTimerAll()[
"tripl1"].Real());
2826 filestr << tripl_speed <<
" ";
2831 static long int NTimes =0, NHits=0, HitSize =0, NStrips=0, StripSize =0, NStripsB=0, StripSizeB =0,
2832 NDup=0, DupSize=0, NTrip=0, TripSize=0, NBranches=0, BranchSize=0, NTracks=0, TrackSize=0 ;
2838 StripSize +=
vStsStrips.size()*
sizeof(
fscal) + (*vSFlag).size()*
sizeof(
unsigned char);
2839 NStripsB+= (*vSFlagB).size();
2840 StripSizeB +=
vStsStripsB.size()*
sizeof(
fscal) + (*vSFlagB).size()*
sizeof(
unsigned char);
2841 NDup += stat_max_n_dup;
2842 DupSize += stat_max_n_dup*
sizeof( int);
2843 NTrip += stat_max_n_trip;
2844 TripSize += stat_max_trip_size;
2846 NBranches += stat_max_n_branches;
2847 BranchSize += stat_max_BranchSize;
2850 int k = 1024*NTimes;
2852 cout<<
"L1 Event size: \n"
2853 <<HitSize/k<<
"kB for "<<NHits/NTimes<<
" hits, \n"
2854 <<StripSize/k<<
"kB for "<<NStrips/NTimes<<
" strips, \n"
2855 <<StripSizeB/k<<
"kB for "<<NStripsB/NTimes<<
" stripsB, \n"
2856 <<DupSize/k<<
"kB for "<<NDup/NTimes<<
" doublets, \n"
2857 <<TripSize/k<<
"kB for "<<NTrip/NTimes<<
" triplets\n"
2858 <<BranchSize/k<<
"kB for "<<NBranches/NTimes<<
" branches, \n"
2859 <<TrackSize/k<<
"kB for "<<NTracks/NTimes<<
" tracks. "<<endl;
2860 cout<<
" L1 total event size = "
2861 <<( HitSize + StripSize + StripSizeB + DupSize + TripSize + BranchSize + TrackSize )/k
2870 draw->DrawRecoTracks();
2872 draw->SaveCanvas(
"Reco_");
2876 static int iEvee = 0;
2878 if (iEvee % 1 == 0) fL1Pulls->Build(1);
2880 #ifdef DOUB_PERFORMANCE
2881 fL1Eff_doublets->CalculateEff();
2882 fL1Eff_doublets->Print(
"Doublets performance.", 1);
2884 #ifdef TRIP_PERFORMANCE
2885 fL1Eff_triplets->CalculateEff();
2886 fL1Eff_triplets->Print(
"Triplet performance", 1);
2904 unsigned char& best_L,
2908 unsigned char& curr_L,
2910 unsigned char min_best_l,
2931 curr_tr.
StsHits[curr_tr.
NHits] = ((*RealIHitP)[ihitm]);
2942 curr_tr.
StsHits[curr_tr.
NHits] = ((*RealIHitP)[ihitr]);
2967 if ((curr_L > best_L) || ((curr_L == best_L) && (curr_chi2 < best_chi2))) {
2970 best_chi2 = curr_chi2;
2977 unsigned int Station = 0;
2978 unsigned int Thread = 0;
2979 unsigned int Triplet = 0;
2980 unsigned int Location = 0;
2984 for (
Tindex in = 0; in < N_neighbour; in++) {
2992 Station = Location / 100000000;
2993 Thread = (Location - Station * 100000000) / 1000000;
2994 Triplet = (Location - Station * 100000000 - Thread * 1000000);
3006 Cqp += new_trip.
Cqp;
3012 const fscal& tx1 = curr_trip->
tx;
3013 const fscal& tx2 = new_trip.
tx;
3016 Ctx += new_trip.
Ctx;
3018 const fscal& ty1 = curr_trip->
ty;
3019 const fscal& ty2 = new_trip.
ty;
3022 Cty += new_trip.
Cty;
3034 if ((curr_L > best_L)
3035 || ((curr_L == best_L) && (curr_chi2 < best_chi2))) {
3038 best_chi2 = curr_chi2;
3044 new_tr[ista] = curr_tr;
3047 unsigned char new_L = curr_L;
3048 fscal new_chi2 = curr_chi2;
3052 ((*RealIHitP)[new_trip.
GetLHit()]);
3053 new_tr[ista].
NHits++;
3055 dqp = dqp / Cqp * 5.;
3061 new_chi2 += dtx * dtx;
3062 new_chi2 += dty * dty;
3064 new_chi2 += dqp * dqp;
3069 const int new_ista = ista + new_trip.
GetMSta() - new_trip.
GetLSta();
3087 void L1Algo::DrawRecoTracksTime(
const vector<CbmL1Track>&
tracks) {
3088 draw->DrawRecoTracksTime(
tracks);
3089 draw->SaveCanvas(
" ");