How to propagate a State




A State, which represents the local state of the dynamic system (i.e. a particle) can be propagated to a given surface inside the Setup or to a given length.

A State can be created following the instructiones given elesewhere. It can be also retrieved from one of the Nodes of a fitted Trajectory. Provided a state is available it can be propagated using the methods in the Navigation Service:

// propagate an state to a given surface, return the traversed length
bool propagate(const Surface& surface, State& state, double& length);

// propagate an state to a given length
bool propagate(double length, State& state);


The NavigationSvc can be accessed via the Recpack manager. Thus propagating a State would require this code:

bool ok = manager.navigation_svc().propagate(surf, state, length);

The method taking a surface as argument will intersect that surface and propagate the state to that surface, computing also the propagation length that is returned as argument. The surface should be one of the surfaces of the Setup (either an outer surface of a volume or an isolated surface) or a temporary surface that is added to the setup just for the propagation.

Sometimes building the surface is not an easy task that could be delegated to RecPack. When doing incremental fitting the surface position and orientation depends on the measurement that should be processed next. Is the matching service the one that deals with states and reconstructed objects (Trajectory, Measurement, etc) simultaneously. The MatchingSvc has the following methods to propagate State's:

// propagate the state to a surface containing a given Measurement
bool propagate(const Measurement& meas, State& state, double& l);

// propagate the state to a surface containing the the State of the Node
bool propagate(const Node& node, State& state, double& l);


The MatchingSvc can be accessed via the Recpack manager. Thus propagating a State using the MatchingSvc would require this code:

bool ok = manager.matching_svc().propagate(meas, state, length);

In the above methods the surface is created automatically, added to the Setup, and removed after the propagation. The surface position is taken either from the measurement position or from the State position. Instructions to obtain the surface orientation are given externally as explained in the page about incremental fitting.