30 new unsigned char[nofZBins * sizeof(
CbmZBin)]))
37 for (
int i = 0;
i < nofZBins; ++
i)
85 Double_t z = hit->
GetZ();
87 if (z < fMinZ || z >=
fMaxZ)
return;
89 Double_t
y = hit->
GetY();
91 if (y < fMinY || y >=
fMaxY)
return;
93 Double_t
x = hit->
GetX();
95 if (x < fMinX || x >=
fMaxX)
return;
99 if (t < fMinT || t >=
fMaxT)
return;
129 if (!zBin.
Use())
continue;
134 if (!yBin.
Use())
continue;
139 if (!xBin.
Use())
continue;
144 if (!tBin.
Use())
continue;
146 for (std::list<CbmTBin::HitHolder>::iterator hi = tBin.
HitsBegin();
153 handleHit(hitHolder);
208 Double_t deltaZmin = stateZ -
fMinZ;
209 Double_t tx = stateVec.GetTx();
210 Double_t ty = stateVec.GetTy();
214 Double_t minTx = tx - wTx;
215 Double_t maxTx = tx + wTx;
217 Double_t minTy = ty - wTy;
218 Double_t maxTy = ty + wTy;
220 if (minTy > 0 && stateVec.GetY() + minTy * deltaZmin >=
fMaxY)
222 else if (maxTy < 0 && stateVec.GetY() + maxTy * deltaZmin <
fMinY)
225 if (minTx > 0 && stateVec.GetX() + minTx * deltaZmin >=
fMaxX)
227 else if (maxTx < 0 && stateVec.GetX() + minTx * deltaZmin <
fMinX)
230 Double_t minZ =
fMinZ;
231 Double_t maxZ =
fMaxZ;
233 Double_t searchZ = stateZ;
234 Double_t searchX = stateVec.GetX();
235 Double_t searchY = stateVec.GetY();
238 if ((
fMaxY - searchY) / minTy + searchZ < maxZ)
239 maxZ = (
fMaxY - searchY) / minTy + searchZ;
240 }
else if (maxTy < 0) {
241 if ((
fMinY - searchY) / maxTy + searchZ < maxZ)
242 maxZ = (
fMinY - searchY) / maxTy + searchZ;
246 if ((
fMaxX - searchX) / minTx + searchZ < maxZ)
247 maxZ = (
fMaxX - searchX) / minTx + searchZ;
248 }
else if (maxTx < 0) {
249 if ((
fMinX - searchX) / maxTx + searchZ < maxZ)
250 maxZ = (
fMinX - searchX) / maxTx + searchZ;
255 for (
int i = 0;
i <= maxZind; ++
i) {
259 Double_t minY = minTy > 0 ? minTy * (minZi - searchZ) + searchY
260 : minTy * (maxZi - searchZ) + searchY;
262 Double_t maxY = maxTy > 0 ? maxTy * (maxZi - searchZ) + searchY
263 : maxTy * (minZi - searchZ) + searchY;
266 for (
int j = minYind; j <= maxYind; ++j) {
268 Double_t minZj = maxZi;
269 Double_t maxZj = minZi;
272 if (tmp < minZj && tmp > minZi) minZj = tmp;
276 if (tmp < minZj && tmp > minZi) minZj = tmp;
278 if (minZj == maxZi) minZj = minZi;
282 if (tmp > maxZj && tmp < maxZi) maxZj = tmp;
286 if (tmp > maxZj && tmp < maxZi) maxZj = tmp;
288 if (maxZj == minZi) maxZj = maxZi;
290 Double_t minX = minTx > 0 ? minTx * (minZj - searchZ) + searchX
291 : minTx * (maxZj - searchZ) + searchX;
292 Double_t maxX = maxTx > 0 ? maxTx * (maxZj - searchZ) + searchX
293 : maxTx * (minZj - searchZ) + searchX;
297 for (
int k = minXind; k <= maxXind; ++k) {
299 Double_t minZk = maxZj;
300 Double_t maxZk = minZj;
303 if (tmp2 < minZk && tmp2 > minZj) minZk = tmp2;
307 if (tmp2 < minZk && tmp2 > minZj) minZk = tmp2;
309 if (minZk == maxZj) minZk = minZj;
313 if (tmp2 > maxZk && tmp2 < maxZj) maxZk = tmp2;
317 if (tmp2 > maxZk && tmp2 < maxZj) maxZk = tmp2;
319 if (maxZk == minZj) maxZk = maxZj;
326 for (
int l = minTind; l <= maxTind; ++l) {
328 std::list<CbmTBin::HitHolder>::iterator hitIter = tBin.
HitsBegin();
329 std::list<CbmTBin::HitHolder>::iterator hitIterEnd = tBin.
HitsEnd();
331 for (; hitIter != hitIterEnd; ++hitIter) {
354 handleHit(hitHolder);
364 Double_t x1 = hit1->
GetX();
365 Double_t y1 = hit1->
GetY();
366 Double_t dx1Sq = hit1->
GetDx() * hit1->
GetDx();
367 Double_t dy1Sq = hit1->
GetDy() * hit1->
GetDy();
370 Double_t x2 = hit2->
GetX();
371 Double_t y2 = hit2->
GetY();
372 Double_t dx2Sq = hit2->
GetDx() * hit2->
GetDx();
373 Double_t dy2Sq = hit2->
GetDy() * hit2->
GetDy();
375 Double_t segDeltaZ = hit2->
GetZ() - hit1->
GetZ();
376 Double_t segDeltaZSq = segDeltaZ * segDeltaZ;
382 searchZ = hit2->
GetZ();
386 searchZ = (hit1->
GetZ() + hit2->
GetZ()) / 2;
391 Double_t searchX = (x1 + x2) / 2;
392 Double_t searchY = (y1 + y2) / 2;
393 Double_t deltaZmin = searchZ -
fMinZ;
395 Double_t tx = (x2 - x1) / segDeltaZ;
396 Double_t ty = (y2 - y1) / segDeltaZ;
398 Double_t dTxSq = (dx1Sq + dx2Sq) / segDeltaZSq;
400 Double_t minTx = tx - wTx;
401 Double_t maxTx = tx + wTx;
402 Double_t dTySq = (dy1Sq + dy2Sq) / segDeltaZSq;
404 Double_t minTy = ty - wTy;
405 Double_t maxTy = ty + wTy;
407 if (minTy > 0 && searchY + minTy * deltaZmin >=
fMaxY)
409 else if (maxTy < 0 && searchY + maxTy * deltaZmin <
fMinY)
412 if (minTx > 0 && searchX + minTx * deltaZmin >=
fMaxX)
414 else if (maxTx < 0 && searchX + minTx * deltaZmin <
fMinX)
417 Double_t minZ =
fMinZ;
418 Double_t maxZ =
fMaxZ;
421 if ((
fMaxY - searchY) / minTy + searchZ < maxZ)
422 maxZ = (
fMaxY - searchY) / minTy + searchZ;
423 }
else if (maxTy < 0) {
424 if ((
fMinY - searchY) / maxTy + searchZ < maxZ)
425 maxZ = (
fMinY - searchY) / maxTy + searchZ;
429 if ((
fMaxX - searchX) / minTx + searchZ < maxZ)
430 maxZ = (
fMaxX - searchX) / minTx + searchZ;
431 }
else if (maxTx < 0) {
432 if ((
fMinX - searchX) / maxTx + searchZ < maxZ)
433 maxZ = (
fMinX - searchX) / maxTx + searchZ;
438 for (
int i = 0;
i <= maxZind; ++
i) {
442 Double_t minY = minTy > 0 ? minTy * (minZi - searchZ) + searchY
443 : minTy * (maxZi - searchZ) + searchY;
445 Double_t maxY = maxTy > 0 ? maxTy * (maxZi - searchZ) + searchY
446 : maxTy * (minZi - searchZ) + searchY;
449 for (
int j = minYind; j <= maxYind; ++j) {
451 Double_t minZj = maxZi;
452 Double_t maxZj = minZi;
455 if (tmp < minZj && tmp > minZi) minZj = tmp;
459 if (tmp < minZj && tmp > minZi) minZj = tmp;
461 if (minZj == maxZi) minZj = minZi;
465 if (tmp > maxZj && tmp < maxZi) maxZj = tmp;
469 if (tmp > maxZj && tmp < maxZi) maxZj = tmp;
471 if (maxZj == minZi) maxZj = maxZi;
473 Double_t minX = minTx > 0 ? minTx * (minZj - searchZ) + searchX
474 : minTx * (maxZj - searchZ) + searchX;
475 Double_t maxX = maxTx > 0 ? maxTx * (maxZj - searchZ) + searchX
476 : maxTx * (minZj - searchZ) + searchX;
480 for (
int k = minXind; k <= maxXind; ++k) {
482 Double_t minZk = maxZj;
483 Double_t maxZk = minZj;
486 if (tmp2 < minZk && tmp2 > minZj) minZk = tmp2;
490 if (tmp2 < minZk && tmp2 > minZj) minZk = tmp2;
492 if (minZk == maxZj) minZk = minZj;
496 if (tmp2 > maxZk && tmp2 < maxZj) maxZk = tmp2;
500 if (tmp2 > maxZk && tmp2 < maxZj) maxZk = tmp2;
502 if (maxZk == minZj) maxZk = maxZj;
509 for (
int l = minTind; l <= maxTind; ++l) {
511 std::list<CbmTBin::HitHolder>::iterator hitIter = tBin.
HitsBegin();
512 std::list<CbmTBin::HitHolder>::iterator hitIterEnd = tBin.
HitsEnd();
514 for (; hitIter != hitIterEnd; ++hitIter) {
516 Double_t z = hit->
GetZ();
517 Double_t zSq = z * z;
518 Double_t deltaY = hit->
GetY() - ty * z;
522 * (dTySq * zSq + hit->
GetDy() * hit->
GetDy()))
525 Double_t deltaX = hit->
GetX() - tx * z;
529 * (dTxSq * zSq + hit->
GetDx() * hit->
GetDx()))
538 std::pair<std::set<Segment, SegmentComp>::iterator,
bool> ir =