Skip to content

Commit fc75fcc

Browse files
authored
AOD: Fix aod-thinner for new-ish datamodel changes (#13210)
1 parent 7cf6732 commit fc75fcc

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

Framework/AODMerger/src/aodThinner.cxx

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,9 @@ int main(int argc, char* argv[])
214214
uint8_t tpcNClsFindable = 0;
215215
bool bTPClsFindable = false;
216216
uint8_t ITSClusterMap = 0;
217+
UInt_t ITSClusterSizes = 0;
217218
bool bITSClusterMap = false;
219+
bool bITSClusterSizes = false;
218220
uint8_t TRDPattern = 0;
219221
bool bTRDPattern = false;
220222
float_t TOFChi2 = 0;
@@ -231,6 +233,9 @@ int main(int argc, char* argv[])
231233
} else if (brName == "fITSClusterMap") {
232234
trackExtraTree->SetBranchAddress("fITSClusterMap", &ITSClusterMap);
233235
bITSClusterMap = true;
236+
} else if (brName == "fITSClusterSizes") {
237+
trackExtraTree->SetBranchAddress("fITSClusterSizes", &ITSClusterSizes);
238+
bITSClusterSizes = true;
234239
} else if (brName == "fTRDPattern") {
235240
trackExtraTree->SetBranchAddress("fTRDPattern", &TRDPattern);
236241
bTRDPattern = true;
@@ -240,6 +245,15 @@ int main(int argc, char* argv[])
240245
}
241246
}
242247

248+
// Sanity-Check
249+
// If any (%ITSClusterMap or %ITSClusterSizes) of these are not found, continuation is not possible, hence fataling
250+
if (!bTPClsFindable || !bTRDPattern || !bTOFChi2 ||
251+
(!bITSClusterMap && !bITSClusterSizes)) {
252+
printf(" *** FATAL *** Branch detection failed in %s for trackextra.[(fITSClusterMap=%d,fITSClusterSizes=%d),fTPCNClsFindable=%d,fTRDPattern=%d,fTOFChi2=%d]\n", dfName, bITSClusterMap, bITSClusterSizes, bTPClsFindable, bTRDPattern, bTOFChi2);
253+
exitCode = 10;
254+
break;
255+
}
256+
243257
int fIndexCollisions = 0;
244258
track_iu->SetBranchAddress("fIndexCollisions", &fIndexCollisions);
245259

@@ -253,11 +267,10 @@ int main(int argc, char* argv[])
253267
// Flag collisions
254268
hasCollision[i] = (fIndexCollisions >= 0);
255269

256-
// Remove TPC only tracks, if (opt.) they are not assoc. to a V0
257-
if ((!bTPClsFindable || tpcNClsFindable > 0.) &&
270+
// Remove TPC only tracks, if they are not assoc. to a V0
271+
if (tpcNClsFindable > 0 && TRDPattern == 0 && TOFChi2 < -1. &&
258272
(!bITSClusterMap || ITSClusterMap == 0) &&
259-
(!bTRDPattern || TRDPattern == 0) &&
260-
(!bTOFChi2 || TOFChi2 < -1.) &&
273+
(!bITSClusterSizes || ITSClusterSizes == 0) &&
261274
(keepV0TPCs.find(i) == keepV0TPCs.end())) {
262275
counter++;
263276
} else {
@@ -410,6 +423,7 @@ int main(int argc, char* argv[])
410423
if (exitCode != 0) {
411424
printf("Removing incomplete output file %s.\n", outputFile->GetName());
412425
gSystem->Unlink(outputFile->GetName());
426+
return exitCode; // skip output below
413427
}
414428

415429
clock.Stop();

0 commit comments

Comments
 (0)