5 modified files
GeomConverter/src/org/lcsim/geometry/segmentation
diff -u -r1.10 -r1.11
--- GridXYZ.java 13 Jul 2005 07:38:31 -0000 1.10
+++ GridXYZ.java 13 Jul 2005 23:35:57 -0000 1.11
@@ -60,7 +60,7 @@
return new long[3];
}
- /** FIXME: Doesn't belong here, as it is always computable given x and y. */
+ /** FIXME: Doesn't belong here, as it is always generally derivable from x and y. */
public double getPhi()
{
double phi = atan2(getX(), getY() );
GeomConverter/src/org/lcsim/geometry/segmentation
diff -u -r1.9 -r1.10
--- NonprojectiveCylinder.java 13 Jul 2005 07:07:15 -0000 1.9
+++ NonprojectiveCylinder.java 13 Jul 2005 23:35:57 -0000 1.10
@@ -36,8 +36,6 @@
private int zIndex;
private int phiIndex;
-// private NonProjCalGeometry npgeom;
-
/** Creates a new instance of NonprojectiveCylinder */
public NonprojectiveCylinder(Element node) throws DataConversionException
{
@@ -45,19 +43,8 @@
gridSizePhi = node.getAttribute("gridSizePhi").getDoubleValue();
gridSizeZ = node.getAttribute("gridSizeZ").getDoubleValue();
-
-// nppars = new NonProjCalGeometry( detector, gridSizeZ, gridSizePhi );
}
- /**
- * In the simulator, this is actually local because local -> global
- * is applied depending on cylinder's position. --JM
- */
- //public CoordinateSystemType getCoordinateSystemType()
- //{
- // return CoordinateSystemType.GLOBAL;
- //}
-
void setGridSizePhi(double gsp)
{
gridSizePhi = gsp;
GeomConverter/src/org/lcsim/geometry/segmentation
diff -u -r1.15 -r1.16
--- ProjectiveCylinder.java 13 Jul 2005 07:07:15 -0000 1.15
+++ ProjectiveCylinder.java 13 Jul 2005 23:35:57 -0000 1.16
@@ -25,11 +25,6 @@
phiBins = node.getAttribute("phiBins").getIntValue();
}
- //public CoordinateSystemType getCoordinateSystemType()
- //{
- // return CoordinateSystemType.GLOBAL;
- //}
-
public double getPhi()
{
return Math.PI*2*(getValue(phiIndex)+0.5)/phiBins;
@@ -42,18 +37,18 @@
public double getX()
{
- return getRadius(getLayer())*Math.cos(getPhi());
+ return getDistanceToSensitive(getLayer())*Math.cos(getPhi());
}
public double getY()
{
- return getRadius(getLayer())*Math.sin(getPhi());
+ return getDistanceToSensitive(getLayer())*Math.sin(getPhi());
}
public double getZ()
{
double cosTheta = Math.cos(getTheta());
- return getRadius(getLayer())*cosTheta/Math.sqrt(1-cosTheta*cosTheta);
+ return getDistanceToSensitive(getLayer())*cosTheta/Math.sqrt(1-cosTheta*cosTheta);
}
public void setIDDescription(IDDescriptor id)
GeomConverter/src/org/lcsim/geometry/segmentation
diff -u -r1.12 -r1.13
--- ProjectiveZPlane.java 13 Jul 2005 18:34:19 -0000 1.12
+++ ProjectiveZPlane.java 13 Jul 2005 23:35:57 -0000 1.13
@@ -29,54 +29,40 @@
{
super(node);
thetaBins = node.getAttribute("thetaBins").getIntValue();
- phiBins = node.getAttribute("phiBins").getIntValue();
-
- //thetaDim = (PI) / thetaBins;
- //phiDim = (PI*2) / phiBins;
- }
-
- //public CoordinateSystemType getCoordinateSystemType()
- //{
- // return CoordinateSystemType.GLOBAL;
- //}
+ phiBins = node.getAttribute("phiBins").getIntValue();
+ }
public double getPhi()
{
double phi = (Math.PI*2) * ((getValue(phiIndex)+0.5)/phiBins);
return phi;
- //double (getValue(phiIndex) + 0.5) * phiDim;
}
public double getTheta()
{
- return (Math.PI) * ((getValue(thetaIndex)+0.5)/thetaBins);
- //double (getValue(thetaIndex) + 0.5) * thetaDim;
+ return (Math.PI) * ((getValue(thetaIndex)+0.5)/thetaBins);
}
public double getX()
- {
- //return getRadius(getLayer())*Math.cos(getPhi());
+ {
return getSphericalRadius() * Math.cos(getPhi());
}
public double getY()
- {
- //return getRadius(getLayer())*Math.sin(getPhi());
+ {
return getSphericalRadius() * Math.sin(getPhi());
}
-
+
public double getZ()
{
- //double cosTheta = Math.cos(getTheta());
- //return getRadius(getLayer())*cosTheta/Math.sqrt(1-cosTheta*cosTheta);
/* getRadius() is misnamed here. Actually returning distance to layer center along Z. */
- return -Math.signum(getTheta()-PI/2) * getRadius(getLayer() );
+ return -Math.signum(getTheta()-PI/2) * getDistanceToSensitive(getLayer() );
}
private double getSphericalRadius()
{
return getZ() * tan(getTheta() );
- }
+ }
public void setIDDescription(IDDescriptor id)
{
GeomConverter/src/org/lcsim/geometry/segmentation
diff -u -r1.4 -r1.5
--- SegmentationBase.java 13 Jul 2005 07:07:15 -0000 1.4
+++ SegmentationBase.java 13 Jul 2005 23:35:57 -0000 1.5
@@ -45,12 +45,7 @@
SegmentationBase(Element e)
{
super(e);
- }
-
- //public CoordinateSystemType getCoordinateSystemType()
- //{
- // return CoordinateSystemType.UNDEFINED;
- //}
+ }
abstract public double getX();
@@ -91,7 +86,7 @@
/**
* FIXME: Should be renamed as it is actually returning the distance to the midpoint of the sensitive layer.
*/
- public double getRadius(int layer)
+ public double getDistanceToSensitive(int layer)
{
return detector.getDistanceToLayerSensorMid(layer);
}
@@ -101,7 +96,8 @@
return sqrt(getX() * getX() + getY() * getY() );
}
- public int getIndex(String field)
+ //public int getIndex(String field)
+ public int getValue(String field)
{
return decoder.getValue(field);
}
@@ -116,6 +112,11 @@
return decoder.getFieldName(index);
}
+ public int getFieldIndex(String name)
+ {
+ return decoder.getFieldIndex(name);
+ }
+
public int getFieldCount()
{
return values.length;
CVSspam 0.2.8