@@ -133,10 +133,15 @@ void GPUTPCGMMerger::DumpMergedBetweenSectors(std::ostream& out) const
133133}
134134
135135void GPUTPCGMMerger::DumpCollected (std::ostream& out) const
136+ {
137+ out << " \n TPC Merger Collected Tracks\n " ;
138+ DumpTrackParam (out);
139+ }
140+
141+ void GPUTPCGMMerger::DumpTrackParam (std::ostream& out) const
136142{
137143 std::streamsize ss = out.precision ();
138144 out << std::setprecision (6 );
139- out << " \n TPC Merger Collected Tracks\n " ;
140145 for (uint32_t i = 0 ; i < mMemory ->nMergedTracks ; i++) {
141146 const auto & trk = mMergedTracks [i];
142147 const auto & p = trk.GetParam ();
@@ -145,6 +150,15 @@ void GPUTPCGMMerger::DumpCollected(std::ostream& out) const
145150 out << std::setprecision (ss);
146151}
147152
153+ void GPUTPCGMMerger::DumpRebuiltTracks (std::ostream& out) const
154+ {
155+ out << " \n TPC Merger Rebuilt Tracks\n " ;
156+ out << " Cluster Attachment\n " ;
157+ DumpTrackClusters (out, false , true );
158+ out << " Track Params\n " ;
159+ DumpTrackParam (out);
160+ }
161+
148162void GPUTPCGMMerger::DumpMergeCE (std::ostream& out) const
149163{
150164 DumpTrackLinks (out, true , " for CE merging" );
@@ -157,6 +171,26 @@ void GPUTPCGMMerger::DumpMergeCE(std::ostream& out) const
157171 }
158172}
159173
174+ void GPUTPCGMMerger::DumpTrackClusters (std::ostream& out, bool non0StateOnly, bool noNDF0) const
175+ {
176+ for (uint32_t j = 0 ; j < mMemory ->nMergedTracks ; j++) {
177+ const auto & trk = mMergedTracks [j];
178+ if (trk.NClusters () == 0 ) {
179+ continue ;
180+ }
181+ if (noNDF0 && (!trk.OK () || trk.GetParam ().GetNDF () < 0 )) {
182+ continue ;
183+ }
184+ out << " Track " << j << " : (" << trk.NClusters () << " ): " ;
185+ for (uint32_t i = trk.FirstClusterRef (); i < trk.FirstClusterRef () + trk.NClusters (); i++) {
186+ if (!non0StateOnly || mClusters [i].state != 0 ) {
187+ out << j << " /" << (i - trk.FirstClusterRef ()) << " : " << (int32_t )mClusters [i].row << " /" << mClusters [i].num << " /" << (int32_t )mClusters [i].state << " , " ;
188+ }
189+ }
190+ out << " \n " ;
191+ }
192+ }
193+
160194void GPUTPCGMMerger::DumpFitPrepare (std::ostream& out) const
161195{
162196 out << " \n TPC Merger Refit Prepare\n " ;
@@ -165,14 +199,7 @@ void GPUTPCGMMerger::DumpFitPrepare(std::ostream& out) const
165199 out << " " << i << " : " << mTrackOrderAttach [i] << " \n " ;
166200 }
167201 out << " Clusters\n " ;
168- for (uint32_t j = 0 ; j < mMemory ->nMergedTracks ; j++) {
169- const auto & trk = mMergedTracks [j];
170- out << " Track " << j << " : " ;
171- for (uint32_t i = trk.FirstClusterRef (); i < trk.FirstClusterRef () + trk.NClusters (); i++) {
172- out << j << " /" << (i - trk.FirstClusterRef ()) << " : " << mClusters [i].num << " /" << (int32_t )mClusters [i].state << " , " ;
173- }
174- out << " \n " ;
175- }
202+ DumpTrackClusters (out);
176203 uint32_t j = 0 ;
177204 for (uint32_t i = 0 ; i < mNClusters ; i++) {
178205 if ((mClusterAttachment [i] & attachFlagMask) != 0 ) {
@@ -223,19 +250,7 @@ void GPUTPCGMMerger::DumpLoopers(std::ostream& out) const
223250void GPUTPCGMMerger::DumpFinal (std::ostream& out) const
224251{
225252 out << " \n TPC Merger Finalized\n " ;
226- for (uint32_t j = 0 ; j < mMemory ->nMergedTracks ; j++) {
227- const auto & trk = mMergedTracks [j];
228- if (trk.NClusters () == 0 ) {
229- continue ;
230- }
231- out << " Track " << j << " : " ;
232- for (uint32_t i = trk.FirstClusterRef (); i < trk.FirstClusterRef () + trk.NClusters (); i++) {
233- if (mClusters [i].state != 0 ) {
234- out << j << " /" << (i - trk.FirstClusterRef ()) << " : " << mClusters [i].num << " /" << (int32_t )mClusters [i].state << " , " ;
235- }
236- }
237- out << " \n " ;
238- }
253+ DumpTrackClusters (out, true );
239254 uint32_t j = 0 ;
240255 for (uint32_t i = 0 ; i < mNClusters ; i++) {
241256 if ((mClusterAttachment [i] & attachFlagMask) != 0 ) {
@@ -251,6 +266,35 @@ void GPUTPCGMMerger::DumpFinal(std::ostream& out) const
251266 out << " \n " ;
252267}
253268
269+ void GPUTPCGMMerger::DumpInterpolatedHits (std::ostream& out) const
270+ {
271+ out << " \n TPC Merger Interpolated Hits\n " ;
272+ for (uint32_t i = 0 ; i < mMemory ->nMergedTracks ; i++) {
273+ const auto & trk = mMergedTracks [i];
274+ if (trk.OK () && trk.GetParam ().GetNDF () >= 0 && trk.NClusters ()) {
275+ out << " Track " << i << " :" ;
276+ for (uint32_t j = 0 ; j < GPUCA_ROW_COUNT; j++) {
277+ auto * candidates = &mClusterCandidates [(i * GPUCA_ROW_COUNT + j) * Param ().rec .tpc .rebuildTrackInFitClusterCandidates ];
278+ if (candidates[0 ].id ) {
279+ out << " Row " << j << " : " ;
280+ if (candidates[0 ].best ) {
281+ out << " Best " << candidates[0 ].best << " - " ;
282+ }
283+ for (uint32_t k = 0 ; k < Param ().rec .tpc .rebuildTrackInFitClusterCandidates ; k++) {
284+ if (candidates[k].id ) {
285+ out << k << " : id " << candidates[k].id << " err " << candidates[k].error << " weight " << candidates[k].weight << " - " ;
286+ }
287+ }
288+ out << " ; " ;
289+ }
290+ }
291+ out << " \n " ;
292+ }
293+ }
294+ out << " \n " ;
295+ }
296+
297+
254298template <int32_t mergeType>
255299inline void GPUTPCGMMerger::MergedTrackStreamerInternal (const GPUTPCGMBorderTrack& b1, const GPUTPCGMBorderTrack& b2, const char * name, int32_t sector1, int32_t sector2, int32_t mergeMode, float weight, float frac) const
256300{
0 commit comments