Skip to content

Commit 78d0606

Browse files
committed
AOD: Add sanity-check for branch detection
Fatal if necessary branches are not detected. Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 4becb12 commit 78d0606

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Framework/AODMerger/src/aodThinner.cxx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "TGrid.h"
2727
#include "TMap.h"
2828
#include "TLeaf.h"
29+
#include "TError.h"
2930

3031
#include "aodMerger.h"
3132

@@ -245,6 +246,13 @@ int main(int argc, char* argv[])
245246
}
246247
}
247248

249+
// Sanity-Check
250+
// If any (%ITSClusterMap or %ITSClusterSizes) of these are not found, continuation is not possible, hence fataling
251+
if (!bTPClsFindable || !bTRDPattern || !bTOFChi2 ||
252+
(!bITSClusterMap && !bITSClusterSizes)) {
253+
Fatal("Sanity-Check", "Branch detection failed for trackextra.[(fITSClusterMap=%d,fITSClusterSizes=%d),fTPCNClsFindable=%d,fTRDPattern=%d,fTOFChi2=%d]", bITSClusterMap, bITSClusterSizes, bTPClsFindable, bTRDPattern, bTOFChi2);
254+
}
255+
248256
int fIndexCollisions = 0;
249257
track_iu->SetBranchAddress("fIndexCollisions", &fIndexCollisions);
250258

@@ -258,12 +266,10 @@ int main(int argc, char* argv[])
258266
// Flag collisions
259267
hasCollision[i] = (fIndexCollisions >= 0);
260268

261-
// Remove TPC only tracks, if (opt.) they are not assoc. to a V0
262-
if ((!bTPClsFindable || tpcNClsFindable > 0.) &&
269+
// Remove TPC only tracks, if they are not assoc. to a V0
270+
if (tpcNClsFindable > 0 && TRDPattern == 0 && TOFChi2 < -1. &&
263271
(!bITSClusterMap || ITSClusterMap == 0) &&
264272
(!bITSClusterSizes || ITSClusterSizes == 0) &&
265-
(!bTRDPattern || TRDPattern == 0) &&
266-
(!bTOFChi2 || TOFChi2 < -1.) &&
267273
(keepV0TPCs.find(i) == keepV0TPCs.end())) {
268274
counter++;
269275
} else {

0 commit comments

Comments
 (0)