6 modified files
lcsim/src/org/lcsim/contrib/onoprien/vsegment/geom
diff -u -r1.2 -r1.3
--- SensorType.java 30 Sep 2008 04:41:51 -0000 1.2
+++ SensorType.java 3 Oct 2008 04:17:11 -0000 1.3
@@ -12,7 +12,7 @@
* and its segmentation into channels (strips or pixels in case of silicon sensors).
*
* @author D.Onoprienko
- * @version $Id: SensorType.java,v 1.2 2008/09/30 04:41:51 onoprien Exp $
+ * @version $Id: SensorType.java,v 1.3 2008/10/03 04:17:11 onoprien Exp $
*/
public interface SensorType {
@@ -65,4 +65,10 @@
*/
List<Integer> getNeighbors(int channelID);
+ /**
+ * Returns a list of vectors that correspond to corners of the sensor, in sensor reference frame.
+ * Useful for drawing sensors and event display.
+ */
+ List<Hep3Vector> getCorners();
+
}
lcsim/src/org/lcsim/contrib/onoprien/vsegment/geom/segmenter
diff -u -r1.2 -r1.3
--- DiskToWedgesSegmenter.java 30 Sep 2008 04:41:51 -0000 1.2
+++ DiskToWedgesSegmenter.java 3 Oct 2008 04:17:12 -0000 1.3
@@ -24,7 +24,7 @@
* Simplistic <tt>Segmenter</tt> that tiles a single disk with wedges.
*
* @author D. Onoprienko
- * @version $Id: DiskToWedgesSegmenter.java,v 1.2 2008/09/30 04:41:51 onoprien Exp $
+ * @version $Id: DiskToWedgesSegmenter.java,v 1.3 2008/10/03 04:17:12 onoprien Exp $
*/
public class DiskToWedgesSegmenter extends RegionSegmenter {
@@ -42,11 +42,8 @@
Tube solid = (Tube) gInfo.getLogicalVolume().getSolid();
_rMiddleMin = solid.getInnerRadius();
double rMax = solid.getOuterRadius();
- double halfThickness = solid.getZHalfLength();
_z = gInfo.getPosition().z();
- _zMin = _z - halfThickness;
- _zMax = _z + halfThickness;
_deltaPhi = (2.*Math.PI)/nPhiSlices;
_rMin = _rMiddleMin/Math.cos(_deltaPhi/2.);
@@ -59,9 +56,11 @@
}
_rotation = new Rotation3D[_nPhi];
+ _u = new ConstHep3Vector[_nPhi];
+ _v = new ConstHep3Vector[_nPhi];
for (int indexPhi=0; indexPhi < _nPhi; indexPhi++ ) {
double angle = (left) ? _deltaPhi * (indexPhi + 1) - Math.PI/2. : _deltaPhi * indexPhi - Math.PI/2.;
- _rotation[indexPhi] = Rotation3D.passiveZRotation(angle);
+ _rotation[indexPhi] = Rotation3D.passiveZRotation(-angle);
_u[indexPhi] = new ConstHep3Vector(_rotation[indexPhi].rotated(ConstHep3Vector.V100));
_v[indexPhi] = new ConstHep3Vector(_rotation[indexPhi].rotated(ConstHep3Vector.V010));
}
@@ -75,8 +74,6 @@
double[] pos = hit.getPoint();
- if (pos[2]<_zMin || pos[2]>_zMax) return new int[0];
-
double r = Math.hypot(pos[0],pos[1]);
double phi = Math.atan2(pos[1], pos[0]);
phi = (phi > 0.) ? phi : phi + Math.PI * 2.;
@@ -127,8 +124,6 @@
int _nRadial;
double _z;
- double _zMin;
- double _zMax;
double _rMin;
double _rMiddleMin;
lcsim/src/org/lcsim/contrib/onoprien/vsegment/geom/sensortype
diff -u -r1.2 -r1.3
--- Hexagon.java 30 Sep 2008 04:41:51 -0000 1.2
+++ Hexagon.java 3 Oct 2008 04:17:12 -0000 1.3
@@ -1,13 +1,13 @@
package org.lcsim.contrib.onoprien.vsegment.geom.sensortype;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.*;
import hep.physics.vec.BasicHep3Vector;
import hep.physics.vec.Hep3Vector;
import org.lcsim.contrib.onoprien.vsegment.geom.SensorType;
import org.lcsim.contrib.onoprien.vsegment.hit.ITrackerHit;
+import org.lcsim.contrib.onoprien.vsegment.transform.ConstHep3Vector;
import org.lcsim.contrib.onoprien.vsegment.transform.IRefFrame;
/**
@@ -19,7 +19,7 @@
* have zero dimension in W direction.
*
* @author D.Onoprienko
- * @version $Id: Hexagon.java,v 1.2 2008/09/30 04:41:51 onoprien Exp $
+ * @version $Id: Hexagon.java,v 1.3 2008/10/03 04:17:12 onoprien Exp $
*/
public class Hexagon implements SensorType {
@@ -120,6 +120,21 @@
return out;
}
+ /**
+ * Returns a list of vectors that correspond to corners of the sensor, in sensor reference frame.
+ * Useful for drawing sensors and event display.
+ */
+ public List<Hep3Vector> getCorners() {
+ double a = _side/2.;
+ double b = _side/Math.sqrt(2.);
+ return Arrays.asList(new Hep3Vector[]{new ConstHep3Vector(-b, -a, 0.),
+ new ConstHep3Vector(-b, a, 0.),
+ new ConstHep3Vector(0., a+b, 0.),
+ new ConstHep3Vector( b, a, 0.),
+ new ConstHep3Vector( b, -a, 0.),
+ new ConstHep3Vector(0., -a-b, 0.)});
+ }
+
// -- Private parts : ---------------------------------------------------------
protected double _side;
lcsim/src/org/lcsim/contrib/onoprien/vsegment/geom/sensortype
diff -u -r1.3 -r1.4
--- Rectangle.java 30 Sep 2008 04:41:51 -0000 1.3
+++ Rectangle.java 3 Oct 2008 04:17:12 -0000 1.4
@@ -1,13 +1,13 @@
package org.lcsim.contrib.onoprien.vsegment.geom.sensortype;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.*;
import hep.physics.vec.BasicHep3Vector;
import hep.physics.vec.Hep3Vector;
import org.lcsim.contrib.onoprien.vsegment.geom.SensorType;
import org.lcsim.contrib.onoprien.vsegment.hit.ITrackerHit;
+import org.lcsim.contrib.onoprien.vsegment.transform.ConstHep3Vector;
import org.lcsim.contrib.onoprien.vsegment.transform.IRefFrame;
/**
@@ -18,7 +18,7 @@
* have zero dimension in W direction.
*
* @author D.Onoprienko
- * @version $Id: Rectangle.java,v 1.3 2008/09/30 04:41:51 onoprien Exp $
+ * @version $Id: Rectangle.java,v 1.4 2008/10/03 04:17:12 onoprien Exp $
*/
public class Rectangle implements SensorType {
@@ -262,6 +262,19 @@
return out;
}
+ /**
+ * Returns a list of vectors that correspond to corners of the sensor, in sensor reference frame.
+ * Useful for drawing sensors and event display.
+ */
+ public List<Hep3Vector> getCorners() {
+ double uHigh = _uLow + _pitch*_nDivU;
+ double vHigh = _vLow + _length*_nDivV;
+ return Arrays.asList(new Hep3Vector[]{new ConstHep3Vector(_uLow, _vLow, 0.),
+ new ConstHep3Vector(_uLow, vHigh, 0.),
+ new ConstHep3Vector(uHigh, vHigh, 0.),
+ new ConstHep3Vector(uHigh, _vLow, 0.)});
+ }
+
// -- Private parts : ---------------------------------------------------------
protected double _uLow;
lcsim/src/org/lcsim/contrib/onoprien/vsegment/geom/sensortype
diff -u -r1.2 -r1.3
--- Ring.java 30 Sep 2008 04:41:51 -0000 1.2
+++ Ring.java 3 Oct 2008 04:17:12 -0000 1.3
@@ -5,6 +5,8 @@
import hep.physics.vec.BasicHep3Vector;
import hep.physics.vec.Hep3Vector;
+import org.lcsim.contrib.onoprien.vsegment.transform.ConstHep3Vector;
+
/**
* Class to represent a disk sensor divided into rectangular strips or pixels.
* Reference frame origin is at the center of the disk in X and Y.
@@ -17,7 +19,7 @@
* center of the channel (strip or pixel) to which the point belongs is ouside the ring.
*
* @author D.Onoprienko
- * @version $Id: Ring.java,v 1.2 2008/09/30 04:41:51 onoprien Exp $
+ * @version $Id: Ring.java,v 1.3 2008/10/03 04:17:12 onoprien Exp $
*/
public class Ring extends Rectangle {
@@ -80,6 +82,17 @@
double r = getChannelPosition(channelID).magnitude();
return r > _rMin && r < _rMax;
}
+
+ /**
+ * Returns a list of vectors that correspond to corners of the sensor, in sensor reference frame.
+ * Useful for drawing sensors and event display.
+ */
+ public List<Hep3Vector> getCorners() {
+ return Arrays.asList(new Hep3Vector[]{new ConstHep3Vector(-_rMax,-_rMax,0.),
+ new ConstHep3Vector(-_rMax,_rMax,0.),
+ new ConstHep3Vector(_rMax,_rMax,0.),
+ new ConstHep3Vector(_rMax,-_rMax,0.)});
+ }
// -- Private parts : ---------------------------------------------------------
lcsim/src/org/lcsim/contrib/onoprien/vsegment/geom/sensortype
diff -u -r1.2 -r1.3
--- WedgeSideParallel.java 30 Sep 2008 04:41:51 -0000 1.2
+++ WedgeSideParallel.java 3 Oct 2008 04:17:12 -0000 1.3
@@ -7,6 +7,7 @@
import org.lcsim.contrib.onoprien.vsegment.geom.SensorType;
import org.lcsim.contrib.onoprien.vsegment.hit.ITrackerHit;
+import org.lcsim.contrib.onoprien.vsegment.transform.ConstHep3Vector;
import org.lcsim.contrib.onoprien.vsegment.transform.IRefFrame;
/**
@@ -17,7 +18,7 @@
* have zero dimension in W direction.
*
* @author D.Onoprienko
- * @version $Id: WedgeSideParallel.java,v 1.2 2008/09/30 04:41:51 onoprien Exp $
+ * @version $Id: WedgeSideParallel.java,v 1.3 2008/10/03 04:17:12 onoprien Exp $
*/
public class WedgeSideParallel implements SensorType {
@@ -157,19 +158,19 @@
* Returns an array of (U,V) coordinates of corners of the sensor.
* Useful for event display. The dimensions of the returned array are [4][2].
*/
- public double[][] getCorners() {
- double[][] out = new double[4][2];
- out[0] = new double[]{0.,0.};
+ public List<Hep3Vector> getCorners() {
+ ArrayList<Hep3Vector> out = new ArrayList<Hep3Vector>(4);
+ out.add(ConstHep3Vector.V000);
if (_left) {
- out[1] = new double[]{0.,_side};
+ out.add(new ConstHep3Vector(0.,_side,0.));
double u = (_side - _vConst) * Math.sin(2.*Math.atan(_tan));
- out[2] = new double[]{u, _side - u * _tan};
- out[3] = new double[]{_uCorner, - _uCorner * _tan};
- } else {
+ out.add(new ConstHep3Vector(u, _side - u * _tan, 0.));
+ out.add(new ConstHep3Vector(_uCorner, - _uCorner * _tan, 0.));
+ } else {;
double u = - _side * Math.sin(2.*Math.atan(_tan));
- out[1] = new double[]{u, - u * _cotan2};
- out[2] = new double[]{_uCorner, _side + _uCorner * _tan};
- out[3] = new double[]{_uCorner, _uCorner * _tan};
+ out.add(new ConstHep3Vector(u, - u * _cotan2, 0.));
+ out.add(new ConstHep3Vector(_uCorner, _side + _uCorner * _tan, 0.));
+ out.add(new ConstHep3Vector(_uCorner, _uCorner * _tan, 0.));
}
return out;
}
CVSspam 0.2.8