Commit in projects/lcsim/trunk/detector-framework on MAIN
pom.xml+53109 -> 3110
src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTestRunTracker2014.java+224-533109 -> 3110
src/test/resources/org/lcsim/geometry/subdetector/HPSTestRunTracker2014.xml+2-13109 -> 3110
+231-54
3 modified files
new test run geom in progress.

projects/lcsim/trunk/detector-framework
pom.xml 3109 -> 3110
--- projects/lcsim/trunk/detector-framework/pom.xml	2014-05-07 23:35:24 UTC (rev 3109)
+++ projects/lcsim/trunk/detector-framework/pom.xml	2014-05-08 00:13:45 UTC (rev 3110)
@@ -89,6 +89,11 @@
                 </exclusion>
             </exclusions>
         </dependency>
+        <dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>commons-math3</artifactId>
+			<version>3.0</version>
+		</dependency>
     </dependencies>
     
 </project>

projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd
HPSTestRunTracker2014.java 3109 -> 3110
--- projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTestRunTracker2014.java	2014-05-07 23:35:24 UTC (rev 3109)
+++ projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTestRunTracker2014.java	2014-05-08 00:13:45 UTC (rev 3110)
@@ -6,6 +6,7 @@
 import hep.physics.vec.Hep3Vector;
 import hep.physics.vec.VecOp;
 
+
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -28,6 +29,7 @@
 import org.lcsim.geometry.compact.converter.lcdd.util.SensitiveDetector;
 import org.lcsim.geometry.compact.converter.lcdd.util.Volume;
 
+
 /**
  * 
  * Convert an SiTrackerBarrel subdetector to the LCDD format.
@@ -100,6 +102,7 @@
 	
 	private final Hep3Vector ball_pos_module1_support_plate_local = new BasicHep3Vector(25.0, 661.0, pedestal_height_L1-support_plate_pocket_depth);
 	private final Hep3Vector vee_pos_module1_support_plate_local = new BasicHep3Vector(95.0, 661.0, pedestal_height_L1-support_plate_pocket_depth);
+	//private final Hep3Vector flat_pos_module1_support_plate_local = new BasicHep3Vector(60.0, 655.10, pedestal_height_L1-support_plate_pocket_depth);
 	private final Hep3Vector flat_pos_module1_support_plate_local = new BasicHep3Vector(60.0, 667.10, pedestal_height_L1-support_plate_pocket_depth);
 
 	private final Hep3Vector ball_pos_module2_support_plate_local = new BasicHep3Vector(25.0, 561.0, pedestal_height_L2-support_plate_pocket_depth);
@@ -184,6 +187,7 @@
 		trackingWrap.vol = trackingVolume;
 	
 		// Surveyed position of the base plate in the JLab/tracking volume
+		// Use edges of plate instead of real survey balls
 		Hep3Vector ball_pos_base_plate = new BasicHep3Vector(-1*this.base_plate_width/2.0, -1.0*this.base_height/2.0+this.base_plate_thickness,this.base_length/2.0);
 		Hep3Vector vee_pos_base_plate = new BasicHep3Vector(ball_pos_base_plate.x()+this.base_plate_width,ball_pos_base_plate.y(),ball_pos_base_plate.z());
 		Hep3Vector flat_pos_base_plate = new BasicHep3Vector(ball_pos_base_plate.x(),ball_pos_base_plate.y(),ball_pos_base_plate.z()-this.base_plate_length);
@@ -193,7 +197,8 @@
 				
 		
 		
-		
+		org.apache.commons.math3.geometry.euclidean.threed.Rotation dummyrot = new org.apache.commons.math3.geometry.euclidean.threed.Rotation(3.0,1.0,1.0,1.0,true);
+
 	
 		
 		
@@ -204,8 +209,8 @@
 	
 	
 	private void makeBase(VolWrapper trackingWrap,
-				Hep3Vector ball_pos_base_plate, Hep3Vector vee_pos_base_plate,
-				Hep3Vector flat_pos_base_plate, LCDD lcdd, SensitiveDetector sens) throws JDOMException {
+				Hep3Vector ball_pos_base_plate, Hep3Vector vee_pos_base_plate, Hep3Vector flat_pos_base_plate, 
+				LCDD lcdd, SensitiveDetector sens) throws JDOMException {
 		
 		
 		if(_debug) {
@@ -221,12 +226,22 @@
 		
 		// create the coordinate system of the base plate
 		CoordSysDef base_plate_coord = new CoordSysDef(ball_pos_base_plate, vee_pos_base_plate, flat_pos_base_plate);		
-		Transform3D trans_base_plate_to_base = getTransformation(base_plate_coord);
+		Transform3D trans_base_plate_to_tracking = getTransformation(base_plate_coord);
+		
+		
 
+		if(_debug) {
+			print(String.format("ball_pos_base_plate %s", ball_pos_base_plate.toString()));
+			print(String.format("vee_pos_base_plate %s", vee_pos_base_plate.toString()));
+			print(String.format("flat_pos_base_plate %s", flat_pos_base_plate.toString()));
+			print(String.format("base_plate_coord:\n%s", base_plate_coord.toString()));
+		}
 		
+		
+		
 		// Find distance to center in the local coordinate system 
 		Hep3Vector box_center_base_local = new BasicHep3Vector(base_width/2.0, base_length/2.0, base_height/2.0 - this.base_plate_thickness);
-		Hep3Vector box_center_base = trans_base_plate_to_base.transformed(box_center_base_local);
+		Hep3Vector box_center_base = trans_base_plate_to_tracking.transformed(box_center_base_local);
 				
 		print(String.format("box_center_base_local  %s", box_center_base_local.toString()));
 		print(String.format("box_center_base        %s", box_center_base.toString()));
@@ -246,23 +261,92 @@
 		baseWrap.name = volName;
 		baseWrap.pos_vol = pos;
 		baseWrap.rot_vol = rot;
+		baseWrap.coord = base_plate_coord;
 		
 		
 		
-		
-		
 		// create the base plate inside the support box 
 		makeBasePlate(baseWrap, ball_pos_base_plate, vee_pos_base_plate, flat_pos_base_plate, lcdd, sens );
 		
 	
+		if(_debug) {
+			print("Make c-support positions on base plate for bottom");
+		}
 		
 		// create the box around the support plate w.r.t. base plate 
-		makeSupport("bottom",baseWrap, lcdd, sens );
+		// ball position is C-support pin position on electron side
+		// vee position is C-support pin position on positron side
+		// flat position is a randomly chosen point perpendicular to ball to vee vector starting from 
+		// the ball position and offset 10mm at same vertical position. 
+		final double ball_pos_csup_x = 385.0 - 271.05;
+		final double ball_pos_csup_y = 121.62;
+		final double ball_pos_csup_z = 0.0;
+		final double vee_pos_csup_x = 385.0 - 51.15;
+		final double vee_pos_csup_y = 115.02;
+		final double vee_pos_csup_z = 0.0;
+		// find the arbitrary flat
+		// this is the rotation angle around the local w of the c-support
+		final double rot_angle_local_w = Math.asin( (vee_pos_csup_y - ball_pos_csup_y)/(vee_pos_csup_x - ball_pos_csup_x));
+		final double flat_pos_csup_x = ball_pos_csup_x - 10.0 * Math.sin(rot_angle_local_w);
+		final double flat_pos_csup_y = ball_pos_csup_y + 10.0 * Math.cos(rot_angle_local_w);
+		final double flat_pos_csup_z = 0.0;
+		
+		Hep3Vector ball_pos_csup = new BasicHep3Vector(ball_pos_csup_x,ball_pos_csup_y,ball_pos_csup_z);
+		Hep3Vector vee_pos_csup = new BasicHep3Vector(vee_pos_csup_x,vee_pos_csup_y,vee_pos_csup_z);
+		Hep3Vector flat_pos_csup = new BasicHep3Vector(flat_pos_csup_x,flat_pos_csup_y,flat_pos_csup_z);
+		
+//		Hep3Vector ball_pos_support_plate = new BasicHep3Vector(-1.0 * support_width/2.0, -1.0 * support_height/2.0 + support_plate_bottom_height , support_length/2.0);
+//		Hep3Vector vee_pos_support_plate = new BasicHep3Vector(ball_pos_support_plate.x() + support_plate_bottom_width, ball_pos_support_plate.y(),ball_pos_support_plate.z());
+//		Hep3Vector flat_pos_support_plate = new BasicHep3Vector(ball_pos_support_plate.x(), ball_pos_support_plate.y(),ball_pos_support_plate.z() - support_plate_bottom_length);
+		
+		if(_debug) {
+			print(String.format("rot_angle_local_w %f", rot_angle_local_w));
+			print(String.format("ball_pos_csup %s", ball_pos_csup.toString()));
+			print(String.format("vee_pos_csup %s", vee_pos_csup.toString()));
+			print(String.format("flat_pos_csup %s", flat_pos_csup.toString()));
+		}
+		
+		makeSupport("bottom", baseWrap, ball_pos_csup, vee_pos_csup, flat_pos_csup, lcdd, sens );
 				
 		
+		//baseVolume.setVisAttributes(lcdd.getVisAttributes("BasePlateVis"));
 		
-		//baseVolume.setVisAttributes(lcdd.getVisAttributes("BaseVis"));
 		
+		
+/*
+		
+		volName = "supportplatetest";
+		Box bbox = new Box(volName + "Box", support_plate_bottom_width, support_plate_bottom_height , support_plate_bottom_length);
+		lcdd.add(bbox);
+		Volume supportPlateVolume = new Volume(volName + "_volume", bbox, lcdd.getMaterial("Aluminum"));
+		pos = new Position(volName + "_position",0,0,0);
+		rot = new Rotation(volName + "_rotation",0,0,0); 
+		lcdd.add(pos);
+		lcdd.add(rot);
+		//PhysVol supportPlatePV = new PhysVol(supportPlateVolume);// (supportPlateVolume, supportVolume, pos, rot);
+		PhysVol supportPlatePV = new PhysVol(supportPlateVolume, baseWrap.vol, pos, rot);
+		
+		
+
+		volName = "supportplatetest2";
+		bbox = new Box(volName + "Box", support_plate_bottom_width/2, support_plate_bottom_height/2 , support_plate_bottom_length/2);
+		lcdd.add(bbox);
+		Volume supportPlateVolume2 = new Volume(volName + "_volume", bbox, lcdd.getMaterial("Aluminum"));
+		pos = new Position(volName + "_position",0,0,0);
+		rot = new Rotation(volName + "_rotation",0,0,0); 
+		lcdd.add(pos);
+		lcdd.add(rot);
+		PhysVol supportPlatePV2 = new PhysVol(supportPlateVolume2, supportPlateVolume, pos, rot);
+		lcdd.add(supportPlateVolume2);
+		
+		lcdd.add(supportPlateVolume);
+		
+		*/
+		
+		
+		
+		
+		
 		lcdd.add(baseVolume);
 		
 
@@ -272,9 +356,17 @@
 	
 	
 	
-	private void makeSupport(String name, VolWrapper baseWrap, LCDD lcdd, SensitiveDetector sens) throws JDOMException {
+	private void makeSupport(String name, VolWrapper baseWrap, 
+							Hep3Vector ball_pos_csup, Hep3Vector vee_pos_csup, Hep3Vector flat_pos_csup,
+							LCDD lcdd, SensitiveDetector sens) throws JDOMException {
 		
 
+		if(_debug) {
+			print("--- makeSupport for " + name + " half ----");
+			
+		}
+		
+		
 		double support_length = -99999.9;
 		double support_width = -99999.9;
 		double support_height = -99999.9;
@@ -296,42 +388,116 @@
 		}
 		
 		
+		// create the coordinate system of the c-support
+		CoordSysDef csup_coord = new CoordSysDef(ball_pos_csup, vee_pos_csup, flat_pos_csup);		
+		Transform3D trans_csup_to_base_plate = getTransformation(csup_coord);
+		Transform3D trans_base_plate_to_base = getTransformation(baseWrap.coord);
+		if(_debug) {
+			print(String.format("ball_pos_csup %s", ball_pos_csup.toString()));
+			print(String.format("vee_pos_csup  %s", vee_pos_csup.toString()));
+			print(String.format("flat_pos_csup %s", flat_pos_csup.toString()));
+			print(String.format("trans_csup_to_base_plate:\n%s", trans_csup_to_base_plate.toString()));
+			print(String.format("trans_base_plate_to_base:\n%s", trans_base_plate_to_base.toString()));
+		}
+				
 		
+		// Create the support box
+		
+		Hep3Vector box_dim_local = new BasicHep3Vector(support_width, support_length, support_height);
+		Hep3Vector box_dim_base_plate = trans_csup_to_base_plate.rotated(box_dim_local);
+		Hep3Vector box_dim = trans_base_plate_to_base.rotated(box_dim_base_plate);
+
+		if(_debug) {
+			print(String.format("box_dim_local      %s", box_dim_local.toString()));
+			print(String.format("box_dim_base_plate %s", box_dim_base_plate.toString()));
+			print(String.format("box_dim            %s", box_dim.toString()));
+		}
+
+		// Place the support box wrt to the c-support coordinate system
+		
+		//Find rotation around x-axis
+		Hep3Vector u = csup_coord.u;
+		
+		// Find distance to center
+		Hep3Vector box_center_support_local = new BasicHep3Vector(support_plate_bottom_width/2.0, support_plate_bottom_length/2.0, -1.0 * support_plate_bottom_height/2.0);
+		Hep3Vector box_center_support_base_plate = trans_csup_to_base_plate.transformed(box_center_support_local);
+		
+		print(String.format("box_center_support_local      %s", box_center_support_local.toString()));
+		print(String.format("box_center_support_base_plate %s", box_center_support_base_plate.toString()));
+
+		// Find the equivalent lcdd rotation angles from the coordinate system
+		
+		//Hep3Vector lcdd_rot_angles = new BasicHep3Vector(Math.PI,-0.1,0); 
+
+		// find the displacement from the rotation around an arbitrary point in local coordinates
+		//Hep3Vector box_center_module_coord_rot = getRotationDisplacement(ball_pos_halfmod, box_center_module_coord, lcdd_rot_angles);
+		
+		// find the position of the center in the module box
+		//Hep3Vector box_center_sub = VecOp.sub(box_center_module_coord_rot, moduleWrap.center);
+		//Hep3Vector box_center = transModuleToSupportCoord.rotated(box_center_sub);
+
+		// fix the rotation
+		//Hep3Vector lcdd_rot_angles_support = transModuleToSupportCoord.rotated(lcdd_rot_angles);
+
+		
+		// create the lcdd tags
+		//Position pos = new Position(halfModuleName + "_position",box_center.x(), box_center.y(), box_center.z());
+		//Rotation rot = new Rotation(halfModuleName + "_rotation",lcdd_rot_angles_support.x(), lcdd_rot_angles_support.y(), lcdd_rot_angles_support.z());
+		//lcdd.add(pos);
+		//lcdd.add(rot);
+		
+		
+		Hep3Vector box_center_support = trans_base_plate_to_base.transformed(box_center_support_base_plate);
+		
+		print(String.format("box_center_support            %s", box_center_support.toString()));
+		
 		String volName = "support_" + name;
-		Box box = new Box(volName + "Box", support_width, support_height , support_length);
+		Box box = new Box(volName + "Box", box_dim.x(), box_dim.y(), box_dim.z());
 		lcdd.add(box);
+
 		Volume supportVolume = new Volume(volName + "_volume", box, lcdd.getMaterial("Vacuum"));
 
-		Position pos = new Position( volName + "_position", 0,0,0); 
-		Rotation rot = new Rotation( volName + "_rotation",0,0,0);
+
+	
+		
+		Position pos = new Position(volName + "_position",box_center_support.x(), box_center_support.y(), box_center_support.z());
+		//Find LCDD rotation angles from coordinate system unit vectors
+		Hep3Vector lcdd_rot_angles = new BasicHep3Vector(0,0,0); //getLCDDRotation(support_plate_coord);
+		Rotation rot = new Rotation(volName + "_rotation",lcdd_rot_angles.x(), lcdd_rot_angles.y(), lcdd_rot_angles.z());
 		lcdd.add(pos);
 		lcdd.add(rot);
 		
 		PhysVol supportPV = new PhysVol(supportVolume, baseWrap.vol, pos, rot);
-		
+
 		VolWrapper supportWrap = new VolWrapper();
 		supportWrap.vol = supportVolume;
 		supportWrap.name = volName;
+		supportWrap.center = box_center_support_local;
 		supportWrap.pos_vol = pos;
 		supportWrap.rot_vol = rot;
 		supportWrap.mother = baseWrap;
+		supportWrap.coord = csup_coord;
 		baseWrap.daughters.add(supportWrap);
-		
 
 		
-		
-		// create the support plate inside the support box at the "bottom"
-		// survey points are: 
-		// ball: corner of the hinge end at the surface on the positron side
-		// vee: corner of the hinge end at the surface on the electron side
+		// create the support plate inside the support box coordinate system
+		// survey points on the support plate are: 
+		// ball: corner of the hinge end at the surface on the electron side
+		// vee: corner of the hinge end at the surface on the positron side
 		// flat: middle of plate at upstream end at the surface
 		
-		Hep3Vector ball_pos_support_plate = new BasicHep3Vector(-1.0 * support_width/2.0, -1.0 * support_height/2.0 + support_plate_bottom_height , support_length/2.0);
+		Hep3Vector ball_pos_support_plate = new BasicHep3Vector(0.0, -1.0 * support_height/2.0 + support_plate_bottom_height , support_length/2.0);
 		Hep3Vector vee_pos_support_plate = new BasicHep3Vector(ball_pos_support_plate.x() + support_plate_bottom_width, ball_pos_support_plate.y(),ball_pos_support_plate.z());
 		Hep3Vector flat_pos_support_plate = new BasicHep3Vector(ball_pos_support_plate.x(), ball_pos_support_plate.y(),ball_pos_support_plate.z() - support_plate_bottom_length);
+		//Hep3Vector ball_pos_support_plate = new BasicHep3Vector(-1.0 * support_width/2.0, -1.0 * support_height/2.0 + support_plate_bottom_height , support_length/2.0);
+		//Hep3Vector vee_pos_support_plate = new BasicHep3Vector(ball_pos_support_plate.x() + support_plate_bottom_width, ball_pos_support_plate.y(),ball_pos_support_plate.z());
+		//Hep3Vector flat_pos_support_plate = new BasicHep3Vector(ball_pos_support_plate.x(), ball_pos_support_plate.y(),ball_pos_support_plate.z() - support_plate_bottom_length);
 		
 		makeSupportPlate(supportWrap, ball_pos_support_plate, vee_pos_support_plate, flat_pos_support_plate, lcdd, sens );
+
 		
+			
+		
 		// create the module from positions of module ball, vee and flat w.r.t. support plate survey points
 
 		// create the coordinate system of the support plate
@@ -342,7 +508,7 @@
 			print("Make modules on support plate");
 		}
 		
-		for(int ilayer = 1; ilayer <=5; ++ilayer) {
+		for(int ilayer = 1; ilayer <=1; ++ilayer) {
 
 			String layerName = String.format("L%db", ilayer);
 			
@@ -409,10 +575,12 @@
 		
 		
 		// add support volume to lcdd
+		supportVolume.setVisAttributes(lcdd.getVisAttributes("SupportVolumeVis"));
 		lcdd.add(supportVolume);
-		
 
+				
 
+
 		
 	/*
 				
@@ -476,7 +644,7 @@
 		
 
 
-		String volName = "supportplate";
+		String volName = supportWrap.name + "_supportplate";
 		Box box = new Box(volName + "Box", support_plate_bottom_width, support_plate_bottom_height , support_plate_bottom_length);
 		lcdd.add(box);
 		Volume supportPlateVolume = new Volume(volName + "_volume", box, lcdd.getMaterial("Aluminum"));
@@ -485,10 +653,10 @@
 		// create the coordinate system
 		CoordSysDef support_plate_coord = new CoordSysDef(ball_pos_support_plate, vee_pos_support_plate, flat_pos_support_plate);
 		
-		print(String.format("support_plate ball %s", ball_pos_support_plate.toString()));
-		print(String.format("support_plate vee  %s", vee_pos_support_plate.toString()));
-		print(String.format("support_plate flat %s", flat_pos_support_plate.toString()));
-		print(String.format("support_plate:\n%s", support_plate_coord.toString()));
+		print(String.format("ball_pos_support_plate %s", ball_pos_support_plate.toString()));
+		print(String.format("vee_pos_support_plate  %s", vee_pos_support_plate.toString()));
+		print(String.format("flat_pos_support_plate %s", flat_pos_support_plate.toString()));
+		print(String.format("support_plate_coord:\n%s", support_plate_coord.toString()));
 
 		// Find distance to center in the local coordinate system 
 		Transform3D trans_support_plate_to_support = getTransformation(support_plate_coord);
@@ -505,9 +673,17 @@
 		Rotation rot = new Rotation(volName + "_rotation",lcdd_rot_angles.x(), lcdd_rot_angles.y(), lcdd_rot_angles.z());
 		lcdd.add(pos);
 		lcdd.add(rot);
+
+		print ("supportVolume solidref: " + supportWrap.vol.getSolidRef());
+		print ("supportVolume getVolumeName: " + supportWrap.vol.getVolumeName());
+		print ("supportPlateVolume solidref: " + supportPlateVolume.getSolidRef());
+		print ("supportPlateVolume getVolumeName: " + supportPlateVolume.getVolumeName());
+		//print("supportPlateVolume: " + supportPlateVolume.);
+		//print("supportWrap.vol: " + supportWrap.vol.toString());
+		//PhysVol supportPlatePV = new PhysVol(supportPlateVolume);//, supportWrap.vol, pos, rot);
 		PhysVol supportPlatePV = new PhysVol(supportPlateVolume, supportWrap.vol, pos, rot);
-		// add volume to lcdd
-		
+		//supportPlateVolume.addPhysVol(supportPlatePV);
+		//supportPlateVolume.getAttributes()
 		supportPlateVolume.setVisAttributes(lcdd.getVisAttributes("SupportPlateVis"));
 		
 		lcdd.add(supportPlateVolume);
@@ -544,7 +720,7 @@
 			print(String.format("ball_pos_base_plate %s", ball_pos_base_plate.toString()));
 			print(String.format("vee_pos_base_plate %s", vee_pos_base_plate.toString()));
 			print(String.format("flat_pos_base_plate %s", flat_pos_base_plate.toString()));
-			print(String.format("support_plate:\n%s", base_plate_coord.toString()));
+			print(String.format("base_plate_coord:\n%s", base_plate_coord.toString()));
 		}
 		
 		
@@ -578,7 +754,7 @@
 		PhysVol basePlatePV = new PhysVol(basePlateVolume, baseWrap.vol, pos, rot);
 		// add volume to lcdd
 		
-		basePlateVolume.setVisAttributes(lcdd.getVisAttributes("basePlateVis"));
+		basePlateVolume.setVisAttributes(lcdd.getVisAttributes("BasePlateVis"));
 		
 		lcdd.add(basePlateVolume);
 		
@@ -710,7 +886,7 @@
 			print(String.format("flat_pos_halfmod_axial_local %s", flat_pos_halfmod_axial_local.toString()));
 		}
 		
-		makeHalfModule("axial",moduleWrap, ball_pos_halfmod_axial_local, vee_pos_halfmod_axial_local, flat_pos_halfmod_axial_local,lcdd,sens);
+		//makeHalfModule("axial",moduleWrap, ball_pos_halfmod_axial_local, vee_pos_halfmod_axial_local, flat_pos_halfmod_axial_local,lcdd,sens);
 
 		
 		
@@ -740,7 +916,7 @@
 			print(String.format("flat_pos_coldblock_local %s", flat_pos_coldblock_local.toString()));
 		}
 		
-		makeColdBlock(moduleWrap, ball_pos_coldblock_local, vee_pos_coldblock_local, flat_pos_coldblock_local,lcdd,sens);
+		//makeColdBlock(moduleWrap, ball_pos_coldblock_local, vee_pos_coldblock_local, flat_pos_coldblock_local,lcdd,sens);
 
 		
 		
@@ -817,7 +993,7 @@
 		
 		// vector to the center of the half module box from the half module ball position
 		double box_center_local_x =  this.half_module_length/2.0 - ( (170.00 + 10.00) - this.sensor_length/2.0); 
-		double box_center_local_y = (this.half_module_thickness/2.0 - (cf_thickness + kapton_thickness + sensor_thickness/2.0));
+		double box_center_local_y = -1.0*this.half_module_thickness/2.0 + (cf_thickness + kapton_thickness + sensor_thickness/2.0);
 		double box_center_local_z = this.half_module_width/2.0 - ( 12.66 - (8.83 -3.00) + this.sensor_width/2.0 ); 
 		Hep3Vector box_center_local = new BasicHep3Vector( box_center_local_x, box_center_local_y, box_center_local_z); 
 		//Hep3Vector box_center_local = new BasicHep3Vector( 0.,0.,0.);
@@ -834,13 +1010,14 @@
 		Hep3Vector lcdd_rot_angles;
 		if(side.equals("stereo")) {
 			if(halfModuleName.contains("L1") || halfModuleName.contains("L2") ||halfModuleName.contains("L3")) {
-				lcdd_rot_angles = new BasicHep3Vector(0.0,0.1,0.0); 
+				lcdd_rot_angles = new BasicHep3Vector(Math.PI,-0.1,0); 
 			} else {
-				lcdd_rot_angles = new BasicHep3Vector(0.0,0.05,0.0); 
+				lcdd_rot_angles = new BasicHep3Vector(Math.PI,-0.05,0.0); 
 			}
 		} 
 		else {
-			lcdd_rot_angles = new BasicHep3Vector(Math.PI,0,0); 		
+			//lcdd_rot_angles = new BasicHep3Vector(Math.PI,0,0); 		
+			lcdd_rot_angles = new BasicHep3Vector(0,0,0); 		
 		}
 
 		// find the displacement from the rotation around an arbitrary point in local coordinates
@@ -890,7 +1067,7 @@
 
 		
 		final double ball_pos_kapton_local_x =  -1 * (180.0 - this.sensor_length/2.0) + 8.5;
-		final double ball_pos_kapton_local_y =  -1 * (this.sensor_thickness/2.0 + this.kapton_thickness/2.0);
+		final double ball_pos_kapton_local_y =  (this.sensor_thickness/2.0 + this.kapton_thickness/2.0);
 		final double ball_pos_kapton_local_z = -1 * (this.sensor_width/2.0 + 12.66) + 8.83 - 3.00 + 6.00 ;
 		final double vee_pos_kapton_local_x =  ball_pos_kapton_local_x + 1.0; // arbitrary distance
 		final double vee_pos_kapton_local_y =  ball_pos_kapton_local_y;
@@ -908,7 +1085,7 @@
 		
 		
 		final double ball_pos_cf_local_x =  -1 * (180.0 - this.sensor_length/2.0);
-		final double ball_pos_cf_local_y =  -1 * (this.sensor_thickness/2.0 + this.kapton_thickness + this.cf_thickness/2.0);
+		final double ball_pos_cf_local_y =  (this.sensor_thickness/2.0 + this.kapton_thickness + this.cf_thickness/2.0);
 		final double ball_pos_cf_local_z = -1 * (this.sensor_width/2.0 + 12.66) + 8.83 - 3.00;
 		final double vee_pos_cf_local_x =  ball_pos_cf_local_x + 1.0; // arbitrary distance
 		final double vee_pos_cf_local_y =  ball_pos_cf_local_y;
@@ -927,7 +1104,7 @@
 		
 
 		final double ball_pos_hybrid_local_x =  -1 * (170.0 - this.sensor_length/2.0);
-		final double ball_pos_hybrid_local_y =  -1 * (this.sensor_thickness/2.0 - this.hybrid_thickness/2.0);
+		final double ball_pos_hybrid_local_y =  (this.sensor_thickness/2.0 - this.hybrid_thickness/2.0);
 		final double ball_pos_hybrid_local_z = -1 * (this.sensor_width/2.0);
 		final double vee_pos_hybrid_local_x =  ball_pos_hybrid_local_x + 1.0; // arbitrary distance
 		final double vee_pos_hybrid_local_y =  ball_pos_hybrid_local_y;
@@ -1560,16 +1737,16 @@
 	 */
 	private Transform3D getTransformation(Hep3Vector origin, Hep3Vector u, Hep3Vector v, Hep3Vector w) {		
 		// Find the transform between the two frames - use transform classes here (not really needed)
-				Translation3D translation = new Translation3D(origin.x(), origin.y(), origin.z());
-				//RotationGeant trackingToEnvelopeRotation = new RotationGeant(0, 0, 0);
-		        Rotation3D rotation = new Rotation3D(
-		        		new BasicHep3Matrix(
+		Translation3D translation = new Translation3D(origin.x(), origin.y(), origin.z());
+		//RotationGeant trackingToEnvelopeRotation = new RotationGeant(0, 0, 0);
+		Rotation3D rotation = new Rotation3D(
+				new BasicHep3Matrix(
 						u.x(),v.x(),w.x(),
 						u.y(),v.y(),w.y(),
 						u.z(),v.z(),w.z()
 						));
-				Transform3D envelopeToSupportTransform = new Transform3D(translation, rotation);
-				return envelopeToSupportTransform;
+		Transform3D envelopeToSupportTransform = new Transform3D(translation, rotation);
+		return envelopeToSupportTransform;
 	}
 	
 	private Position getLCDDPosition(ITransform3D transform, String name) {
@@ -1622,12 +1799,6 @@
 			w = VecOp.unit(VecOp.cross(ball_to_vee,ball_to_flat));
 			v = VecOp.cross(w, u);
 		}
-		public void rotate(Hep3Vector euler_angles) {
-			RotationGeant rotation = new RotationGeant(euler_angles.x(), euler_angles.y(), euler_angles.z());
-			rotation.rotate(u);
-			rotation.rotate(v);
-			rotation.rotate(w);
-		}
 /*
 		public void rotate(Hep3Vector euler_angles) {
 			RotationGeant rotation = new RotationGeant(euler_angles.x(), euler_angles.y(), euler_angles.z());

projects/lcsim/trunk/detector-framework/src/test/resources/org/lcsim/geometry/subdetector
HPSTestRunTracker2014.xml 3109 -> 3110
--- projects/lcsim/trunk/detector-framework/src/test/resources/org/lcsim/geometry/subdetector/HPSTestRunTracker2014.xml	2014-05-07 23:35:24 UTC (rev 3109)
+++ projects/lcsim/trunk/detector-framework/src/test/resources/org/lcsim/geometry/subdetector/HPSTestRunTracker2014.xml	2014-05-08 00:13:45 UTC (rev 3110)
@@ -30,13 +30,14 @@
   <display>
 	
     <vis name="SensorVis" alpha="1.0" r="1.0" g="0.0" b="0.0" drawingStyle="wireframe" lineStyle="unbroken" showDaughters="true" visible="true"/>
-    <vis name="CarbonFiberVis" alpha="1.0" r="0.88" g="0.88" b="0.88" drawingStyle="solid" lineStyle="unbroken" showDaughters="true" visible="true"/>
+    <vis name="CarbonFiberVis" alpha="1.0" r="0.88" g="0.88" b="0.88" drawingStyle="wireframe" lineStyle="unbroken" showDaughters="true" visible="true"/>
     <vis name="KaptonVis" alpha="1.0" r="0.91" g="0.77" b="0.06" drawingStyle="wireframe" lineStyle="unbroken" showDaughters="true" visible="true"/>
     <vis name="HybridVis" alpha="1.0" r="0.0" g="1.0" b="0" drawingStyle="wireframe" lineStyle="unbroken" showDaughters="true" visible="true"/>
     <vis name="HalfModuleVis" alpha="1.0" r="1.0" g="1.0" b="1.0" drawingStyle="wireframe" lineStyle="dashed" showDaughters="true" visible="true"/>
     <vis name="ColdBlockVis" alpha="1.0" r="1.0" g="0.0" b="0.0" drawingStyle="wireframe" lineStyle="dashed" showDaughters="true" visible="true"/>
     <vis name="ModuleVis" alpha="1.0" r="1.0" g="1.0" b="1.0" drawingStyle="wireframe" lineStyle="dotted" showDaughters="true" visible="true"/>
     <vis name="SupportPlateVis" alpha="1.0" r="0.75" g="0.73" b="0.75" drawingStyle="solid" lineStyle="dashed" showDaughters="true" visible="true"/>
+    <vis name="SupportVolumeVis" alpha="1.0" r="0.75" g="0.73" b="0.75" drawingStyle="wireframe" lineStyle="dashed" showDaughters="true" visible="true"/>
     <vis name="BasePlateVis" alpha="1.0" r="0.75" g="0.73" b="0.75" drawingStyle="solid" lineStyle="dashed" showDaughters="true" visible="true"/>
     <vis name="LayerVis" alpha="0.0" r="0.0" g="0.0" b="1.0" drawingStyle="wireframe" showDaughters="true" visible="false"/>
     <vis name="ComponentVis" alpha="0.0" r="0.0" g="0.2" b="0.4" drawingStyle="solid" showDaughters="false" visible="false"/>
SVNspam 0.1


Use REPLY-ALL to reply to list

To unsubscribe from the LCDET-SVN list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCDET-SVN&A=1