9 #include <gsl/gsl_fit.h>
40 bool aUseHalfPitchShiftInX,
41 bool aUseHalfPitchShiftInY,
42 bool aUseHalfPitchShiftInXW,
43 bool aUseHalfPitchShiftInYW,
51 double aYsensorSize) {
75 UseHalfPitchShiftInX = aUseHalfPitchShiftInX;
76 UseHalfPitchShiftInY = aUseHalfPitchShiftInY;
77 UseHalfPitchShiftInXW = aUseHalfPitchShiftInXW;
78 UseHalfPitchShiftInYW = aUseHalfPitchShiftInYW;
84 XsensorSize = aXsensorSize;
85 YsensorSize = aYsensorSize;
88 std::cout <<
"TrackProducerFP420: call constructor" << std::endl;
89 std::cout <<
" sn0= " << sn0 <<
" pn0= " << pn0 <<
" rn0= " << rn0 <<
" xytype= " << xytype << std::endl;
90 std::cout <<
" zD2= " <<
zD2 <<
" zD3= " <<
zD3 <<
" zinibeg= " << zinibeg << std::endl;
92 std::cout <<
" pitchX= " << pitchX <<
" pitchY= " << pitchY << std::endl;
93 std::cout <<
" ZGapLDet= " << ZGapLDet << std::endl;
94 std::cout <<
" ZSiStep= " << ZSiStep <<
" ZSiPlane= " << ZSiPlane << std::endl;
95 std::cout <<
" ZSiDet= " << ZSiDet << std::endl;
96 std::cout <<
" UseHalfPitchShiftInX= " << UseHalfPitchShiftInX <<
" UseHalfPitchShiftInY= " << UseHalfPitchShiftInY
98 std::cout <<
"TrackProducerFP420:----------------------" << std::endl;
99 std::cout <<
" dXX= " << dXX <<
" dYY= " << dYY << std::endl;
100 std::cout <<
" chiCutX= " << chiCutX <<
" chiCutY= " << chiCutY << std::endl;
110 std::vector<TrackFP420> rhits;
112 rhits.reserve(restracks);
131 std::cout <<
"===============================================================================" << std::endl;
132 std::cout <<
"=================================================================" << std::endl;
133 std::cout <<
"==========================================================" << std::endl;
135 std::cout <<
"TrackProducerFP420: Start trackFinderSophisticated " << std::endl;
140 if (xytype < 1 || xytype > 2) {
141 std::cout <<
"TrackProducerFP420:ERROR in trackFinderSophisticated: check xytype = " << xytype << std::endl;
147 std::cout <<
"TrackProducerFP420:ERROR in trackFinderSophisticated: check sn0 (configuration) = " << sn0
152 int zbeg = 1,
zmax = 3;
160 double zX[24][20], xX[24][20], wX[24][20];
161 double zY[24][20], yY[24][20], wY[24][20];
162 double yXW[24][20], wXW[24][20];
163 double xYW[24][20], wYW[24][20];
164 bool qX[24][20], qY[24][20];
178 }
else if (xytype == 2) {
184 float Xshift = pitch / 2.;
185 float Yshift = pitchW / 2.;
190 unsigned int ii0 = 999999;
191 int allplacesforsensors = 7;
192 for (
int sector = 1; sector < sn0; sector++) {
193 for (
int zmodule = 1; zmodule < pn0; zmodule++) {
194 for (
int zsideinorder = 1; zsideinorder < allplacesforsensors; zsideinorder++) {
197 std::cout <<
"TrackProducerFP420: sector= " << sector <<
" zmodule= " << zmodule
198 <<
" zsideinorder= " << zsideinorder <<
" zside= " <<
zside <<
" det= " << det << std::endl;
202 if (justlayer < 1 || justlayer > 2) {
203 std::cout <<
"TrackProducerFP420:WRONG justlayer= " << justlayer << std::endl;
206 if (copyinlayer < 1 || copyinlayer > 3) {
207 std::cout <<
"TrackProducerFP420:WRONG copyinlayer= " << copyinlayer << std::endl;
210 if (orientation < 1 || orientation > 2) {
211 std::cout <<
"TrackProducerFP420:WRONG orientation= " << orientation << std::endl;
225 std::cout <<
"TrackProducerFP420: justlayer= " << justlayer <<
" copyinlayer= " << copyinlayer
226 <<
" ii= " <<
ii << std::endl;
229 double zdiststat = 0.;
239 double kplane = -(pn0 - 1) / 2 - 0.5 + (zmodule - 1);
240 double zcurrent = zinibeg +
z420 + (ZSiStep - ZSiPlane) / 2 + kplane * ZSiStep + zdiststat;
243 if (justlayer == 1) {
244 if (orientation == 1)
245 zcurrent += (ZGapLDet + ZSiDet / 2);
246 if (orientation == 2)
247 zcurrent += zBlade - (ZGapLDet + ZSiDet / 2);
249 if (justlayer == 2) {
250 if (orientation == 1)
251 zcurrent += (ZGapLDet + ZSiDet / 2) + zBlade + gapBlade;
252 if (orientation == 2)
253 zcurrent += 2 * zBlade + gapBlade - (ZGapLDet + ZSiDet / 2);
258 zcurrent = -zcurrent;
271 if (justlayer == 2) {
273 if (UseHalfPitchShiftInX ==
true) {
277 if (UseHalfPitchShiftInXW ==
true) {
282 double XXXDelta = 0.0;
283 if (copyinlayer == 2) {
284 XXXDelta = XsensorSize;
286 if (copyinlayer == 3) {
287 XXXDelta = 2. * XsensorSize;
289 double YYYDelta = 0.0;
290 if (copyinlayer == 2) {
291 YYYDelta = XsensorSize;
293 if (copyinlayer == 3) {
294 YYYDelta = 2. * XsensorSize;
301 std::cout <<
"TrackProducerFP420: check iu = " << iu << std::endl;
302 std::cout <<
"TrackProducerFP420: sector= " << sector <<
" zmodule= " << zmodule <<
" zside= " <<
zside
303 <<
" det= " << det <<
" rn0= " << rn0 <<
" pn0= " << pn0 <<
" sn0= " << sn0
304 <<
" copyinlayer= " << copyinlayer << std::endl;
307 std::vector<ClusterFP420> currentclust;
308 currentclust.clear();
310 outputRange =
input->get(iu);
314 for (; sort_begin != sort_end; ++sort_begin) {
316 currentclust.push_back(*sort_begin);
320 std::cout <<
"TrackProducerFP420: currentclust.size = " << currentclust.size() << std::endl;
324 std::vector<ClusterFP420>::const_iterator simHitIter = currentclust.begin();
325 std::vector<ClusterFP420>::const_iterator simHitIterEnd = currentclust.end();
334 }
else if (xytype == 2) {
343 for (; simHitIter != simHitIterEnd; ++simHitIter) {
352 if (copyinlayer == 1 && nY[
ii] > reshits1) {
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 if (copyinlayer != 1 && nY[
ii] > reshits2) {
361 std::cout <<
"WARNING-ERROR:TrackproducerFP420: currentclust.size()= " << currentclust.size()
362 <<
" bigger reservated number of hits"
363 <<
" zcurrent=" << zY[nY[
ii] - 1][
ii] <<
" copyinlayer= " << copyinlayer <<
" ii= " <<
ii
366 zY[nY[
ii] - 1][
ii] = zcurrent;
367 yY[nY[
ii] - 1][
ii] = icluster.
barycenter() * pitch + 0.5 * pitch + YYYDelta;
370 yY[nY[
ii] - 1][
ii] = yY[nY[
ii] - 1][
ii] - dYYcur;
373 wY[nY[
ii] - 1][
ii] *= wY[nY[
ii] - 1][
ii];
375 xYW[nY[
ii] - 1][
ii] = (xYW[nY[
ii] - 1][
ii] + dYYWcur);
377 xYW[nY[
ii] - 1][
ii] = -(xYW[nY[
ii] - 1][
ii] + dYYWcur);
379 wYW[nY[
ii] - 1][
ii] =
381 wYW[nY[
ii] - 1][
ii] *= wYW[nY[
ii] - 1][
ii];
382 qY[nY[
ii] - 1][
ii] =
true;
383 if (copyinlayer == 1 && nY[
ii] == reshits1)
385 if (copyinlayer != 1 && nY[
ii] == reshits2)
389 else if (xytype == 2) {
392 std::cout <<
"TrackproducerFP420: nX[ii]= " << nX[
ii] <<
" Ncl= " << currentclust.size()
393 <<
" copyinlayer= " << copyinlayer <<
" ii= " <<
ii <<
" zcurrent = " << zcurrent
394 <<
" xX= " << icluster.
barycenter() * pitch + 0.5 * pitch + XXXDelta
395 <<
" yXW= " << icluster.
barycenterW() * pitchW + 0.5 * pitchW <<
" det= " << det
399 if (copyinlayer == 1 && nX[
ii] > reshits1) {
400 std::cout <<
"WARNING-ERROR:TrackproducerFP420: nX[ii]= " << nX[
ii]
401 <<
" bigger reservated number of hits"
402 <<
" currentclust.size()= " << currentclust.size() <<
" copyinlayer= " << copyinlayer
403 <<
" ii= " <<
ii << std::endl;
406 if (copyinlayer != 1 && nX[
ii] > reshits2) {
407 std::cout <<
"WARNING-ERROR:TrackproducerFP420: nX[ii]= " << nX[
ii]
408 <<
" bigger reservated number of hits"
409 <<
" currentclust.size()= " << currentclust.size() <<
" copyinlayer= " << copyinlayer
410 <<
" ii= " <<
ii << std::endl;
413 zX[nX[
ii] - 1][
ii] = zcurrent;
414 xX[nX[
ii] - 1][
ii] = icluster.
barycenter() * pitch + 0.5 * pitch + XXXDelta;
417 xX[nX[
ii] - 1][
ii] = -(xX[nX[
ii] - 1][
ii] + dXXcur);
420 wX[nX[
ii] - 1][
ii] *= wX[nX[
ii] - 1][
ii];
422 yXW[nX[
ii] - 1][
ii] = -(yXW[nX[
ii] - 1][
ii] - dXXWcur);
424 yXW[nX[
ii] - 1][
ii] = yXW[nX[
ii] - 1][
ii] - dXXWcur;
426 wXW[nX[
ii] - 1][
ii] =
428 wXW[nX[
ii] - 1][
ii] *= wXW[nX[
ii] - 1][
ii];
429 qX[nX[
ii] - 1][
ii] =
true;
431 std::cout <<
"trackFinderSophisticated: nX[ii]= " << nX[
ii] <<
" ii = " <<
ii
432 <<
" zcurrent = " << zcurrent <<
" yXW[nX[ii]-1][ii] = " << yXW[nX[
ii] - 1][
ii]
433 <<
" xX[nX[ii]-1][ii] = " << xX[nX[
ii] - 1][
ii] << std::endl;
434 std::cout <<
" XXXDelta= " << XXXDelta <<
" dXXcur= " << dXXcur <<
" -dXXWcur= " << -dXXWcur
437 <<
" wXW[nX[ii]-1][ii]= " << wXW[nX[
ii] - 1][
ii] << std::endl;
438 std::cout <<
" -icluster.barycenterW()*pitchW+0.5*pitchW = "
439 << icluster.
barycenterW() * pitchW + 0.5 * pitchW << std::endl;
440 std::cout <<
"============================================================" << std::endl;
443 std::cout <<
"trackFinderSophisticated: nX[ii]= " << nX[
ii] <<
" ii = " <<
ii
444 <<
" zcurrent = " << zcurrent <<
" xX[nX[ii]-1][ii] = " << xX[nX[
ii] - 1][
ii] << std::endl;
446 <<
" wXW[nX[ii]-1][ii] = " << wXW[nX[
ii] - 1][
ii] << std::endl;
447 std::cout <<
" -icluster.barycenter()*pitch-0.5*pitch = "
448 << -icluster.
barycenter() * pitch - 0.5 * pitch <<
" -dXXcur = " << -dXXcur
449 <<
" -XXXDelta = " << -XXXDelta << std::endl;
450 std::cout <<
"============================================================" << std::endl;
453 if (copyinlayer == 1 && nX[
ii] == reshits1)
455 if (copyinlayer != 1 && nX[
ii] == reshits2)
463 if (nY[
ii] > nmetcury) {
468 if (sector == (sn0 - 1))
473 else if (xytype == 2) {
474 if (nX[
ii] > nmetcurx) {
479 if (sector == (sn0 - 1))
489 std::cout <<
"trackFinderSophisticated: tyf= " << tyf <<
" tys1 = " << tys1 <<
" tyss = " << tyss << std::endl;
490 std::cout <<
"trackFinderSophisticated: txf= " << txf <<
" txs1 = " << txs1 <<
" txss = " << txss << std::endl;
491 std::cout <<
"============================================================" << std::endl;
511 int pys1Cut = 3, pyssCut = 1, pyallCut = 5;
533 double sigman = 0.18, ssigma = 2.5, sigmam = 0.18;
545 sigman = 0.30, ssigma = 8.0,
550 std::cout <<
"trackFinderSophisticated: ssigma= " << ssigma << std::endl;
562 int numberXtracks = 0, numberYtracks = 0, totpl = 2 * (pn0 - 1) * (sn0 - 1);
565 for (
int xytypecurrent = xytype; xytypecurrent < xytype + 1; ++xytypecurrent) {
567 std::cout <<
"trackFinderSophisticated: xytypecurrent= " << xytypecurrent << std::endl;
573 int qAcl[20], qAii[20], fip = 0, niteration = 0;
574 int ry = 0, rys1 = 0, ryss = 0;
575 int tas1 = tys1, tass = tyss, taf = tyf;
576 bool SelectTracks =
true;
581 double yA[24][20], zA[24][20], wA[24][20];
587 if (xytypecurrent == 1) {
590 tg0 = 3 * 1. / (800. + 20.);
594 for (
int ii = 0;
ii < totpl; ++
ii) {
596 std::cout <<
"trackFinderSophisticated: ii= " <<
ii <<
" nY[ii]= " << nY[
ii] << std::endl;
597 std::cout <<
"trackFinderSophisticated: ii= " <<
ii <<
" uY[ii]= " << uY[
ii] << std::endl;
601 for (
int cl = 0;
cl < nA[
ii]; ++
cl) {
603 std::cout <<
" cl= " <<
cl <<
" yY[cl][ii]= " << yY[
cl][
ii] << std::endl;
604 std::cout <<
" zY[cl][ii]= " << zY[
cl][
ii] <<
" wY[cl][ii]= " << wY[
cl][
ii] <<
" qY[cl][ii]= " << qY[
cl][
ii]
617 else if (xytypecurrent == 2) {
620 tg0 = 3 * 2. / (800. + 20.);
624 for (
int ii = 0;
ii < totpl; ++
ii) {
626 std::cout <<
"trackFinderSophisticated: ii= " <<
ii <<
" nX[ii]= " << nX[
ii] << std::endl;
627 std::cout <<
"trackFinderSophisticated: ii= " <<
ii <<
" uX[ii]= " << uX[
ii] << std::endl;
631 for (
int cl = 0;
cl < nA[
ii]; ++
cl) {
633 std::cout <<
" cl= " <<
cl <<
" xX[cl][ii]= " << xX[
cl][
ii] << std::endl;
634 std::cout <<
" zX[cl][ii]= " << zX[
cl][
ii] <<
" wX[cl][ii]= " << wX[
cl][
ii] <<
" qX[cl][ii]= " << qX[
cl][
ii]
648 std::cout <<
" start road finder " << std::endl;
651 double fyY[20], fzY[20], fwY[20];
652 double fyYW[20], fwYW[20];
653 int py = 0, pys1 = 0, pyss = 0;
654 bool NewStation =
false, py1first =
false;
655 for (
int sector = 1; sector < sn0; ++sector) {
656 double tav = 0.,
t1 = 0.,
t2 = 0.,
t = 0., sm;
661 for (
int zmodule = 1; zmodule < pn0; ++zmodule) {
662 for (
int justlayer = zbeg; justlayer <
zmax; justlayer++) {
672 if (nA[
ii] != 0 && uA[
ii] != nA[
ii]) {
676 if (sector == (sn0 - 1))
678 if (
py == 2 && sector == 1) {
680 double dymin = 9999999., df2;
682 for (
int cl = 0;
cl < nA[
ii]; ++
cl) {
693 t = (yA[
cl2][
ii] - fyY[fip]) / (zA[
cl2][
ii] - fzY[fip]);
697 std::cout <<
" t= " <<
t <<
" tg0= " << tg0 << std::endl;
708 std::cout <<
" point is taken, mark it for not using again uA[ii]= " << uA[
ii] << std::endl;
710 if (uA[
ii] == nA[
ii]) {
714 if (sector == (sn0 - 1))
722 if (sector == (sn0 - 1))
732 if (sector == (sn0 - 1))
738 bool clLoopTrue =
true;
740 for (
int clind = 0; clind < nA[
ii]; ++clind) {
757 std::cout <<
" point is taken, mark it uA[ii]= " << uA[
ii] << std::endl;
759 if (uA[
ii] == nA[
ii]) {
763 if (sector == (sn0 - 1))
773 sigma = ssigma / (sn0 - 1 - sector);
777 if (stattimes == 1 || sector == 3)
781 double cov00, cov01, cov11, c0Y, c1Y, chisqY;
782 gsl_fit_wlinear(fzY, 1, fwY, 1, fyY, 1,
py - 1, &c0Y, &c1Y, &cov00, &cov01, &cov11, &chisqY);
786 double dymin = 9999999., df2;
787 for (
int clmatch = 0; clmatch < nA[
ii]; ++clmatch) {
788 if (qA[clmatch][
ii]) {
789 double smmatch = c0Y + c1Y * zA[clmatch][
ii];
798 if (cl2match != -1) {
803 sm = c0Y + c1Y * zA[
cl][
ii];
806 std::cout <<
" sector= " << sector <<
" sn0= " << sn0 <<
" sigma= " << sigma << std::endl;
807 std::cout <<
" stattimes= " << stattimes <<
" ssigma= " << ssigma <<
" sigmam= " << sigmam
809 std::cout <<
" sm= " << sm <<
" c0Y= " << c0Y <<
" c1Y= " << c1Y <<
" chisqY= " << chisqY
811 std::cout <<
" zA[cl][ii]= " << zA[
cl][
ii] <<
" ii= " <<
ii <<
" cl= " <<
cl << std::endl;
812 for (
int ct = 0; ct <
py - 1; ++ct) {
813 std::cout <<
" py-1= " <<
py - 1 <<
" fzY[ct]= " << fzY[ct] << std::endl;
814 std::cout <<
" fyY[ct]= " << fyY[ct] <<
" fwY[ct]= " << fwY[ct] << std::endl;
820 t = (yA[
cl][
ii] - fyY[fip]) / (zA[
cl][
ii] - fzY[fip]);
824 sm = fyY[fip] + tav * (zA[
cl][
ii] - fzY[fip]);
829 double diffpo = yA[
cl][
ii] - sm;
831 std::cout <<
" diffpo= " << diffpo <<
" yA[cl][ii]= " << yA[
cl][
ii] <<
" sm= " << sm
832 <<
" sigma= " << sigma << std::endl;
838 if (stattimes == 1) {
842 }
else if (stattimes == 2) {
844 t = (yA[
cl][
ii] - fyY[fip]) / (zA[
cl][
ii] - fzY[fip]);
859 std::cout <<
" 3333 point is taken, mark it uA[ii]= " << uA[
ii] << std::endl;
861 if (uA[
ii] == nA[
ii]) {
865 if (sector == (sn0 - 1))
882 if ((
py != 1 && clcurr != -1 && qA[clcurr][
ii]) || (
py == 1 && !py1first)) {
887 if (sector == (sn0 - 1))
899 std::cout <<
"END: pys1= " << pys1 <<
" pyss = " << pyss <<
" py = " <<
py << std::endl;
903 if (pys1 < pys1Cut || pyss < pyssCut ||
py < pyallCut) {
909 double cov00, cov01, cov11;
910 double c0Y, c1Y, chisqY;
911 gsl_fit_wlinear(fzY, 1, fwY, 1, fyY, 1,
py, &c0Y, &c1Y, &cov00, &cov01, &cov11, &chisqY);
925 chindfx = chisqY / (
py - 2);
932 std::cout <<
" Do FIT XZ: chindfx= " << chindfx <<
" chisqY= " << chisqY <<
" py= " <<
py << std::endl;
937 std::cout <<
" preparation for second order fit for Wide pixels= " << std::endl;
939 for (
int ipy = 0; ipy <
py; ++ipy) {
940 if (xytypecurrent == 1) {
941 fyYW[ipy] = xYW[qAcl[ipy]][qAii[ipy]];
942 fwYW[ipy] = wYW[qAcl[ipy]][qAii[ipy]];
944 std::cout <<
" ipy= " << ipy << std::endl;
945 std::cout <<
" qAcl[ipy]= " << qAcl[ipy] <<
" qAii[ipy]= " << qAii[ipy] << std::endl;
946 std::cout <<
" fyYW[ipy]= " << fyYW[ipy] <<
" fwYW[ipy]= " << fwYW[ipy] << std::endl;
948 }
else if (xytypecurrent == 2) {
949 fyYW[ipy] = yXW[qAcl[ipy]][qAii[ipy]];
950 fwYW[ipy] = wXW[qAcl[ipy]][qAii[ipy]];
952 std::cout <<
" ipy= " << ipy << std::endl;
953 std::cout <<
" qAcl[ipy]= " << qAcl[ipy] <<
" qAii[ipy]= " << qAii[ipy] << std::endl;
954 std::cout <<
" fyYW[ipy]= " << fyYW[ipy] <<
" fwYW[ipy]= " << fwYW[ipy] << std::endl;
960 std::cout <<
" start second order fit for Wide pixels= " << std::endl;
962 double wov00, wov01, wov11;
963 double w0Y, w1Y, whisqY;
964 gsl_fit_wlinear(fzY, 1, fwYW, 1, fyYW, 1,
py, &w0Y, &w1Y, &wov00, &wov01, &wov11, &whisqY);
969 chindfy = whisqY / (
py - 2);
976 std::cout <<
" chindfy= " << chindfy <<
" chiCutY= " << chiCutY << std::endl;
979 if (xytypecurrent == 1) {
980 if (chindfx < chiCutX && chindfy < chiCutY) {
982 Ay[numberYtracks - 1] = c0Y;
983 By[numberYtracks - 1] = c1Y;
984 Cy[numberYtracks - 1] = chisqY;
986 My[numberYtracks - 1] =
py;
987 AyW[numberYtracks - 1] = w0Y;
988 ByW[numberYtracks - 1] = w1Y;
989 CyW[numberYtracks - 1] = whisqY;
990 MyW[numberYtracks - 1] =
py;
993 std::cout <<
" niteration = " << niteration << std::endl;
994 std::cout <<
" chindfy= " << chindfy <<
" py= " <<
py << std::endl;
995 std::cout <<
" c0Y= " << c0Y <<
" c1Y= " << c1Y << std::endl;
996 std::cout <<
" pys1= " << pys1 <<
" pyss = " << pyss << std::endl;
1000 }
else if (xytypecurrent == 2) {
1001 if (chindfx < chiCutX && chindfy < chiCutY) {
1003 Ax[numberXtracks - 1] = c0Y;
1004 Bx[numberXtracks - 1] = c1Y;
1005 Cx[numberXtracks - 1] = chisqY;
1007 Mx[numberXtracks - 1] =
py;
1008 AxW[numberXtracks - 1] = w0Y;
1009 BxW[numberXtracks - 1] = w1Y;
1010 CxW[numberXtracks - 1] = whisqY;
1011 MxW[numberXtracks - 1] =
py;
1013 std::cout <<
" niteration = " << niteration << std::endl;
1014 std::cout <<
" chindfx= " << chindfy <<
" px= " <<
py << std::endl;
1015 std::cout <<
" c0X= " << c0Y <<
" c1X= " << c1Y << std::endl;
1016 std::cout <<
" pxs1= " << pys1 <<
" pxss = " << pyss << std::endl;
1025 std::cout <<
"Current iteration, niteration >= " << niteration << std::endl;
1026 std::cout <<
" numberYtracks= " << numberYtracks << std::endl;
1027 std::cout <<
" numberXtracks= " << numberXtracks << std::endl;
1028 std::cout <<
" pys1= " << pys1 <<
" pyss = " << pyss <<
" py = " <<
py << std::endl;
1029 std::cout <<
" tas1= " << tas1 <<
" tass = " << tass <<
" taf = " << taf << std::endl;
1030 std::cout <<
" rys1= " << rys1 <<
" ryss = " << ryss <<
" ry = " <<
ry << std::endl;
1031 std::cout <<
" tas1-rys1= " << tas1 - rys1 <<
" tass-ryss = " << tass - ryss <<
" taf-ry = " << taf -
ry
1033 std::cout <<
"---------------------------------------------------------- " << std::endl;
1036 if (tas1 - rys1 < pys1Cut || tass - ryss < pyssCut || taf -
ry < pyallCut) {
1037 SelectTracks =
false;
1042 }
while (SelectTracks && niteration < nitMax);
1054 std::cout <<
" numberXtracks= " << numberXtracks <<
" numberYtracks= " << numberYtracks << std::endl;
1068 std::cout <<
" numberXtracks= " << numberXtracks <<
" numberYtracks= " << numberYtracks << std::endl;
1070 if (numberXtracks > 0) {
1071 int newxnum[10], newynum[10];
1074 double dthmin = 999999.;
1075 int trminx = -1, trminy = -1;
1076 for (
int trx = 0; trx < numberXtracks; ++trx) {
1078 std::cout <<
"----------- trx= " << trx <<
" nmathed= " << nmathed << std::endl;
1080 for (
int tr = 0; tr < numberYtracks; ++tr) {
1082 std::cout <<
"--- tr= " << tr <<
" nmathed= " << nmathed << std::endl;
1085 for (
int nmx = 0; nmx < nmathed; ++nmx) {
1086 if (trx == newxnum[nmx])
1090 for (
int nm = 0; nm < nmathed; ++nm) {
1091 if (tr == newynum[nm])
1110 <<
" abs(BxW[trx]-By[tr])= " <<
std::abs(BxW[trx] - By[tr]) <<
" dthdif= " << dthdif
1114 if (dthdif < dthmin) {
1125 newxnum[nmathed - 1] = trminx;
1127 newxnum[nmathed - 1] = nmathed - 1;
1130 std::cout <<
" trminx= " << trminx << std::endl;
1132 if (nmathed > numberYtracks) {
1133 newynum[nmathed - 1] = -1;
1135 std::cout <<
"!!! nmathed= " << nmathed <<
" > numberYtracks= " << numberYtracks << std::endl;
1139 std::cout <<
" trminy= " << trminy << std::endl;
1141 newynum[nmathed - 1] = trminy;
1143 }
while (nmathed < numberXtracks && nmathed < restracks);
1148 for (
int tr = 0; tr < nmathed; ++tr) {
1149 int tx = newxnum[tr];
1150 int ty = newynum[tr];
1163 std::cout <<
" for track tr= " << tr <<
" tx= " << tx <<
" ty= " << ty << std::endl;
1164 std::cout <<
" Ax= " << Ax[tx] <<
" Ay= " << Ay[ty] << std::endl;
1165 std::cout <<
" Bx= " << Bx[tx] <<
" By= " << By[ty] << std::endl;
1166 std::cout <<
" Cx= " << Cx[tx] <<
" Cy= " << Cy[ty] << std::endl;
1167 std::cout <<
" Mx= " << Mx[tx] <<
" My= " << My[ty] << std::endl;
1168 std::cout <<
" AxW= " << AxW[tx] <<
" AyW= " << AyW[ty] << std::endl;
1169 std::cout <<
" BxW= " << BxW[tx] <<
" ByW= " << ByW[ty] << std::endl;
1170 std::cout <<
" CxW= " << CxW[tx] <<
" CyW= " << CyW[ty] << std::endl;
1171 std::cout <<
" MxW= " << MxW[tx] <<
" MyW= " << MyW[ty] << std::endl;
1175 rhits.push_back(
TrackFP420(Ax[tx], Bx[tx], Cx[tx], Mx[tx], Ay[ty], By[ty], Cy[ty], My[ty]));
1183 else if (xytype == 1) {
1184 for (
int ty = 0; ty < numberYtracks; ++ty) {
1186 std::cout <<
" for track ty= " << ty << std::endl;
1187 std::cout <<
" Ay= " << Ay[ty] << std::endl;
1188 std::cout <<
" By= " << By[ty] << std::endl;
1189 std::cout <<
" Cy= " << Cy[ty] << std::endl;
1190 std::cout <<
" My= " << My[ty] << std::endl;
1191 std::cout <<
" AyW= " << AyW[ty] << std::endl;
1192 std::cout <<
" ByW= " << ByW[ty] << std::endl;
1193 std::cout <<
" CyW= " << CyW[ty] << std::endl;
1194 std::cout <<
" MyW= " << MyW[ty] << std::endl;
1196 rhits.push_back(
TrackFP420(AyW[ty], ByW[ty], CyW[ty], MyW[ty], Ay[ty], By[ty], Cy[ty], My[ty]));
1201 else if (xytype == 2) {
1202 for (
int tx = 0; tx < numberXtracks; ++tx) {
1204 std::cout <<
" for track tx= " << tx << std::endl;
1205 std::cout <<
" Ax= " << Ax[tx] << std::endl;
1206 std::cout <<
" Bx= " << Bx[tx] << std::endl;
1207 std::cout <<
" Cx= " << Cx[tx] << std::endl;
1208 std::cout <<
" Mx= " << Mx[tx] << std::endl;
1209 std::cout <<
" AxW= " << AxW[tx] << std::endl;
1210 std::cout <<
" BxW= " << BxW[tx] << std::endl;
1211 std::cout <<
" CxW= " << CxW[tx] << std::endl;
1212 std::cout <<
" MxW= " << MxW[tx] << std::endl;
1214 rhits.push_back(
TrackFP420(Ax[tx], Bx[tx], Cx[tx], Mx[tx], AxW[tx], BxW[tx], CxW[tx], MxW[tx]));