lcsim/src/org/lcsim/mc/fast/tracking/fix
diff -u -r1.2 -r1.3
--- FastMCTrackFactory.java 17 Dec 2008 18:25:22 -0000 1.2
+++ FastMCTrackFactory.java 2 Apr 2011 16:35:41 -0000 1.3
@@ -1,5 +1,5 @@
/**
- * @version $Id: FastMCTrackFactory.java,v 1.2 2008/12/17 18:25:22 jstrube Exp $
+ * @version $Id: FastMCTrackFactory.java,v 1.3 2011/04/02 16:35:41 jstrube Exp $
*/
package org.lcsim.mc.fast.tracking.fix;
@@ -45,6 +45,8 @@
private ConditionsManager _manager;
private double _Bz;
private HelixSwimmer _swimmer;
+ private static Random rDummy = new Random();
+ private static SpacePoint pDummy = new SpacePoint();
/**
* This constructor obtains the necessary information for construction like the field and the resolution tables from
@@ -92,6 +94,17 @@
return t;
}
+ /**
+ * Creates a track from an MCParticle without smearing the parameters
+ * @param part The MCParticle that is transformed to a track
+ * @return A FastMCTrack instance that contains information about the particle that was used as input
+ */
+ public Track getUnsmearedTrack(MCParticle part) {
+ FastMCTrack t = (FastMCTrack) getTrack(new SpaceVector(part.getMomentum()), new SpacePoint(part.getOrigin()), pDummy, (int) part.getCharge(), rDummy, false);
+ t._particle = part;
+ return t;
+ }
+
/**
* Creates a new Track with the given parameters.
@@ -103,7 +116,7 @@
* @return A new NewTFastMCTrackect with the desired properties
*/
public Track getTrack(SpaceVector momentum, SpacePoint location, int charge) {
- return getTrack(momentum, location, new SpacePoint(), charge, new Random());
+ return getTrack(momentum, location, pDummy, charge, rDummy);
}
/**
@@ -117,7 +130,7 @@
* @return A new NewTrFastMCTrackct with the desired properties
*/
public Track getTrack(SpaceVector momentum, SpacePoint location, int charge, Random random) {
- return getTrack(momentum, location, new SpacePoint(), charge, random);
+ return getTrack(momentum, location, pDummy, charge, random);
}
/**
@@ -131,7 +144,7 @@
* @return A new NewTrFastMCTrackct with the desired properties
*/
public Track getTrack(SpaceVector momentum, SpacePoint location, SpacePoint referencePoint, int charge) {
- return getTrack(momentum, location, referencePoint, charge, new Random());
+ return getTrack(momentum, location, referencePoint, charge, rDummy);
}
/**
@@ -193,7 +206,7 @@
}
public Track getTrack(Hep3Vector momentum, Hep3Vector location, int charge) {
- return getTrack(new SpaceVector(momentum), new SpacePoint(location), new SpacePoint(), charge, new Random());
+ return getTrack(new SpaceVector(momentum), new SpacePoint(location), pDummy, charge, rDummy);
}
/**