Commit in projects/lcsim/trunk/detector-framework/src on MAIN
main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTestRunTracker2014.java+138-2143171 -> 3172
test/resources/org/lcsim/geometry/subdetector/HPSTestRunTracker2014.xml+5-53171 -> 3172
+143-219
2 modified files
Fixed pedestal depths. Fixed 100um shift on bot sup plate. Reorganized constants.

projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd
HPSTestRunTracker2014.java 3171 -> 3172
--- projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTestRunTracker2014.java	2014-07-03 23:47:24 UTC (rev 3171)
+++ projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTestRunTracker2014.java	2014-07-07 20:21:42 UTC (rev 3172)
@@ -42,142 +42,151 @@
 public class HPSTestRunTracker2014 extends LCDDSubdetector
 {
 	private boolean _debug = true; 
-	public static final double inch = 25.4;
+	private final boolean buildBeamPlane = true;
 	
+	//General
+	public final double inch = 25.4;
+	
+	// Global position references	
 	private final double target_pos_wrt_base_plate_x = 162.3; //from Marco's 3D model
 	private final double target_pos_wrt_base_plate_y = 80.55; //from Tim's sketchup //68.75; //from Marco's 3D model
 	private final double target_pos_wrt_base_plate_z = 926.59; //from Marco's 3D model
 
-	
+	// Base plate references	
 	private final double base_plate_thickness = 0.25*inch;
 	private final double base_plate_width = 385.00;
 	private final double base_plate_length = 1216.00;
 	private final double base_plate_offset_height = 2.0; //from Marco's 3D model
 	private final double PS_vac_box_inner_height = 7.0*inch;
-	// height of the dummy box holding the entire SVT: this means the bottom of the base plate to the the inner surface of of the PS vac box for now
+	// height of the dummy box holding the entire SVT: 
+	// this means the bottom of the base plate to the the inner surface of of the PS vac box for now
 	private final double base_height = PS_vac_box_inner_height - base_plate_offset_height; 
 	private final double base_width = base_plate_width;
 	private final double base_length = base_plate_length;
 	private final double beamPlaneThickness = 0.00000001;
 
-	
-	
-	private final double sensor_length= 100.00; //98.33;
-	private final double sensor_width = 40.34; //38.3399;
-	private final double sensor_thickness = 0.32;
-	private final double sensor_active_length= 98.33;
-	private final double sensor_active_width = 38.3399;
-	private final double sensor_active_thickness = sensor_thickness;
+	// c-support references
+	// pin position on base plate surface
+	double ball_pos_csup_pin_bottom_x = 51.15;
+	double ball_pos_csup_pin_bottom_y = 115.02;
+	double ball_pos_csup_pin_bottom_z = 0.0;
+	double vee_pos_csup_pin_bottom_x = 271.05;
+	double vee_pos_csup_pin_bottom_y = 121.62;
+	double vee_pos_csup_pin_bottom_z = 0.0;
 
-	private final double hybrid_length = 170.0 - sensor_length; // sensor b-to-b with hybrid
-	private final double hybrid_width  = sensor_width;
-	private final double hybrid_thickness = 4.0/64.0*inch;
-	//TODO Check these numbers
-	private final double cf_length = 200.;
-	private final double cf_width = 45.;
-	private final double cf_thickness = 0.250;
-	private final double kapton_length = 184.0;
-	private final double kapton_width = 40.0;
-	private final double kapton_thickness = 0.050;
+	// point on axis of rotation on the inside of the c-support frame where the insert get's attached
+	// this is referenced to the pin position coord system above
+	private final double ball_pos_csup_bearings_bottom_x = 240.0 - 265.0 + 14.0;
+	private final double ball_pos_csup_bearings_bottom_y = (-6.0 + 22.0);
+	private final double ball_pos_csup_bearings_bottom_z = 14.7;		
+	private final double vee_pos_csup_bearings_bottom_x = 240.0- 129.0;
+	private final double vee_pos_csup_bearings_bottom_y = (-6.0 + 22.0);
+	private final double vee_pos_csup_bearings_bottom_z = 14.7;
+	// Top only needs a vertical offset to be specified
+	private final double ball_pos_csup_bearings_top_z = 146.4;
 	
-	private final double support_plate_bottom_height = 12.7; //1/2"
+	// support plate references
+	// use a settable rotation to effectively determine the flat and therefore the tilt of the support 
+	// 0.000723559 should put L1 sensor on beam plane
+	private final double support_plate_bottom_tilt_angle = 0.0; //0.000723559;
+	private final double support_plate_top_tilt_angle = 0.0; //-0.000723559;
+	private final double support_plate_bottom_height = 12.7;
 	private final double support_plate_bottom_length = 736.1;
 	private final double support_plate_bottom_width = 120.0;
-	private final double support_plate_top_height = support_plate_bottom_height;
 	private final double support_plate_top_length = support_plate_bottom_length;
 	private final double support_plate_top_width = support_plate_bottom_width;
+	private final double support_plate_pocket_depth = 6.65; // Tim's sketchup, drawing says 6.66mm?
 	private final double pedestal_height_L1 = 11.00;
 	private final double pedestal_height_L2 = 9.50;
 	private final double pedestal_height_L3 = 8.00;
 	private final double pedestal_height_L4 = 10.00;
 	private final double pedestal_height_L5 = 7.00;
-	private final double support_plate_pocket_depth = 6.00;
+	//these are for the box surrounding the whole support including modules
+	private final double support_bottom_length = support_plate_bottom_length;
+	private final double support_bottom_width = (25.0-5.0) + this.module_box_L13_length;
+	private final double support_bottom_height = support_plate_bottom_height - support_plate_pocket_depth + this.module_box_L13_width + this.pedestal_height_L1;
+	private final double support_top_length = support_bottom_length;
+	private final double support_top_width = support_bottom_width;
+	private final double support_top_height = support_bottom_height;
 
+	// module references
 	private final double module_box_L13_length = 205.2; // includes lexan spacer and cold block
 	private final double module_box_L13_height = 12.5; // includes screws height
 	private final double module_box_L13_width = 71.3 - 13.0; // height from cold block to encapsulate the whole module
 	private final double module_box_L45_length = 205.2; // includes lexan spacer and cold block
 	private final double module_box_L45_height = 12.5; // includes screws height
 	private final double module_box_L45_width = 65.3-12.0; 
-	
-	private final double half_module_thickness = this.hybrid_thickness + this.cf_thickness + this.kapton_thickness;
-	private final double half_module_length = this.cf_length;
-	private final double half_module_width = 6.83 + this.sensor_width;
-	
-	private final double coldblock_L13_length = 82.00;
-	private final double coldblock_L13_width = 52.50;
-	private final double coldblock_L13_thickness = 6.00;
-	private final double coldblock_L45_length = 82.00;
-	private final double coldblock_L45_width = 51.00;
-	private final double coldblock_L45_thickness = 6.00;
-
-	private final double support_bottom_length = this.support_plate_bottom_length;
-	private final double support_bottom_width = (25.0-5.0) + this.module_box_L13_length;
-	private final double support_bottom_height = this.support_plate_bottom_height - this.support_plate_pocket_depth + this.module_box_L13_width + this.pedestal_height_L1;
-	private final double support_top_length = support_bottom_length;
-	private final double support_top_width = support_bottom_width;
-	private final double support_top_height = support_bottom_height;
-	
-	
-	
-	
 	// survey positions for each module is the pockets:
-	// ball: hole
+	// ball: hole 
 	// vee:  slot
 	// flat: middle of pocket defining local w out of the pocket vertically
 
 	// bottom
-	private final Hep3Vector ball_pos_module1_support_plate_bottom_local = new BasicHep3Vector(25.0, 661.0, pedestal_height_L1-support_plate_pocket_depth);
-	private final Hep3Vector vee_pos_module1_support_plate_bottom_local = new BasicHep3Vector(95.0, 661.0, pedestal_height_L1-support_plate_pocket_depth);
+	private final Hep3Vector ball_pos_module1_support_plate_bottom_local = new BasicHep3Vector(25.0, 661.1, pedestal_height_L1-support_plate_pocket_depth);
+	private final Hep3Vector vee_pos_module1_support_plate_bottom_local = new BasicHep3Vector(95.0, 661.1, pedestal_height_L1-support_plate_pocket_depth);
 	private final Hep3Vector flat_pos_module1_support_plate_bottom_local = new BasicHep3Vector(60.0, 667.10, pedestal_height_L1-support_plate_pocket_depth);
-
-	private final Hep3Vector ball_pos_module2_support_plate_bottom_local = new BasicHep3Vector(25.0, 561.0, pedestal_height_L2-support_plate_pocket_depth);
-	private final Hep3Vector vee_pos_module2_support_plate_bottom_local = new BasicHep3Vector(95.0, 561.0, pedestal_height_L2-support_plate_pocket_depth);
+	private final Hep3Vector ball_pos_module2_support_plate_bottom_local = new BasicHep3Vector(25.0, 561.1, pedestal_height_L2-support_plate_pocket_depth);
+	private final Hep3Vector vee_pos_module2_support_plate_bottom_local = new BasicHep3Vector(95.0, 561.1, pedestal_height_L2-support_plate_pocket_depth);
 	private final Hep3Vector flat_pos_module2_support_plate_bottom_local = new BasicHep3Vector(60.0, 567.10, pedestal_height_L2-support_plate_pocket_depth);
-
-	private final Hep3Vector ball_pos_module3_support_plate_bottom_local = new BasicHep3Vector(25.0, 461.0, pedestal_height_L3-support_plate_pocket_depth);
-	private final Hep3Vector vee_pos_module3_support_plate_bottom_local = new BasicHep3Vector(95.0, 461.0, pedestal_height_L3-support_plate_pocket_depth);
+	private final Hep3Vector ball_pos_module3_support_plate_bottom_local = new BasicHep3Vector(25.0, 461.1, pedestal_height_L3-support_plate_pocket_depth);
+	private final Hep3Vector vee_pos_module3_support_plate_bottom_local = new BasicHep3Vector(95.0, 461.1, pedestal_height_L3-support_plate_pocket_depth);
 	private final Hep3Vector flat_pos_module3_support_plate_bottom_local = new BasicHep3Vector(60.0, 467.10, pedestal_height_L3-support_plate_pocket_depth);
-
-	private final Hep3Vector ball_pos_module4_support_plate_bottom_local = new BasicHep3Vector(25.0, 261.0, pedestal_height_L4-support_plate_pocket_depth);
-	private final Hep3Vector vee_pos_module4_support_plate_bottom_local = new BasicHep3Vector(95.0, 261.0, pedestal_height_L4-support_plate_pocket_depth);
+	private final Hep3Vector ball_pos_module4_support_plate_bottom_local = new BasicHep3Vector(25.0, 261.1, pedestal_height_L4-support_plate_pocket_depth);
+	private final Hep3Vector vee_pos_module4_support_plate_bottom_local = new BasicHep3Vector(95.0, 261.1, pedestal_height_L4-support_plate_pocket_depth);
 	private final Hep3Vector flat_pos_module4_support_plate_bottom_local = new BasicHep3Vector(60.0, 267.10, pedestal_height_L4-support_plate_pocket_depth);
-
-	private final Hep3Vector ball_pos_module5_support_plate_bottom_local = new BasicHep3Vector(25.0, 61.0, pedestal_height_L5-support_plate_pocket_depth);
-	private final Hep3Vector vee_pos_module5_support_plate_bottom_local = new BasicHep3Vector(95.0, 61.0, pedestal_height_L5-support_plate_pocket_depth);
+	private final Hep3Vector ball_pos_module5_support_plate_bottom_local = new BasicHep3Vector(25.0, 61.1, pedestal_height_L5-support_plate_pocket_depth);
+	private final Hep3Vector vee_pos_module5_support_plate_bottom_local = new BasicHep3Vector(95.0, 61.1, pedestal_height_L5-support_plate_pocket_depth);
 	private final Hep3Vector flat_pos_module5_support_plate_bottom_local = new BasicHep3Vector(60.0, 67.10, pedestal_height_L5-support_plate_pocket_depth);
-
 	// top
-
 	// top has a fixed offset of 15mm along plate on module pocket positions w.r.t. bottom
 	// top local coordinates is rotation pi around u-vec so need to adjust pocket depth coordinate
-
 	private final Hep3Vector ball_pos_module1_support_plate_top_local = new BasicHep3Vector(25.0, 676.1, -1.0 * (pedestal_height_L1-support_plate_pocket_depth));
 	private final Hep3Vector vee_pos_module1_support_plate_top_local = new BasicHep3Vector(95.0, 676.1, -1.0 * (pedestal_height_L1-support_plate_pocket_depth));
 	private final Hep3Vector flat_pos_module1_support_plate_top_local = new BasicHep3Vector(60.0, 670.1, -1.0 * (pedestal_height_L1-support_plate_pocket_depth));
-
 	private final Hep3Vector ball_pos_module2_support_plate_top_local = new BasicHep3Vector(25.0, 576.1, -1.0 * (pedestal_height_L2-support_plate_pocket_depth));
 	private final Hep3Vector vee_pos_module2_support_plate_top_local = new BasicHep3Vector(95.0, 576.1, -1.0 * (pedestal_height_L2-support_plate_pocket_depth));
 	private final Hep3Vector flat_pos_module2_support_plate_top_local = new BasicHep3Vector(60.0, 570.1, -1.0 * (pedestal_height_L2-support_plate_pocket_depth));
-
 	private final Hep3Vector ball_pos_module3_support_plate_top_local = new BasicHep3Vector(25.0, 476.1, -1.0 * (pedestal_height_L3-support_plate_pocket_depth));
 	private final Hep3Vector vee_pos_module3_support_plate_top_local = new BasicHep3Vector(95.0, 476.1, -1.0 * (pedestal_height_L3-support_plate_pocket_depth));
 	private final Hep3Vector flat_pos_module3_support_plate_top_local = new BasicHep3Vector(60.0, 470.1, -1.0 * (pedestal_height_L3-support_plate_pocket_depth));
-
 	private final Hep3Vector ball_pos_module4_support_plate_top_local = new BasicHep3Vector(25.0, 276.1, -1.0 * (pedestal_height_L4-support_plate_pocket_depth));
 	private final Hep3Vector vee_pos_module4_support_plate_top_local = new BasicHep3Vector(95.0, 276.1, -1.0 * (pedestal_height_L4-support_plate_pocket_depth));
 	private final Hep3Vector flat_pos_module4_support_plate_top_local = new BasicHep3Vector(60.0, 270.1, -1.0 * (pedestal_height_L4-support_plate_pocket_depth));
-
 	private final Hep3Vector ball_pos_module5_support_plate_top_local = new BasicHep3Vector(25.0, 76.1, -1.0 * (pedestal_height_L5-support_plate_pocket_depth));
 	private final Hep3Vector vee_pos_module5_support_plate_top_local = new BasicHep3Vector(95.0, 76.1, -1.0 * (pedestal_height_L5-support_plate_pocket_depth));
 	private final Hep3Vector flat_pos_module5_support_plate_top_local = new BasicHep3Vector(60.0, 70.1, -1.0 * (pedestal_height_L5-support_plate_pocket_depth));
-
 	
 	
+	//half-module references
+	// The half-module is only approximated with boxes here so be careful
+	private final double sensor_length= 100.00; //98.33;
+	private final double sensor_width = 40.34; //38.3399;
+	private final double sensor_thickness = 0.32;
+	private final double sensor_active_length= 98.33;
+	private final double sensor_active_width = 38.3399;
+	private final double sensor_active_thickness = sensor_thickness;
+	private final double hybrid_length = 170.0 - sensor_length; // sensor b-to-b with hybrid
+	private final double hybrid_width  = sensor_width;
+	private final double hybrid_thickness = 4.0/64.0*inch;
+	//TODO Check these numbers
+	private final double cf_length = 200.;
+	private final double cf_width = 45.;
+	private final double cf_thickness = 0.250;
+	private final double kapton_length = 184.0;
+	private final double kapton_width = 40.0;
+	private final double kapton_thickness = 0.050;
+	private final double coldblock_L13_length = 82.00;
+	private final double coldblock_L13_width = 52.50;
+	private final double coldblock_L13_thickness = 6.00;
+	private final double coldblock_L45_length = 82.00;
+	private final double coldblock_L45_width = 51.00;
+	private final double coldblock_L45_thickness = 6.00;
+	private final double half_module_thickness = this.hybrid_thickness + this.cf_thickness + this.kapton_thickness;
+	private final double half_module_length = this.cf_length;
+	private final double half_module_width = 6.83 + this.sensor_width;
 	
 	
 	
-	
 	public HPSTestRunTracker2014(Element node) throws JDOMException
 	{
 		super(node);
@@ -236,32 +245,19 @@
 		}
 		
 
-		makeExample(lcdd,sens);
+		//makeExample(lcdd,sens);
 
 		
-		// Surveyed position of the base plate in the JLab/tracking volume
-		// Use edges of plate instead of real survey balls for now
-		// Defined so that the local coordinate system of the base plate is oriented as
-		// width - u - global x
-		// length - v - global -z
-		// thickness - w - global y	
 		
 		// ball at the upper (vertically) downstream edge of the base plate on the electron side
 		// vee at the upper (vertically) downstream edge of the base plate on the positron side
 		// flat at the upper (vertically) upstream edge of the base plate on the electron side
 		
 		// The tracking coordinate system is located at the target position.
-		// The base plate is located flush against the upstream edge of the PS vacuum box
-		// The pole face of the PS magnet is 12" from that edge
-		// The x=0 is centered on the support plate width at the target position in z( TODO: really?)
-		// The beam is at y=0 in the center of the PS vac box
 		
 		final double ball_pos_base_plate_x = -1.0*target_pos_wrt_base_plate_x;
 		final double ball_pos_base_plate_y = -1.0*target_pos_wrt_base_plate_y;
 		final double ball_pos_base_plate_z = target_pos_wrt_base_plate_z;		
-		//final double ball_pos_base_plate_x = -1.0*base_plate_width/2.0;
-		//final double ball_pos_base_plate_y = -1.0*PS_vac_box_inner_height/2.0 + base_plate_thickness + base_plate_offset_height;
-		//final double ball_pos_base_plate_z = base_plate_length - 12.0*inch;
 		final double vee_pos_base_plate_x = ball_pos_base_plate_x + base_plate_width;
 		final double vee_pos_base_plate_y = ball_pos_base_plate_y;
 		final double vee_pos_base_plate_z = ball_pos_base_plate_z;
@@ -271,19 +267,21 @@
 		Hep3Vector ball_pos_base_plate = new BasicHep3Vector(ball_pos_base_plate_x, ball_pos_base_plate_y, ball_pos_base_plate_z);
 		Hep3Vector vee_pos_base_plate = new BasicHep3Vector(vee_pos_base_plate_x,vee_pos_base_plate_y,vee_pos_base_plate_z);
 		Hep3Vector flat_pos_base_plate = new BasicHep3Vector(flat_pos_base_plate_x, flat_pos_base_plate_y, flat_pos_base_plate_z);
-		
-		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()));
-		
 
-		// beam plane at global z=0
-		Hep3Vector ball_pos_beamplane = new BasicHep3Vector(-1.0*base_plate_width/2.0,0.0,base_plate_length/2.0);
-		Hep3Vector vee_pos_beamplane = new BasicHep3Vector(ball_pos_beamplane.x()+base_plate_width,ball_pos_beamplane.y(),ball_pos_beamplane.z());
-		Hep3Vector flat_pos_beamplane = new BasicHep3Vector(ball_pos_beamplane.x(), ball_pos_beamplane.y(), ball_pos_beamplane.z()-base_plate_length/2.0);
+		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()));
+		}		
+
+		if(buildBeamPlane ) {
+			// beam plane at global z=0
+			Hep3Vector ball_pos_beamplane = new BasicHep3Vector(-1.0*base_plate_width/2.0,0.0,base_plate_length/2.0);
+			Hep3Vector vee_pos_beamplane = new BasicHep3Vector(ball_pos_beamplane.x()+base_plate_width,ball_pos_beamplane.y(),ball_pos_beamplane.z());
+			Hep3Vector flat_pos_beamplane = new BasicHep3Vector(ball_pos_beamplane.x(), ball_pos_beamplane.y(), ball_pos_beamplane.z()-base_plate_length/2.0);
+			makeBeamPlane(trackingWrap, ball_pos_beamplane, vee_pos_beamplane, flat_pos_beamplane, lcdd, sens);
+		}
 		
-		makeBeamPlane(trackingWrap, ball_pos_beamplane, vee_pos_beamplane, flat_pos_beamplane, lcdd, sens);
-		
 		makeBase(trackingWrap, ball_pos_base_plate, vee_pos_base_plate, flat_pos_base_plate, lcdd, sens );
 				
 		
@@ -410,13 +408,6 @@
 		// flat position is a randomly chosen point perpendicular to ball to vee vector and offset 10mm along the plate. 
 		// Note that the flat here sets the tilt angle of the support plates.
 		
-		// pin position on base plate surface
-		double ball_pos_csup_pin_bottom_x = 51.15;
-		double ball_pos_csup_pin_bottom_y = 115.02;
-		double ball_pos_csup_pin_bottom_z = 0.0;
-		double vee_pos_csup_pin_bottom_x = 271.05;
-		double vee_pos_csup_pin_bottom_y = 121.62;
-		double vee_pos_csup_pin_bottom_z = 0.0;
 		// find the rotation to place the flat point
 		org.apache.commons.math3.geometry.euclidean.threed.Rotation rot1_csup = 
 				new org.apache.commons.math3.geometry.euclidean.threed.Rotation(
@@ -452,17 +443,10 @@
 			
 		}
 		
-		// now create the support box which will have it's coordinates at the rotation axis point so that flat determines the tilt of the plates
-		// it will referenced locally to the c-support pin coordinate system 
+		// now create the support box which will have it's coordinates at the rotation axis so that the flat determines the tilt of the plates
+		// it is referenced locally to the c-support pin coordinate system 
 
-		// point on axis of rotation on the inside of the c-support frame where the insert get's attached
-		double ball_pos_csup_bearings_bottom_x = 240.0 - 265.0 + 14.0;
-		double ball_pos_csup_bearings_bottom_y = (-6.0 + 22.0);
-		double ball_pos_csup_bearings_bottom_z = 14.7;
 		
-		double vee_pos_csup_bearings_bottom_x = 240.0- 129.0;
-		double vee_pos_csup_bearings_bottom_y = (-6.0 + 22.0);
-		double vee_pos_csup_bearings_bottom_z = 14.7;
 		
 		// use an arbitrary local flat position: 10.0mm along the support plate direction
 		double flat_pos_csup_bearings_bottom_x = ball_pos_csup_bearings_bottom_x;
@@ -473,13 +457,11 @@
 		Hep3Vector ball_pos_csup_bearings_bottom = new BasicHep3Vector(ball_pos_csup_bearings_bottom_x,ball_pos_csup_bearings_bottom_y,ball_pos_csup_bearings_bottom_z);
 		Hep3Vector vee_pos_csup_bearings_bottom = new BasicHep3Vector(vee_pos_csup_bearings_bottom_x,vee_pos_csup_bearings_bottom_y,vee_pos_csup_bearings_bottom_z);	
 		
-		// use a settable rotation to effectively determine the flat and therefore the tilt of the support 
-		final double csup_bottom_rot_angle_local_u = 0.0;
 		
 		// build the rotation to find the proper location of the flat
 		org.apache.commons.math3.geometry.euclidean.threed.Rotation rot_csup = 
 				new org.apache.commons.math3.geometry.euclidean.threed.Rotation(org.apache.commons.math3.geometry.euclidean.threed.RotationOrder.XYZ, 
-						csup_bottom_rot_angle_local_u, 0.0, 0.0 );
+						support_plate_bottom_tilt_angle, 0.0, 0.0 );
 		// apply to flat local position
 		org.apache.commons.math3.geometry.euclidean.threed.Vector3D flat_pos_csup_bearings_bottom_3D_rot = 
 				rot_csup.applyTo(new org.apache.commons.math3.geometry.euclidean.threed.Vector3D(0.0,10.0,0.0));
@@ -499,7 +481,7 @@
 			print(String.format("Creating the c-support bearings\n"));
 			print(String.format("ball_pos_csup_bearings_bottom 			 %s", ball_pos_csup_bearings_bottom.toString()));
 			print(String.format("vee_pos_csup_bearings_bottom            %s", vee_pos_csup_bearings_bottom.toString()));
-			print(String.format("csup_bottom_rot_angle_local_u           %f", csup_bottom_rot_angle_local_u ));
+			print(String.format("csup_bottom_rot_angle_local_u           %f", support_plate_bottom_tilt_angle ));
 			print(String.format("flat_pos_csup_bearings_bottom           %s", flat_pos_csup_bearings_bottom.toString()));
 			print(String.format("csup_bearings_coord:\n%s ", csup_bearings_bottom_coord.toString()));
 			//Transform3D trans_csup_bearings_to_base = getTransformation(csup_pin_coord);
@@ -537,18 +519,16 @@
 		
 		Hep3Vector ball_pos_csup_bearings_top = new BasicHep3Vector(ball_pos_csup_bearings_bottom.x(),
 																	ball_pos_csup_bearings_bottom.y(),
-																	146.4);
+																	ball_pos_csup_bearings_top_z);
 		Hep3Vector vee_pos_csup_bearings_top = new BasicHep3Vector(vee_pos_csup_bearings_bottom.x(),
 																	vee_pos_csup_bearings_bottom.y(),
-																	146.4);
+																	ball_pos_csup_bearings_top_z);
 		
-		// use a settable rotation to effectively determine the flat and therefore the tilt of the support 
-		final double csup_top_rot_angle_local_u = 0.0;
-
+		
 		// build the rotation to find the proper location of the flat
 		org.apache.commons.math3.geometry.euclidean.threed.Rotation rot_csup_top = 
 				new org.apache.commons.math3.geometry.euclidean.threed.Rotation(org.apache.commons.math3.geometry.euclidean.threed.RotationOrder.XYZ, 
-						csup_top_rot_angle_local_u, 0.0, 0.0 );
+						support_plate_top_tilt_angle, 0.0, 0.0 );
 		// apply to flat local position (as for bottom it is arbitrary offset)
 		org.apache.commons.math3.geometry.euclidean.threed.Vector3D flat_pos_csup_bearings_top_3D_rot = 
 				rot_csup.applyTo(new org.apache.commons.math3.geometry.euclidean.threed.Vector3D(0.0,10.0,0.0));
@@ -568,7 +548,7 @@
 			print(String.format("Creating the c-support bearings for top\n"));
 			print(String.format("ball_pos_csup_bearings_top 		  %s", ball_pos_csup_bearings_top.toString()));
 			print(String.format("vee_pos_csup_bearings_top            %s", vee_pos_csup_bearings_top.toString()));
-			print(String.format("csup_top_rot_angle_local_u           %f", csup_top_rot_angle_local_u ));
+			print(String.format("csup_top_rot_angle_local_u           %f", support_plate_top_tilt_angle ));
 			print(String.format("flat_pos_csup_bearings_top           %s", flat_pos_csup_bearings_top.toString()));
 			print(String.format("csup_bearings_top_coord:\n%s ", csup_bearings_top_coord.toString()));
 			//print(String.format("trans_csup_bearings_to_pin:\n%s ", trans_csup_bearings_to_pin.toString()));
@@ -678,6 +658,8 @@
 			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()));
+			Hep3Vector ball_pos_base_plate_tmp1 = this.transformToMotherCoord(ball_pos_base_plate, baseWrap, "trackingVolume");
+			print(String.format("ball_pos_base_plate tracking %s", ball_pos_base_plate_tmp1.toString()));
 		}
 
 
@@ -1053,8 +1035,8 @@
 			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()));
-			Transform3D trans_support_to_mother = getTransformation(supportWrap.coord);
-			print(String.format("ball_pos_support_plate (in %s) %s", supportWrap.mother.name,trans_support_to_mother.transformed(ball_pos_support_plate).toString()));
+			Hep3Vector ball_pos_support_plate_tmp1  = this.transformToMotherCoord(ball_pos_support_plate, supportWrap, "trackingVolume");
+			print(String.format("ball_pos_support_plate tracking %s", ball_pos_support_plate_tmp1.toString()));
 			
 		}
 		
@@ -1168,6 +1150,11 @@
 			print(String.format("ball_pos_mod  %s", ball_pos_mod.toString()));
 			print(String.format("ball_pos_mod %s", ball_pos_mod.toString()));
 			print(String.format("module_coord:\n%s", module_coord.toString()));
+			Hep3Vector ball_pos_mod_tmp1 = transformToMotherCoord(ball_pos_mod, supportWrap, "support_bottom");
+			if(ball_pos_mod_tmp1==null) {
+				 ball_pos_mod_tmp1 = transformToMotherCoord(ball_pos_mod, supportWrap, "support_top");
+			}
+			print(String.format("ball_pos_mod tracking %s", ball_pos_mod_tmp1.toString()));
 		}
 		
 		
@@ -1793,24 +1780,6 @@
 	
 	
 	
-	
-	
-	private Hep3Vector transformToMotherCoord(Hep3Vector vec, VolWrapper motherWrap, String targetCoordName) {
-		print(String.format("vec %s motherWrap %s target %s", vec.toString(), motherWrap.name, targetCoordName));
-		if(motherWrap.name.equals(targetCoordName)) {
-			print(String.format("found the vec %s", vec.toString()));
-			return vec;
-		} else {
-			Transform3D trans = getTransformation(motherWrap.coord); 
-			Hep3Vector vec_t = trans.transformed(vec);
-			print(String.format("continue searching"));
-			return transformToMotherCoord(vec_t, motherWrap.mother, targetCoordName);
-		}
-		
-	}
-	
-	
-	
 	private void makeHalfModuleComponentActiveSensor(VolWrapper motherWrap, 
 			Hep3Vector ball_pos, Hep3Vector vee_pos, Hep3Vector flat_pos, 
 			LCDD lcdd, SensitiveDetector sens) throws JDOMException {
@@ -1837,20 +1806,13 @@
 			print(String.format("vee_pos  %s", vee_pos.toString()));
 			print(String.format("flat_pos %s", flat_pos.toString()));
 			print(String.format("coord:\n%s", coord.toString()));
-			Hep3Vector ball_pos_tmp = this.transformToMotherCoord(ball_pos, motherWrap, "base");
-			print(String.format("ball_pos tmp %s %s", volName, ball_pos_tmp.toString()));
-//			Transform3D motherTrans = getTransformation(motherWrap.coord); 
-//			print(String.format("ball_pos (%s): %s", motherWrap.mother.name, motherTrans.transformed(ball_pos).toString()));
-//			Transform3D motherMotherTrans = getTransformation(motherWrap.mother.coord); 
-//			print(String.format("ball_pos (%s): %s", motherWrap.mother.mother.name, motherMotherTrans.transformed(motherTrans.transformed(ball_pos)).toString()));
-//			Transform3D motherMotherMotherTrans = getTransformation(motherWrap.mother.mother.coord); 
-//			print(String.format("ball_pos (%s): %s", motherWrap.mother.mother.mother.name, motherMotherMotherTrans.transformed(motherMotherTrans.transformed(ball_pos)).toString()));
-//			Transform3D motherMotherMotherMotherTrans = getTransformation(motherWrap.mother.mother.mother.coord); 
-//			print(String.format("ball_pos (%s): %s", motherWrap.mother.mother.mother.mother.name, motherMotherMotherMotherTrans.transformed(motherMotherMotherTrans.transformed(ball_pos)).toString()));
-//			Transform3D motherMotherMotherMotherMotherTrans = getTransformation(motherWrap.mother.mother.mother.mother.coord); 
-//			print(String.format("ball_pos %s (%s): %s", volName, motherWrap.mother.mother.mother.mother.name, motherMotherMotherMotherMotherTrans.transformed(motherMotherMotherMotherTrans.transformed(ball_pos)).toString()));
-//			
-
+			Hep3Vector ball_pos_tmp2 = transformToMotherCoord(ball_pos, motherWrap, "support_bottom");
+			if(ball_pos_tmp2==null) ball_pos_tmp2 = transformToMotherCoord(ball_pos, motherWrap, "support_top");
+			print(String.format("ball_pos support %s %s", volName, ball_pos_tmp2.toString()));
+			Hep3Vector ball_pos_tmp = transformToMotherCoord(ball_pos, motherWrap, "base");
+			print(String.format("ball_pos base %s %s", volName, ball_pos_tmp.toString()));
+			Hep3Vector ball_pos_tmp1 = transformToMotherCoord(ball_pos, motherWrap, "trackingVolume");
+			print(String.format("ball_pos tracking tmp %s %s", volName, ball_pos_tmp1.toString()));
 		}
 
 
@@ -1870,7 +1832,7 @@
 			print(String.format("motherWrap.center      %s", motherWrap.center.toString()));
 			print(String.format("box_center             %s", box_center.toString()));
 	
-			print(String.format("motherWrap.center      %s", motherWrap.coord.toString()));
+			print(String.format("motherWrap.coord      %s", motherWrap.coord.toString()));
 			
 		}
 
@@ -2147,9 +2109,27 @@
 	
 	
 	
+
+	private Hep3Vector transformToMotherCoord(Hep3Vector vec, VolWrapper motherWrap, String targetCoordName) {
+		if(_debug) print(String.format("vec %s motherWrap %s target %s", vec.toString(), motherWrap.name, targetCoordName));
+		if(motherWrap.name.equals(targetCoordName)) {
+			if(_debug) print(String.format("found the vec %s", vec.toString()));
+			return vec;
+		} else {
+			if(motherWrap.name.equals("trackingVolume")) {
+				return null;
+			}
+			Transform3D trans = getTransformation(motherWrap.coord); 
+			Hep3Vector vec_t = trans.transformed(vec);
+			if(_debug) print(String.format("continue searching"));
+			return transformToMotherCoord(vec_t, motherWrap.mother, targetCoordName);
+		}
+		
+	}
 	
 	
 	
+	
 
 	
 	
@@ -2415,7 +2395,7 @@
 	Transform3D trans_beamplane_to_tracking = getTransformation(beamplane_coord);
 	
 	String volName = "beamPlaneVol";
-	Box box = new Box(volName + "Box", base_width, base_length, beamPlaneThickness);
+	Box box = new Box(volName + "Box", base_width, base_length*2, beamPlaneThickness);
 	lcdd.add(box);
 	Volume volume = new Volume(volName + "_volume", box, lcdd.getMaterial("Vacuum"));
 	
@@ -2553,63 +2533,7 @@
 	
 	}
 	
-	
-	
-	/*
-	
-	// Get corrections to survey ball positions from compact file to support plate positions (from e.g. survey)
-	Map<String, Hep3Vector> corr_balls = new HashMap<String,Hep3Vector>(); // save for debugging
-	for(Iterator i = node.getChildren("support_plate").iterator(); i.hasNext();) {
-		Element e = (Element)i.next();
-		if(e.getAttributeValue("name").equals("SupportPlateL1-3bot")) {
-			for(Iterator ii = e.getChildren("position").iterator(); ii.hasNext();) {
-				Element element = (Element) ii.next();
-				String name = element.getAttribute("name").getValue();
-				// get vector correction
-				Hep3Vector corr = new BasicHep3Vector(element.getAttribute("x").getDoubleValue(), element.getAttribute("y").getDoubleValue(), element.getAttribute("z").getDoubleValue());
-				if( name.equals("ball")) {
-					VecOp.add(ball_pos, corr);
-					corr_balls.put("ball", corr);
-				}
-				else if( name.equals("vee")) {
-					VecOp.add(vee_pos, corr);
-					corr_balls.put("vee", corr);
-				}
-				else if( name.equals("flat")) {
-					VecOp.add(flat_pos, corr);
-					corr_balls.put("flat", corr);
-				} 
-				else {
-					print(String.format("wrong alignment name for support plate: \"%s\"", name));
-					System.exit(1);
-				}
-			} //ii
-		}
-	} //i
 
-	
-	// Find the local alignment corrections to the support plate
-	Hep3Vector local_translation = new BasicHep3Vector(0,0,0);
-	Hep3Vector local_rotation = new BasicHep3Vector(0,0,0);
-	for(Iterator i = node.getChildren("support_plate").iterator(); i.hasNext();) {
-		Element e = (Element)i.next();
-		if(e.getAttributeValue("name").equals("SupportPlateL1-3bot")) {
-			for(Iterator ii = e.getChildren("alignment").iterator(); ii.hasNext();) {
-				Element element = (Element) ii.next();
-				local_translation = new BasicHep3Vector(element.getAttribute("x").getDoubleValue(), element.getAttribute("y").getDoubleValue(), element.getAttribute("z").getDoubleValue());
-				local_rotation = new BasicHep3Vector(element.getAttribute("rx").getDoubleValue(), element.getAttribute("ry").getDoubleValue(), element.getAttribute("rz").getDoubleValue());
-
-			} //ii
-		}
-	} //i
-			
-
-			
-	*/
-	
-	
-	
-
 }
 
 

projects/lcsim/trunk/detector-framework/src/test/resources/org/lcsim/geometry/subdetector
HPSTestRunTracker2014.xml 3171 -> 3172
--- projects/lcsim/trunk/detector-framework/src/test/resources/org/lcsim/geometry/subdetector/HPSTestRunTracker2014.xml	2014-07-03 23:47:24 UTC (rev 3171)
+++ projects/lcsim/trunk/detector-framework/src/test/resources/org/lcsim/geometry/subdetector/HPSTestRunTracker2014.xml	2014-07-07 20:21:42 UTC (rev 3172)
@@ -31,12 +31,12 @@
 	
     <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="ActiveSensorVis" 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="wireframe" lineStyle="unbroken" showDaughters="true" visible="false"/>
-    <vis name="KaptonVis" alpha="1.0" r="0.91" g="0.77" b="0.06" drawingStyle="wireframe" lineStyle="unbroken" showDaughters="true" visible="false"/>
-    <vis name="HybridVis" alpha="1.0" r="0.0" g="1.0" b="0" drawingStyle="wireframe" lineStyle="unbroken" showDaughters="true" visible="false"/>
-    <vis name="HalfModuleVis" alpha="1.0" r="1.0" g="1.0" b="1.0" drawingStyle="wireframe" lineStyle="dashed" showDaughters="true" visible="false"/>
+    <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="0.75" g="0.73" b="0.75" drawingStyle="solid" 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="false"/>
+    <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.45" g="0.45" b="0.45" 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.35" g="0.35" b="0.35" drawingStyle="solid" lineStyle="dashed" showDaughters="true" visible="true"/>
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