Print

Print


Commit in projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd on MAIN
HPSTestRunTracker2014Builder.java+17-193345 -> 3346
HPSTestRunTracker2014GeometryDefinition.java+72-143345 -> 3346
HPSTestRunTracker2014LCDDBuilder.java+2-23345 -> 3346
HPSTestRunTracker2014Test1Builder.java-1213345 removed
HPSTestRunTracker2014Test1LCDDBuilder.java-1423345 removed
HPSTrackerJavaBuilder.java+10-33345 -> 3346
HPSTrackerLCDDBuilder.java+8-133345 -> 3346
+109-314
2 removed + 5 modified, total 7 files
Delete obsolete files. Add all comb of cardan angles.

projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd
HPSTestRunTracker2014Builder.java 3345 -> 3346
--- projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTestRunTracker2014Builder.java	2014-09-25 22:39:09 UTC (rev 3345)
+++ projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTestRunTracker2014Builder.java	2014-09-26 23:50:42 UTC (rev 3346)
@@ -16,12 +16,14 @@
  */
 public class HPSTestRunTracker2014Builder extends HPSTrackerBuilder  {
 
-	public final boolean onlyAxial = true;
-	public final boolean onlyBottom = true;
-	public final boolean onlyL1 = true;
+	public final boolean doAxial = true;
+	public final boolean doStereo = true;
+	public final boolean doColdBlock = false;
+    public final boolean doBottom = true;
+    public final boolean doTop = false;
+	public final int layerBitMask = 0x1;
+    
 	
-	
-	
 	/**
 	 *  Default constructor.
 	 */
@@ -59,10 +61,9 @@
 		modules = new ArrayList<ModuleBundle>();
 		
 		for(int l=1; l<=5;++l) {
-			if(onlyL1 && l!=1) continue;
-				makeModuleBundle(l,"bottom");
-				if(!onlyBottom)
-					makeModuleBundle(l,"top");
+		    if(!doLayer(l)) continue;
+		    if(doBottom) makeModuleBundle(l,"bottom");
+		    if(doTop) makeModuleBundle(l,"top");
 			
 		}		
 		
@@ -98,11 +99,9 @@
 		final HPSTestRunTracker2014GeometryDefinition.BaseGeometry mother;
 		final HPSTestRunTracker2014GeometryDefinition.BaseGeometry ref;
 		if(half == "bottom") {
-			//mother = getItem(HPSTestRunTracker2014GeomDef.SupportBottom.class);
 			mother = getBaseGeometry(HPSTestRunTracker2014GeometryDefinition.Base.class);
 			ref = getBaseGeometry(HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.class);
 		} else {
-			//mother= getItem(HPSTestRunTracker2014GeomDef.SupportTop.class);
 			mother= getBaseGeometry(HPSTestRunTracker2014GeometryDefinition.Base.class);
 			ref = getBaseGeometry(HPSTestRunTracker2014GeometryDefinition.SupportPlateTop.class);
 		}
@@ -120,15 +119,11 @@
 		ModuleBundle bundle = new ModuleBundle(module);
 		addModuleBundle(bundle);
 		
+        if(doAxial) makeHalfModule("axial", module);
+		if(doColdBlock) makeColdBlock(module);
+		if(doStereo) makeHalfModule("stereo", module);
 		
-		makeHalfModule("axial", module);
 		
-		if(!onlyAxial) {
-			makeColdBlock(module);
-		
-			makeHalfModule("stereo", module);
-		}
-		
 		if(isDebug()) {
 			System.out.printf("%s: created module bundle:\n", this.getClass().getSimpleName());
 			bundle.print();
@@ -331,7 +326,10 @@
 		
 	}
 		
-	
+	public boolean doLayer(int layer) {
+	    int a = (1<<(layer-1)) & layerBitMask;
+	    return a!=0?true:false;
+	}
 
     
     /*

projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd
HPSTestRunTracker2014GeometryDefinition.java 3345 -> 3346
--- projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTestRunTracker2014GeometryDefinition.java	2014-09-25 22:39:09 UTC (rev 3345)
+++ projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTestRunTracker2014GeometryDefinition.java	2014-09-26 23:50:42 UTC (rev 3346)
@@ -6,6 +6,9 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.commons.math3.geometry.euclidean.threed.Rotation;
+import org.apache.commons.math3.geometry.euclidean.threed.RotationOrder;
+import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
 import org.lcsim.detector.Rotation3D;
 import org.lcsim.detector.Transform3D;
 import org.lcsim.detector.Translation3D;
@@ -89,7 +92,13 @@
 				setCoord();
 				setCenter();
 				setBoxDim();
+				applyCorrections();
 			}
+
+			protected void applyCorrections() {
+			    //do nothing here unless overridden
+			}
+			
 			public  void setBallPos(double x, double y, double z) {
 				ballPos = new BasicHep3Vector(x,y,z);
 			}
@@ -1018,8 +1027,11 @@
 
 			public TestRunHalfModuleStereo(String name, BaseGeometry mother, int layer, String half) {
 				super(name, mother, layer, half);
+				if(layer<=3) stereo_angle = 0.1;
+                else if(layer>=4&&layer<=5) stereo_angle = 0.05;
+                else throw new RuntimeException("Layer " + layer + " is not defined.");
 				init();
-				setExplicitRotation();
+				//setExplicitRotation();
 			}
 			
 			protected void setPos() {
@@ -1042,7 +1054,8 @@
 				ballPos = new BasicHep3Vector(ball_pos_halfmod_local_x, ball_pos_halfmod_local_y, ball_pos_halfmod_local_z);
 				veePos = new BasicHep3Vector(vee_pos_halfmod_local_x, vee_pos_halfmod_local_y,vee_pos_halfmod_local_z);
 				flatPos = new BasicHep3Vector(flat_pos_halfmod_local_x, flat_pos_halfmod_local_y,flat_pos_halfmod_local_z);
-			
+				
+				
 				// I should set the coordiantes from the the drawing without explicit roations
 				// TODO FIX THIS!
 				calcAndSetPos();
@@ -1083,6 +1096,29 @@
 				explicit_rot_angles = new BasicHep3Vector(res);
 			}
 			
+			
+			
+			protected void applyCorrections() {
+			    // Apply whatever corrections we want to the final volume as created
+			    // Maybe alignment corrections too but should be done in the top level
+			    
+                // Rotate these into the right place for the stereo
+                // My rotations here are active rotations in the mother coordinate system frame
+                // flip around u
+                Rotation r1 = new Rotation(new Vector3D(1,0,0),Math.PI);
+                //Rotation r2 = new Rotation(new Vector3D(0,1,0),stereo_angle);
+                //Rotation r = r2.applyTo(r1);
+                Rotation r = r1;
+                System.out.printf("%s: Coord before corrections\n%s\n", getClass().getSimpleName(),getCoord().toString());
+                System.out.printf("%s: box center before corrections\n%s\n", getClass().getSimpleName(),getBoxDim().toString());
+                getCoord().rotateApache(r);
+                System.out.printf("%s: Coord after corrections\n%s\n", getClass().getSimpleName(),getCoord().toString());
+                System.out.printf("%s: box center after corrections\n%s\n", getClass().getSimpleName(),getBoxDim().toString());
+                
+                
+			}
+			
+			
 		}
 		
 		public static abstract class TestRunColdBlock extends BaseGeometry {		
@@ -1449,21 +1485,42 @@
 				w = unit_z;
 			}
 
+			public Coord(Hep3Vector ball, Hep3Vector vee, Hep3Vector flat) {
+                origin = ball;
+                Hep3Vector ball_to_vee = VecOp.sub(vee, ball);
+                u = VecOp.unit(ball_to_vee);
+                Hep3Vector ball_to_flat = VecOp.sub(flat, ball);
+                w = VecOp.unit(VecOp.cross(ball_to_vee,ball_to_flat));
+                v = VecOp.cross(w, u);
+                check();
+            }
+			
 			private void check() {
-				if(u.magnitude()-1>0.00001 || v.magnitude()-1>0.00001 || v.magnitude()-1>0.00001) {
-					throw new RuntimeException("Error: this coordinate system is ill-defined " + toString());
-				}
+			    checkUnitLength();
+			    checkAngles();
 			}
+
+			private void checkUnitLength() {
+			    if(u.magnitude()-1>0.00001 || v.magnitude()-1>0.00001 || v.magnitude()-1>0.00001) {
+			        throw new RuntimeException("Error: the unit vectors of the  coordinate system is ill-defined " + toString());
+			    }
+			}
+
+			private void checkAngles() {
+			    if( (VecOp.dot(u, v)-1)>0.00001 ||  (VecOp.dot(u, w)-1)>0.00001 ||  (VecOp.dot(v, w)-1)>0.00001 ) {
+			        throw new RuntimeException("Error: the angles in coordinate system is ill-defined " + toString());
+			    }
+			}
 			
-			public Coord(Hep3Vector ball, Hep3Vector vee, Hep3Vector flat) {
-				origin = ball;
-				Hep3Vector ball_to_vee = VecOp.sub(vee, ball);
-				u = VecOp.unit(ball_to_vee);
-				Hep3Vector ball_to_flat = VecOp.sub(flat, ball);
-				w = VecOp.unit(VecOp.cross(ball_to_vee,ball_to_flat));
-				v = VecOp.cross(w, u);
-				check();
+			public void rotateApache(Rotation r) {
+			    System.out.printf("%s: apply apache rotation to this coord system\n%s\n", getClass().getSimpleName(),toString());
+			    this.u = new BasicHep3Vector(r.applyTo(new Vector3D(u.v())).toArray());
+			    this.v = new BasicHep3Vector(r.applyTo(new Vector3D(v.v())).toArray());
+			    this.w = new BasicHep3Vector(r.applyTo(new Vector3D(w.v())).toArray());
+			    System.out.printf("%s: new coord system after apache rotation to this coord system\n%s\n", getClass().getSimpleName(),toString());                
 			}
+
+			
 	/*
 			public void rotate(Hep3Vector euler_angles) {
 				RotationGeant rotation = new RotationGeant(euler_angles.x(), euler_angles.y(), euler_angles.z());
@@ -1488,7 +1545,8 @@
 			public Hep3Vector w() {
 				return w;
 			}
-			public String toString() {
+			
+            public String toString() {
 				return "Coordinate system: \norigin " + origin.toString() + "\nu " + u.toString() + "\nv " + v.toString() + "\nw " + w.toString();
 			}
 		

projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd
HPSTestRunTracker2014LCDDBuilder.java 3345 -> 3346
--- projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTestRunTracker2014LCDDBuilder.java	2014-09-25 22:39:09 UTC (rev 3345)
+++ projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTestRunTracker2014LCDDBuilder.java	2014-09-26 23:50:42 UTC (rev 3346)
@@ -124,8 +124,8 @@
 		// create the module
 		LCDDBaseGeometry lcddM = new LCDDBaseGeometry(bundle.module, lcdd, mother);
 		add(lcddM);
-		if(bundle.halfModuleAxial!=null) addHalfModule(bundle.halfModuleAxial,lcddM);
-		if(bundle.coldBlock!=null) add(new LCDDBaseGeometry(bundle.coldBlock, lcdd, lcddM));		
+		if(bundle.halfModuleAxial!=null)  addHalfModule(bundle.halfModuleAxial,lcddM);
+		if(bundle.coldBlock!=null)        add(new LCDDBaseGeometry(bundle.coldBlock, lcdd, lcddM));		
 		if(bundle.halfModuleStereo!=null) addHalfModule(bundle.halfModuleStereo,lcddM);
 	}
 

projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd
HPSTestRunTracker2014Test1Builder.java removed after 3345
--- projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTestRunTracker2014Test1Builder.java	2014-09-25 22:39:09 UTC (rev 3345)
+++ projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTestRunTracker2014Test1Builder.java	2014-09-26 23:50:42 UTC (rev 3346)
@@ -1,121 +0,0 @@
-/**
- * 
- */
-package org.lcsim.geometry.compact.converter.lcdd;
-
-import hep.physics.vec.Hep3Vector;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.lcsim.detector.Transform3D;
-import org.lcsim.geometry.compact.converter.lcdd.HPSTestRunTracker2014GeometryDefinition.BaseGeometry;
-import org.lcsim.geometry.compact.converter.lcdd.HPSTestRunTracker2014GeometryDefinition.TestRunHalfModule;
-import org.lcsim.geometry.compact.converter.lcdd.HPSTestRunTracker2014GeometryDefinition.TrackingBase;
-
-/**
- * 
- * Class used to encapsulate the rules for building geometry based building blocks defined in {@link HPSTestRunTracker2014GeometryDefinition}
- * 
- * @author Per Hansson Adrian <[log in to unmask]>
- *
- */
-public class HPSTestRunTracker2014Test1Builder extends HPSTrackerBuilder  {
-
-
-	public static boolean onlyAxial = true;
-	public static boolean onlyBottom = true;
-	public static boolean onlyL1 = true;
-	
-	
-	
-	/**
-	 *  Default constructor.
-	 */
-	public HPSTestRunTracker2014Test1Builder(boolean debugFlag) {
-		setDebug(debugFlag);
-
-	}
-
-
-	public void build() {
-
-		if(isDebug()) System.out.printf("%s: constructing the geometry objects\n", this.getClass().getSimpleName());
-
-		// Build the geometry from the basic building blocks in the geometry definition class
-		// Keep the order correct.
-		// Each item has knowledge of its mother but not its daughters
-		TrackingBase tracking = new TrackingBase("trackingVolume",null);
-		geometries.add(tracking);
-
-		
-		// Modules are built using an encapsulating class that keeps tracks of all components
-		modules = new ArrayList<ModuleBundle>();
-		
-		for(int l=1; l<=5;++l) {
-			if(onlyL1 && l!=1) continue;
-				makeModuleBundle(l,"bottom");
-				if(!onlyBottom)
-					makeModuleBundle(l,"top");
-			
-		}		
-		
-		//if(isDebug()) {
-			System.out.printf("%s: DONE constructing the geometry objects kuk\n", this.getClass().getSimpleName());
-			System.out.printf("%s: List of all the geometry objects built\n", this.getClass().getSimpleName());
-			for(BaseGeometry bg : geometries) {
-				System.out.printf("-------\n%s\n", bg.toString());
-			}
-		//}
-		
-	}
-	
-	
-
-
-	
-	/**
-	 * Create the module. 
-	 * @param layer - of the module
-	 * @param half - top or bottom half of the tracker
-	 */
-	private void makeModuleBundle(int layer, String half) 
-    {
-				
-		//String moduleName = mother.getName();
-		String moduleName = "module_L"+ layer + (half=="bottom"?"b":"t");	
-		String side = "axial";
-
-		if(isDebug()) System.out.printf("%s: makeHalfModule for %s %s \n", this.getClass().getSimpleName(), moduleName, side);
-		
-		String volName = moduleName + "_halfmodule_" + side;
-		
-		
-		
-		// find the mother and reference geometry
-		// Note that the reference geometry is the support plate and since that is assumed to be 
-		// created through it's references we don't need more than one reference to reach the mother coordinate system
-		final BaseGeometry mother = getBaseGeometry(TrackingBase.class);
-		
-		TestRunHalfModule halfModule = new HPSTestRunTracker2014GeometryDefinition.TestRunHalfModuleAxial(volName, mother, layer, half);
-		
-	
-		
-		
-		
-		if(isDebug()) {
-			System.out.printf("%s: created module bundle:\n", this.getClass().getSimpleName());
-			
-		}
-		
-    }
-
-
-
-	
-	
-	
-
-    
-	
-}

projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd
HPSTestRunTracker2014Test1LCDDBuilder.java removed after 3345
--- projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTestRunTracker2014Test1LCDDBuilder.java	2014-09-25 22:39:09 UTC (rev 3345)
+++ projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTestRunTracker2014Test1LCDDBuilder.java	2014-09-26 23:50:42 UTC (rev 3346)
@@ -1,142 +0,0 @@
-package org.lcsim.geometry.compact.converter.lcdd;
-
-import java.util.ArrayList;
-
-import org.lcsim.geometry.compact.converter.lcdd.HPSTestRunTracker2014GeometryDefinition.BaseGeometry;
-import org.lcsim.geometry.compact.converter.lcdd.HPSTestRunTracker2014GeometryDefinition.TestRunHalfModule;
-import org.lcsim.geometry.compact.converter.lcdd.HPSTestRunTracker2014GeometryDefinition.TestRunHalfModuleAxial;
-import org.lcsim.geometry.compact.converter.lcdd.HPSTestRunTracker2014GeometryDefinition.TrackingBase;
-import org.lcsim.geometry.compact.converter.lcdd.HPSTrackerBuilder.HalfModuleBundle;
-import org.lcsim.geometry.compact.converter.lcdd.HPSTrackerBuilder.ModuleBundle;
-import org.lcsim.geometry.compact.converter.lcdd.HPSTrackerLCDDBuilder.LCDDBaseGeometry;
-import org.lcsim.geometry.compact.converter.lcdd.util.Volume;
-
-/**
- * Class used by LCDD converter to build detector for SLIC. 
- * It encapsulates and adds the LCDD specific information to the generic @HPSTestRunTracker2014Builder. 
- * 
- * @author Per Hansson Adrian <[log in to unmask]>
- *
- */
-public class HPSTestRunTracker2014Test1LCDDBuilder extends HPSTrackerLCDDBuilder {
-
-	/**
-	 *  Default constructor
-	 */
-	public HPSTestRunTracker2014Test1LCDDBuilder(boolean debugFlag) {
-		super(debugFlag);
-	}
-	
-
-	
-	/**
-	 * Build the LCDD geometry objects.
-	 * @param worldVolume - the reference volume.
-	 */
-	public void build(Volume worldVolume) {
-		// build geometry
-		setBuilder(new HPSTestRunTracker2014Test1Builder(this._debug));
-
-		if(_builder==null) throw new RuntimeException("need to set builder class before calling build!");
-
-		if(isDebug()) System.out.printf("%s: build the base geometry objects\n", getClass().getSimpleName());
-
-		_builder.build();
-
-		if(isDebug()) System.out.printf("%s: DONE build the base geometry objects\n", getClass().getSimpleName());
-
-
-		if(isDebug()) System.out.printf("%s: build the LCDD geometry objects\n", getClass().getSimpleName());
-		
-		// initialize the list to store a reference to each object
-		lcddGeometries = new ArrayList<LCDDBaseGeometry>();
-
-		// Go through the list of volumes to build that is created in the generic builder class
-		// TODO this is manual now since I don't have a way of knowing in the generic builder class what is a ghost volume at this point.
-		LCDDBaseGeometry trackingGeometry = new LCDDBaseGeometry(_builder.getBaseGeometry(TrackingBase.class), worldVolume);
-		add(trackingGeometry);
-		//baseTrackerGeometry = new LCDDBaseGeometry(getBaseGeometry(Base.class), lcdd, trackingGeometry);
-		//add(baseTrackerGeometry);
-		baseTrackerGeometry = trackingGeometry;
-		
-		// build modules	
-		
-		if(isDebug()) System.out.printf("%s: build modules\n", getClass().getSimpleName());
-	
-		
-
-		// Find the mother among the LCDD objects using its name, should probably have a better way...
-		LCDDBaseGeometry mother = trackingGeometry;
-
-		// Loop over all modules created
-		for(ModuleBundle m : _builder.modules) {
-
-			// Do only L1?
-			if(HPSTestRunTracker2014Test1Builder.onlyL1 && m.getLayer()!=1) continue;
-
-			if(HPSTestRunTracker2014Test1Builder.onlyBottom && m.getHalf()!="bottom") continue;
-
-			if(isDebug()) { 
-				System.out.printf("%s: module layer %d half %s\n", getClass().getSimpleName(),m.getLayer(),m.getHalf());
-				m.print();
-			}
-			
-			HalfModuleBundle bundle = m.halfModuleAxial;
-			
-			
-			addHalfModule(bundle, mother);
-			
-			
-			
-		}
-
-
-
-		//if(isDebug()) {
-		System.out.printf("%s: DONE building the LCDD geometry objects\n", getClass().getSimpleName());
-		System.out.printf("%s: List of all %d LCDD geometry objects built\n", this.getClass().getSimpleName(), lcddGeometries.size());
-		for(LCDDBaseGeometry bg : lcddGeometries) {
-			System.out.printf("-------\n%s\n", bg.toString());
-		}
-		//}
-
-		
-
-		// Set visualization features
-		setVisualization();
-		
-		
-	}	
-	
-	/**
-	 * Rules for adding the LCDD half module geometry.
-	 * @param bundle - module to be added
-	 * @param mother - mother LCDD geometry object
-	 */
-	private void addHalfModule(HalfModuleBundle bundle, LCDDBaseGeometry mother) {
-		// This could perhaps be fixed if there is a relation with daughters in geometry definition?
-		// create the half-module
-		LCDDBaseGeometry lcddHM = new LCDDBaseGeometry(bundle.halfModule, lcdd, mother);
-		add(lcddHM);
-		// create the sensor
-		LCDDBaseGeometry lcddS = new LCDDBaseGeometry(bundle.sensor, lcdd, lcddHM);
-		add(lcddS);
-		// create the active sensor
-		LCDDBaseGeometry lcddAS = new LCDDBaseGeometry(bundle.activeSensor, lcdd, lcddS);
-		add(lcddAS);
-		
-//		// create the lamination
-//		LCDDBaseGeometry lcddL = new LCDDBaseGeometry(bundle.lamination, lcdd, lcddHM);
-//		add(lcddL);
-//		// create the carbon fiber frame
-//		LCDDBaseGeometry lcddCF = new LCDDBaseGeometry(bundle.carbonFiber, lcdd, lcddHM);
-//		add(lcddCF);
-//		// create the hybrid frame
-//		LCDDBaseGeometry lcddH = new LCDDBaseGeometry(bundle.hybrid, lcdd, lcddHM);
-//		add(lcddH);
-
-	}	
-
-	
-
-}
\ No newline at end of file

projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd
HPSTrackerJavaBuilder.java 3345 -> 3346
--- projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTrackerJavaBuilder.java	2014-09-25 22:39:09 UTC (rev 3345)
+++ projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTrackerJavaBuilder.java	2014-09-26 23:50:42 UTC (rev 3346)
@@ -363,7 +363,10 @@
             
 			//Hep3Vector lcdd_rot_angles = HPSTestRunTracker2014.getEulerAngles(unit_u,unit_v,base.getCoord().u(), base.getCoord().v());
 			//Hep3Vector lcdd_rot_angles = HPSTestRunTracker2014.getEulerAngles(base.getCoord().u(), base.getCoord().v(), unit_u,unit_v);
-			Hep3Vector lcdd_rot_angles = HPSTestRunTracker2014.getEulerAngles(base_u, base_v, unit_u,unit_v);
+			Hep3Vector lcdd_rot_angles_uv = HPSTestRunTracker2014.getEulerAngles(base_u, base_v, unit_u,unit_v);
+			Hep3Vector lcdd_rot_angles_uw = HPSTestRunTracker2014.getEulerAngles(base_u, base_w, unit_u,unit_w);
+            Hep3Vector lcdd_rot_angles_vw = HPSTestRunTracker2014.getEulerAngles(base_v, base_w, unit_v,unit_w);
+            Hep3Vector lcdd_rot_angles = lcdd_rot_angles_uw;
             //Hep3Vector lcdd_rot_angles_active = HPSTestRunTracker2014.getActiveEulerAngles(base.getCoord().v(), base.getCoord().w(), unit_v,unit_w);
 //			double rot_mat[][] = HPSTestRunTracker2014.getActiveEulerAnglesMatrix(base.getCoord().v(), base.getCoord().w(), unit_v,unit_w);
 //			Rotation3D rot_xcheck = new Rotation3D();
@@ -390,7 +393,8 @@
 				// Find the displacement of the box center due to rotation about different origin
 				// Find the origin in the physical mother coord
 				if(isDebug()) System.out.printf("%s: transform origin %s to physical mother %s\n", this.getClass().getSimpleName(),base.getCoord().origin(),physMother.getName());
-				Transform3D tpm = getTransform(base.getMother().getCoord().getTransformation(),base.getMother().getMother(),physMother.getName()); 
+				Transform3D tpm = 
+				        getTransform(base.getMother().getCoord().getTransformation(),base.getMother().getMother(),physMother.getName()); 
 				if(isDebug()) System.out.printf("%s: found transform to physical mother \n%s\n\n", this.getClass().getSimpleName(),tpm.toString());
 				Hep3Vector origin_mother = tpm.transformed(base.getCoord().origin());
 				if(isDebug()) System.out.printf("%s: origin in physical mother coord is %s\n", this.getClass().getSimpleName(),origin_mother.toString());
@@ -423,7 +427,10 @@
 				System.out.printf("%s: box_center                  %s\n", this.getClass().getSimpleName(), box_center.toString());
 				System.out.printf("%s: pos                         %s\n", this.getClass().getSimpleName(), getPos().toString());
 				System.out.printf("%s: euler                       %s\n", this.getClass().getSimpleName(), lcdd_rot_angles.toString());
-				//System.out.printf("%s: euler (active)              %s\n", this.getClass().getSimpleName(), lcdd_rot_angles_active.toString());
+				System.out.printf("%s: euler (uv)                  %s\n", this.getClass().getSimpleName(), lcdd_rot_angles_uv.toString());
+                System.out.printf("%s: euler (uw)                  %s\n", this.getClass().getSimpleName(), lcdd_rot_angles_uw.toString());
+				System.out.printf("%s: euler (vw)                  %s\n", this.getClass().getSimpleName(), lcdd_rot_angles_vw.toString());
+                //System.out.printf("%s: euler (active)              %s\n", this.getClass().getSimpleName(), lcdd_rot_angles_active.toString());
 				System.out.printf("%s: rot                         %s\n", this.getClass().getSimpleName(), getRot().toString());
 
 				//calculate the position in tracking volume separately as a xcheck

projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd
HPSTrackerLCDDBuilder.java 3345 -> 3346
--- projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTrackerLCDDBuilder.java	2014-09-25 22:39:09 UTC (rev 3345)
+++ projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTrackerLCDDBuilder.java	2014-09-26 23:50:42 UTC (rev 3346)
@@ -210,7 +210,10 @@
 			}
 			//Hep3Vector lcdd_rot_angles = HPSTestRunTracker2014.getEulerAngles(unit_u,unit_v,base.getCoord().u(), base.getCoord().v());
 			//Hep3Vector lcdd_rot_angles = HPSTestRunTracker2014.getEulerAngles(base.getCoord().u(), base.getCoord().v(), unit_u,unit_v);
-			Hep3Vector lcdd_rot_angles = HPSTestRunTracker2014.getEulerAngles(base_u, base_v, unit_u,unit_v);
+			Hep3Vector lcdd_rot_angles_uv = HPSTestRunTracker2014.getEulerAngles(base_u, base_v, unit_u,unit_v);
+            Hep3Vector lcdd_rot_angles_uw = HPSTestRunTracker2014.getEulerAngles(base_u, base_w, unit_u,unit_w);
+            Hep3Vector lcdd_rot_angles_vw = HPSTestRunTracker2014.getEulerAngles(base_v, base_w, unit_v,unit_w);
+            Hep3Vector lcdd_rot_angles = lcdd_rot_angles_uw;
             
 			// Check if there are explicit rotations built into the object itself which overrides
 			// TODO this should be included in the definition of the coordinate system. Fix this for the affected components.
@@ -234,17 +237,6 @@
 			// Create the LCDD position
 			setPos(new Position(getName() + "_position",box_center.x(), box_center.y(), box_center.z()));
 			
-			/*
-			if(getName().contains("module_L1t") && !getName().contains("halfmodule") && !getName().contains("cold")) {
-				lcdd_rot_angles = new BasicHep3Vector(-Math.PI,0,0.03);
-				lcdd_rot_angles = HPSTestRunTracker2014.getEulerAngles(base.getCoord().u(), base.getCoord().v(), new BasicHep3Vector(1,0,0),new BasicHep3Vector(0,1,0));
-				lcdd_rot_angles = HPSTestRunTracker2014.getEulerAngles(base.getCoord().u(), base.getCoord().w(), new BasicHep3Vector(1,0,0),new BasicHep3Vector(0,0,1));
-			}
-			if(getName().contains("module_L1b") && !getName().contains("halfmodule") && !getName().contains("cold")) {
-				lcdd_rot_angles = new BasicHep3Vector(0,0,-0.030);
-			}
-			*/
-			
 			setRot(new Rotation(getName() + "_rotation",lcdd_rot_angles.x(), lcdd_rot_angles.y(), lcdd_rot_angles.z()));
 			if(isDebug()) {
 				System.out.printf("%s: box_center_base_local  %s\n", this.getClass().getSimpleName(), box_center_base_local.toString());
@@ -253,7 +245,10 @@
 				System.out.printf("%s: box_center             %s\n", this.getClass().getSimpleName(), box_center.toString());
 				System.out.printf("%s: pos                    %s\n", this.getClass().getSimpleName(), getPos().toString());
 				System.out.printf("%s: euler                  %s\n", this.getClass().getSimpleName(), lcdd_rot_angles.toString());
-				System.out.printf("%s: rot                    %s\n", this.getClass().getSimpleName(), getRot().toString());
+				System.out.printf("%s: euler (uv)             %s\n", this.getClass().getSimpleName(), lcdd_rot_angles_uv.toString());
+                System.out.printf("%s: euler (uw)             %s\n", this.getClass().getSimpleName(), lcdd_rot_angles_uw.toString());
+                System.out.printf("%s: euler (vw)             %s\n", this.getClass().getSimpleName(), lcdd_rot_angles_vw.toString());
+                System.out.printf("%s: rot                    %s\n", this.getClass().getSimpleName(), getRot().toString());
 				
 				//calculate the position in tracking volume separately as a xcheck
 				Hep3Vector box_center_tracking_xcheck = HPSTrackerBuilder.transformToTracking(box_center_base_local, base);
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