2 removed + 6 modified, total 8 files
lcsim/src/org/lcsim/mc/fast/tracking
diff -u -r1.9 -r1.10
--- MCFastTracking.java 15 Mar 2006 11:36:02 -0000 1.9
+++ MCFastTracking.java 15 Jul 2006 09:35:58 -0000 1.10
@@ -1,5 +1,8 @@
package org.lcsim.mc.fast.tracking;
+/**
+ * $Id: MCFastTracking.java,v 1.10 2006/07/15 09:35:58 jstrube Exp $
+ */
import hep.physics.particle.Particle;
import java.io.IOException;
import java.util.ArrayList;
lcsim/src/org/lcsim/mc/fast/tracking
diff -u -r1.7 -r1.8
--- ReconTrack.java 8 Nov 2005 20:39:56 -0000 1.7
+++ ReconTrack.java 15 Jul 2006 09:35:58 -0000 1.8
@@ -18,7 +18,7 @@
* are provided. <br>
*
* @author Tony Johnson, Wolfgang Walkowiak
- * @version $Id: ReconTrack.java,v 1.7 2005/11/08 20:39:56 jstrube Exp $
+ * @version $Id: ReconTrack.java,v 1.8 2006/07/15 09:35:58 jstrube Exp $
*/
public class ReconTrack implements Track
{
@@ -448,7 +448,7 @@
public int[] getSubdetectorHitNumbers()
{
- return new int[0]; // FixMe:
+ return new int[0]; // FIXME
}
/**
@@ -494,7 +494,7 @@
public int getType()
{
- return 0; // FixMe:
+ return 0; // FIXME:
}
/**
@@ -519,18 +519,18 @@
public boolean fitSuccess()
{
- //TODO: Not implemented in fastMC
+ // FIXME Not implemented in fastMC
return false;
}
public double getdEdx()
{
- return 0; // FixMe:
+ return 0; // FIXME
}
public double getdEdxError()
{
- return 0; // FixMe:
+ return 0; // FIXME
}
public String toString()
lcsim/src/org/lcsim/mc/fast/tracking
diff -u -r1.1 -r1.2
--- SimpleTables.java 9 Aug 2005 18:34:03 -0000 1.1
+++ SimpleTables.java 15 Jul 2006 09:35:59 -0000 1.2
@@ -14,7 +14,7 @@
private double ThetaTerm;
/** Creates a new instance of SimpleTables */
- SimpleTables(ConditionsSet set)
+ public SimpleTables(ConditionsSet set)
{
ConstantTerm = set.getDouble("ConstantTerm");
ThetaTerm = set.getDouble("ThetaTerm");
lcsim/src/org/lcsim/mc/fast/tracking
diff -u -r1.4 -r1.5
--- ResolutionTable.java 20 Jun 2006 22:43:07 -0000 1.4
+++ ResolutionTable.java 15 Jul 2006 09:35:59 -0000 1.5
@@ -8,11 +8,11 @@
import java.util.StringTokenizer;
-class ResolutionTable
+public class ResolutionTable
{
private Map hash = new HashMap();
- ResolutionTable(Reader in) throws IOException
+ public ResolutionTable(Reader in) throws IOException
{
BufferedReader inn = new TrimReader(in);
setupTable(inn);
@@ -24,7 +24,7 @@
return (LookupTable) hash.get(name);
}
- LookupTable findTable(int i, int j) {
+ public LookupTable findTable(int i, int j) {
String name = String.format("(%s,%s):", i+1, j+1);
// System.out.printf("%s\n", name);
return findTable(name);
lcsim/src/org/lcsim/mc/fast/tracking
diff -u -r1.2 -r1.3
--- LookupTable.java 26 Aug 2005 05:26:19 -0000 1.2
+++ LookupTable.java 15 Jul 2006 09:35:59 -0000 1.3
@@ -7,7 +7,7 @@
import java.util.StringTokenizer;
-class LookupTable
+public class LookupTable
{
// cosine theta
private double[] m_key1;
@@ -60,7 +60,7 @@
}
}
- double interpolateVal(double val1, double val2)
+ public double interpolateVal(double val1, double val2)
{
int index1 = binarySearch(m_key1, val1);
int index2 = binarySearch(m_key2, val2);
lcsim/src/org/lcsim/mc/fast/tracking
diff -u -r1.1 -r1.2
--- TrackResolutionTables.java 1 Feb 2005 19:42:48 -0000 1.1
+++ TrackResolutionTables.java 15 Jul 2006 09:35:59 -0000 1.2
@@ -5,7 +5,7 @@
import java.io.*;
-class TrackResolutionTables
+public class TrackResolutionTables
{
private ResolutionTable barrel;
private ResolutionTable endcap;
@@ -13,7 +13,7 @@
private double PolarOuter;
private double PtMin;
- TrackResolutionTables(ConditionsSet set, boolean beamSpotConstraint) throws IOException
+ public TrackResolutionTables(ConditionsSet set, boolean beamSpotConstraint) throws IOException
{
PtMin = set.getDouble("PtMin");
PolarInner = set.getDouble("PolarInner");
@@ -27,17 +27,17 @@
endcap = new ResolutionTable(set.getRawSubConditions(endcapFile).getReader());
}
- ResolutionTable getBarrelTable()
+ public ResolutionTable getBarrelTable()
{
return barrel;
}
- ResolutionTable getEndcapTable()
+ public ResolutionTable getEndcapTable()
{
return endcap;
}
- double getPolarInner()
+ public double getPolarInner()
{
return PolarInner;
}
lcsim/src/org/lcsim/mc/fast/tracking
diff -N MCFastTrackFactory.java
--- MCFastTrackFactory.java 20 Jun 2006 22:43:07 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,60 +0,0 @@
-/**
- *
- */
-package org.lcsim.mc.fast.tracking;
-
-import java.io.IOException;
-import java.util.Random;
-
-import org.lcsim.conditions.ConditionsManager;
-import org.lcsim.conditions.ConditionsSet;
-import org.lcsim.event.Track;
-import org.lcsim.spacegeom.SpacePoint;
-
-/**
- * This class can be used to generate covariantly smeared Tracks from just momentum, position and charge as input
- * @author jstrube
- *
- */
-public class MCFastTrackFactory {
-
- private boolean _beamConstraint;
- private double _bField = 5.;
- private TrackResolutionTables _tables;
- private SimpleTables _simpleTables;
- private Random _random = new Random();
- private boolean _makeHists = false;
- private boolean _useSimpleTables = false;
- public MCFastTrackFactory() {
- this("sidaug05", 5., new Random(), false, false, false);
- }
- public MCFastTrackFactory(String detector
- , double bField
- , Random random
- , boolean beamConstraint
- , boolean makeHists
- , boolean useSimpleTables) {
- _bField = bField;
- _random = random;
- _beamConstraint = beamConstraint;
- _makeHists = makeHists;
- _useSimpleTables = useSimpleTables;
-
- ConditionsManager manager = ConditionsManager.defaultInstance();
- try {
- manager.setDetector(detector, 0);
- } catch (ConditionsManager.ConditionsNotFoundException e) {
- }
- ConditionsSet trackParameters = manager.getConditions("TrackParameters");
- ConditionsSet simpleTrack = manager.getConditions("SimpleTrack");
- try {
- _tables = new TrackResolutionTables(trackParameters, beamConstraint);
- _simpleTables = new SimpleTables(simpleTrack);
- } catch(IOException e) {
- }
- }
-
- public Track getMCTrack(SpacePoint momentum, SpacePoint location, int charge) {
- return new FastMCTrack(momentum, location, charge, _bField, _tables, _simpleTables, _random, _makeHists, _useSimpleTables);
- }
-}
lcsim/src/org/lcsim/mc/fast/tracking
diff -N FastMCTrack.java
--- FastMCTrack.java 28 Jun 2006 04:48:33 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,460 +0,0 @@
-package org.lcsim.mc.fast.tracking;
-
-import hep.physics.vec.Hep3Vector;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Random;
-
-import org.lcsim.event.base.BaseTrack;
-import org.lcsim.spacegeom.SpacePoint;
-import org.lcsim.util.aida.AIDA;
-
-/**
- * This is basically a ReconTrack with a different constructor
- * @author jstrube
- * @version $Id: FastMCTrack.java,v 1.2 2006/06/28 04:48:33 jstrube Exp $
- *
- */
-public class FastMCTrack extends BaseTrack {
- private DocaTrackParameters m_nosmear = null;
- private DocaTrackParameters m_smear = null;
-
- FastMCTrack(SpacePoint momentum, SpacePoint position, int q
- , double bField, TrackResolutionTables parm, SimpleTables SmTbl,
- Random rand, boolean hist, boolean simple) {
- _charge = q;
- // get original momentum from MCParticle
- // convert to helical parameters
- m_nosmear = new DocaTrackParameters(bField, momentum.getCartesianArray(), position.getCartesianArray(), _charge);
-
- double pt = m_nosmear.getPt();
- if (hist) {
-
- double r = Math.abs(m_nosmear.getD0());
-
- AIDA aida = AIDA.defaultInstance();
- aida.cloud1D("ptsqr").fill(pt * pt);
- aida.cloud1D("pt").fill(pt);
- aida.cloud1D("phi").fill(m_nosmear.getPhi0());
- aida.cloud1D("theta").fill(m_nosmear.getTheta());
- aida.cloud1D("tanL").fill(m_nosmear.getTanL());
- aida.cloud1D("r").fill(r);
- aida.cloud1D("z").fill(m_nosmear.getZ0());
- }
- // get appropriate resolution table
- double abscth = Math.abs(m_nosmear.getCosTheta());
- double ptot = m_nosmear.getPtot();
- ResolutionTable table = (abscth < parm.getPolarInner())
- ? parm.getBarrelTable()
- : parm.getEndcapTable();
-
- // get resolution values from interpolation and fill error matrix
- m_nosmear.fillErrorMatrix(getErrorMatrixFromTable(table, abscth, ptot));
-
- // smear tracks according to error matrix
- if (simple == true) {
- m_smear = (DocaTrackParameters) SmearTrackSimple.smearTrackSimple(
- bField, m_nosmear, rand, SmTbl, pt, hist);
- // double[] slice = {0, 0, 1, 0, 0};
- // m_smear = (DocaTrackParameters)
- // SmearTrackSimpleII.SmearTrackSimpleII(bField, m_nosmear, rand,
- // SmTbl, slice, hist);
- } else {
- m_smear = (DocaTrackParameters) SmearTrack.smearTrack(bField,
- m_nosmear, rand);
- }
-
- if (hist) {
- AIDA aida = AIDA.defaultInstance();
- aida.cloud1D("ptNew").fill(m_smear.getPt());
- aida.cloud1D("tanLNew").fill(m_smear.getTanL());
- aida.cloud1D("rNew").fill(Math.abs(m_smear.getD0()));
- aida.cloud1D("phiNew").fill(m_smear.getPhi0());
- aida.cloud1D("zNew").fill(m_smear.getZ0());
- }
- }
-
- /**
- * Get the chi2 from smearing.
- */
- public double getChi2() {
- return m_smear.getChi2();
- }
-
- /**
- * Get DOCA (2-dim) of smeared track. <br>
- *
- * Note: Use #getNotSmearedTrack().getDOCA() to access parameters of the not
- * smeared track.
- */
- public double[] getDoca() {
- return m_smear.getDoca();
- }
-
- public double[] getDocaMomentum(double[] refPoint) {
- return m_smear.getDocaMomentum(refPoint);
- }
-
- /**
- * Get momentum at DOCA (2-dim) of smeared track. <br>
- *
- * Note: Use #getNotSmearedTrack().getMomentum() to access parameters of the
- * not smeared track.
- */
- public double[] getDocaMomentum() {
- return m_smear.getMomentum();
- }
-
- public Hep3Vector getDocaMomentumVec(Hep3Vector refPoint) {
- return m_smear.getDocaMomentumVec(refPoint);
- }
-
- /*
- * Calculate and get Doca momentum on smeared track with respect to any
- * space point.
- */
- public Hep3Vector getDocaMomentumVec(double[] refPoint) {
- return m_smear.getDocaMomentumVec(refPoint);
- }
-
- /**
- * Get x coordinate of momentum of the smeared track at DOCA.
- */
- public double getDocaMomentumX() {
- return m_smear.getPX();
- }
-
- /**
- * Get y coordinate of momentum of the smeared track at DOCA.
- */
- public double getDocaMomentumY() {
- return m_smear.getPY();
- }
-
- /**
- * Get z coordinate of momentum of the smeared track at DOCA.
- */
- public double getDocaMomentumZ() {
- return m_smear.getPZ();
- }
-
- public double[] getDocaPosition(double[] refPoint) {
- return m_smear.getDocaPosition(refPoint);
- }
-
- /**
- * Calculate and get Doca position on the smeared track with respect to any
- * space point.
- */
- public Hep3Vector getDocaPositionVec(Hep3Vector refPoint) {
- return m_smear.getDocaPositionVec(refPoint);
- }
-
- public Hep3Vector getDocaPositionVec(double[] refPoint) {
- return m_smear.getDocaPositionVec(refPoint);
- }
-
- /**
- * Get transverse momentum of the smeared track at DOCA.
- */
- public double getDocaPt() {
- return m_smear.getPt();
- }
-
- /**
- * Calculate and get path length on the smeared track for a doca to any
- * space point in respect to the track defining doca (with respect to the
- * origin). The length l is given in the transverse plane. <br>
- * Use L = l*tan(lambda) to convert.
- */
- public double getDocaTransversePathLength(Hep3Vector refPoint) {
- return m_smear.getDocaTransversePathLength(refPoint);
- }
-
- public double getDocaTransversePathLength(double[] refPoint) {
- return m_smear.getDocaTransversePathLength(refPoint);
- }
-
- /**
- * Get x coordinate of DOCA of smeared track.
- */
- public double getDocaX() {
- return m_smear.getDocaX();
- }
-
- /**
- * Get y coordinate of DOCA of smeared track.
- */
- public double getDocaY() {
- return m_smear.getDocaY();
- }
-
- /**
- * Get z coordinate of DOCA of smeared track.
- */
- public double getDocaZ() {
- return m_smear.getDocaZ();
- }
-
- /**
- * Get the full error matrix.
- *
- * @see #getTrackParameter
- */
- public double[][] getErrorMatrix() {
- return m_smear.getErrorMatrix();
- }
-
- /**
- * Get an individual error matrix element.
- *
- * @see #getTrackParameter
- */
- public double getErrorMatrixElement(int i, int j) {
- return m_smear.getErrorMatrixElement(i, j);
- }
-
-
- public double[] getMomentum(double l) {
- return m_smear.getMomentum(l);
- }
-
- /**
- * Get momentum of smeared track at original vertex point. <br>
- *
- * Note: Use #getNotSmearedTrack().getMomentum() to access parameters of the
- * not smeared track.
- */
- public double[] getMomentum() {
- return m_smear.getMomentum(m_smear.getL0());
- }
-
- /**
- * Calculate and get momentum on track with respect to any path length l on
- * track (l in xy plane).
- */
- public Hep3Vector getMomentumVec(double l) {
- return m_smear.getMomentumVec(l);
- }
-
- public Hep3Vector getMomentumVec() {
- return m_smear.getMomentumVec(m_smear.getL0());
- }
-
- /**
- * Get x coordinate of momentum of the smeared track at original vertex.
- */
- public double getMomentumX() {
- return m_smear.getMomentum(m_smear.getL0())[0];
- }
-
- /**
- * Get y coordinate of momentum of the smeared track at original vertex.
- */
- public double getMomentumY() {
- return m_smear.getMomentum(m_smear.getL0())[1];
- }
-
- /**
- * Get z coordinate of momentum of the smeared track at original vertex.
- */
- public double getMomentumZ() {
- return m_smear.getMomentum(m_smear.getL0())[2];
- }
-
- /**
- * Get the number degrees of freedom.
- */
- public int getNDF() {
- return m_smear.getNDF();
- }
-
- /**
- * Get the complete parameter set for the not smeared track.
- */
- public DocaTrackParameters getNotSmearedTrack() {
- return m_nosmear;
- }
-
- /**
- * Get x coordinate of momentum of the smeared track at original vertex.
- */
- public double getPX() {
- return getMomentumX();
- }
-
- /**
- * Get y coordinate of momentum of the smeared track at original vertex.
- */
- public double getPY() {
- return getMomentumY();
- }
-
- /**
- * Get z coordinate of momentum of the smeared track at original vertex.
- */
- public double getPZ() {
- return getMomentumZ();
- }
-
- public double[] getPosition(double l) {
- return m_smear.getPosition(l);
- }
-
- /**
- * Calculate and get position on track with respect to any path length l on
- * track (l in xy plane).
- */
- public Hep3Vector getPositionVec(double l) {
- return m_smear.getPositionVec(l);
- }
-
- /**
- * Get transverse momentum of the smeared track at original vertex.
- */
- public double getPt() {
- double[] p = getMomentum();
-
- return Math.sqrt((p[0] * p[0]) + (p[1] * p[1]));
- }
-
- public double getRadiusOfInnermostHit() {
- return 0; // FixMe:
- }
-
- /**
- * Get the original vertex point of smeared MC track.
- */
-
- // Get the MC truth particle's origin.
- //
- public double[] getReferencePoint() {
- return m_smear.getPosition(m_smear.getL0());
- }
-
- public boolean isReferencePointPCA() {
- return true;
- }
-
- /**
- * Get x coordinate of the original vertex point of smeared MC track.
- */
- public double getReferencePointX() {
- return getReferencePoint()[0];
- }
-
- /**
- * Get y coordinate of the original vertex point of smeared MC track.
- */
- public double getReferencePointY() {
- return getReferencePoint()[1];
- }
-
- /**
- * Get z coordinate of the original vertex point of smeared MC track.
- */
- public double getReferencePointZ() {
- return getReferencePoint()[2];
- }
-
- /**
- * Get the complete parameter set for the smeared track.
- */
- public DocaTrackParameters getSmearedTrack() {
- return m_smear;
- }
-
- public int[] getSubdetectorHitNumbers() {
- return new int[0]; // FixMe:
- }
-
- /**
- * Get an individual track parameter. <br>
- *
- * The track parameters for LCD are defined as follows <table>
- * <tr>
- * <th>Index</th>
- * <th>Meaning</th>
- * </tr>
- * <tr>
- * <td> 0 </td>
- * <td> d0 = XY impact parameter </td>
- * <tr>
- * <tr>
- * <td> 1 </td>
- * <td> phi0 </td>
- * <tr> </td>
- * <tr>
- * <tr>
- * <td> 2 </td>
- * <td> omega = 1/curv.radius (negative for negative tracks) </td>
- * <tr>
- * <tr>
- * <td> 3 </td>
- * <td> z0 = z of track (z impact parameter) </td>
- * <tr>
- * <tr>
- * <td> 4 </td>
- * <td> s = tan lambda </td>
- * <tr> </table>
- *
- * @param i
- * The index of the track parameter
- * @return The track parameter with the specified index
- *
- * All parameters are given at the DOCA.
- */
- public double getTrackParameter(int i) {
- return m_smear.getTrackParameter(i);
- }
-
- /**
- * Get the track parameters as an array
- *
- * @see #getTrackParameter
- */
- public double[] getTrackParameters() {
- return m_smear.getTrackParameters();
- }
-
- public List getTrackerHits() {
- return Collections.EMPTY_LIST;
- }
-
- public List getTracks() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * Calculate the error matrix for the momentum for a point on the smeared
- * track specified by l. Result is given as a 3x3 array for the matrix.
- */
- public double[][] calcMomentumErrorMatrix(double l) {
- return m_smear.calcMomentumErrorMatrix(l);
- }
-
- /**
- * Calculate the error matrix for the position coordinates for a point on
- * the smeared track specified by l. Result is given as a 3x3 array for the
- * matrix.
- */
- public double[][] calcPositionErrorMatrix(double l) {
- return m_smear.calcPositionErrorMatrix(l);
- }
-
- private double[][] getErrorMatrixFromTable(ResolutionTable table,
- double abscth, double ptot) {
- double[][] errMatrix = new double[5][5];
- for (int i = 0; i < 5; i++) {
- for (int j = 0; j <= i; j++) {
- errMatrix[i][j] = table.findTable(i, j)
- .interpolateVal(abscth, ptot);
- if (i != j) {
- errMatrix[j][i] = errMatrix[i][j];
- }
- }
- }
- return errMatrix;
- }
-}
CVSspam 0.2.8