|
33 | 33 | #include "GPUTPCGMBorderTrack.h" |
34 | 34 | #include "GPUReconstruction.h" |
35 | 35 | #include "GPUDebugStreamer.h" |
| 36 | +#include "GPUTrackingRefit.h" |
36 | 37 |
|
37 | 38 | using namespace GPUCA_NAMESPACE::gpu; |
38 | 39 | using namespace gputpcgmmergertypes; |
@@ -233,3 +234,33 @@ const GPUTPCGMBorderTrack& GPUTPCGMMerger::MergedTrackStreamerFindBorderTrack(co |
233 | 234 | } |
234 | 235 | throw std::runtime_error("didn't find border track"); |
235 | 236 | } |
| 237 | + |
| 238 | +void GPUTPCGMMerger::DebugRefitMergedTrack(const GPUTPCGMMergedTrack& track) |
| 239 | +{ |
| 240 | + GPUTPCGMMergedTrack trk = track; |
| 241 | + GPUTrackingRefit refit; |
| 242 | + ((GPUConstantMem*)GetConstantMem())->ioPtrs.mergedTrackHitStates = ClusterStateExt(); |
| 243 | + ((GPUConstantMem*)GetConstantMem())->ioPtrs.mergedTrackHits = Clusters(); |
| 244 | + refit.SetPtrsFromGPUConstantMem(GetConstantMem()); |
| 245 | + int retval = refit.RefitTrackAsGPU(trk, false, true); |
| 246 | + if (retval > 0) { |
| 247 | + GPUTPCGMPropagator prop; |
| 248 | + prop.SetMaterialTPC(); |
| 249 | + prop.SetPolynomialField(&Param().polynomialField); |
| 250 | + prop.SetMaxSinPhi(GPUCA_MAX_SIN_PHI); |
| 251 | + prop.SetPropagateBzOnly(false); |
| 252 | + prop.SetMatLUT(Param().rec.useMatLUT ? GetConstantMem()->calibObjects.matLUT : nullptr); |
| 253 | + prop.SetTrack(&trk.Param(), trk.GetAlpha()); |
| 254 | + int err = prop.PropagateToXAlpha(track.GetParam().GetX(), track.GetAlpha(), false); |
| 255 | + if (err == 0) { |
| 256 | + printf("REFIT RESULT %d, SnpDiff %f\n", retval, trk.GetParam().GetSinPhi() - track.GetParam().GetSinPhi()); |
| 257 | + if (retval > 20 && fabsf(trk.GetParam().GetSinPhi() - track.GetParam().GetSinPhi()) > 0.01) { |
| 258 | + printf("LARGE DIFF\n"); |
| 259 | + } |
| 260 | + } else { |
| 261 | + printf("PROPAGATE ERROR\n"); |
| 262 | + } |
| 263 | + } else { |
| 264 | + printf("REFIT ERROR\n"); |
| 265 | + } |
| 266 | +} |
0 commit comments