when running with VeloClusterTrackingSIMDFull the following error is thrown in rare cases. A minimal reproducing example is attached.hlt2_fast_reco_singularity.py
TrackBestTrackCreator FATAL Standard std::exception is caught TrackBestTrackCreator ERROR singular matrix
This error only seems to appear when running with VeloClusterTrackingSIMDFull, necessary for example for Velo alignment, which allows Velo tracks with hits on both modules of the same station.
A possible cause could be that tracks are created only from hits from modules of the same station, resulting in a track almost perpendicular to the beam line.
It is indeed quite stange. Are you sure about the code that prints the positions ? I count 11 VP lhcbids but twice as many positions (that would explain why most hits seems duplicated). Understanding what exactly is printed would help to understand the issue.
Ah I answered my question myself: the positions are for the nodes (separated X/Y), so I'd look at the code that makes the measurements.
The creation of the measurements itself seems fine, there the coordinates are identical.
Looking at the reference vector of the nodes before the first fit iteration (i.e. before here) shows an odd pattern. The track is essentially straight in x in the Velo at -201.0, but seems to make odd jumps after the Velo:
TrackBestTrackCreator.TrackMasterFitter INFO ref state = ({ parameters : -71.523, -79.5258, -0.0166208, -0.017402, 3.08435e-05 z : 2165 }) TrackBestTrackCreator.TrackMasterFitter INFO ref state = ({ parameters : -40.4811, -45.5426, -0.0370215, -0.0414278, 3.08435e-05 z : 990 }) TrackBestTrackCreator.TrackMasterFitter INFO ref state = ({ parameters : -31.8602, -35.8652, -0.0413781, -0.0465838, 3.08435e-05 z : 770 }) TrackBestTrackCreator.TrackMasterFitter INFO ref state = ({ parameters : -201.659, -22.7323, -0.00292889, -0.0465838, 3.08435e-05 z : 488.081}) TrackBestTrackCreator.TrackMasterFitter INFO ref state = ({ parameters : -201.659, -22.7323, -0.00292889, -0.0465838, 3.08435e-05 z : 488.081 })TrackBestTrackCreator.TrackMasterFitter INFO ref state = ({ parameters : -201.366, -18.0739, -0.00292889, -0.0465838, 3.08435e-05 z : 388.081 }) TrackBestTrackCreator.TrackMasterFitter INFO ref state = ({ parameters : -201.366, -18.0739, -0.00292889, -0.0465838, 3.08435e-05 z : 388.081 })
The states at 770 and 990 do not correspond to a measurement, so I wonder if anything goes wrong in their creation.
y and ty are correct, but x and tx are wrong. Could you print the value of the state before it's added to the container and the x0 and tx values used to compute it ?
@ahennequ@decianm thanks a lot for looking into this. Indeed binding also the hits works.
Sorry for not having spotted that I was running both in the sequence earlier. I only now understand that was what Michel's question was getting at.
This is beyond this issue, but to me this seems to be an easy mistake to make. Is there a reason why it is allowed to create the tracks and hits with different algorithms?
Interesting question. It's a byproduct of 2 things:
The functional framework requires dependencies to be explicit
Hits are separated of tracks since they could be used for other algorithms (not all hits are used)
Note that for all others detectors the hits and tracks are produced by different algorithms, but the problem remains the same, once a track is created with a hit container the same hit container should be used with this track.
We could keep a pointer to the hits inside the velo container (and we actually have new mechanisms to do it properly with soacollections) but that would mean the framework will not know about the dependency (I'll let @sponce and @graven comment on that).
note that yes, 'data dependencies' must be explicit because it influences scheduling, i.e. the framework wants to make sure that all declared inputs are made available prior to running the component which declares them, i.e. it wants to know the data dependencies of the components it schedules.
But another point is that 'once data is published into the TES, it shall be considered immutable'. This implies that it is perfectly fine to produce 'views' and store them in the TES, provided these views refer to data which either resides in the TES, or which will reside in the TES by the time the view is made accessible from the TES (the latter typically requires the data underlying the view to be 'movable', i.e. moving it into the TES does not invalidate the corresponding view). So a component can have a data dependency on the view, as it can assume that once a view is published, implicitly the underlying source was also published, as that is the responsibility of the producer of the view (which eg. could have stated on explicit dependency on the underlying source, taking it from the TES, or it produced the underlying source 'alongside' the view, and properly moved it into the TES). So provided that the above small print holds, there is no reason why one couldn't have a pointer to the hits inside the velo container...
Note that currently the framework does not actively track data dependencies amongst data objects -- which does affect the possibility to persist 'views'. If those views need to be persisted, then the persistency code must be able to deal with them in some way... eg. it must either somehow be able to figure out what the actual data is, make sure that (or the relevant subset) is also persisted, and then provide a means to re-create the view on read back, or employ some other mechanism depending on the specific case to 'make it work'...
which is then called by make_VeloClusterTrackingSIMD_tracks and make_VeloClusterTrackingSIMD_hits, so that one would only have to remember the binding of the wrapper function?