8 modified files
lcsim/src/org/lcsim/event
diff -u -r1.6 -r1.7
--- TrackerHit.java 23 May 2008 06:53:35 -0000 1.6
+++ TrackerHit.java 9 Nov 2010 22:26:00 -0000 1.7
@@ -5,39 +5,53 @@
/** A generic tracker hit to be used by pattern recognition.
*
* @author gaede
- * @version $Id: TrackerHit.java,v 1.6 2008/05/23 06:53:35 jeremy Exp $
+ * @version $Id: TrackerHit.java,v 1.7 2010/11/09 22:26:00 jeremy Exp $
*/
public interface TrackerHit
{
- /** The hit position in [mm].
- */
- public double[] getPosition();
-
- /**Covariance of the position (x,y,z)
- */
- public double[] getCovMatrix();
-
- /** The dE/dx of the hit in [GeV].
- */
- public double getdEdx();
-
- /** The time of the hit in [ns].
- */
- public double getTime();
-
- /** Type of hit. Mapping of integer types to type names
- * through collection parameters "TrackerHitTypeNames"
- * and "TrackerHitTypeValues".
- */
- public int getType();
-
- /** The raw data hits.
- * Check getType() to get actual data type.
- */
- public List getRawHits();
-
- // FixMe: We could add a method to get a CellID from the RawHits.
- // FixMe: See Dima's comments from 2/13/2007 LCD meeting
-
+ /**
+ * The hit position in [mm].
+ */
+ public double[] getPosition();
+
+ /**
+ * Covariance of the position (x,y,z)
+ */
+ public double[] getCovMatrix();
+
+ /** The dE/dx of the hit in [GeV].
+ */
+ public double getdEdx();
+
+ /**
+ * The measured edep error [GeV].
+ */
+ public double getEdepError();
+
+ /**
+ * The quality of the hit.
+ */
+ public int getQuality();
+
+ /**
+ * The time of the hit in [ns].
+ */
+ public double getTime();
+
+ /**
+ * Type of hit. Mapping of integer types to type names
+ * through collection parameters "TrackerHitTypeNames"
+ * and "TrackerHitTypeValues".
+ */
+ public int getType();
+
+ /** The raw data hits.
+ * Check getType() to get actual data type.
+ */
+ public List getRawHits();
+
+ // FixMe: We could add a method to get a CellID from the RawHits.
+ // FixMe: See Dima's comments from 2/13/2007 LCD meeting
+
} // class or interface
lcsim/src/org/lcsim/event/base
diff -u -r1.5 -r1.6
--- BaseTrackerHit.java 21 Nov 2007 17:20:10 -0000 1.5
+++ BaseTrackerHit.java 9 Nov 2010 22:26:00 -0000 1.6
@@ -3,7 +3,7 @@
*
* Created on March 24, 2006, 9:22 AM
*
- * $Id: BaseTrackerHit.java,v 1.5 2007/11/21 17:20:10 ngraf Exp $
+ * $Id: BaseTrackerHit.java,v 1.6 2010/11/09 22:26:00 jeremy Exp $
*/
package org.lcsim.event.base;
@@ -175,6 +175,16 @@
return _time;
}
+ public double getEdepError()
+ {
+ return 0.;
+ }
+
+ public int getQuality()
+ {
+ return 0;
+ }
+
/**
* Type of hit. Mapping of integer types to type names
* through collection parameters "TrackerHitTypeNames"
lcsim/src/org/lcsim/fit/helicaltrack
diff -u -r1.17 -r1.18
--- HelicalTrackHit.java 1 Dec 2009 19:35:13 -0000 1.17
+++ HelicalTrackHit.java 9 Nov 2010 22:26:00 -0000 1.18
@@ -238,6 +238,16 @@
return _type;
}
+ public int getQuality()
+ {
+ return 0;
+ }
+
+ public double getEdepError()
+ {
+ return 0.;
+ }
+
/**
* Return a list of raw hits for this hit.
* @return raw hit list
lcsim/src/org/lcsim/job
diff -u -r1.47 -r1.48
--- JobControlManager.java 28 Jul 2010 21:40:28 -0000 1.47
+++ JobControlManager.java 9 Nov 2010 22:26:00 -0000 1.48
@@ -46,7 +46,7 @@
* The command line syntax is <code>java -jar ./lib/lcsim.jar steeringFile.xml</code>.
*
* @author jeremym
- * @version $Id: JobControlManager.java,v 1.47 2010/07/28 21:40:28 jeremy Exp $
+ * @version $Id: JobControlManager.java,v 1.48 2010/11/09 22:26:00 jeremy Exp $
*/
public class JobControlManager
{
@@ -429,7 +429,7 @@
}
catch (FileNotFoundException x)
{
- throw new RuntimeException(x);
+ throw new RuntimeException("File not found: " + filePath, x);
}
String line = null;
try
@@ -569,7 +569,7 @@
}
catch (IOException x)
{
- throw new RuntimeException(x);
+ throw new RuntimeException("Error creating log file: " + logFile.toString(), x);
}
}
@@ -1021,4 +1021,4 @@
return path;
}
}
-}
\ No newline at end of file
+}
lcsim/src/org/lcsim/recon/cat
diff -u -r1.2 -r1.3
--- GarfieldHit.java 21 Sep 2007 12:07:47 -0000 1.2
+++ GarfieldHit.java 9 Nov 2010 22:26:00 -0000 1.3
@@ -18,260 +18,269 @@
*
* @author E. von Toerne
* @author D. Onoprienko
- * @version $Id: GarfieldHit.java,v 1.2 2007/09/21 12:07:47 onoprien Exp $
+ * @version $Id: GarfieldHit.java,v 1.3 2010/11/09 22:26:00 jeremy Exp $
*/
final public class GarfieldHit implements TrackerHit {
-
-
- // -- Private parts : -------------------------------------------------------
-
- private String hitStatus;
- private boolean isendcap=false;
- private boolean is3d;
- private boolean hasZ;
- private int layer;
- private double[] pos; // Position of the hit
- private double[] x0; // 2D hits are a line, this is it's one end
- private double[] x1; // 2D hits are a line, this is it's other end
- private double length2D; //length of 2D line in xy plane
- private double simpleError;
- private int id;
- private double phi;
-
- private ArrayList<SimTrackerHit> rawHitList = new ArrayList<SimTrackerHit>(1);
-
- // -- Constructors : --------------------------------------------------------
-
- /**
- * 2D hit constructor.
- */
- GarfieldHit(double[] x0, double[] x1, double error, int layer, int id) {
- this.layer = layer;
- this.id = id;
- this.hitStatus = "new";
- this.is3d = false;
- this.x0 = new double[3]; System.arraycopy(x0, 0, this.x0, 0, 3);
- this.x1 = new double[3]; System.arraycopy(x1, 0, this.x1, 0, 3);
- this.pos = new double[]{0.5*(x0[0]+x1[0]), 0.5*(x0[1]+x1[1]), 0.5*(x0[2]+x1[2])}; // middle of strip
- this.phi = Math.atan2(pos[1],pos[0]);
- this.hasZ = (Math.abs(x0[2]-x1[2])<1.E-2);
- this.simpleError = error;
- this.length2D=Math.sqrt((x0[0]-x1[0])*(x0[0]-x1[0])+(x0[1]-x1[1])*(x0[1]-x1[1]));
- }
-
- /**
- * Generic 3D point. Any getters requiring access to the original hit
- * cannot be called for an object created with this constructor.
- */
- GarfieldHit(double[] point, double error, int layer, int id) {
- this.layer = layer;
- this.id = id;
- this.hitStatus = "new";
- this.is3d = true;
- this.hasZ=true;
- this.pos = new double[3]; System.arraycopy(point, 0, this.pos, 0, 3);
- this.phi = Math.atan2(pos[1],pos[0]);
- this.x0 = null;
- this.x1 = null;
- this.simpleError = error;
- this.length2D = -1.;
- }
-
- // -- Setters : -------------------------------------------------------------
-
- /**
- * Set status string of the hit.
- */
- public void setStatus(String stat){hitStatus=stat;}
- public void setEndcap(boolean enc){isendcap=enc;}
-
- /** Add a hit to the list of simulated hits that contributed to this "digitized" hit. */
- public void addRawHit(SimTrackerHit rawHit) {rawHitList.add(rawHit);}
-
- // -- Getters : -------------------------------------------------------------
-
- /**
- * Returns <code>true</code> if all three coordinates of the hit are known.
- */
- public boolean is3D(){return is3d;}
-
- /**
- * Returns <code>true</code> if Z coordinate of the hit is known.
- */
- public boolean hasZ(){return hasZ;}
-
- /**
- * Returns <code>true</code> if the hit is in endcap.
- */
- public boolean isEndcap(){return isendcap;}
-
- public double getTime() {return rawHitList.isEmpty() ? 0. : rawHitList.get(0).getTime();}
- public double[] getCovMatrix() {return new double[]{0.,0.,0.,0.,0.,0.,0.,0.,0.};}
- public int getType() {return 0;}
-
- public List getRawHits() {return rawHitList;}
-
- /**
- * Get status string of the hit.
- */
- public String getStatus(){return hitStatus;}
-
- /**
- * Get simple error assigned to the hit.
- */
- public double getError(){return simpleError;}
-
- /**
- * Get Garfield layer number: numbers start at the innermost layer of vertex
- * detector and increase to the outer layer of the tracker.
- */
-
- public int getLayer(){return layer;}
-
- /**
- * Get Phi angle of the hit.
- */
- public double getPhi(){return phi;}
-
- /**
- * Get hit position.
- */
- public double[] getPoint(){return new double[]{pos[0],pos[1],pos[2]};}
-
- /**
- * Get hit position.
- */
- public double[] getPosition(){return new double[]{pos[0],pos[1],pos[2]};}
-
- /**
- * Get i-th coordinate of the point corresponding to the start of the line defining 2D hit.
- */
- public final double x0(int i){return x0[i];}
-
- /**
- * Get i-th coordinate of the point corresponding to the end of the line defining 2D hit.
- */
- public final double x1(int i){return x1[i];}
-
- /**
- * Get length of line in xy plane for the line defining 2D hit.
- */
- public final double getLength2D(){return length2D;}
-
-
- /**
- * Get i-th coordinate of the position of the hit.
- */
- double getPoint(int i){return pos[i];}
-
- /**
- * Get hit's distance from the detector axis.
- */
- public double getRxy(){
- return Math.sqrt(pos[0]*pos[0]+pos[1]*pos[1]);
- }
-
- /**
- * absolute value of a double
- */
- private final static double myAbs(double ka){return ka>0.? ka : -ka;}
-
- /**
- * calculate distance of the 2d hit as projected into the xy plane to a 3d postion
- * works best for a 2D hit that lies completely in the xy plane
- * created 11/05/04 for implementation of 2D endcap hits
- * E. von Toerne
- */
- public final double distanceToLine2D(double px, double py) {
- if (is3d) return -1.;
- double xx = x1[0]-x0[0];
- double xy = x1[1]-x0[1];
- double lx = px - x0[0];
- double ly = py - x0[1];
- double ll = lx*lx+ly*ly;
- double lDotX=lx*xx+ly*xy;
- if (lDotX<0.) return Math.sqrt(ll);
- if (lDotX > length2D*length2D) return Math.sqrt((px - x1[0])*(px - x1[0])+(py - x1[1])*(py - x1[1]));
- return Math.sqrt(ll-(lDotX/length2D)*(lDotX/length2D));
- }
-
- //public double sigmaFromHit(GarfieldHelix hel){ return distanceToHit(hel)/getError(); }
-
- private final double sqr(double x){return x*x;}
-
- public final double distanceToHit(GarfieldHelix hel, boolean useXYZ) {
- if (is3d) {
- if (myAbs(pos[2])>1000. && myAbs(hel.dir(2))>0.1) hel.setPointOnHelixWithZ(pos[2]);
- else hel.setPointOnHelixWithXY(pos[0],pos[1]);
- if (useXYZ) return Math.sqrt(sqr(pos[0]- hel.getPointOnHelix(0))+
- sqr(pos[1]- hel.getPointOnHelix(1))+
- sqr(pos[2]- hel.getPointOnHelix(2)));
- else return Math.sqrt(sqr(pos[0]- hel.getPointOnHelix(0))+
- sqr(pos[1]- hel.getPointOnHelix(1)));
-
- } else if (hasZ){
- if (myAbs(hel.dir(2))>0.01) hel.setPointOnHelixWithZ(pos[2]);
- else hel.setPointOnHelixWithXY(pos[0],pos[1]);
- return distanceToLine2D(hel.getPointOnHelix(0),hel.getPointOnHelix(1));
- } else{
- hel.setPointOnHelixWithXY(pos[0],pos[1]);
- return Math.sqrt(sqr(pos[0]-hel.getPointOnHelix(0))+
- sqr(pos[1]-hel.getPointOnHelix(1))+
- sqr(distanceToInterval(x0[2],x1[2],hel.getPointOnHelix(2))));
+
+
+ // -- Private parts : -------------------------------------------------------
+
+ private String hitStatus;
+ private boolean isendcap=false;
+ private boolean is3d;
+ private boolean hasZ;
+ private int layer;
+ private double[] pos; // Position of the hit
+ private double[] x0; // 2D hits are a line, this is it's one end
+ private double[] x1; // 2D hits are a line, this is it's other end
+ private double length2D; //length of 2D line in xy plane
+ private double simpleError;
+ private int id;
+ private double phi;
+
+ private ArrayList<SimTrackerHit> rawHitList = new ArrayList<SimTrackerHit>(1);
+
+ // -- Constructors : --------------------------------------------------------
+
+ /**
+ * 2D hit constructor.
+ */
+ GarfieldHit(double[] x0, double[] x1, double error, int layer, int id) {
+ this.layer = layer;
+ this.id = id;
+ this.hitStatus = "new";
+ this.is3d = false;
+ this.x0 = new double[3]; System.arraycopy(x0, 0, this.x0, 0, 3);
+ this.x1 = new double[3]; System.arraycopy(x1, 0, this.x1, 0, 3);
+ this.pos = new double[]{0.5*(x0[0]+x1[0]), 0.5*(x0[1]+x1[1]), 0.5*(x0[2]+x1[2])}; // middle of strip
+ this.phi = Math.atan2(pos[1],pos[0]);
+ this.hasZ = (Math.abs(x0[2]-x1[2])<1.E-2);
+ this.simpleError = error;
+ this.length2D=Math.sqrt((x0[0]-x1[0])*(x0[0]-x1[0])+(x0[1]-x1[1])*(x0[1]-x1[1]));
+ }
+
+ /**
+ * Generic 3D point. Any getters requiring access to the original hit
+ * cannot be called for an object created with this constructor.
+ */
+ GarfieldHit(double[] point, double error, int layer, int id) {
+ this.layer = layer;
+ this.id = id;
+ this.hitStatus = "new";
+ this.is3d = true;
+ this.hasZ=true;
+ this.pos = new double[3]; System.arraycopy(point, 0, this.pos, 0, 3);
+ this.phi = Math.atan2(pos[1],pos[0]);
+ this.x0 = null;
+ this.x1 = null;
+ this.simpleError = error;
+ this.length2D = -1.;
+ }
+
+ // -- Setters : -------------------------------------------------------------
+
+ /**
+ * Set status string of the hit.
+ */
+ public void setStatus(String stat){hitStatus=stat;}
+ public void setEndcap(boolean enc){isendcap=enc;}
+
+ /** Add a hit to the list of simulated hits that contributed to this "digitized" hit. */
+ public void addRawHit(SimTrackerHit rawHit) {rawHitList.add(rawHit);}
+
+ // -- Getters : -------------------------------------------------------------
+
+ /**
+ * Returns <code>true</code> if all three coordinates of the hit are known.
+ */
+ public boolean is3D(){return is3d;}
+
+ /**
+ * Returns <code>true</code> if Z coordinate of the hit is known.
+ */
+ public boolean hasZ(){return hasZ;}
+
+ /**
+ * Returns <code>true</code> if the hit is in endcap.
+ */
+ public boolean isEndcap(){return isendcap;}
+
+ public double getTime() {return rawHitList.isEmpty() ? 0. : rawHitList.get(0).getTime();}
+ public double[] getCovMatrix() {return new double[]{0.,0.,0.,0.,0.,0.,0.,0.,0.};}
+ public int getType() {return 0;}
+
+ public List getRawHits() {return rawHitList;}
+
+ /**
+ * Get status string of the hit.
+ */
+ public String getStatus(){return hitStatus;}
+
+ /**
+ * Get simple error assigned to the hit.
+ */
+ public double getError(){return simpleError;}
+
+ /**
+ * Get Garfield layer number: numbers start at the innermost layer of vertex
+ * detector and increase to the outer layer of the tracker.
+ */
+
+ public int getLayer(){return layer;}
+
+ /**
+ * Get Phi angle of the hit.
+ */
+ public double getPhi(){return phi;}
+
+ /**
+ * Get hit position.
+ */
+ public double[] getPoint(){return new double[]{pos[0],pos[1],pos[2]};}
+
+ /**
+ * Get hit position.
+ */
+ public double[] getPosition(){return new double[]{pos[0],pos[1],pos[2]};}
+
+ /**
+ * Get i-th coordinate of the point corresponding to the start of the line defining 2D hit.
+ */
+ public final double x0(int i){return x0[i];}
+
+ /**
+ * Get i-th coordinate of the point corresponding to the end of the line defining 2D hit.
+ */
+ public final double x1(int i){return x1[i];}
+
+ /**
+ * Get length of line in xy plane for the line defining 2D hit.
+ */
+ public final double getLength2D(){return length2D;}
+
+ /**
+ * Get i-th coordinate of the position of the hit.
+ */
+ double getPoint(int i){return pos[i];}
+
+ /**
+ * Get hit's distance from the detector axis.
+ */
+ public double getRxy(){
+ return Math.sqrt(pos[0]*pos[0]+pos[1]*pos[1]);
+ }
+
+ public double getEdepError()
+ {
+ return 0;
+ }
+
+ public int getQuality()
+ {
+ return 0;
+ }
+
+ /**
+ * absolute value of a double
+ */
+ private final static double myAbs(double ka){return ka>0.? ka : -ka;}
+
+ /**
+ * calculate distance of the 2d hit as projected into the xy plane to a 3d postion
+ * works best for a 2D hit that lies completely in the xy plane
+ * created 11/05/04 for implementation of 2D endcap hits
+ * E. von Toerne
+ */
+ public final double distanceToLine2D(double px, double py) {
+ if (is3d) return -1.;
+ double xx = x1[0]-x0[0];
+ double xy = x1[1]-x0[1];
+ double lx = px - x0[0];
+ double ly = py - x0[1];
+ double ll = lx*lx+ly*ly;
+ double lDotX=lx*xx+ly*xy;
+ if (lDotX<0.) return Math.sqrt(ll);
+ if (lDotX > length2D*length2D) return Math.sqrt((px - x1[0])*(px - x1[0])+(py - x1[1])*(py - x1[1]));
+ return Math.sqrt(ll-(lDotX/length2D)*(lDotX/length2D));
}
- }
-
- /**
- * returns distance to that interval a,b (0 or the distance to the edge)
- * allows for arbitrary ordering (a<b or a>b)
- */
- final private double distanceToInterval(double a, double b, double c) {
- if (a<b){
- if (c<a) return a-c;
- else if (c>b) return c-b;
- else return 0.;
- } else{
- if (c<b) return b-c;
- else if (c>a) return c-a;
- else return 0.;
+
+ //public double sigmaFromHit(GarfieldHelix hel){ return distanceToHit(hel)/getError(); }
+
+ private final double sqr(double x){return x*x;}
+
+ public final double distanceToHit(GarfieldHelix hel, boolean useXYZ) {
+ if (is3d) {
+ if (myAbs(pos[2])>1000. && myAbs(hel.dir(2))>0.1) hel.setPointOnHelixWithZ(pos[2]);
+ else hel.setPointOnHelixWithXY(pos[0],pos[1]);
+ if (useXYZ) return Math.sqrt(sqr(pos[0]- hel.getPointOnHelix(0))+
+ sqr(pos[1]- hel.getPointOnHelix(1))+
+ sqr(pos[2]- hel.getPointOnHelix(2)));
+ else return Math.sqrt(sqr(pos[0]- hel.getPointOnHelix(0))+
+ sqr(pos[1]- hel.getPointOnHelix(1)));
+
+ } else if (hasZ){
+ if (myAbs(hel.dir(2))>0.01) hel.setPointOnHelixWithZ(pos[2]);
+ else hel.setPointOnHelixWithXY(pos[0],pos[1]);
+ return distanceToLine2D(hel.getPointOnHelix(0),hel.getPointOnHelix(1));
+ } else{
+ hel.setPointOnHelixWithXY(pos[0],pos[1]);
+ return Math.sqrt(sqr(pos[0]-hel.getPointOnHelix(0))+
+ sqr(pos[1]-hel.getPointOnHelix(1))+
+ sqr(distanceToInterval(x0[2],x1[2],hel.getPointOnHelix(2))));
+ }
+ }
+
+ /**
+ * returns distance to that interval a,b (0 or the distance to the edge)
+ * allows for arbitrary ordering (a<b or a>b)
+ */
+ final private double distanceToInterval(double a, double b, double c) {
+ if (a<b){
+ if (c<a) return a-c;
+ else if (c>b) return c-b;
+ else return 0.;
+ } else{
+ if (c<b) return b-c;
+ else if (c>a) return c-a;
+ else return 0.;
+ }
}
- }
-
- /**
- * Hit reporting
- */
- public void debug(){
- double[] ph = getPosition();
- String endCapString = " barrel";
- if (isEndcap()) endCapString = " EndCap";
- String string3d = " ";
- if (is3D()) string3d=" 3D";
- String stringHasZ = " ";
- if (hasZ()) stringHasZ=" hasZ";
- System.out.println(" hit ID="+getID()+" layer="+getLayer()+" "+
- ph[0]+" "+ph[1]+" "+ph[2]+
- endCapString+string3d+stringHasZ);
- }
- /**
- * The system which contains the hit.
- */
- public int getSystem(){return rawHitList.isEmpty() ? -1 : rawHitList.get(0).getSubdetector().getSystemID();}
-
- /**
- * Get hit ID.
- */
- public int getID(){return this.id;}
-
- /**
- * The MCParticle which created the hit. Returns null for the moment
- */
- //public MCParticle getMCParticle() {return null;}
-
- /**
- * Returns dE/dx energy deposition (forwarded from the first simulated hit in the list).
- */
- public double getdEdx() {return rawHitList.isEmpty() ? 0. : rawHitList.get(0).getdEdx();}
-
+
+ /**
+ * Hit reporting
+ */
+ public void debug(){
+ double[] ph = getPosition();
+ String endCapString = " barrel";
+ if (isEndcap()) endCapString = " EndCap";
+ String string3d = " ";
+ if (is3D()) string3d=" 3D";
+ String stringHasZ = " ";
+ if (hasZ()) stringHasZ=" hasZ";
+ System.out.println(" hit ID="+getID()+" layer="+getLayer()+" "+
+ ph[0]+" "+ph[1]+" "+ph[2]+
+ endCapString+string3d+stringHasZ);
+ }
+ /**
+ * The system which contains the hit.
+ */
+ public int getSystem(){return rawHitList.isEmpty() ? -1 : rawHitList.get(0).getSubdetector().getSystemID();}
+
+ /**
+ * Get hit ID.
+ */
+ public int getID(){return this.id;}
+
+ /**
+ * The MCParticle which created the hit. Returns null for the moment
+ */
+ //public MCParticle getMCParticle() {return null;}
+
+ /**
+ * Returns dE/dx energy deposition (forwarded from the first simulated hit in the list).
+ */
+ public double getdEdx() {return rawHitList.isEmpty() ? 0. : rawHitList.get(0).getdEdx();}
+
}
lcsim/src/org/lcsim/recon/tracking/digitization/sisim
diff -u -r1.1 -r1.2
--- BaseTrackerHit.java 24 Apr 2009 01:22:58 -0000 1.1
+++ BaseTrackerHit.java 9 Nov 2010 22:26:00 -0000 1.2
@@ -105,6 +105,16 @@
return _type;
}
+ public double getEdepError()
+ {
+ return 0.;
+ }
+
+ public int getQuality()
+ {
+ return 0;
+ }
+
// More refined output types for hit information
public Hep3Vector getPositionAsVector()
{
lcsim/src/org/lcsim/recon/tracking/vsegment/hitmaking
diff -u -r1.1 -r1.2
--- OldTrackerHit.java 6 Dec 2008 21:53:44 -0000 1.1
+++ OldTrackerHit.java 9 Nov 2010 22:26:00 -0000 1.2
@@ -12,7 +12,7 @@
* this package into old <tt>TrackerHits</tt>.
*
* @author D. Onoprienko
- * @version $Id: OldTrackerHit.java,v 1.1 2008/12/06 21:53:44 onoprien Exp $
+ * @version $Id: OldTrackerHit.java,v 1.2 2010/11/09 22:26:00 jeremy Exp $
*/
public class OldTrackerHit implements org.lcsim.event.TrackerHit {
@@ -106,4 +106,14 @@
protected List _rawHits;
protected List<TrackerCluster> _clusters;
-}
+
+ public double getEdepError()
+ {
+ return 0;
+ }
+
+ public int getQuality()
+ {
+ return 0;
+ }
+}
\ No newline at end of file
lcsim/src/org/lcsim/util/lcio
diff -u -r1.2 -r1.3
--- SIOTrackerHit.java 17 Oct 2007 02:06:23 -0000 1.2
+++ SIOTrackerHit.java 9 Nov 2010 22:26:00 -0000 1.3
@@ -12,101 +12,128 @@
/**
*
* @author Tony Johnson
- * @version $Id: SIOTrackerHit.java,v 1.2 2007/10/17 02:06:23 tonyj Exp $
+ * @version $Id: SIOTrackerHit.java,v 1.3 2010/11/09 22:26:00 jeremy Exp $
*/
class SIOTrackerHit implements TrackerHit
{
- private List<SIORef> tempHits;
- private List rawHits;
- private int type;
- private double[] position = new double[3];
- private double[] covMatrix = new double[6];
- private float dEdx;
- private float time;
-
- SIOTrackerHit(SIOInputStream in, int flags, int version) throws IOException
- {
- type = in.readInt();
- for (int i = 0; i < 3; i++)
- position[i] = in.readDouble();
- for (int i = 0; i < 6; i++)
- covMatrix[i] = in.readFloat();
- dEdx = in.readFloat();
- time = in.readFloat();
-
- int nRawHits = 1 ;
- if( version > 1002)
- {
- nRawHits = in.readInt() ;
- }
-
- tempHits = new ArrayList<SIORef>(nRawHits) ;
- for (int i = 0; i < nRawHits ; i++)
- {
- tempHits.add(in.readPntr());
- }
- rawHits = null;
-
- in.readPTag(this);
- }
- public List getRawHits()
- {
- if (rawHits == null && tempHits != null)
- {
- rawHits = new ArrayList(tempHits.size());
- for (SIORef ref : tempHits)
- {
- rawHits.add(ref.getObject());
- }
- tempHits = null;
- }
- return rawHits;
- }
-
- public double getdEdx()
- {
- return dEdx;
- }
-
- public int getType()
- {
- return type;
- }
-
- public double getTime()
- {
- return time;
- }
-
- public double[] getPosition()
- {
- return position;
- }
-
- public double[] getCovMatrix()
- {
- return covMatrix;
- }
- static void write(TrackerHit hit, SIOOutputStream out, int flags) throws IOException
- {
- out.writeInt(hit.getType());
- double[] pos = hit.getPosition();
- for (int i = 0; i < 3; i++)
- out.writeDouble(pos[i]);
-
- double[] matrix = hit.getCovMatrix();
- for (int i = 0; i < 6; i++)
- out.writeFloat((float) matrix[i]);
- out.writeFloat((float) hit.getdEdx());
- out.writeFloat((float) hit.getTime());
-
- List rawHits = hit.getRawHits() ;
- out.writeInt( rawHits.size()) ;
- for (int i = 0; i < rawHits.size() ; i++)
- {
- out.writePntr( rawHits.get(i) );
- }
-
- out.writePTag(hit);
- }
+ private List<SIORef> tempHits;
+ private List rawHits;
+ private int type;
+ private double[] position = new double[3];
+ private double[] covMatrix = new double[6];
+ private float dEdx;
+ private float time;
+ private float edepError;
+ private int quality;
+
+ SIOTrackerHit(SIOInputStream in, int flags, int version) throws IOException
+ {
+ type = in.readInt();
+ for (int i = 0; i < 3; i++)
+ position[i] = in.readDouble();
+ for (int i = 0; i < 6; i++)
+ covMatrix[i] = in.readFloat();
+
+ dEdx = in.readFloat();
+
+ if ( version > 1012 )
+ {
+ edepError = in.readFloat();
+ }
+
+ time = in.readFloat();
+
+ if ( version > 1011 )
+ {
+ quality = in.readInt();
+ }
+
+ int nRawHits = 1 ;
+ if( version > 1002)
+ {
+ nRawHits = in.readInt() ;
+ }
+
+ tempHits = new ArrayList<SIORef>(nRawHits) ;
+ for (int i = 0; i < nRawHits ; i++)
+ {
+ tempHits.add(in.readPntr());
+ }
+ rawHits = null;
+
+ in.readPTag(this);
+ }
+ public List getRawHits()
+ {
+ if (rawHits == null && tempHits != null)
+ {
+ rawHits = new ArrayList(tempHits.size());
+ for (SIORef ref : tempHits)
+ {
+ rawHits.add(ref.getObject());
+ }
+ tempHits = null;
+ }
+ return rawHits;
+ }
+
+ public double getdEdx()
+ {
+ return dEdx;
+ }
+
+ public int getType()
+ {
+ return type;
+ }
+
+ public double getTime()
+ {
+ return time;
+ }
+
+ public double[] getPosition()
+ {
+ return position;
+ }
+
+ public double[] getCovMatrix()
+ {
+ return covMatrix;
+ }
+
+ public double getEdepError()
+ {
+ return edepError;
+ }
+
+ public int getQuality()
+ {
+ return quality;
+ }
+
+ static void write(TrackerHit hit, SIOOutputStream out, int flags) throws IOException
+ {
+ out.writeInt(hit.getType());
+ double[] pos = hit.getPosition();
+ for (int i = 0; i < 3; i++)
+ out.writeDouble(pos[i]);
+
+ double[] matrix = hit.getCovMatrix();
+ for (int i = 0; i < 6; i++)
+ out.writeFloat((float) matrix[i]);
+ out.writeFloat((float) hit.getdEdx());
+ out.writeFloat((float) hit.getEdepError());
+ out.writeFloat((float) hit.getTime());
+ out.writeInt((int) hit.getQuality());
+
+ List rawHits = hit.getRawHits() ;
+ out.writeInt( rawHits.size()) ;
+ for (int i = 0; i < rawHits.size() ; i++)
+ {
+ out.writePntr( rawHits.get(i) );
+ }
+
+ out.writePTag(hit);
+ }
}
CVSspam 0.2.8