Conversation
|
O2 linter results: ❌ 0 errors, |
|
Hi Tucker, sorry if I am misunderstanding something but in both places where you have put this fix we already check that either track.has_collision() or track.collisionId() >= 0 (both are doing the same thing). These should guard against these tracks (known as orphan tracks) which don't have an associated collision and are common in many datasets. |
|
Hi @nzardosh, the problem with these tracks is not that they have no collision; in fact, when you check This is why the fix also checks that the collision ID for the track is a valid one, not just that it is >= 0, by checking it against the maximum possible index. This captures both cases I've seen (since 398 >= 398 and 0 >= 0) but it's still possible there are others. I've cross-checked this fix against two of the problematic files I found (the two mentioned at the top), and both bypass the problematic tracks as expected. |
|
@mhwang285 if you agree we can close this PR to keep the functionality of spotting the buggy reconstruction |
Occasionally, a track in an AO2D can point to a collision index that does not exist. When one such track is mapped to this "misindexed" collision via track.collision_as() (which occur in L505 and L533), and any property of the collision is queried, it causes a segfault.
Usually this segfault crashes the processing of a single job in a train, but can cause larger issues if a problematic file happens to be a wagon test file. At least two of the wagon test files for the recent 100% production of LHC26a7 on Hyperloop have this issue:
/alice/sim/2026/LHC26a7/0/560089/AOD/070/AO2D.rootand/alice/sim/2026/LHC26a7/0/560089/AOD/069/AO2D.root.070is the second test file, so it is likely to affect many wagon tests (for example, this one). In070, there are four problematic DFs:DF_2405564011777600DF_2405564011953984DF_2405564011954240DF_2405564012012864The first DF contains 398 collisions in
O2collision_001(i.e. collision indices 0 through 397) but thefIndexCollisionsbranch shows that some tracks inO2track_iupoint to collision index 398. The other three DFs have zero collisions (i.e. no entries inO2collision_001), but have tracks inO2track_iuthat all point collision index 0. Note thattrack.collision_as().has_collision()still returnstrueandtrack.collsionId()is greater than or equal to zero for all of these tracks, so the usual checks don't seem to avoid this particular problem.Both of these cases can be avoided if the track's collision ID is checked to be strictly less than the number of collisions (which I believe should be true normally if the files weren't corrupted). For the derived data producer, this issue affects
processTrackSelectionForWeightedMCandprocessTracks. For now I've implemented a configurable that turns on the extra check (default is off), where the check basically skips the problematic tracks. Eventually it would be important to know from the experts whether such tracks should be considered as collision-less (equivalent to tracks withtrack.collisionId() < 0andtrack.has_collision() = false) or thrown out entirely, or maybe this file should be considered as corrupted as a whole and deleted, but for now, I've chosen the more conservative option to throw out the tracks.