GeomConverter/src/org/lcsim/detector/solids
diff -u -r1.2 -r1.3
--- Trap.java 30 Oct 2007 23:34:48 -0000 1.2
+++ Trap.java 30 Oct 2007 23:51:18 -0000 1.3
@@ -20,7 +20,7 @@
* <a href="http://www.lcsim.org/software/geant4/doxygen/html/classG4Trap.html">G4Trap</a>.
*
* @author Jeremy McCormick
- * @version $Id: Trap.java,v 1.2 2007/10/30 23:34:48 jeremy Exp $
+ * @version $Id: Trap.java,v 1.3 2007/10/30 23:51:18 jeremy Exp $
*/
public class Trap
@@ -37,6 +37,8 @@
double dx3;
double dx4;
double Talpha2;
+ double theta;
+ double phi;
double cubicVolume;
@@ -85,7 +87,10 @@
this.dx3=dx3;
this.dx4=dx4;
Talpha2=tan(alp2);
-
+
+ this.theta = theta;
+ this.phi = phi;
+
makePlanes();
}
else
@@ -105,10 +110,7 @@
planes[0]=makePlane(pt[0],pt[4],pt[5],pt[1]) ;
if (planes[0]==null)
{
- throw new RuntimeException();
- //G4cerr << "ERROR - G4Trap()::MakePlanes(): " << GetName() << G4endl;
- //G4Exception("G4Trap::MakePlanes()", "InvalidSetup", FatalException,
- // "Face at ~-Y not planar.");
+ throw new RuntimeException("Face at ~-Y not planar.");
}
// Top side with normal approx. +Y
@@ -116,10 +118,7 @@
planes[1]=makePlane(pt[2],pt[3],pt[7],pt[6]);
if (planes[1]==null)
{
- throw new RuntimeException();
- //G4cerr << "ERROR - G4Trap()::MakePlanes(): " << GetName() << G4endl;
- //G4Exception("G4Trap::MakePlanes()", "InvalidSetup", FatalException,
- // "Face at ~+Y not planar.");
+ throw new RuntimeException("Face at ~+Y not planar.");
}
// Front side with normal approx. -X
@@ -127,10 +126,7 @@
planes[2]=makePlane(pt[0],pt[2],pt[6],pt[4]);
if (planes[2]==null)
{
- throw new RuntimeException();
- //G4cerr << "ERROR - G4Trap()::MakePlanes(): " << GetName() << G4endl;
- //G4Exception("G4Trap::MakePlanes()", "InvalidSetup", FatalException,
- // "Face at ~-X not planar.");
+ throw new RuntimeException("Face at ~-X not planar.");
}
// Back side iwth normal approx. +X
@@ -138,10 +134,7 @@
planes[3]= makePlane(pt[1],pt[5],pt[7],pt[3]);
if (planes[3]==null)
{
- throw new RuntimeException();
- //G4cerr << "ERROR - G4Trap()::MakePlanes(): " << GetName() << G4endl;
- //G4Exception("G4Trap::MakePlanes()", "InvalidSetup", FatalException,
- // "Face at ~+X not planar");
+ throw new RuntimeException("Face at ~+X not planar");
}
return good;
@@ -325,4 +318,14 @@
{
return Talpha2;
}
+
+ public double getTheta()
+ {
+ return theta;
+ }
+
+ public double getPhi()
+ {
+ return phi;
+ }
}
\ No newline at end of file