Transient Tracks

Complete: 3

Usage of TransientTracks objects

For most high-level algorithms, the reco::Track is unsuitable, since it does not have access to the magnetic field, which prevents one estimating the track parameters at abritary points along its trajectory. (See below for changes to 1.3.0pre3 onwards). A TransientTracks has thus to be used. It has a pointer to the magnetic field, and can be given a pointer to the geometry as well. To easiest and safest way is to build the TransientTracks using the TransientTrackBuilder.

To use the TransientTrackBuilder, you have to add the following into your cfg:

include "TrackingTools/TransientTrack/data/TransientTrackBuilder.cfi"

To get the TransientTrackBuilder from the EventSetup:

    edm::ESHandle<TransientTrackBuilder> theB;

You can now build your TransientTracks from Track, TrackRef, or directly from the edm::handle to a TrackCollection:

    reco::TransientTrack * build ( const reco::Track * p)  const;
    reco::TransientTrack * build ( const reco::TrackRef * p)  const;
    std::vector<reco::TransientTrack> build ( const edm::Handle<reco::TrackCollection> & trkColl)  const;

An example of the last usage:

    // get RECO tracks from the event
    edm::Handle<reco::TrackCollection> tks;
    iEvent.getByLabel(trackLabel(), tks);

    //get the builder:
    edm::ESHandle<TransientTrackBuilder> theB;
    //do the conversion:
    vector<TransientTrack> t_tks = (*theB).build(tks);

One can use TransientTracks to estimate track impact parameters with respect to the beam line or primary vertex, taking into account the curvature of the track.

TransientTrack tk = ...;
// beam-line
TrajectoryStateClosestToBeamLine traj = tk.stateAtBeamLine();
Measurement1D meas = traj.transverseImpactParameter();
double d0 = meas.value();
double d0_error = meas.error();
// primary vertex (is  this correct ?)
GlobalPoint vert(pv.x(), pv.y(), pv.z());
TrajectoryStateClosestToPoint  traj2 = tktrajectoryStateClosestToPoint(vert )
double d02 = traj2.perigeeParameters().transverseImpactParameter();
d0_error2 = traj2.perigeeError().transverseImpactParameterError();

Furthermore, since the version 1.3.0_pre3, several changes have been made to the TransientTrack:

  • The TransientTrack is now reference counted. No change to the user code has to be made for this change.
  • Different concrete implementation of the basic TransientTrack are introduced. This allows their use with different types of basic track objest (reco::GsfTrack, reco::Track, FreeTrajectoryState without persistent track, e.g. for refitted tracks). The interface of the TransientTrack does not change, and no change to the user code when using the TransientTrack has to be made. For a correct usage, the TransientTrack should be built using the TransientTrackBuilder, or, if you have a FreeTrajectoryState, using the TransientTrackFromFTSFactory.
  • Since the TransientTrack can now be created from different objects, with or without a persistent track, the TransientTrack can not derive from reco::Track anymore. The methods of the persistent tracks can thus not be used directly. The method track() allows nevertheless to access the reco::Track. In case the TransientTrack has been created without a persistent track, a new reco::Track is created. This track can also be saved in the event.
  • In addition, several reco::Track methods (e.g. the hit pattern) are implemented, and forward the call to the persistent track. An exception is thrown in case no persistent track is available.
  • Since the TT is now reference counted, if you request the builder a single TT, you do not get a pointer anymore, and you do not need to delete at the and of your block. So use it like that:
==const reco::TransientTrack transientTrack = theBuilder->build(&lepton);==

Review Status

Editor/Reviewer and date Comments
Main.speer - 17 Jul 2006 Page Author
JennyWilliams - 28 Mar 2007 moved page into SWGuide

Responsible: Main.speer (Thomas Speer)
Last reviewed by: Reviewer

Edit | Attach | Watch | Print version | History: r20 | r13 < r12 < r11 < r10 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r11 - 2008-05-10 - IanTomalin

    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CMSPublic All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback