From 2ac91a082c1ce28401690a3d0862855bdd0f31dd Mon Sep 17 00:00:00 2001 From: noferini <9963644+noferini@users.noreply.github.com> Date: Mon, 9 Dec 2024 15:37:20 +0100 Subject: [PATCH] fix in track propagation to TOF for MC --- Detectors/GlobalTracking/src/MatchTOF.cxx | 54 +++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/Detectors/GlobalTracking/src/MatchTOF.cxx b/Detectors/GlobalTracking/src/MatchTOF.cxx index 2db453b0f62be..de9e54f22eb85 100644 --- a/Detectors/GlobalTracking/src/MatchTOF.cxx +++ b/Detectors/GlobalTracking/src/MatchTOF.cxx @@ -932,6 +932,33 @@ void MatchTOF::doMatching(int sec) } //Printf("nStepsInsideSameStrip[nStripsCrossedInPropagation-1] = %d", nStepsInsideSameStrip[nStripsCrossedInPropagation - 1]); if (nStepsInsideSameStrip[nStripsCrossedInPropagation - 1] == 0) { + // fine propagation inside the strip -> 1 mm step + if(MCTruthON){ // for the moment to be applied only for MC -> condition to be removed for new 2025 data + // temporary variables since propagation can fail + int detIdTemp2[5] = {0, 0, 0, 0, 0}; + float deltaPosTemp2[3] = {deltaPosTemp[0], deltaPosTemp[1], deltaPosTemp[2]}; + while(deltaPosTemp2[1] < -0.1 && detIdTemp2[2] != -1){ // continuing propagation if dy is negative and we are still inside the strip volume + propagateToRefX(trefTrk, reachedPoint, 0.1, intLT); + reachedPoint = 0.1; + trefTrk.getXYZGlo(pos); + for (int ii = 0; ii < 3; ii++) { // we need to change the type... + posFloat[ii] = pos[ii]; + } + + Geo::getPadDxDyDz(posFloat, detIdTemp2, deltaPosTemp2, sec); + if (detIdTemp2[2] != -1) { // if propation was succesful -> update params + detIdTemp[0] = detIdTemp2[0]; + detIdTemp[1] = detIdTemp2[1]; + detIdTemp[2] = detIdTemp2[2]; + detIdTemp[3] = detIdTemp2[3]; + detIdTemp[4] = detIdTemp2[4]; + deltaPosTemp[0] = deltaPosTemp2[0]; + deltaPosTemp[1] = deltaPosTemp2[1]; + deltaPosTemp[2] = deltaPosTemp2[2]; + } + } + } + detId[nStripsCrossedInPropagation - 1][0] = detIdTemp[0]; detId[nStripsCrossedInPropagation - 1][1] = detIdTemp[1]; detId[nStripsCrossedInPropagation - 1][2] = detIdTemp[2]; @@ -1290,6 +1317,33 @@ void MatchTOF::doMatchingForTPC(int sec) //Printf("nStepsInsideSameStrip[nStripsCrossedInPropagation-1] = %d", nStepsInsideSameStrip[nStripsCrossedInPropagation - 1]); if (nStepsInsideSameStrip[ibc][nStripsCrossedInPropagation[ibc] - 1] == 0) { + // fine propagation inside the strip -> 1 mm step + if(MCTruthON){ // for the moment to be applied only for MC -> condition to be removed for new 2025 data + // temporary variables since propagation can fail + int detIdTemp2[5] = {0, 0, 0, 0, 0}; + float deltaPosTemp2[3] = {deltaPosTemp[0], deltaPosTemp[1], deltaPosTemp[2]}; + while(deltaPosTemp2[1] < -0.1 && detIdTemp2[2] != -1){ // continuing propagation if dy is negative and we are still inside the strip volume + propagateToRefX(trefTrk, reachedPoint, 0.1, intLT); + reachedPoint = 0.1; + trefTrk.getXYZGlo(pos); + for (int ii = 0; ii < 3; ii++) { // we need to change the type... + posFloat[ii] = pos[ii]; + } + + Geo::getPadDxDyDz(posFloat, detIdTemp2, deltaPosTemp2, sec); + if (detIdTemp2[2] != -1) { // if propation was succesful -> update params + detIdTemp[0] = detIdTemp2[0]; + detIdTemp[1] = detIdTemp2[1]; + detIdTemp[2] = detIdTemp2[2]; + detIdTemp[3] = detIdTemp2[3]; + detIdTemp[4] = detIdTemp2[4]; + deltaPosTemp[0] = deltaPosTemp2[0]; + deltaPosTemp[1] = deltaPosTemp2[1]; + deltaPosTemp[2] = deltaPosTemp2[2]; + } + } + } + detId[ibc][nStripsCrossedInPropagation[ibc] - 1][0] = detIdTemp[0]; detId[ibc][nStripsCrossedInPropagation[ibc] - 1][1] = detIdTemp[1]; detId[ibc][nStripsCrossedInPropagation[ibc] - 1][2] = detIdTemp[2];