109 std::vector<TrackFP420>
rhits;
110 int constexpr restracks = 10;
111 rhits.reserve(restracks);
113 double Ax[restracks];
114 double Bx[restracks];
115 double Cx[restracks];
117 double Ay[restracks];
118 double By[restracks];
119 double Cy[restracks];
121 double AxW[restracks];
122 double BxW[restracks];
123 double CxW[restracks];
125 double AyW[restracks];
126 double ByW[restracks];
127 double CyW[restracks];
130 std::cout <<
"===============================================================================" << std::endl;
131 std::cout <<
"=================================================================" << std::endl;
132 std::cout <<
"==========================================================" << std::endl;
134 std::cout <<
"TrackProducerFP420: Start trackFinderSophisticated " << std::endl;
139 if (xytype < 1 || xytype > 2) {
140 std::cout <<
"TrackProducerFP420:ERROR in trackFinderSophisticated: check xytype = " <<
xytype << std::endl;
146 std::cout <<
"TrackProducerFP420:ERROR in trackFinderSophisticated: check sn0 (configuration) = " <<
sn0
151 int constexpr zbeg = 1, zmax = 3;
154 int constexpr reshits1 = 12;
155 int constexpr reshits2 = 24;
156 int constexpr resplanes = 20;
157 int nX[resplanes] = {}, nY[resplanes] = {};
158 int uX[resplanes] = {}, uY[resplanes] = {};
159 double zX[reshits2][resplanes], xX[reshits2][resplanes], wX[reshits2][resplanes];
160 double zY[reshits2][resplanes], yY[reshits2][resplanes], wY[reshits2][resplanes];
161 double yXW[reshits2][resplanes], wXW[reshits2][resplanes];
162 double xYW[reshits2][resplanes], wYW[reshits2][resplanes];
163 bool qX[reshits2][resplanes], qY[reshits2][resplanes];
183 float Xshift = pitch / 2.;
184 float Yshift = pitchW / 2.;
189 unsigned int ii0 = 999999;
190 int allplacesforsensors = 7;
191 for (
int sector = 1; sector <
sn0; sector++) {
192 for (
int zmodule = 1; zmodule <
pn0; zmodule++) {
193 for (
int zsideinorder = 1; zsideinorder < allplacesforsensors; zsideinorder++) {
196 std::cout <<
"TrackProducerFP420: sector= " << sector <<
" zmodule= " << zmodule
197 <<
" zsideinorder= " << zsideinorder <<
" zside= " << zside <<
" det= " << det << std::endl;
201 if (justlayer < 1 || justlayer > 2) {
202 std::cout <<
"TrackProducerFP420:WRONG justlayer= " << justlayer << std::endl;
205 if (copyinlayer < 1 || copyinlayer > 3) {
206 std::cout <<
"TrackProducerFP420:WRONG copyinlayer= " << copyinlayer << std::endl;
209 if (orientation < 1 || orientation > 2) {
210 std::cout <<
"TrackProducerFP420:WRONG orientation= " << orientation << std::endl;
224 std::cout <<
"TrackProducerFP420: justlayer= " << justlayer <<
" copyinlayer= " << copyinlayer
225 <<
" ii= " << ii << std::endl;
228 double zdiststat = 0.;
238 double kplane = -(pn0 - 1) / 2 - 0.5 + (zmodule - 1);
242 if (justlayer == 1) {
243 if (orientation == 1)
245 else if (orientation == 2)
247 }
else if (justlayer == 2) {
248 if (orientation == 1)
250 else if (orientation == 2)
256 zcurrent = -zcurrent;
269 if (justlayer == 2) {
280 double XXXDelta = 0.0;
281 double YYYDelta = 0.0;
282 if (copyinlayer == 2) {
285 }
else if (copyinlayer == 3) {
295 std::cout <<
"TrackProducerFP420: check iu = " << iu << std::endl;
296 std::cout <<
"TrackProducerFP420: sector= " << sector <<
" zmodule= " << zmodule <<
" zside= " << zside
297 <<
" det= " << det <<
" rn0= " <<
rn0 <<
" pn0= " << pn0 <<
" sn0= " << sn0
298 <<
" copyinlayer= " << copyinlayer << std::endl;
301 std::vector<ClusterFP420> currentclust;
302 currentclust.clear();
304 outputRange = input->get(iu);
308 for (; sort_begin != sort_end; ++sort_begin) {
310 currentclust.push_back(*sort_begin);
314 std::cout <<
"TrackProducerFP420: currentclust.size = " << currentclust.size() << std::endl;
318 std::vector<ClusterFP420>::const_iterator simHitIter = currentclust.begin();
319 std::vector<ClusterFP420>::const_iterator simHitIterEnd = currentclust.end();
337 for (; simHitIter != simHitIterEnd; ++simHitIter) {
346 if (copyinlayer == 1 && nY[ii] > reshits1) {
348 std::cout <<
"WARNING-ERROR:TrackproducerFP420: currentclust.size()= " << currentclust.size()
349 <<
" bigger reservated number of hits"
350 <<
" zcurrent=" << zY[nY[
ii] - 1][
ii] <<
" copyinlayer= " << copyinlayer <<
" ii= " << ii
352 }
else if (copyinlayer != 1 && nY[ii] > reshits2) {
354 std::cout <<
"WARNING-ERROR:TrackproducerFP420: currentclust.size()= " << currentclust.size()
355 <<
" bigger reservated number of hits"
356 <<
" zcurrent=" << zY[nY[
ii] - 1][
ii] <<
" copyinlayer= " << copyinlayer <<
" ii= " << ii
359 zY[nY[
ii] - 1][
ii] = zcurrent;
360 yY[nY[
ii] - 1][
ii] = icluster.
barycenter() * pitch + 0.5 * pitch + YYYDelta;
363 yY[nY[
ii] - 1][
ii] = yY[nY[
ii] - 1][
ii] - dYYcur;
366 wY[nY[
ii] - 1][
ii] *= wY[nY[
ii] - 1][
ii];
368 xYW[nY[
ii] - 1][
ii] = (xYW[nY[
ii] - 1][
ii] + dYYWcur);
370 xYW[nY[
ii] - 1][
ii] = -(xYW[nY[
ii] - 1][
ii] + dYYWcur);
372 wYW[nY[
ii] - 1][
ii] =
374 wYW[nY[
ii] - 1][
ii] *= wYW[nY[
ii] - 1][
ii];
375 qY[nY[
ii] - 1][
ii] =
true;
376 if (copyinlayer == 1 && nY[ii] == reshits1)
378 if (copyinlayer != 1 && nY[ii] == reshits2)
385 std::cout <<
"TrackproducerFP420: nX[ii]= " << nX[
ii] <<
" Ncl= " << currentclust.size()
386 <<
" copyinlayer= " << copyinlayer <<
" ii= " << ii <<
" zcurrent = " << zcurrent
387 <<
" xX= " << icluster.
barycenter() * pitch + 0.5 * pitch + XXXDelta
388 <<
" yXW= " << icluster.
barycenterW() * pitchW + 0.5 * pitchW <<
" det= " << det
392 if (copyinlayer == 1 && nX[ii] > reshits1) {
393 std::cout <<
"WARNING-ERROR:TrackproducerFP420: nX[ii]= " << nX[
ii]
394 <<
" bigger reservated number of hits"
395 <<
" currentclust.size()= " << currentclust.size() <<
" copyinlayer= " << copyinlayer
396 <<
" ii= " << ii << std::endl;
398 }
else if (copyinlayer != 1 && nX[ii] > reshits2) {
399 std::cout <<
"WARNING-ERROR:TrackproducerFP420: nX[ii]= " << nX[
ii]
400 <<
" bigger reservated number of hits"
401 <<
" currentclust.size()= " << currentclust.size() <<
" copyinlayer= " << copyinlayer
402 <<
" ii= " << ii << std::endl;
405 zX[nX[
ii] - 1][
ii] = zcurrent;
406 xX[nX[
ii] - 1][
ii] = icluster.
barycenter() * pitch + 0.5 * pitch + XXXDelta;
409 xX[nX[
ii] - 1][
ii] = -(xX[nX[
ii] - 1][
ii] + dXXcur);
412 wX[nX[
ii] - 1][
ii] *= wX[nX[
ii] - 1][
ii];
414 yXW[nX[
ii] - 1][
ii] = -(yXW[nX[
ii] - 1][
ii] - dXXWcur);
416 yXW[nX[
ii] - 1][
ii] = yXW[nX[
ii] - 1][
ii] - dXXWcur;
418 wXW[nX[
ii] - 1][
ii] =
420 wXW[nX[
ii] - 1][
ii] *= wXW[nX[
ii] - 1][
ii];
421 qX[nX[
ii] - 1][
ii] =
true;
423 std::cout <<
"trackFinderSophisticated: nX[ii]= " << nX[
ii] <<
" ii = " << ii
424 <<
" zcurrent = " << zcurrent <<
" yXW[nX[ii]-1][ii] = " << yXW[nX[
ii] - 1][
ii]
425 <<
" xX[nX[ii]-1][ii] = " << xX[nX[
ii] - 1][
ii] << std::endl;
426 std::cout <<
" XXXDelta= " << XXXDelta <<
" dXXcur= " << dXXcur <<
" -dXXWcur= " << -dXXWcur
429 <<
" wXW[nX[ii]-1][ii]= " << wXW[nX[
ii] - 1][
ii] << std::endl;
430 std::cout <<
" -icluster.barycenterW()*pitchW+0.5*pitchW = "
431 << icluster.
barycenterW() * pitchW + 0.5 * pitchW << std::endl;
432 std::cout <<
"============================================================" << std::endl;
435 std::cout <<
"trackFinderSophisticated: nX[ii]= " << nX[
ii] <<
" ii = " << ii
436 <<
" zcurrent = " << zcurrent <<
" xX[nX[ii]-1][ii] = " << xX[nX[
ii] - 1][
ii] << std::endl;
438 <<
" wXW[nX[ii]-1][ii] = " << wXW[nX[
ii] - 1][
ii] << std::endl;
439 std::cout <<
" -icluster.barycenter()*pitch-0.5*pitch = "
440 << -icluster.
barycenter() * pitch - 0.5 * pitch <<
" -dXXcur = " << -dXXcur
441 <<
" -XXXDelta = " << -XXXDelta << std::endl;
442 std::cout <<
"============================================================" << std::endl;
445 if (copyinlayer == 1 && nX[ii] == reshits1)
447 if (copyinlayer != 1 && nX[ii] == reshits2)
455 if (nY[ii] > nmetcury) {
460 if (sector == (sn0 - 1))
466 if (nX[ii] > nmetcurx) {
471 if (sector == (sn0 - 1))
481 std::cout <<
"trackFinderSophisticated: tyf= " << tyf <<
" tys1 = " << tys1 <<
" tyss = " << tyss << std::endl;
482 std::cout <<
"trackFinderSophisticated: txf= " << txf <<
" txs1 = " << txs1 <<
" txss = " << txss << std::endl;
483 std::cout <<
"============================================================" << std::endl;
493 int constexpr nitMax = 10;
502 int constexpr pys1Cut = 3, pyssCut = 1, pyallCut = 5;
524 double sigman = 0.18, ssigma = 2.5, sigmam = 0.18;
536 sigman = 0.30, ssigma = 8.0,
541 std::cout <<
"trackFinderSophisticated: ssigma= " << ssigma << std::endl;
553 int numberXtracks = 0, numberYtracks = 0, totpl = 2 * (pn0 - 1) * (sn0 - 1);
556 for (
int xytypecurrent =
xytype; xytypecurrent <
xytype + 1; ++xytypecurrent) {
558 std::cout <<
"trackFinderSophisticated: xytypecurrent= " << xytypecurrent << std::endl;
564 int qAcl[resplanes], qAii[resplanes], fip = 0, niteration = 0;
565 int ry = 0, rys1 = 0, ryss = 0;
566 int tas1 = tys1, tass = tyss, taf = tyf;
567 bool SelectTracks =
true;
572 double yA[reshits2][resplanes], zA[reshits2][resplanes], wA[reshits2][resplanes];
573 int nA[resplanes], uA[resplanes];
574 bool qA[reshits2][resplanes];
578 if (xytypecurrent == 1) {
581 tg0 = 3 * 1. / (800. + 20.);
585 for (
int ii = 0; ii < totpl; ++
ii) {
587 std::cout <<
"trackFinderSophisticated: ii= " << ii <<
" nY[ii]= " << nY[
ii] << std::endl;
588 std::cout <<
"trackFinderSophisticated: ii= " << ii <<
" uY[ii]= " << uY[
ii] << std::endl;
592 for (
int cl = 0;
cl < nA[
ii]; ++
cl) {
594 std::cout <<
" cl= " <<
cl <<
" yY[cl][ii]= " << yY[
cl][
ii] << std::endl;
595 std::cout <<
" zY[cl][ii]= " << zY[
cl][
ii] <<
" wY[cl][ii]= " << wY[
cl][
ii] <<
" qY[cl][ii]= " << qY[
cl][
ii]
608 else if (xytypecurrent == 2) {
611 tg0 = 3 * 2. / (800. + 20.);
615 for (
int ii = 0; ii < totpl; ++
ii) {
617 std::cout <<
"trackFinderSophisticated: ii= " << ii <<
" nX[ii]= " << nX[
ii] << std::endl;
618 std::cout <<
"trackFinderSophisticated: ii= " << ii <<
" uX[ii]= " << uX[
ii] << std::endl;
622 for (
int cl = 0;
cl < nA[
ii]; ++
cl) {
624 std::cout <<
" cl= " <<
cl <<
" xX[cl][ii]= " << xX[
cl][
ii] << std::endl;
625 std::cout <<
" zX[cl][ii]= " << zX[
cl][
ii] <<
" wX[cl][ii]= " << wX[
cl][
ii] <<
" qX[cl][ii]= " << qX[
cl][
ii]
639 std::cout <<
" start road finder " << std::endl;
642 double fyY[20], fzY[20], fwY[20];
643 double fyYW[20], fwYW[20];
644 int py = 0, pys1 = 0, pyss = 0;
645 bool NewStation =
false, py1first =
false;
646 for (
int sector = 1; sector <
sn0; ++sector) {
647 double tav = 0., t1 = 0., t2 = 0.,
t = 0., sm;
652 for (
int zmodule = 1; zmodule <
pn0; ++zmodule) {
653 for (
int justlayer = zbeg; justlayer < zmax; justlayer++) {
663 if (nA[ii] != 0 && uA[ii] != nA[ii]) {
667 if (sector == (sn0 - 1))
669 if (py == 2 && sector == 1) {
671 double dymin = 9999999., df2;
673 for (
int cl = 0;
cl < nA[
ii]; ++
cl) {
684 t = (yA[
cl2][
ii] - fyY[fip]) / (zA[cl2][ii] - fzY[fip]);
688 std::cout <<
" t= " <<
t <<
" tg0= " << tg0 << std::endl;
692 fyY[py - 1] = yA[
cl2][
ii];
693 fzY[py - 1] = zA[
cl2][
ii];
694 fwY[py - 1] = wA[
cl2][
ii];
699 std::cout <<
" point is taken, mark it for not using again uA[ii]= " << uA[
ii] << std::endl;
701 if (uA[ii] == nA[ii]) {
705 if (sector == (sn0 - 1))
713 if (sector == (sn0 - 1))
723 if (sector == (sn0 - 1))
729 bool clLoopTrue =
true;
731 for (
int clind = 0; clind < nA[
ii]; ++clind) {
741 fyY[py - 1] = yA[
cl][
ii];
742 fzY[py - 1] = zA[
cl][
ii];
743 fwY[py - 1] = wA[
cl][
ii];
748 std::cout <<
" point is taken, mark it uA[ii]= " << uA[
ii] << std::endl;
750 if (uA[ii] == nA[ii]) {
754 if (sector == (sn0 - 1))
764 sigma = ssigma / (sn0 - 1 - sector);
768 if (stattimes == 1 || sector == 3)
772 double cov00, cov01, cov11, c0Y, c1Y, chisqY;
773 gsl_fit_wlinear(fzY, 1, fwY, 1, fyY, 1, py - 1, &c0Y, &c1Y, &cov00, &cov01, &cov11, &chisqY);
777 double dymin = 9999999., df2;
778 for (
int clmatch = 0; clmatch < nA[
ii]; ++clmatch) {
779 if (qA[clmatch][ii]) {
780 double smmatch = c0Y + c1Y * zA[clmatch][
ii];
781 df2 =
std::abs(smmatch - yA[clmatch][ii]);
789 if (cl2match != -1) {
794 sm = c0Y + c1Y * zA[
cl][
ii];
797 std::cout <<
" sector= " << sector <<
" sn0= " << sn0 <<
" sigma= " << sigma << std::endl;
798 std::cout <<
" stattimes= " << stattimes <<
" ssigma= " << ssigma <<
" sigmam= " << sigmam
800 std::cout <<
" sm= " << sm <<
" c0Y= " << c0Y <<
" c1Y= " << c1Y <<
" chisqY= " << chisqY
802 std::cout <<
" zA[cl][ii]= " << zA[
cl][
ii] <<
" ii= " << ii <<
" cl= " << cl << std::endl;
803 for (
int ct = 0; ct < py - 1; ++ct) {
804 std::cout <<
" py-1= " << py - 1 <<
" fzY[ct]= " << fzY[ct] << std::endl;
805 std::cout <<
" fyY[ct]= " << fyY[ct] <<
" fwY[ct]= " << fwY[ct] << std::endl;
811 t = (yA[
cl][
ii] - fyY[fip]) / (zA[cl][ii] - fzY[fip]);
812 t1 +=
t * wA[
cl][
ii];
815 sm = fyY[fip] + tav * (zA[
cl][
ii] - fzY[fip]);
820 double diffpo = yA[
cl][
ii] - sm;
822 std::cout <<
" diffpo= " << diffpo <<
" yA[cl][ii]= " << yA[
cl][
ii] <<
" sm= " << sm
823 <<
" sigma= " << sigma << std::endl;
829 if (stattimes == 1) {
833 }
else if (stattimes == 2) {
835 t = (yA[
cl][
ii] - fyY[fip]) / (zA[cl][ii] - fzY[fip]);
842 fyY[py - 1] = yA[
cl][
ii];
843 fzY[py - 1] = zA[
cl][
ii];
844 fwY[py - 1] = wA[
cl][
ii];
850 std::cout <<
" 3333 point is taken, mark it uA[ii]= " << uA[
ii] << std::endl;
852 if (uA[ii] == nA[ii]) {
856 if (sector == (sn0 - 1))
862 t1 -=
t * wA[
cl][
ii];
873 if ((py != 1 && clcurr != -1 && qA[clcurr][ii]) || (py == 1 && !py1first)) {
878 if (sector == (sn0 - 1))
890 std::cout <<
"END: pys1= " << pys1 <<
" pyss = " << pyss <<
" py = " << py << std::endl;
894 if (pys1 < pys1Cut || pyss < pyssCut || py < pyallCut) {
900 double cov00, cov01, cov11;
901 double c0Y, c1Y, chisqY;
902 gsl_fit_wlinear(fzY, 1, fwY, 1, fyY, 1, py, &c0Y, &c1Y, &cov00, &cov01, &cov11, &chisqY);
916 chindfx = chisqY / (py - 2);
923 std::cout <<
" Do FIT XZ: chindfx= " << chindfx <<
" chisqY= " << chisqY <<
" py= " << py << std::endl;
928 std::cout <<
" preparation for second order fit for Wide pixels= " << std::endl;
930 for (
int ipy = 0; ipy < py; ++ipy) {
931 if (xytypecurrent == 1) {
932 fyYW[ipy] = xYW[qAcl[ipy]][qAii[ipy]];
933 fwYW[ipy] = wYW[qAcl[ipy]][qAii[ipy]];
935 std::cout <<
" ipy= " << ipy << std::endl;
936 std::cout <<
" qAcl[ipy]= " << qAcl[ipy] <<
" qAii[ipy]= " << qAii[ipy] << std::endl;
937 std::cout <<
" fyYW[ipy]= " << fyYW[ipy] <<
" fwYW[ipy]= " << fwYW[ipy] << std::endl;
939 }
else if (xytypecurrent == 2) {
940 fyYW[ipy] = yXW[qAcl[ipy]][qAii[ipy]];
941 fwYW[ipy] = wXW[qAcl[ipy]][qAii[ipy]];
943 std::cout <<
" ipy= " << ipy << std::endl;
944 std::cout <<
" qAcl[ipy]= " << qAcl[ipy] <<
" qAii[ipy]= " << qAii[ipy] << std::endl;
945 std::cout <<
" fyYW[ipy]= " << fyYW[ipy] <<
" fwYW[ipy]= " << fwYW[ipy] << std::endl;
951 std::cout <<
" start second order fit for Wide pixels= " << std::endl;
953 double wov00, wov01, wov11;
954 double w0Y, w1Y, whisqY;
955 gsl_fit_wlinear(fzY, 1, fwYW, 1, fyYW, 1, py, &w0Y, &w1Y, &wov00, &wov01, &wov11, &whisqY);
960 chindfy = whisqY / (py - 2);
967 std::cout <<
" chindfy= " << chindfy <<
" chiCutY= " <<
chiCutY << std::endl;
970 if (xytypecurrent == 1) {
973 Ay[numberYtracks - 1] = c0Y;
974 By[numberYtracks - 1] = c1Y;
975 Cy[numberYtracks - 1] = chisqY;
977 My[numberYtracks - 1] = py;
978 AyW[numberYtracks - 1] = w0Y;
979 ByW[numberYtracks - 1] = w1Y;
980 CyW[numberYtracks - 1] = whisqY;
981 MyW[numberYtracks - 1] = py;
984 std::cout <<
" niteration = " << niteration << std::endl;
985 std::cout <<
" chindfy= " << chindfy <<
" py= " << py << std::endl;
986 std::cout <<
" c0Y= " << c0Y <<
" c1Y= " << c1Y << std::endl;
987 std::cout <<
" pys1= " << pys1 <<
" pyss = " << pyss << std::endl;
991 }
else if (xytypecurrent == 2) {
994 Ax[numberXtracks - 1] = c0Y;
995 Bx[numberXtracks - 1] = c1Y;
996 Cx[numberXtracks - 1] = chisqY;
998 Mx[numberXtracks - 1] = py;
999 AxW[numberXtracks - 1] = w0Y;
1000 BxW[numberXtracks - 1] = w1Y;
1001 CxW[numberXtracks - 1] = whisqY;
1002 MxW[numberXtracks - 1] = py;
1004 std::cout <<
" niteration = " << niteration << std::endl;
1005 std::cout <<
" chindfx= " << chindfy <<
" px= " << py << std::endl;
1006 std::cout <<
" c0X= " << c0Y <<
" c1X= " << c1Y << std::endl;
1007 std::cout <<
" pxs1= " << pys1 <<
" pxss = " << pyss << std::endl;
1016 std::cout <<
"Current iteration, niteration >= " << niteration << std::endl;
1017 std::cout <<
" numberYtracks= " << numberYtracks << std::endl;
1018 std::cout <<
" numberXtracks= " << numberXtracks << std::endl;
1019 std::cout <<
" pys1= " << pys1 <<
" pyss = " << pyss <<
" py = " << py << std::endl;
1020 std::cout <<
" tas1= " << tas1 <<
" tass = " << tass <<
" taf = " << taf << std::endl;
1021 std::cout <<
" rys1= " << rys1 <<
" ryss = " << ryss <<
" ry = " << ry << std::endl;
1022 std::cout <<
" tas1-rys1= " << tas1 - rys1 <<
" tass-ryss = " << tass - ryss <<
" taf-ry = " << taf - ry
1024 std::cout <<
"---------------------------------------------------------- " << std::endl;
1027 if (tas1 - rys1 < pys1Cut || tass - ryss < pyssCut || taf - ry < pyallCut) {
1028 SelectTracks =
false;
1033 }
while (SelectTracks && niteration < nitMax);
1045 std::cout <<
" numberXtracks= " << numberXtracks <<
" numberYtracks= " << numberYtracks << std::endl;
1059 std::cout <<
" numberXtracks= " << numberXtracks <<
" numberYtracks= " << numberYtracks << std::endl;
1061 if (numberXtracks > 0) {
1062 int newxnum[restracks], newynum[restracks];
1065 double dthmin = 999999.;
1066 int trminx = -1, trminy = -1;
1067 for (
int trx = 0; trx < numberXtracks; ++trx) {
1069 std::cout <<
"----------- trx= " << trx <<
" nmathed= " << nmathed << std::endl;
1071 for (
int tr = 0; tr < numberYtracks; ++tr) {
1073 std::cout <<
"--- tr= " << tr <<
" nmathed= " << nmathed << std::endl;
1076 for (
int nmx = 0; nmx < nmathed; ++nmx) {
1077 if (trx == newxnum[nmx])
1081 for (
int nm = 0; nm < nmathed; ++nm) {
1082 if (tr == newynum[nm])
1101 <<
" abs(BxW[trx]-By[tr])= " <<
std::abs(BxW[trx] - By[tr]) <<
" dthdif= " << dthdif
1105 if (dthdif < dthmin) {
1116 newxnum[nmathed - 1] = trminx;
1118 newxnum[nmathed - 1] = nmathed - 1;
1121 std::cout <<
" trminx= " << trminx << std::endl;
1123 if (nmathed > numberYtracks) {
1124 newynum[nmathed - 1] = -1;
1126 std::cout <<
"!!! nmathed= " << nmathed <<
" > numberYtracks= " << numberYtracks << std::endl;
1130 std::cout <<
" trminy= " << trminy << std::endl;
1132 newynum[nmathed - 1] = trminy;
1134 }
while (nmathed < numberXtracks && nmathed < restracks);
1139 for (
int tr = 0; tr < nmathed; ++tr) {
1140 int tx = newxnum[tr];
1141 int ty = newynum[tr];
1154 std::cout <<
" for track tr= " << tr <<
" tx= " << tx <<
" ty= " << ty << std::endl;
1155 std::cout <<
" Ax= " << Ax[tx] <<
" Ay= " << Ay[ty] << std::endl;
1156 std::cout <<
" Bx= " << Bx[tx] <<
" By= " << By[ty] << std::endl;
1157 std::cout <<
" Cx= " << Cx[tx] <<
" Cy= " << Cy[ty] << std::endl;
1158 std::cout <<
" Mx= " << Mx[tx] <<
" My= " << My[ty] << std::endl;
1159 std::cout <<
" AxW= " << AxW[tx] <<
" AyW= " << AyW[ty] << std::endl;
1160 std::cout <<
" BxW= " << BxW[tx] <<
" ByW= " << ByW[ty] << std::endl;
1161 std::cout <<
" CxW= " << CxW[tx] <<
" CyW= " << CyW[ty] << std::endl;
1162 std::cout <<
" MxW= " << MxW[tx] <<
" MyW= " << MyW[ty] << std::endl;
1166 rhits.push_back(
TrackFP420(Ax[tx], Bx[tx], Cx[tx], Mx[tx], Ay[ty], By[ty], Cy[ty], My[ty]));
1174 else if (xytype == 1) {
1175 for (
int ty = 0; ty < numberYtracks; ++ty) {
1177 std::cout <<
" for track ty= " << ty << std::endl;
1178 std::cout <<
" Ay= " << Ay[ty] << std::endl;
1179 std::cout <<
" By= " << By[ty] << std::endl;
1180 std::cout <<
" Cy= " << Cy[ty] << std::endl;
1181 std::cout <<
" My= " << My[ty] << std::endl;
1182 std::cout <<
" AyW= " << AyW[ty] << std::endl;
1183 std::cout <<
" ByW= " << ByW[ty] << std::endl;
1184 std::cout <<
" CyW= " << CyW[ty] << std::endl;
1185 std::cout <<
" MyW= " << MyW[ty] << std::endl;
1187 rhits.push_back(
TrackFP420(AyW[ty], ByW[ty], CyW[ty], MyW[ty], Ay[ty], By[ty], Cy[ty], My[ty]));
1192 else if (xytype == 2) {
1193 for (
int tx = 0; tx < numberXtracks; ++tx) {
1195 std::cout <<
" for track tx= " << tx << std::endl;
1196 std::cout <<
" Ax= " << Ax[tx] << std::endl;
1197 std::cout <<
" Bx= " << Bx[tx] << std::endl;
1198 std::cout <<
" Cx= " << Cx[tx] << std::endl;
1199 std::cout <<
" Mx= " << Mx[tx] << std::endl;
1200 std::cout <<
" AxW= " << AxW[tx] << std::endl;
1201 std::cout <<
" BxW= " << BxW[tx] << std::endl;
1202 std::cout <<
" CxW= " << CxW[tx] << std::endl;
1203 std::cout <<
" MxW= " << MxW[tx] << std::endl;
1205 rhits.push_back(
TrackFP420(Ax[tx], Bx[tx], Cx[tx], Mx[tx], AxW[tx], BxW[tx], CxW[tx], MxW[tx]));
static int unpackCopyIndex(int rn0, int zside)
std::vector< ClusterFP420 >::const_iterator ContainerIterator
static int realzside(int rn0, int zsideinorder)
const std::vector< short > & amplitudes() const
static int unpackLayerIndex(int rn0, int zside)
float barycerrorW() const
float barycenterW() const
static unsigned packMYIndex(int rn0, int pn0, int sn0, int det, int zside, int sector, int zmodule)
Abs< T >::type abs(const T &t)
bool UseHalfPitchShiftInXW
std::vector< TrackFP420 > rhits
bool UseHalfPitchShiftInX
std::pair< ContainerIterator, ContainerIterator > Range
static int unpackOrientation(int rn0, int zside)