|
64 | 64 | #include "TOFBase/Geo.h" |
65 | 65 | #include "ITSBase/GeometryTGeo.h" |
66 | 66 | #endif |
| 67 | +#ifdef GPUCA_O2_LIB |
| 68 | +#include "ITSMFTBase/DPLAlpideParam.h" |
| 69 | +#endif |
67 | 70 |
|
68 | 71 | #include "GPUDisplayShaders.h" |
69 | 72 |
|
@@ -1539,78 +1542,108 @@ int GPUDisplay::DrawGLScene_internal(bool mixAnimation, float mAnimateTime) |
1539 | 1542 | if (fabsf(ptr->z) > mMaxClusterZ) { |
1540 | 1543 | mMaxClusterZ = fabsf(ptr->z); |
1541 | 1544 | } |
1542 | | - if (iSlice < 18) { |
1543 | | - ptr->z += mZadd; |
1544 | | - ptr->z += mZadd; |
1545 | | - } else { |
1546 | | - ptr->z -= mZadd; |
1547 | | - ptr->z -= mZadd; |
1548 | | - } |
1549 | | - |
| 1545 | + ptr->z += iSlice < 18 ? mZadd : -mZadd; |
1550 | 1546 | ptr->x /= GL_SCALE_FACTOR; |
1551 | 1547 | ptr->y /= GL_SCALE_FACTOR; |
1552 | 1548 | ptr->z /= GL_SCALE_FACTOR; |
1553 | 1549 | ptr->w = tCLUSTER; |
1554 | 1550 | } |
1555 | 1551 | } |
1556 | 1552 |
|
1557 | | - GPUCA_OPENMP(parallel for num_threads(getNumThreads()) reduction(max : mMaxClusterZ)) |
| 1553 | + int trdTriggerRecord = -1; |
| 1554 | + float trdZoffset = 0; |
| 1555 | + GPUCA_OPENMP(parallel for num_threads(getNumThreads()) reduction(max : mMaxClusterZ) firstprivate(trdTriggerRecord, trdZoffset)) |
1558 | 1556 | for (int i = 0; i < mCurrentSpacePointsTRD; i++) { |
| 1557 | + while (mParam->par.ContinuousTracking && trdTriggerRecord < (int)mIOPtrs->nTRDTriggerRecords - 1 && mIOPtrs->trdTrackletIdxFirst[trdTriggerRecord + 1] <= i) { |
| 1558 | + trdTriggerRecord++; |
| 1559 | + float trdTime = mIOPtrs->trdTriggerTimes[trdTriggerRecord] * 1e3 / o2::constants::lhc::LHCBunchSpacingNS / o2::tpc::constants::LHCBCPERTIMEBIN; |
| 1560 | + trdZoffset = fabsf(mCalib->fastTransform->convVertexTimeToZOffset(0, trdTime, mParam->par.continuousMaxTimeBin)); |
| 1561 | + } |
1559 | 1562 | const auto& sp = mIOPtrs->trdSpacePoints[i]; |
1560 | 1563 | int iSec = trdGeometry().GetSector(mIOPtrs->trdTracklets[i].GetDetector()); |
1561 | 1564 | float4* ptr = &mGlobalPosTRD[i]; |
1562 | 1565 | mParam->Slice2Global(iSec, sp.getX() + mXadd, sp.getY(), sp.getZ(), &ptr->x, &ptr->y, &ptr->z); |
1563 | | - ptr->x /= GL_SCALE_FACTOR; |
1564 | | - ptr->y /= GL_SCALE_FACTOR; |
1565 | | - ptr->z /= GL_SCALE_FACTOR; |
| 1566 | + ptr->z += ptr->z > 0 ? trdZoffset : -trdZoffset; |
1566 | 1567 | if (fabsf(ptr->z) > mMaxClusterZ) { |
1567 | 1568 | mMaxClusterZ = fabsf(ptr->z); |
1568 | 1569 | } |
1569 | | - ptr->w = tTRDCLUSTER; |
1570 | | - ptr = &mGlobalPosTRD2[i]; |
1571 | | - mParam->Slice2Global(iSec, sp.getX() + mXadd + 4.5f, sp.getY() + 1.5f * sp.getDy(), sp.getZ(), &ptr->x, &ptr->y, &ptr->z); |
1572 | 1570 | ptr->x /= GL_SCALE_FACTOR; |
1573 | 1571 | ptr->y /= GL_SCALE_FACTOR; |
1574 | 1572 | ptr->z /= GL_SCALE_FACTOR; |
| 1573 | + ptr->w = tTRDCLUSTER; |
| 1574 | + ptr = &mGlobalPosTRD2[i]; |
| 1575 | + mParam->Slice2Global(iSec, sp.getX() + mXadd + 4.5f, sp.getY() + 1.5f * sp.getDy(), sp.getZ(), &ptr->x, &ptr->y, &ptr->z); |
| 1576 | + ptr->z += ptr->z > 0 ? trdZoffset : -trdZoffset; |
1575 | 1577 | if (fabsf(ptr->z) > mMaxClusterZ) { |
1576 | 1578 | mMaxClusterZ = fabsf(ptr->z); |
1577 | 1579 | } |
| 1580 | + ptr->x /= GL_SCALE_FACTOR; |
| 1581 | + ptr->y /= GL_SCALE_FACTOR; |
| 1582 | + ptr->z /= GL_SCALE_FACTOR; |
1578 | 1583 | ptr->w = tTRDCLUSTER; |
1579 | 1584 | } |
1580 | 1585 |
|
1581 | 1586 | GPUCA_OPENMP(parallel for num_threads(getNumThreads()) reduction(max : mMaxClusterZ)) |
1582 | 1587 | for (int i = 0; i < mCurrentClustersTOF; i++) { |
1583 | | - float4* ptr = &mGlobalPosTOF[i]; |
1584 | 1588 | #ifdef HAVE_O2HEADERS |
| 1589 | + float4* ptr = &mGlobalPosTOF[i]; |
1585 | 1590 | mParam->Slice2Global(mIOPtrs->tofClusters[i].getSector(), mIOPtrs->tofClusters[i].getX() + mXadd, mIOPtrs->tofClusters[i].getY(), mIOPtrs->tofClusters[i].getZ(), &ptr->x, &ptr->y, &ptr->z); |
1586 | | - ptr->x /= GL_SCALE_FACTOR; |
1587 | | - ptr->y /= GL_SCALE_FACTOR; |
1588 | | - ptr->z /= GL_SCALE_FACTOR; |
1589 | | -#endif |
| 1591 | + float ZOffset = 0; |
| 1592 | + if (mParam->par.ContinuousTracking) { |
| 1593 | + float tofTime = mIOPtrs->tofClusters[i].getTime() * 1e-3 / o2::constants::lhc::LHCBunchSpacingNS / o2::tpc::constants::LHCBCPERTIMEBIN; |
| 1594 | + ZOffset = fabsf(mCalib->fastTransform->convVertexTimeToZOffset(0, tofTime, mParam->par.continuousMaxTimeBin)); |
| 1595 | + ptr->z += ptr->z > 0 ? ZOffset : -ZOffset; |
| 1596 | + } |
1590 | 1597 | if (fabsf(ptr->z) > mMaxClusterZ) { |
1591 | 1598 | mMaxClusterZ = fabsf(ptr->z); |
1592 | 1599 | } |
| 1600 | + ptr->x /= GL_SCALE_FACTOR; |
| 1601 | + ptr->y /= GL_SCALE_FACTOR; |
| 1602 | + ptr->z /= GL_SCALE_FACTOR; |
1593 | 1603 | ptr->w = tTOFCLUSTER; |
| 1604 | +#endif |
1594 | 1605 | } |
1595 | 1606 |
|
1596 | | - //GPUCA_OPENMP(parallel for num_threads(getNumThreads()) reduction(max : mMaxClusterZ)) |
1597 | | - for (int i = 0; i < mCurrentClustersITS; i++) { |
1598 | | - float4* ptr = &mGlobalPosITS[i]; |
| 1607 | + if (mCurrentClustersITS) { |
1599 | 1608 | #ifdef HAVE_O2HEADERS |
1600 | | - const auto& cl = mIOPtrs->itsClusters[i]; |
1601 | | - auto* itsGeo = o2::its::GeometryTGeo::Instance(); |
1602 | | - auto p = cl.getXYZGlo(*itsGeo); |
1603 | | - ptr->x = p.X(); |
1604 | | - ptr->y = p.Y(); |
1605 | | - ptr->z = p.Z(); |
1606 | | - ptr->x /= GL_SCALE_FACTOR; |
1607 | | - ptr->y /= GL_SCALE_FACTOR; |
1608 | | - ptr->z /= GL_SCALE_FACTOR; |
| 1609 | + float itsROFhalfLen = 0; |
| 1610 | +#ifdef GPUCA_O2_LIB // Not available in standalone benchmark |
| 1611 | + if (mParam->par.ContinuousTracking) { |
| 1612 | + const auto& alpParams = o2::itsmft::DPLAlpideParam<o2::detectors::DetID::ITS>::Instance(); |
| 1613 | + itsROFhalfLen = alpParams.roFrameLengthInBC / (float)o2::tpc::constants::LHCBCPERTIMEBIN / 2; |
| 1614 | + } |
1609 | 1615 | #endif |
1610 | | - if (fabsf(ptr->z) > mMaxClusterZ) { |
1611 | | - mMaxClusterZ = fabsf(ptr->z); |
| 1616 | + int i = 0; |
| 1617 | + for (unsigned int j = 0; j < mIOPtrs->nItsClusterROF; j++) { |
| 1618 | + float ZOffset = 0; |
| 1619 | + if (mParam->par.ContinuousTracking) { |
| 1620 | + o2::InteractionRecord startIR = o2::InteractionRecord(0, mIOPtrs->settingsTF && mIOPtrs->settingsTF->hasTfStartOrbit ? mIOPtrs->settingsTF->tfStartOrbit : 0); |
| 1621 | + float itsROFtime = mIOPtrs->itsClusterROF[j].getBCData().differenceInBC(startIR) / (float)o2::tpc::constants::LHCBCPERTIMEBIN; |
| 1622 | + ZOffset = fabsf(mCalib->fastTransform->convVertexTimeToZOffset(0, itsROFtime + itsROFhalfLen, mParam->par.continuousMaxTimeBin)); |
| 1623 | + } |
| 1624 | + if (i != mIOPtrs->itsClusterROF[j].getFirstEntry()) { |
| 1625 | + throw std::runtime_error("Inconsistent ITS data, number of clusters does not match ROF content"); |
| 1626 | + } |
| 1627 | + for (int k = 0; k < mIOPtrs->itsClusterROF[j].getNEntries(); k++) { |
| 1628 | + float4* ptr = &mGlobalPosITS[i]; |
| 1629 | + const auto& cl = mIOPtrs->itsClusters[i]; |
| 1630 | + auto* itsGeo = o2::its::GeometryTGeo::Instance(); |
| 1631 | + auto p = cl.getXYZGlo(*itsGeo); |
| 1632 | + ptr->x = p.X(); |
| 1633 | + ptr->y = p.Y(); |
| 1634 | + ptr->z = p.Z(); |
| 1635 | + ptr->z += ptr->z > 0 ? ZOffset : -ZOffset; |
| 1636 | + if (fabsf(ptr->z) > mMaxClusterZ) { |
| 1637 | + mMaxClusterZ = fabsf(ptr->z); |
| 1638 | + } |
| 1639 | + ptr->x /= GL_SCALE_FACTOR; |
| 1640 | + ptr->y /= GL_SCALE_FACTOR; |
| 1641 | + ptr->z /= GL_SCALE_FACTOR; |
| 1642 | + ptr->w = tITSCLUSTER; |
| 1643 | + i++; |
| 1644 | + } |
1612 | 1645 | } |
1613 | | - ptr->w = tITSCLUSTER; |
| 1646 | +#endif |
1614 | 1647 | } |
1615 | 1648 |
|
1616 | 1649 | mTimerFPS.ResetStart(); |
|
0 commit comments