Print

Print


Author: phansson
Date: Mon Oct 27 22:31:48 2014
New Revision: 3396

Log:
Make the half-module local coordinate system adhere to the lcsim definition for strip sensors so that alignment correction for sensors can be applied to the whole half-module.

Modified:
    projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/HPSTestRunTracker2014GeometryDefinition.java

Modified: projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/HPSTestRunTracker2014GeometryDefinition.java
 =============================================================================
--- projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/HPSTestRunTracker2014GeometryDefinition.java	(original)
+++ projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/HPSTestRunTracker2014GeometryDefinition.java	Mon Oct 27 22:31:48 2014
@@ -20,7 +20,6 @@
  * @author Per Hansson Adrian <[log in to unmask]>
  *
  */
-
 public class HPSTestRunTracker2014GeometryDefinition extends HPSTrackerBuilder {
 
 
@@ -31,7 +30,7 @@
     public final boolean doColdBlock = false;
     public final boolean doBottom = true;
     public final boolean doTop = true;
-    public final int layerBitMask = 0x1F;   
+    public final int layerBitMask = 0x1F; //0x1;//    
 
 
     //General
@@ -230,14 +229,14 @@
         
         // Build the half-module
         TestRunHalfModule halfModule;
-        AlignmentCorrection alignmentCorrection;
+        AlignmentCorrection alignmentCorrection = null;
         if(side == "axial") {
-            alignmentCorrection =  getHalfModuleAlignmentCorrection(isTopLayer, getOldGeomDefLayerFromVolumeName(isTopLayer, layer, true));
+            //alignmentCorrection =  getHalfModuleAlignmentCorrection(isTopLayer, getOldGeomDefLayerFromVolumeName(isTopLayer, layer, true));
             halfModule = new TestRunHalfModuleAxial(volName, mother, alignmentCorrection, layer, half);
             halfModuleBundle = new TestRunHalfModuleBundle(halfModule);
             bundle.halfModuleAxial = halfModuleBundle;
         } else if(side == "stereo") {
-            alignmentCorrection =  getHalfModuleAlignmentCorrection(isTopLayer, getOldGeomDefLayerFromVolumeName(isTopLayer, layer, false));
+            //alignmentCorrection =  getHalfModuleAlignmentCorrection(isTopLayer, getOldGeomDefLayerFromVolumeName(isTopLayer, layer, false));
             halfModule = new TestRunHalfModuleStereo(volName, mother, alignmentCorrection, layer, half);
             halfModuleBundle = new TestRunHalfModuleBundle(halfModule);
             bundle.halfModuleStereo = halfModuleBundle;
@@ -340,8 +339,18 @@
         // sensor id is hard coded in old geometry to be zero by counting over the components of the module
         int component_number = 0;
 
+        boolean isTopLayer = getHalfFromName(volName) == "top" ? true : false;
+        int layer  = getLayerFromVolumeName(volName);
+        boolean isAxial = isAxialFromName(volName);
+        int oldLayer = getOldGeomDefLayerFromVolumeName(isTopLayer, layer, isAxial);
+        if(isDebug()) System.out.printf("%s: half? %s layer %d oldlayer %d axial? %s\n", 
+                this.getClass().getSimpleName(), isTopLayer?"top":"bottom", layer,oldLayer,isAxial?"yes":"no");
+
+        AlignmentCorrection alignmentCorrection =  getHalfModuleAlignmentCorrection(isTopLayer, oldLayer);
+        
+        
         //  
-        Sensor sensor = new Sensor(volName, mother, component_number);
+        Sensor sensor = new Sensor(volName, mother, alignmentCorrection, component_number);
         sensor.setMaterial("Silicon");
 
         TestRunHalfModuleBundle hm = (TestRunHalfModuleBundle) getHalfModuleBundle((TestRunModule) mother.getMother(), mother.getName());
@@ -1191,13 +1200,26 @@
             double box_center_local_x =  TestRunHalfModule.getLength()/2.0 - ( (170.00 + 10.00) - Sensor.getSensorLength()/2.0); 
             double box_center_local_y = -1.0*TestRunHalfModule.getThickness()/2.0 + (TestRunHalfModule.getCFThickness() + HalfModuleLamination.kapton_thickness + Sensor.getSensorThickness()/2.0);
             double box_center_local_z = TestRunHalfModule.getWidth()/2.0 - ( 12.66 - (8.83 -3.00) + Sensor.getSensorWidth()/2.0 ); 
-            setCenter(box_center_local_x, box_center_local_y, box_center_local_z); 
+            if(useSiStripsConvention) {
+                setCenter(box_center_local_z, box_center_local_x, box_center_local_y); 
+            } else {
+                setCenter(box_center_local_x, box_center_local_y, box_center_local_z); 
+            }
         }
         protected void setCoord() {
             setCoord(null);
         }
         protected void setBoxDim() {
-            setBoxDim(getLength(), getThickness(), getWidth());
+            //setBoxDim(getLength(), getThickness(), getWidth());
+            
+            if(useSiStripsConvention) {
+                setBoxDim(getWidth(),getLength(),getThickness());
+                //setBoxDim(getSensorWidth(),getSensorLength(),getSensorThickness());
+            } else {
+                setBoxDim(getLength(), getThickness(), getWidth());
+                //setBoxDim(getSensorLength(),getSensorThickness(),getSensorWidth());
+            }
+            
         }
         protected double getStereoAngle() {
             return stereo_angle;
@@ -1257,15 +1279,35 @@
                 ball_pos_halfmod_local_y = -2.0*ball_pos_halfmod_local_y;
             }				
             final double ball_pos_halfmod_local_z =  dist_lower_sensor_edge_to_cold_block_mounting_surface + Sensor.getSensorWidth()/2.0;
-            final double vee_pos_halfmod_local_x =  ball_pos_halfmod_local_x + Sensor.getSensorLength()/2.0;
-            final double vee_pos_halfmod_local_y =  ball_pos_halfmod_local_y;
-            final double vee_pos_halfmod_local_z =  ball_pos_halfmod_local_z;
-            final double flat_pos_halfmod_local_x =  ball_pos_halfmod_local_x;
-            final double flat_pos_halfmod_local_y =  ball_pos_halfmod_local_y + Sensor.getSensorThickness()/2.0;
-            final double flat_pos_halfmod_local_z =  ball_pos_halfmod_local_z;		
+            
+            
+            double vee_pos_halfmod_local_x;
+            double vee_pos_halfmod_local_y;
+            double vee_pos_halfmod_local_z;
+            double flat_pos_halfmod_local_x;
+            double flat_pos_halfmod_local_y;
+            double flat_pos_halfmod_local_z;
+
+
+            if(useSiStripsConvention) {
+                vee_pos_halfmod_local_x =  ball_pos_halfmod_local_x;
+                vee_pos_halfmod_local_y =  ball_pos_halfmod_local_y;
+                vee_pos_halfmod_local_z =  ball_pos_halfmod_local_z + Sensor.getSensorWidth()/2.0;
+                flat_pos_halfmod_local_x =  ball_pos_halfmod_local_x + Sensor.getSensorLength()/2.0;
+                flat_pos_halfmod_local_y =  ball_pos_halfmod_local_y;
+                flat_pos_halfmod_local_z =  ball_pos_halfmod_local_z;        
+            } else {
+                vee_pos_halfmod_local_x =  ball_pos_halfmod_local_x + Sensor.getSensorLength()/2.0;
+                vee_pos_halfmod_local_y =  ball_pos_halfmod_local_y;
+                vee_pos_halfmod_local_z =  ball_pos_halfmod_local_z;
+                flat_pos_halfmod_local_x =  ball_pos_halfmod_local_x;
+                flat_pos_halfmod_local_y =  ball_pos_halfmod_local_y + Sensor.getSensorThickness()/2.0;
+                flat_pos_halfmod_local_z =  ball_pos_halfmod_local_z;        
+            }
             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);
+            
             
             if(debug) {
                 System.out.printf("%s: survey positions for %s\n",this.getClass().getSimpleName(),getName());
@@ -1296,19 +1338,82 @@
             final double coldBlockThick = getLayer() <=3 ? TestRunColdBlockL13.coldblock_L13_thickness : TestRunColdBlockL45.coldblock_L45_thickness;
             final double dist_lower_sensor_edge_to_cold_block_mounting_surface = getLayer() <=3 ? TestRunModuleL13.dist_lower_sensor_edge_to_cold_block_mounting_surface : TestRunModuleL45.dist_lower_sensor_edge_to_cold_block_mounting_surface;
 
-            final double ball_pos_halfmod_local_x =  dist_sensor_center_to_coldblock_hole_vdir;
+//            final double ball_pos_halfmod_local_x =  dist_sensor_center_to_coldblock_hole_vdir;
+//            // note minus sign to separate from axial
+//            final double ball_pos_halfmod_local_y =  -1.0 * (-1.0* (coldBlockThick/2.0 + TestRunHalfModule.getCFThickness() + HalfModuleLamination.kapton_thickness + Sensor.getSensorThickness()/2.0));
+//            final double ball_pos_halfmod_local_z =  dist_lower_sensor_edge_to_cold_block_mounting_surface + Sensor.getSensorWidth()/2.0;
+//            final double vee_pos_halfmod_local_x =  ball_pos_halfmod_local_x + Sensor.getSensorLength()/2.0;
+//            final double vee_pos_halfmod_local_y =  ball_pos_halfmod_local_y;
+//            final double vee_pos_halfmod_local_z =  ball_pos_halfmod_local_z;
+//            final double flat_pos_halfmod_local_x =  ball_pos_halfmod_local_x;
+//            final double flat_pos_halfmod_local_y =  ball_pos_halfmod_local_y + Sensor.getSensorThickness()/2.0;
+//            final double flat_pos_halfmod_local_z =  ball_pos_halfmod_local_z;		
+//            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);
+            
+            double ball_pos_halfmod_local_x;
+            double ball_pos_halfmod_local_y;
+            double ball_pos_halfmod_local_z;
+            double vee_pos_halfmod_local_x;
+            double vee_pos_halfmod_local_y;
+            double vee_pos_halfmod_local_z;
+            double flat_pos_halfmod_local_x;
+            double flat_pos_halfmod_local_y;
+            double flat_pos_halfmod_local_z;
+
+            ball_pos_halfmod_local_x =  dist_sensor_center_to_coldblock_hole_vdir;
             // note minus sign to separate from axial
-            final double ball_pos_halfmod_local_y =  -1.0 * (-1.0* (coldBlockThick/2.0 + TestRunHalfModule.getCFThickness() + HalfModuleLamination.kapton_thickness + Sensor.getSensorThickness()/2.0));
-            final double ball_pos_halfmod_local_z =  dist_lower_sensor_edge_to_cold_block_mounting_surface + Sensor.getSensorWidth()/2.0;
-            final double vee_pos_halfmod_local_x =  ball_pos_halfmod_local_x + Sensor.getSensorLength()/2.0;
-            final double vee_pos_halfmod_local_y =  ball_pos_halfmod_local_y;
-            final double vee_pos_halfmod_local_z =  ball_pos_halfmod_local_z;
-            final double flat_pos_halfmod_local_x =  ball_pos_halfmod_local_x;
-            final double flat_pos_halfmod_local_y =  ball_pos_halfmod_local_y + Sensor.getSensorThickness()/2.0;
-            final double flat_pos_halfmod_local_z =  ball_pos_halfmod_local_z;		
+            ball_pos_halfmod_local_y =  -1.0 * (-1.0* (coldBlockThick/2.0 + TestRunHalfModule.getCFThickness() + HalfModuleLamination.kapton_thickness + Sensor.getSensorThickness()/2.0));
+            ball_pos_halfmod_local_z =  dist_lower_sensor_edge_to_cold_block_mounting_surface + Sensor.getSensorWidth()/2.0;
+            
+            if(useSiStripsConvention) {
+
+                vee_pos_halfmod_local_x =  ball_pos_halfmod_local_x ;
+                vee_pos_halfmod_local_y =  ball_pos_halfmod_local_y;
+                vee_pos_halfmod_local_z =  ball_pos_halfmod_local_z + Sensor.getSensorWidth()/2.0;
+                flat_pos_halfmod_local_x =  ball_pos_halfmod_local_x + Sensor.getSensorLength()/2.0;
+                flat_pos_halfmod_local_y =  ball_pos_halfmod_local_y;
+                flat_pos_halfmod_local_z =  ball_pos_halfmod_local_z;      
+
+
+
+                //                vee_pos_halfmod_local_x =  ball_pos_halfmod_local_x;
+                //                vee_pos_halfmod_local_y =  ball_pos_halfmod_local_y;
+                //                vee_pos_halfmod_local_z =  ball_pos_halfmod_local_z - Sensor.getSensorWidth()/2.0;
+                //                flat_pos_halfmod_local_x =  ball_pos_halfmod_local_x + Sensor.getSensorLength()/2.0;
+                //                flat_pos_halfmod_local_y =  ball_pos_halfmod_local_y;
+                //                flat_pos_halfmod_local_z =  ball_pos_halfmod_local_z;            
+
+
+            } else {
+                
+                 vee_pos_halfmod_local_x =  ball_pos_halfmod_local_x + Sensor.getSensorLength()/2.0;
+                 vee_pos_halfmod_local_y =  ball_pos_halfmod_local_y;
+                 vee_pos_halfmod_local_z =  ball_pos_halfmod_local_z;
+                 flat_pos_halfmod_local_x =  ball_pos_halfmod_local_x;
+                 flat_pos_halfmod_local_y =  ball_pos_halfmod_local_y + Sensor.getSensorThickness()/2.0;
+                 flat_pos_halfmod_local_z =  ball_pos_halfmod_local_z;      
+                
+                
+                
+//                
+//                vee_pos_halfmod_local_x =  ball_pos_halfmod_local_x + Sensor.getSensorLength()/2.0;
+//                vee_pos_halfmod_local_y =  ball_pos_halfmod_local_y;
+//                vee_pos_halfmod_local_z =  ball_pos_halfmod_local_z;
+//                flat_pos_halfmod_local_x =  ball_pos_halfmod_local_x;
+//                flat_pos_halfmod_local_y =  ball_pos_halfmod_local_y + Sensor.getSensorThickness()/2.0;
+//                flat_pos_halfmod_local_z =  ball_pos_halfmod_local_z;        
+            }
+           
+            
+            
+            
+            
             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);
+            
             
             if(debug) {
                 System.out.printf("%s: survey positions for %s\n",this.getClass().getSimpleName(),getName());
@@ -1448,12 +1553,18 @@
     }
 
 
+    /**
+     * Silicon sensor @SurveyVolume.
+     * The coordinate system is located at the same position and orientation as the half-module.
+     * @author Per Hansson Adrian <[log in to unmask]>
+     *
+     */
     public static class Sensor extends HalfModuleComponent {
         static final double sensor_length= 100.00; 
         private static final double sensor_width = 40.34; 
         private static final double sensor_thickness = 0.32;
-        public Sensor(String name, SurveyVolume m, int id) {
-            super(name, m, id);
+        public Sensor(String name, SurveyVolume mother, AlignmentCorrection alignmentCorrection, int id) {
+            super(name, mother, alignmentCorrection, id);
             init();
         }			
         public static double getSensorLength() {
@@ -1471,16 +1582,20 @@
         protected void setPos() {
             
             if(debug) System.out.printf("%s: setPos for %s\n",this.getClass().getSimpleName(),getName());
-            
-            if(useSiStripsConvention) {
-                setBallPos(0,0,0);
-                setVeePos(ballPos.x(), ballPos.y(), ballPos.z() + getSensorWidth()/2.0);
-                setFlatPos(ballPos.x() + getSensorLength()/2.0,ballPos.y(), ballPos.z());					
-            } else {
-                setBallPos(0,0,0);
-                setVeePos(ballPos.x() + getSensorLength()/2.0, ballPos.y(), ballPos.z());
-                setFlatPos(ballPos.x(),ballPos.y() + getSensorThickness()/2.0, ballPos.z());
-            }
+
+            setBallPos(0,0,0);
+            setVeePos(ballPos.x() + getSensorWidth()/2.0, ballPos.y(), ballPos.z());
+            setFlatPos(ballPos.x(),ballPos.y() + getSensorLength()/2.0, ballPos.z());                   
+            
+//            if(useSiStripsConvention) {
+//                setBallPos(0,0,0);
+//                setVeePos(ballPos.x(), ballPos.y(), ballPos.z() + getSensorWidth()/2.0);
+//                setFlatPos(ballPos.x() + getSensorLength()/2.0,ballPos.y(), ballPos.z());					
+//            } else {
+//                setBallPos(0,0,0);
+//                setVeePos(ballPos.x() + getSensorLength()/2.0, ballPos.y(), ballPos.z());
+//                setFlatPos(ballPos.x(),ballPos.y() + getSensorThickness()/2.0, ballPos.z());
+//            }
 
             if(debug) {
                 System.out.printf("%s: survey positions for %s\n",this.getClass().getSimpleName(),getName());
@@ -1515,6 +1630,12 @@
         }			
     }
 
+    /**
+     * Active part of the @Sensor @SurveyVolume.
+     * The coordinate system is located at the same position and orientation as the sensor.
+     * @author Per Hansson Adrian <[log in to unmask]>
+     *
+     */
     public static class ActiveSensor extends SurveyVolume {
         private static final double sensor_active_length= 98.33;
         private static final double sensor_active_width = 38.3399;
@@ -1538,16 +1659,20 @@
         protected void setPos() {
             
             if(debug) System.out.printf("%s: setPos for %s\n",this.getClass().getSimpleName(),getName());
-            
-            if(useSiStripsConvention) {
-                ballPos = new BasicHep3Vector(0,0,0);
-                veePos = new BasicHep3Vector(getActiveSensorWidth()/2.0,0,0);
-                flatPos = new BasicHep3Vector(0,getActiveSensorLength()/2.0,0);
-            } else {
-                ballPos = new BasicHep3Vector(0,0,0);
-                veePos = new BasicHep3Vector(getActiveSensorWidth()/2.0,0,0);
-                flatPos = new BasicHep3Vector(0,getActiveSensorLength()/2.0,0);
-            }
+
+            ballPos = new BasicHep3Vector(0,0,0);
+            veePos = new BasicHep3Vector(getActiveSensorWidth()/2.0,0,0);
+            flatPos = new BasicHep3Vector(0,getActiveSensorLength()/2.0,0);
+
+//            if(useSiStripsConvention) {
+//                ballPos = new BasicHep3Vector(0,0,0);
+//                veePos = new BasicHep3Vector(getActiveSensorWidth()/2.0,0,0);
+//                flatPos = new BasicHep3Vector(0,getActiveSensorLength()/2.0,0);
+//            } else {
+//                ballPos = new BasicHep3Vector(0,0,0);
+//                veePos = new BasicHep3Vector(getActiveSensorWidth()/2.0,0,0);
+//                flatPos = new BasicHep3Vector(0,getActiveSensorLength()/2.0,0);
+//            }
             
             if(debug) {
                 System.out.printf("%s: survey positions for %s\n",this.getClass().getSimpleName(),getName());
@@ -1560,20 +1685,248 @@
         protected void setCenter() {
             setCenter(0,0,0);
         }
-        @Override
         protected void setBoxDim() {
-            if(useSiStripsConvention) {
-                setBoxDim(getActiveSensorWidth(), getActiveSensorLength(), getActiveSensorThickness());
-            } else {
-                setBoxDim(getActiveSensorLength(),getActiveSensorThickness(),getActiveSensorWidth());
-            }
-        }
-    }
-
+
+            setBoxDim(getActiveSensorWidth(), getActiveSensorLength(), getActiveSensorThickness());
+
+//            if(useSiStripsConvention) {
+//                setBoxDim(getActiveSensorWidth(), getActiveSensorLength(), getActiveSensorThickness());
+//            } else {
+//                setBoxDim(getActiveSensorLength(),getActiveSensorThickness(),getActiveSensorWidth());
+//            }
+        }
+    }
+
+ 
+    /**
+     * Kapton insulation @SurveyVolume for the half-module
+     * The coordinate system is located at the same position and orientation as the sensor.
+     * @author Per Hansson Adrian <[log in to unmask]>
+     *
+     */
+    public static class HalfModuleLamination extends HalfModuleComponent {
+        protected static final double kapton_length = 184.0;
+        protected static final double kapton_width = 40.0;
+        protected static final double kapton_thickness = 0.050;
+        public HalfModuleLamination(String name, SurveyVolume m, int id) {
+            super(name, m, null, id);
+            init();
+        }
+        protected void setPos() {
+
+            if(debug) System.out.printf("%s: setPos for %s\n",this.getClass().getSimpleName(),getName());
+
+            //             double ball_pos_kapton_local_x =  -1 * (180.0 - Sensor.getSensorLength()/2.0) + 8.5;
+            //             double ball_pos_kapton_local_y =  (Sensor.getSensorThickness()/2.0 + HalfModuleLamination.kapton_thickness/2.0);
+            //             double ball_pos_kapton_local_z = -1 * (Sensor.getSensorWidth()/2.0 + 12.66) + 8.83 - 3.00 + 6.00 ;
+            //             double vee_pos_kapton_local_x =  ball_pos_kapton_local_x + 1.0; // arbitrary distance
+            //             double vee_pos_kapton_local_y =  ball_pos_kapton_local_y;
+            //             double vee_pos_kapton_local_z =  ball_pos_kapton_local_z;
+            //             double flat_pos_kapton_local_x =  ball_pos_kapton_local_x;
+            //             double flat_pos_kapton_local_y =  ball_pos_kapton_local_y + HalfModuleLamination.kapton_thickness/2.0; // arbitrary distance
+            //             double flat_pos_kapton_local_z =  ball_pos_kapton_local_z;
+
+            double ball_pos_kapton_local_x =  -1 * (Sensor.getSensorWidth()/2.0 + 12.66) + 8.83 - 3.00 + 6.00;
+            double ball_pos_kapton_local_y =  -1 * (180.0 - Sensor.getSensorLength()/2.0) + 8.5;
+            double ball_pos_kapton_local_z = (Sensor.getSensorThickness()/2.0 + HalfModuleLamination.kapton_thickness/2.0);
+            double vee_pos_kapton_local_x =  ball_pos_kapton_local_x + Sensor.getSensorWidth()/2.0; // arbitrary distance
+            double vee_pos_kapton_local_y =  ball_pos_kapton_local_y;
+            double vee_pos_kapton_local_z =  ball_pos_kapton_local_z;
+            double flat_pos_kapton_local_x =  ball_pos_kapton_local_x;
+            double flat_pos_kapton_local_y =  ball_pos_kapton_local_y + Sensor.getSensorLength(); // arbitrary distance
+            double flat_pos_kapton_local_z =  ball_pos_kapton_local_z;
+
+
+
+
+            ballPos = new BasicHep3Vector(ball_pos_kapton_local_x,ball_pos_kapton_local_y,ball_pos_kapton_local_z);
+            veePos = new BasicHep3Vector(vee_pos_kapton_local_x,vee_pos_kapton_local_y,vee_pos_kapton_local_z);
+            flatPos = new BasicHep3Vector(flat_pos_kapton_local_x,flat_pos_kapton_local_y,flat_pos_kapton_local_z);
+
+            if(debug) {
+                System.out.printf("%s: survey positions for %s\n",this.getClass().getSimpleName(),getName());
+                printSurveyPos();
+            }
+        }
+        protected void setCenter() {
+            setCenter(getWidth()/2.0, getLength()/2.0,0.0);
+            //setCenter(getLength()/2.0, 0.0, getWidth()/2.0);
+        }
+        protected  double getThickness() {
+            return kapton_thickness;
+        }
+        protected  double getHeigth() {
+            return getThickness();
+        }
+        protected  double getWidth() {
+            return kapton_width;
+        }
+        protected  double getLength() {
+            return kapton_length;
+        }
+        protected void setBoxDim() {
+            setBoxDim(getWidth(),getLength(),getThickness());
+            //setBoxDim(getLength(),getThickness(),getWidth());
+        }
+    }
+
+    /**
+     * Carbon fiber backing @SurveyVolume for the half-module
+     * The coordinate system is located at the same position and orientation as the sensor.
+     * @author Per Hansson Adrian <[log in to unmask]>
+     *
+     */
+    public static class CarbonFiber extends HalfModuleComponent {
+        protected static  final double cf_length = 200.;
+        protected static  final double cf_width = 45.;
+        protected static  final double cf_thickness = 0.250;
+        public CarbonFiber(String name, SurveyVolume m, int id) {
+            super(name, m, null, id);
+            init();
+        }
+        protected void setPos() {
+            
+            if(debug) System.out.printf("%s: setPos for %s\n",this.getClass().getSimpleName(),getName());
+            
+//            final double ball_pos_cf_local_x =  -1 * (180.0 - Sensor.getSensorLength()/2.0);
+//            final double ball_pos_cf_local_y =  (Sensor.getSensorThickness()/2.0 + HalfModuleLamination.kapton_thickness + TestRunHalfModule.getCFThickness()/2.0);
+//            final double ball_pos_cf_local_z = -1 * (Sensor.getSensorWidth()/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;
+//            final double vee_pos_cf_local_z =  ball_pos_cf_local_z;
+//            final double flat_pos_cf_local_x =  ball_pos_cf_local_x;
+//            final double flat_pos_cf_local_y =  ball_pos_cf_local_y + TestRunHalfModule.getCFThickness()/2.0; // arbitrary distance
+//            final double flat_pos_cf_local_z =  ball_pos_cf_local_z;
+//            setBallPos(ball_pos_cf_local_x,ball_pos_cf_local_y,ball_pos_cf_local_z);
+//            setVeePos(vee_pos_cf_local_x,vee_pos_cf_local_y,vee_pos_cf_local_z);
+//            setFlatPos(flat_pos_cf_local_x,flat_pos_cf_local_y,flat_pos_cf_local_z);
+           
+            final double ball_pos_cf_local_x =  -1 * (Sensor.getSensorWidth()/2.0 + 12.66) + 8.83 - 3.00;
+            final double ball_pos_cf_local_y =  -1 * (180.0 - Sensor.getSensorLength()/2.0);
+            final double ball_pos_cf_local_z = (Sensor.getSensorThickness()/2.0 + HalfModuleLamination.kapton_thickness + TestRunHalfModule.getCFThickness()/2.0);
+            final double vee_pos_cf_local_x =  ball_pos_cf_local_x + Sensor.getSensorWidth()/2.0; // arbitrary distance
+            final double vee_pos_cf_local_y =  ball_pos_cf_local_y;
+            final double vee_pos_cf_local_z =  ball_pos_cf_local_z;
+            final double flat_pos_cf_local_x =  ball_pos_cf_local_x;
+            final double flat_pos_cf_local_y =  ball_pos_cf_local_y + Sensor.getSensorLength()/2.0; // arbitrary distance
+            final double flat_pos_cf_local_z =  ball_pos_cf_local_z;
+            setBallPos(ball_pos_cf_local_x,ball_pos_cf_local_y,ball_pos_cf_local_z);
+            setVeePos(vee_pos_cf_local_x,vee_pos_cf_local_y,vee_pos_cf_local_z);
+            setFlatPos(flat_pos_cf_local_x,flat_pos_cf_local_y,flat_pos_cf_local_z);
+           
+            
+            
+            
+            if(debug) {
+                System.out.printf("%s: survey positions for %s\n",this.getClass().getSimpleName(),getName());
+                printSurveyPos();
+            }
+            
+        }
+        protected void setCenter() {
+            setCenter(getWidth()/2.0, getLength()/2.0, 0.0);
+            //setCenter(getLength()/2.0, 0.0, getWidth()/2.0);
+        }
+        protected double getThickness() {
+            return cf_thickness;
+        }
+        protected double getWidth() {
+            return cf_width;
+        }
+        protected double getLength() {
+            return cf_length;
+        }
+        protected double getHeigth() {
+            return getThickness();
+        }
+        protected void setBoxDim() {
+            setBoxDim(getWidth(),getLength(),getThickness());
+            //setBoxDim(getLength(),getThickness(),getWidth());
+        }
+    }
+
+    /**
+     * Hybrid @SurveyVolume for the half-module
+     * The coordinate system is located at the same position and orientation as the sensor.
+     * @author Per Hansson Adrian <[log in to unmask]>
+     *
+     */
+    public static class Hybrid extends HalfModuleComponent {
+        protected static final double hybrid_length = 170.0 - Sensor.getSensorLength(); // sensor b-to-b with hybrid
+        protected static final double hybrid_width  = Sensor.getSensorWidth();
+        protected static final double hybrid_thickness = 4.0/64.0*inch;
+        public Hybrid(String name, SurveyVolume m, int id) {
+            super(name, m, null, id);
+            init();
+        }
+        protected void setPos() {
+            
+            if(debug) System.out.printf("%s: setPos for %s\n",this.getClass().getSimpleName(),getName());
+            
+//            final double ball_pos_hybrid_local_x =  -1 * (170.0 - Sensor.getSensorLength()/2.0);
+//            final double ball_pos_hybrid_local_y =  (Sensor.getSensorThickness()/2.0 - TestRunHalfModule.getHybridThickness()/2.0);
+//            final double ball_pos_hybrid_local_z = -1 * (Sensor.getSensorWidth()/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;
+//            final double vee_pos_hybrid_local_z =  ball_pos_hybrid_local_z;
+//            final double flat_pos_hybrid_local_x =  ball_pos_hybrid_local_x;
+//            final double flat_pos_hybrid_local_y =  ball_pos_hybrid_local_y + TestRunHalfModule.getHybridThickness()/2.0; // arbitrary distance
+//            final double flat_pos_hybrid_local_z =  ball_pos_hybrid_local_z;
+//            setBallPos(ball_pos_hybrid_local_x,ball_pos_hybrid_local_y,ball_pos_hybrid_local_z);
+//            setVeePos(vee_pos_hybrid_local_x,vee_pos_hybrid_local_y,vee_pos_hybrid_local_z);
+//            setFlatPos(flat_pos_hybrid_local_x,flat_pos_hybrid_local_y,flat_pos_hybrid_local_z);
+            
+            final double ball_pos_hybrid_local_x =  -1 * (Sensor.getSensorWidth()/2.0);
+            final double ball_pos_hybrid_local_y =  -1 * (170.0 - Sensor.getSensorLength()/2.0);
+            final double ball_pos_hybrid_local_z = (Sensor.getSensorThickness()/2.0 - TestRunHalfModule.getHybridThickness()/2.0);
+            final double vee_pos_hybrid_local_x =  ball_pos_hybrid_local_x + Sensor.getSensorWidth()/2.0; // arbitrary distance
+            final double vee_pos_hybrid_local_y =  ball_pos_hybrid_local_y;
+            final double vee_pos_hybrid_local_z =  ball_pos_hybrid_local_z;
+            final double flat_pos_hybrid_local_x =  ball_pos_hybrid_local_x;
+            final double flat_pos_hybrid_local_y =  ball_pos_hybrid_local_y + Sensor.getSensorLength()/2.0; // arbitrary distance
+            final double flat_pos_hybrid_local_z =  ball_pos_hybrid_local_z;
+            setBallPos(ball_pos_hybrid_local_x,ball_pos_hybrid_local_y,ball_pos_hybrid_local_z);
+            setVeePos(vee_pos_hybrid_local_x,vee_pos_hybrid_local_y,vee_pos_hybrid_local_z);
+            setFlatPos(flat_pos_hybrid_local_x,flat_pos_hybrid_local_y,flat_pos_hybrid_local_z);
+            
+            
+            if(debug) {
+                System.out.printf("%s: survey positions for %s\n",this.getClass().getSimpleName(),getName());
+                printSurveyPos();
+            }
+        }
+        protected void setCenter() {
+            setCenter(getWidth()/2.0, getLength()/2.0, 0.0);
+            //setCenter(getLength()/2.0, 0.0, getWidth()/2.0);
+        }
+        protected double getThickness() {
+            return hybrid_thickness;
+        }
+        protected double getHeigth() {
+            return getThickness();
+        }
+        protected double getWidth() {
+            return hybrid_width;
+        }
+        protected double getLength() {
+            return hybrid_length;
+        }
+        protected void setBoxDim() {
+            setBoxDim(getWidth(), getLength(),getThickness());
+            //setBoxDim(getLength(),getThickness(), getWidth());
+        }
+    }
+
+
+    /**
+     * Base class for components of a half-module @SurveyVolume
+     * @author Per Hansson Adrian <[log in to unmask]>
+     *
+     */
     public static abstract class HalfModuleComponent extends SurveyVolume {
         int id = -1;
-        public HalfModuleComponent(String name, SurveyVolume m, int id) {
-            super(name, m, null);
+        public HalfModuleComponent(String name, SurveyVolume mother, AlignmentCorrection alignmentCorrection, int id) {
+            super(name, mother, alignmentCorrection);
             this.id = id;
         }
         protected abstract double getThickness();
@@ -1586,162 +1939,9 @@
         public int getId() {
             return id;
         }
-    }		
-
-    public static class HalfModuleLamination extends HalfModuleComponent {
-        protected static final double kapton_length = 184.0;
-        protected static final double kapton_width = 40.0;
-        protected static final double kapton_thickness = 0.050;
-        public HalfModuleLamination(String name, SurveyVolume m, int id) {
-            super(name, m, id);
-            init();
-        }
-        protected void setPos() {
-            
-            if(debug) System.out.printf("%s: setPos for %s\n",this.getClass().getSimpleName(),getName());
-            
-            final double ball_pos_kapton_local_x =  -1 * (180.0 - Sensor.getSensorLength()/2.0) + 8.5;
-            final double ball_pos_kapton_local_y =  (Sensor.getSensorThickness()/2.0 + HalfModuleLamination.kapton_thickness/2.0);
-            final double ball_pos_kapton_local_z = -1 * (Sensor.getSensorWidth()/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;
-            final double vee_pos_kapton_local_z =  ball_pos_kapton_local_z;
-            final double flat_pos_kapton_local_x =  ball_pos_kapton_local_x;
-            final double flat_pos_kapton_local_y =  ball_pos_kapton_local_y + HalfModuleLamination.kapton_thickness/2.0; // arbitrary distance
-            final double flat_pos_kapton_local_z =  ball_pos_kapton_local_z;
-
-            ballPos = new BasicHep3Vector(ball_pos_kapton_local_x,ball_pos_kapton_local_y,ball_pos_kapton_local_z);
-            veePos = new BasicHep3Vector(vee_pos_kapton_local_x,vee_pos_kapton_local_y,vee_pos_kapton_local_z);
-            flatPos = new BasicHep3Vector(flat_pos_kapton_local_x,flat_pos_kapton_local_y,flat_pos_kapton_local_z);
-
-            if(debug) {
-                System.out.printf("%s: survey positions for %s\n",this.getClass().getSimpleName(),getName());
-                printSurveyPos();
-            }
-        }
-        protected void setCenter() {
-            setCenter(getLength()/2.0, 0.0, getWidth()/2.0);
-        }
-        protected  double getThickness() {
-            return kapton_thickness;
-        }
-        protected  double getHeigth() {
-            return getThickness();
-        }
-        protected  double getWidth() {
-            return kapton_width;
-        }
-        protected  double getLength() {
-            return kapton_length;
-        }
-        protected void setBoxDim() {
-            setBoxDim(getLength(),getThickness(),getWidth());
-        }
-    }
-
-    public static class CarbonFiber extends HalfModuleComponent {
-        protected static  final double cf_length = 200.;
-        protected static  final double cf_width = 45.;
-        protected static  final double cf_thickness = 0.250;
-        public CarbonFiber(String name, SurveyVolume m, int id) {
-            super(name, m, id);
-            init();
-        }
-        protected void setPos() {
-            
-            if(debug) System.out.printf("%s: setPos for %s\n",this.getClass().getSimpleName(),getName());
-            
-            final double ball_pos_cf_local_x =  -1 * (180.0 - Sensor.getSensorLength()/2.0);
-            final double ball_pos_cf_local_y =  (Sensor.getSensorThickness()/2.0 + HalfModuleLamination.kapton_thickness + TestRunHalfModule.getCFThickness()/2.0);
-            final double ball_pos_cf_local_z = -1 * (Sensor.getSensorWidth()/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;
-            final double vee_pos_cf_local_z =  ball_pos_cf_local_z;
-            final double flat_pos_cf_local_x =  ball_pos_cf_local_x;
-            final double flat_pos_cf_local_y =  ball_pos_cf_local_y + TestRunHalfModule.getCFThickness()/2.0; // arbitrary distance
-            final double flat_pos_cf_local_z =  ball_pos_cf_local_z;
-            setBallPos(ball_pos_cf_local_x,ball_pos_cf_local_y,ball_pos_cf_local_z);
-            setVeePos(vee_pos_cf_local_x,vee_pos_cf_local_y,vee_pos_cf_local_z);
-            setFlatPos(flat_pos_cf_local_x,flat_pos_cf_local_y,flat_pos_cf_local_z);
-            
-            if(debug) {
-                System.out.printf("%s: survey positions for %s\n",this.getClass().getSimpleName(),getName());
-                printSurveyPos();
-            }
-            
-        }
-        protected void setCenter() {
-            setCenter(getLength()/2.0, 0.0, getWidth()/2.0);
-        }
-        protected double getThickness() {
-            return cf_thickness;
-        }
-        protected double getWidth() {
-            return cf_width;
-        }
-        protected double getLength() {
-            return cf_length;
-        }
-        protected double getHeigth() {
-            return getThickness();
-        }
-        protected void setBoxDim() {
-            setBoxDim(getLength(),getThickness(),getWidth());
-        }
-    }
-
-
-    public static class Hybrid extends HalfModuleComponent {
-        protected static final double hybrid_length = 170.0 - Sensor.getSensorLength(); // sensor b-to-b with hybrid
-        protected static final double hybrid_width  = Sensor.getSensorWidth();
-        protected static final double hybrid_thickness = 4.0/64.0*inch;
-        public Hybrid(String name, SurveyVolume m, int id) {
-            super(name, m, id);
-            init();
-        }
-        protected void setPos() {
-            
-            if(debug) System.out.printf("%s: setPos for %s\n",this.getClass().getSimpleName(),getName());
-            
-            final double ball_pos_hybrid_local_x =  -1 * (170.0 - Sensor.getSensorLength()/2.0);
-            final double ball_pos_hybrid_local_y =  (Sensor.getSensorThickness()/2.0 - TestRunHalfModule.getHybridThickness()/2.0);
-            final double ball_pos_hybrid_local_z = -1 * (Sensor.getSensorWidth()/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;
-            final double vee_pos_hybrid_local_z =  ball_pos_hybrid_local_z;
-            final double flat_pos_hybrid_local_x =  ball_pos_hybrid_local_x;
-            final double flat_pos_hybrid_local_y =  ball_pos_hybrid_local_y + TestRunHalfModule.getHybridThickness()/2.0; // arbitrary distance
-            final double flat_pos_hybrid_local_z =  ball_pos_hybrid_local_z;
-            setBallPos(ball_pos_hybrid_local_x,ball_pos_hybrid_local_y,ball_pos_hybrid_local_z);
-            setVeePos(vee_pos_hybrid_local_x,vee_pos_hybrid_local_y,vee_pos_hybrid_local_z);
-            setFlatPos(flat_pos_hybrid_local_x,flat_pos_hybrid_local_y,flat_pos_hybrid_local_z);
-            
-            if(debug) {
-                System.out.printf("%s: survey positions for %s\n",this.getClass().getSimpleName(),getName());
-                printSurveyPos();
-            }
-        }
-        protected void setCenter() {
-            setCenter(getLength()/2.0, 0.0, getWidth()/2.0);
-        }
-        protected double getThickness() {
-            return hybrid_thickness;
-        }
-        protected double getHeigth() {
-            return getThickness();
-        }
-        protected double getWidth() {
-            return hybrid_width;
-        }
-        protected double getLength() {
-            return hybrid_length;
-        }
-        protected void setBoxDim() {
-            setBoxDim(getLength(),getThickness(), getWidth());
-        }
-    }
-
-
+    }       
+
+    
 
     public static class TestRunModuleBundle extends ModuleBundle {
         TestRunModuleBundle(TestRunModule m) {

########################################################################
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