LArSoft
v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
|
Proxy tag for a recob::Track
collection proxy.
More...
#include "Track.h"
Public Types | |
enum | TrackType_t { Unfitted, Fitted, NTypes } |
Types of tracks and trajectories. More... | |
using | TrackDataProduct_t = std::vector< recob::Track > |
Type of the main collection. More... | |
using | TrackTrajectoryTag = recob::TrackTrajectory |
Tag used for the "standard" track trajectory information. More... | |
using | TrackFitHitInfoTag = recob::TrackFitHitInfo |
Tag used for the "standard" track fit information. More... | |
using | HitTag = recob::Hit |
Tag used for the associated hits. More... | |
Proxy tag for a recob::Track
collection proxy.
This type can be used to get a proxy for recob::Track
collection:
An example of usage for a simple track processing loop:
In this example, the track proxy accesses the track itself, its associated hits (always implicitly present) and the track fit hit information (explicitly requested). Since both those data products are produced by the same module as the track, there is no need to specify their producer module label.
Unfortunately, the proxy object (tracks
in the example) can be of a different class depending on which data is merged into it: a proxy created by getCollection<proxy::Tracks>(event, tag, proxy::withFitHitInfo())
has different type than e.g. getCollection<proxy::Tracks>(event, tag)
. This implies than when passing proxies as arguments to functions, template types must be used. For example, the following code is equivalent to the one above, but with methods processing a single track (a track proxy) and a single trajectory point (a track point proxy):
As any other proxy object, other data can be merged to the proxy, but no custom interface will be available. For example:
will add a data product std::vector<recob::TrackMomentumFit>
expected to have one element (of type recob::TrackMomentumFit
) per track, which will be accessed with the generic proxy interface:
The other common features of proxy collections are supported, like tagging of different instances of the same data types:
A new, filtered collection of proxies can be created with obvious means and with a less-than-friendly declaration:
The collection thus created (longTracks
) is valid also after the collection proxy (tracks
) has fallen out of scope.
proxy::Tracks
is not the type of the collection proxy returned by getCollection()
. using proxy::Tracks::HitTag = recob::Hit |
using proxy::Tracks::TrackDataProduct_t = std::vector<recob::Track> |