GeomConverter/src/org/lcsim/geometry/compact/converter/lcdd
diff -u -r1.2 -r1.3
--- PolyhedraEndcapCalorimeter.java 26 Aug 2005 19:02:49 -0000 1.2
+++ PolyhedraEndcapCalorimeter.java 27 Aug 2005 01:10:16 -0000 1.3
@@ -41,7 +41,7 @@
{
if ( sens == null)
{
- throw new IllegalArgumentException("PolyhedraBarrelCalorimeter's SD is null.");
+ throw new IllegalArgumentException("PolyhedraBarrelCalorimeter <" + getName() + " has null SD.");
}
/* local refs to LCDD objects */
@@ -64,9 +64,9 @@
/* polyhedra rotation so it lays "flat" */
double zrot = Math.PI / numsides;
- Rotation rot = new Rotation(detName + "_rotation");
- rot.setZ(zrot);
- define.addRotation(rot);
+ Rotation envelopeRotation = new Rotation(detName + "_rotation");
+ envelopeRotation.setZ(zrot);
+ define.addRotation(envelopeRotation);
/* total thickness of the detector */
double layersThickness = org.lcsim.geometry.layer.LayerFromCompactCnv.computeDetectorTotalThickness(node);
@@ -209,22 +209,31 @@
sectPosY = sectCenterRadius * cos(rotY);
}
- /* place envelope physical volume */
- boolean reflect = node.getAttribute("reflect").getBooleanValue();
- Rotation reflection = lcdd.getDefine().getRotation("reflect_rot");
-
+ /* place envelope physical volume */
PhysVol envelopePhysvol = new PhysVol(envelopeVolume);
envelopePhysvol.setZ(zmin + layersThickness/2);
envelopePhysvol.addPhysVolID("system",id);
+ envelopePhysvol.setRotation(envelopeRotation);
envelopePhysvol.addPhysVolID("barrel",1);
+
motherVolume.addPhysVol(envelopePhysvol);
/* place reflected physical volume */
+ boolean reflect = node.getAttribute("reflect").getBooleanValue();
if (reflect)
{
+ Rotation envelopeRotationReflect = define.getRotation("reflect_polyhedra_rot");
+ if ( envelopeRotationReflect == null )
+ {
+ envelopeRotationReflect = new Rotation("reflect_polyhedra_rot");
+ envelopeRotationReflect.setX(Math.PI);
+ envelopeRotationReflect.setZ(zrot);
+ define.addRotation(envelopeRotationReflect);
+ }
+
PhysVol physvol2 = new PhysVol(envelopeVolume);
physvol2.setZ(-zmin-layersThickness/2);
- physvol2.setRotation(reflection);
+ physvol2.setRotation(envelopeRotationReflect);
physvol2.addPhysVolID("system",id);
physvol2.addPhysVolID("barrel",2);
motherVolume.addPhysVol(physvol2);