@@ -77,17 +77,17 @@ void GPUChainTracking::DumpData(const char* filename)
7777 DumpData (fp, mIOPtrs .rawClusters , mIOPtrs .nRawClusters , InOutPointerType::RAW_CLUSTERS);
7878#ifdef HAVE_O2HEADERS
7979 if (mIOPtrs .clustersNative ) {
80- DumpData (fp, &mIOPtrs .clustersNative ->clustersLinear , &mIOPtrs .clustersNative ->nClustersTotal , InOutPointerType::CLUSTERS_NATIVE);
81- fwrite (&mIOPtrs .clustersNative ->nClusters [0 ][0 ], sizeof (mIOPtrs .clustersNative ->nClusters [0 ][0 ]), NSLICES * GPUCA_ROW_COUNT, fp);
82- if (mIOPtrs .clustersNative ->clustersMCTruth ) {
83- const auto & buffer = mIOPtrs .clustersNative ->clustersMCTruth ->getBuffer ();
84- std::pair<const char *, size_t > tmp = {buffer.data (), buffer.size ()};
85- DumpData (fp, &tmp.first , &tmp.second , InOutPointerType::CLUSTER_NATIVE_MC);
80+ if (DumpData (fp, &mIOPtrs .clustersNative ->clustersLinear , &mIOPtrs .clustersNative ->nClustersTotal , InOutPointerType::CLUSTERS_NATIVE)) {
81+ fwrite (&mIOPtrs .clustersNative ->nClusters [0 ][0 ], sizeof (mIOPtrs .clustersNative ->nClusters [0 ][0 ]), NSLICES * GPUCA_ROW_COUNT, fp);
82+ if (mIOPtrs .clustersNative ->clustersMCTruth ) {
83+ const auto & buffer = mIOPtrs .clustersNative ->clustersMCTruth ->getBuffer ();
84+ std::pair<const char *, size_t > tmp = {buffer.data (), buffer.size ()};
85+ DumpData (fp, &tmp.first , &tmp.second , InOutPointerType::CLUSTER_NATIVE_MC);
86+ }
8687 }
8788 }
8889 if (mIOPtrs .tpcPackedDigits ) {
89- DumpData (fp, mIOPtrs .tpcPackedDigits ->tpcDigits , mIOPtrs .tpcPackedDigits ->nTPCDigits , InOutPointerType::TPC_DIGIT);
90- if (mIOPtrs .tpcPackedDigits ->tpcDigitsMC ) {
90+ if (DumpData (fp, mIOPtrs .tpcPackedDigits ->tpcDigits , mIOPtrs .tpcPackedDigits ->nTPCDigits , InOutPointerType::TPC_DIGIT) && mIOPtrs .tpcPackedDigits ->tpcDigitsMC ) {
9191 const char * ptrs[NSLICES];
9292 size_t sizes[NSLICES];
9393 for (unsigned int i = 0 ; i < NSLICES; i++) {
@@ -121,8 +121,9 @@ void GPUChainTracking::DumpData(const char* filename)
121121 }
122122 }
123123 total *= TPCZSHDR::TPC_ZS_PAGE_SIZE;
124- DumpData (fp, &ptr, &total, InOutPointerType::TPC_ZS);
125- fwrite (&counts, sizeof (counts), 1 , fp);
124+ if (DumpData (fp, &ptr, &total, InOutPointerType::TPC_ZS)) {
125+ fwrite (&counts, sizeof (counts), 1 , fp);
126+ }
126127 }
127128#endif
128129 DumpData (fp, mIOPtrs .sliceTracks , mIOPtrs .nSliceTracks , InOutPointerType::SLICE_OUT_TRACK);
0 commit comments