Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For this to work many of the existing classes had to be refactored to use common methods to ensure consistency. Furthermore the current HelixSwimmer has to rely on the implementation of Track being broken in the same way as ReconTrack...

Code Examples

If you want the new Tracks in the event, it's as easy as
import org.lcsim.contrib.JanStrube.tracking.NewMCFastTrackDriver;
...
loop.add(NewMCFastTrackDriver());

For more control, you will need to instantiate a Factory that can give you the Tracks. (The Track doesn't know anything about the B field, so it can't translate from MCParticle parameters to LCIO Track parameters by itself)

Code Block

NewFastMCTrackFactory factory = new NewFastMCTrackFactory(event, false);
for (MCParticle daughter : part.getDaughters()) {
                  Track unsmearedTrack = tf.getTrack(
                      new SpaceVector(daughter.getMomentum()), // momentum
                      new SpacePoint(daughter.getOrigin()), // position
                      new SpacePoint(part.getEndPoint()), // reference point
                      (int)daughter.getCharge(), // charge
                      rand, // random generator for smearing
                      false); // smearing ? default is true

                  Track smearedTrack = tf.getTrack(
                      new SpaceVector(daughter.getMomentum()),
                      new SpacePoint(daughter.getOrigin()),
                      new SpacePoint(part.getEndPoint()),
                      (int)daughter.getCharge(),
                      rand,
                      true);
}

For more information please consult the source code. I will try to expand on the examples.