lcsim/src/org/lcsim/contrib/onoprien/tracking/geom/sensortypes
diff -u -r1.1 -r1.2
--- WedgeSideParallel.java 25 Sep 2007 03:16:34 -0000 1.1
+++ WedgeSideParallel.java 8 Oct 2007 21:36:02 -0000 1.2
@@ -10,7 +10,7 @@
/**
*
* @author D.Onoprienko
- * @version $Id: WedgeSideParallel.java,v 1.1 2007/09/25 03:16:34 onoprien Exp $
+ * @version $Id: WedgeSideParallel.java,v 1.2 2007/10/08 21:36:02 onoprien Exp $
*/
public class WedgeSideParallel implements SensorType {
@@ -21,7 +21,7 @@
_thickness = thickness;
_pitch = pitch;
_tan = Math.tan(angle/2.);
- _cotan = 1./_tan;
+ _cotan2 = 1./Math.tan(angle);
_side = ((longBase - shortBase)/2.)/Math.sin(angle/2.);
_maxID = (int) Math.floor((longBase * Math.cos(angle/2.))/pitch);
_uCorner = shortBase * Math.cos(angle/2.);
@@ -35,7 +35,7 @@
_thickness = thickness;
_side = side;
_tan = Math.tan(angle/2.);
- _cotan = 1./_tan;
+ _cotan2 = 1./Math.tan(angle);
_pitch = pitch;
_maxID = (int) Math.floor(((rMin+side)*Math.sin(angle))/pitch);
_uCorner = rMin * Math.sin(angle);
@@ -64,11 +64,11 @@
if (u < _uCorner) {
v = _side/2. - u * _tan;
} else {
- v = ((_side - u * _tan) + (u * _cotan + _vConst) )/2.;
+ v = ((_side - u * _tan) + (u * _cotan2 + _vConst) )/2.;
}
} else {
if (u < 0.) {
- v = (_side + u * _tan - u * _cotan )/2.;
+ v = (_side + u * _tan - u * _cotan2 )/2.;
} else {
v = _side/2. + u * _tan;
}
@@ -89,15 +89,16 @@
if (u < _uCorner) {
length = _side;
} else {
- length = (_side - u * _tan) - (u * _cotan + _vConst);
+ length = (_side - u * _tan) - (u * _cotan2 + _vConst);
}
} else {
if (u < 0.) {
- length = (_side + u * _tan) + u * _cotan ;
+ length = (_side + u * _tan) + u * _cotan2 ;
} else {
length = _side;
}
}
+ if (length < 0.) System.out.println("U: "+u+" left "+_left);
return new BasicHep3Vector(_pitch, length, _thickness);
}
@@ -145,7 +146,7 @@
private double _pitch;
private double _side;
private double _tan;
- private double _cotan;
+ private double _cotan2;
private double _uCorner;
private double _vConst;