LISTSERV mailing list manager LISTSERV 16.5

Help for HPS-SVN Archives


HPS-SVN Archives

HPS-SVN Archives


HPS-SVN@LISTSERV.SLAC.STANFORD.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

HPS-SVN Home

HPS-SVN Home

HPS-SVN  December 2016

HPS-SVN December 2016

Subject:

r4592 - /java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/

From:

[log in to unmask]

Reply-To:

Notification of commits to the hps svn repository <[log in to unmask]>

Date:

Thu, 1 Dec 2016 20:39:10 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (8091 lines)

Author: [log in to unmask]
Date: Thu Dec  1 12:39:07 2016
New Revision: 4592

Log:
Changing some of the 2014 converter files. These changes were made in the layer0-branch and are now copied into the java-trunk.

Modified:
    java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/HPSTestRunTracker2014GeometryDefinition.java
    java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/HPSTracker2014GeometryDefinition.java
    java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/HPSTracker2014JavaBuilder.java
    java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/HPSTracker2014LCDDBuilder.java
    java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/HPSTracker2014v1GeometryDefinition.java
    java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/HPSTrackerBuilder.java

Modified: java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/HPSTestRunTracker2014GeometryDefinition.java
 =============================================================================
--- java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/HPSTestRunTracker2014GeometryDefinition.java	(original)
+++ java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/HPSTestRunTracker2014GeometryDefinition.java	Thu Dec  1 12:39:07 2016
@@ -19,22 +19,31 @@
  * @author Per Hansson Adrian <[log in to unmask]>
  *
  */
-public class HPSTestRunTracker2014GeometryDefinition extends HPSTrackerGeometryDefinition {
-
-
-
-    
-    //General
+public class HPSTestRunTracker2014GeometryDefinition extends
+        HPSTrackerGeometryDefinition {
+
+    // General
     protected static final boolean useSiStripsConvention = true;
     protected static final boolean use30mradRotation = true;
     protected static final boolean useFakeHalfModuleAxialPos = false;
 
-    // Global position references   
-    protected static final double target_pos_wrt_base_plate_x = 162.3; //from Marco's 3D model
-    protected static final double target_pos_wrt_base_plate_y = 80.55; //from Tim's sketchup //68.75; //from Marco's 3D model
-    protected static final double target_pos_wrt_base_plate_z = 926.59; //from Marco's 3D model
-    
-
+    // Global position references
+    protected static final double target_pos_wrt_base_plate_x = 162.3; // from
+                                                                       // Marco's
+                                                                       // 3D
+                                                                       // model
+    protected static final double target_pos_wrt_base_plate_y = 80.55; // from
+                                                                       // Tim's
+                                                                       // sketchup
+                                                                       // //68.75;
+                                                                       // //from
+                                                                       // Marco's
+                                                                       // 3D
+                                                                       // model
+    protected static final double target_pos_wrt_base_plate_z = 926.59; // from
+                                                                        // Marco's
+                                                                        // 3D
+                                                                        // model
 
     public HPSTestRunTracker2014GeometryDefinition(boolean debug, Element node) {
         super(debug, node);
@@ -43,117 +52,135 @@
         doColdBlock = false;
         doBottom = true;
         doTop = true;
-        layerBitMask = 0x1F;    //0x1;//
-    }
-
-
-    /* (non-Javadoc)
+        layerBitMask = 0x1F; // 0x1;//
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
      * @see org.lcsim.geometry.compact.converter.HPSTrackerBuilder#build()
      */
     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
+        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
-        TrackingVolume tracking = new TrackingVolume("trackingVolume",null);
+        TrackingVolume tracking = new TrackingVolume("trackingVolume", null);
         surveyVolumes.add(tracking);
 
-        TrackerEnvelope base = new TrackerEnvelope("base",tracking);
+        TrackerEnvelope base = new TrackerEnvelope("base", tracking);
         surveyVolumes.add(base);
-        
-        BasePlate basePlate = new BasePlate("baseplate",base, "Aluminum");
+
+        BasePlate basePlate = new BasePlate("baseplate", base, "Aluminum");
         surveyVolumes.add(basePlate);
-        
+
         CSupport cSupport = new CSupport("c_support", base);
-        surveyVolumes.add(cSupport);        
-        
+        surveyVolumes.add(cSupport);
+
         AlignmentCorrection alignmentCorrectionSupportBottom = getL13UChannelAlignmentCorrection(false);
-        SupportBottom supportBottom = new SupportBottom("support_bottom", base, alignmentCorrectionSupportBottom, cSupport);
+        SupportBottom supportBottom = new SupportBottom("support_bottom", base,
+                alignmentCorrectionSupportBottom, cSupport);
         surveyVolumes.add(supportBottom);
-        // The support survey positions are now with respect to its mother and not the reference coord. system.
-        // So to get the reference for the support plate I don't need to apply that extra transformation
-        
-        SupportPlateBottom supportPlateBottom = new SupportPlateBottom("support_plate_bottom", base, supportBottom, "Aluminum");
-        surveyVolumes.add(supportPlateBottom);        
-        
+        // The support survey positions are now with respect to its mother and
+        // not the reference coord. system.
+        // So to get the reference for the support plate I don't need to apply
+        // that extra transformation
+
+        SupportPlateBottom supportPlateBottom = new SupportPlateBottom(
+                "support_plate_bottom", base, supportBottom, "Aluminum");
+        surveyVolumes.add(supportPlateBottom);
+
         AlignmentCorrection alignmentCorrectionSupportTop = getL13UChannelAlignmentCorrection(true);
-        SupportTop supportTop = new SupportTop("support_top", base, alignmentCorrectionSupportTop, cSupport);
+        SupportTop supportTop = new SupportTop("support_top", base,
+                alignmentCorrectionSupportTop, cSupport);
         surveyVolumes.add(supportTop);
-        
-        SupportPlateTop supportPlateTop = new SupportPlateTop("support_plate_top", base, supportTop, "Aluminum");
+
+        SupportPlateTop supportPlateTop = new SupportPlateTop(
+                "support_plate_top", base, supportTop, "Aluminum");
         surveyVolumes.add(supportPlateTop);
 
-        for(int l=1; l<=5;++l) {
-            if(doLayer(l)) {
-                if(doBottom) makeModuleBundle(l,"bottom");
-                if(doTop)    makeModuleBundle(l,"top");
-            }
-        }       
-
-        if(isDebug()) {
-            System.out.printf("%s: DONE constructing the geometry objects\n", this.getClass().getSimpleName());
-            System.out.printf("%s: List of all the geometry objects built\n", this.getClass().getSimpleName());
-            for(SurveyVolume bg : surveyVolumes) {
+        for (int l = 1; l <= 5; ++l) {
+            if (doLayer(l)) {
+                if (doBottom)
+                    makeModuleBundle(l, "bottom");
+                if (doTop)
+                    makeModuleBundle(l, "top");
+            }
+        }
+
+        if (isDebug()) {
+            System.out.printf("%s: DONE constructing the geometry objects\n",
+                    this.getClass().getSimpleName());
+            System.out.printf("%s: List of all the geometry objects built\n",
+                    this.getClass().getSimpleName());
+            for (SurveyVolume bg : surveyVolumes) {
                 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
+     * Create the module.
+     * 
+     * @param layer
+     *            - of the module
+     * @param half
+     *            - top or bottom half of the tracker
      */
-    protected void makeModuleBundle(int layer, String half) 
-    {
-
-        if(isDebug()) System.out.printf("%s: makeModule for layer %d %s \n", this.getClass().getSimpleName(), layer, half);
-
+    protected void makeModuleBundle(int layer, String half) {
+
+        if (isDebug())
+            System.out.printf("%s: makeModule for layer %d %s \n", this
+                    .getClass().getSimpleName(), layer, half);
 
         // build the module name
-        String volName = "module_L"+ layer + (half=="bottom"?"b":"t");      
-
-        boolean isL13 = ( layer >=1 && layer <=3 ) ? true : false;          
+        String volName = "module_L" + layer + (half == "bottom" ? "b" : "t");
+
+        boolean isL13 = (layer >= 1 && layer <= 3) ? true : false;
 
         // 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
+        // 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 SurveyVolume mother;
         final SurveyVolume ref;
-        if(half == "bottom") {
+        if (half == "bottom") {
             mother = getSurveyVolume(TrackerEnvelope.class);
             ref = getSurveyVolume(SupportPlateBottom.class);
         } else {
-            mother= getSurveyVolume(TrackerEnvelope.class);
+            mother = getSurveyVolume(TrackerEnvelope.class);
             ref = getSurveyVolume(SupportPlateTop.class);
         }
 
-        //Create the module
+        // Create the module
         TestRunModule module;
-        if(isL13) {
+        if (isL13) {
             module = new TestRunModuleL13(volName, mother, ref, layer, half);
         } else {
             module = new TestRunModuleL45(volName, mother, ref, layer, half);
         }
 
-
         // create the bundle for this module
         TestRunModuleBundle bundle = new TestRunModuleBundle(module);
         addModuleBundle(bundle);
 
-        if(doAxial) makeHalfModule("axial", module);
-        if(doColdBlock) makeColdBlock(module);
-        if(doStereo) makeHalfModule("stereo", module);
-
-
-        if(isDebug()) {
-            System.out.printf("%s: created module bundle:\n", this.getClass().getSimpleName());
+        if (doAxial)
+            makeHalfModule("axial", module);
+        if (doColdBlock)
+            makeColdBlock(module);
+        if (doStereo)
+            makeHalfModule("stereo", module);
+
+        if (isDebug()) {
+            System.out.printf("%s: created module bundle:\n", this.getClass()
+                    .getSimpleName());
             bundle.print();
         }
 
@@ -161,111 +188,125 @@
 
     /**
      * Create the cold block object.
-     * @param mother to the cold block
+     * 
+     * @param mother
+     *            to the cold block
      */
-    protected void makeColdBlock(TestRunModule mother) { 
-    
-    
+    protected void makeColdBlock(TestRunModule mother) {
+
         String moduleName = mother.getName();
-    
-        if(isDebug()) System.out.printf("%s: makeColdBlock for %s \n", this.getClass().getSimpleName(), moduleName);
-    
-    
+
+        if (isDebug())
+            System.out.printf("%s: makeColdBlock for %s \n", this.getClass()
+                    .getSimpleName(), moduleName);
+
         String volName = moduleName + "_coldblock";
-    
+
         // find layer
         int layer = getLayerFromVolumeName(moduleName);
-    
+
         // Build the half-module
         TestRunColdBlock coldBlock;
-    
-        if(layer >= 1 && layer <=3) {
+
+        if (layer >= 1 && layer <= 3) {
             coldBlock = new TestRunColdBlockL13(volName, mother, layer);
-        } else if(layer >= 4 && layer <=5) {
+        } else if (layer >= 4 && layer <= 5) {
             coldBlock = new TestRunColdBlockL45(volName, mother, layer);
         } else {
             throw new RuntimeException("wrong layer for " + volName);
         }
-    
+
         TestRunModuleBundle bundle = (TestRunModuleBundle) getModuleBundle(mother);
         bundle.coldBlock = coldBlock;
     }
-    
-
-
-   
+
     public static class TrackerEnvelope extends SurveyVolume {
-        // 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
-        public static final double base_height = PS_vac_box_inner_height - BasePlate.base_plate_offset_height; 
+        // 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
+        public static final double base_height = PS_vac_box_inner_height
+                - BasePlate.base_plate_offset_height;
         public static final double base_width = BasePlate.base_plate_width;
         public static final double base_length = BasePlate.base_plate_length;
 
         public TrackerEnvelope(String name, SurveyVolume mother) {
-            super(name,mother, null);
+            super(name, mother, null);
             init();
         }
+
         protected void setPos() {
-            final double ball_pos_base_x = -1.0*target_pos_wrt_base_plate_x;
-            final double ball_pos_base_y = -1.0*target_pos_wrt_base_plate_y;
-            final double ball_pos_base_z = target_pos_wrt_base_plate_z;     
-            final double vee_pos_base_x = ball_pos_base_x + BasePlate.base_plate_width;
+            final double ball_pos_base_x = -1.0 * target_pos_wrt_base_plate_x;
+            final double ball_pos_base_y = -1.0 * target_pos_wrt_base_plate_y;
+            final double ball_pos_base_z = target_pos_wrt_base_plate_z;
+            final double vee_pos_base_x = ball_pos_base_x
+                    + BasePlate.base_plate_width;
             final double vee_pos_base_y = ball_pos_base_y;
             final double vee_pos_base_z = ball_pos_base_z;
             final double flat_pos_base_x = ball_pos_base_x;
             final double flat_pos_base_y = ball_pos_base_y;
-            final double flat_pos_base_z = ball_pos_base_z - BasePlate.base_plate_length;
-            setBallPos(ball_pos_base_x,ball_pos_base_y,ball_pos_base_z);
-            setVeePos(vee_pos_base_x,vee_pos_base_y,vee_pos_base_z);
+            final double flat_pos_base_z = ball_pos_base_z
+                    - BasePlate.base_plate_length;
+            setBallPos(ball_pos_base_x, ball_pos_base_y, ball_pos_base_z);
+            setVeePos(vee_pos_base_x, vee_pos_base_y, vee_pos_base_z);
             setFlatPos(flat_pos_base_x, flat_pos_base_y, flat_pos_base_z);
         }
+
         protected void setCenter() {
-            setCenter(base_width/2.0, base_length/2.0, base_height/2.0 - BasePlate.base_plate_thickness);
-        }
+            setCenter(base_width / 2.0, base_length / 2.0, base_height / 2.0
+                    - BasePlate.base_plate_thickness);
+        }
+
         protected void setBoxDim() {
-            setBoxDim(base_width,base_length,base_height);
-        }
-    }
-
-
+            setBoxDim(base_width, base_length, base_height);
+        }
+    }
 
     public static class BasePlate extends SurveyVolume {
-        // Base plate references    
-        public static final double base_plate_thickness = 0.25*inch;
+        // Base plate references
+        public static final double base_plate_thickness = 0.25 * inch;
         public static final double base_plate_width = 385.00;
         public static final double base_plate_length = 1216.00;
-        //height from vacuum chamber surface
-        protected static final double base_plate_offset_height = 2.0; //from Marco's 3D model
+        // height from vacuum chamber surface
+        protected static final double base_plate_offset_height = 2.0; // from
+                                                                      // Marco's
+                                                                      // 3D
+                                                                      // model
+
         public BasePlate(String name, SurveyVolume mother, String material) {
-            super(name,mother, null);
+            super(name, mother, null);
             init();
             setMaterial(material);
         }
+
         protected void setPos() {
-            setBallPos(0,0,0);
-            setVeePos(base_plate_width,ballPos.y(),ballPos.z());
-            setFlatPos(ballPos.x(),base_plate_length,ballPos.z());
-        }
+            setBallPos(0, 0, 0);
+            setVeePos(base_plate_width, ballPos.y(), ballPos.z());
+            setFlatPos(ballPos.x(), base_plate_length, ballPos.z());
+        }
+
         protected void setCenter() {
-            setCenter(base_plate_width/2.0, base_plate_length/2.0, -base_plate_thickness/2.0);
-        }
+            setCenter(base_plate_width / 2.0, base_plate_length / 2.0,
+                    -base_plate_thickness / 2.0);
+        }
+
         protected void setBoxDim() {
-            setBoxDim(base_plate_width,base_plate_length, base_plate_thickness);
-        }
-    }
-
-
-
+            setBoxDim(base_plate_width, base_plate_length, base_plate_thickness);
+        }
+    }
 
     public static class CSupport extends SurveyVolume {
         // This is the sequence of locating the support plate positions:
         // The c-support pin positions are found
-        // the points on the axis of rotation are used as references for building the box surrounding the support plates (incl sensors).
+        // the points on the axis of rotation are used as references for
+        // building the box surrounding the support plates (incl sensors).
         // this should make it more straightforward when applying a tilt angle
         // c-support:
-        // ball position is C-support pin position on electron side on the base plate surface
-        // vee position is C-support pin position on positron side on the base plate surface
-        // flat position is a randomly chosen point perpendicular to ball to vee vector and offset 10mm along the plate. 
+        // ball position is C-support pin position on electron side on the base
+        // plate surface
+        // vee position is C-support pin position on positron side on the base
+        // plate surface
+        // 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.
 
         // c-support references
@@ -274,36 +315,45 @@
         private static final double ball_pos_csup_pin_bottom_y = 115.02;
         private static final double ball_pos_csup_pin_bottom_z = 0.0;
         private static final double vee_pos_csup_pin_bottom_x = 271.05;
-        private static  double vee_pos_csup_pin_bottom_y = 121.62;
-        private static  double vee_pos_csup_pin_bottom_z = 0.0;
-
+        private static double vee_pos_csup_pin_bottom_y = 121.62;
+        private static double vee_pos_csup_pin_bottom_z = 0.0;
 
         public CSupport(String name, SurveyVolume mother) {
-            super(name,mother, null);
+            super(name, mother, null);
             init();
-        }           
+        }
+
         private void calcAndSetFlatPos() {
-            if(use30mradRotation) {
+            if (use30mradRotation) {
                 // find the rotation to place the flat point
-                Rotation rot1_csup = 
-                        new Rotation(
-                                new Vector3D(vee_pos_csup_pin_bottom_x-ball_pos_csup_pin_bottom_x,
-                                        vee_pos_csup_pin_bottom_y-ball_pos_csup_pin_bottom_y,
-                                        vee_pos_csup_pin_bottom_z-ball_pos_csup_pin_bottom_z),
-                                        new Vector3D(1,0,0));
-
-                Vector3D flat_pos_csup_pin_bottom_3D_rot = rot1_csup.applyTo(new Vector3D(0,10.0,0));
+                Rotation rot1_csup = new Rotation(
+                        new Vector3D(vee_pos_csup_pin_bottom_x
+                                - ball_pos_csup_pin_bottom_x,
+                                vee_pos_csup_pin_bottom_y
+                                        - ball_pos_csup_pin_bottom_y,
+                                vee_pos_csup_pin_bottom_z
+                                        - ball_pos_csup_pin_bottom_z),
+                        new Vector3D(1, 0, 0));
+
+                Vector3D flat_pos_csup_pin_bottom_3D_rot = rot1_csup
+                        .applyTo(new Vector3D(0, 10.0, 0));
                 // translate
-                double flat_pos_csup_pin_bottom_x = ball_pos_csup_pin_bottom_x + flat_pos_csup_pin_bottom_3D_rot.getX();
-                double flat_pos_csup_pin_bottom_y = ball_pos_csup_pin_bottom_y + flat_pos_csup_pin_bottom_3D_rot.getY();
-                double flat_pos_csup_pin_bottom_z = ball_pos_csup_pin_bottom_z + flat_pos_csup_pin_bottom_3D_rot.getZ();
-
-                setFlatPos(flat_pos_csup_pin_bottom_x,flat_pos_csup_pin_bottom_y,flat_pos_csup_pin_bottom_z);
-                if(debug) System.out.println("rotated setPos for csupport: \n" + getFlatPos().toString());
+                double flat_pos_csup_pin_bottom_x = ball_pos_csup_pin_bottom_x
+                        + flat_pos_csup_pin_bottom_3D_rot.getX();
+                double flat_pos_csup_pin_bottom_y = ball_pos_csup_pin_bottom_y
+                        + flat_pos_csup_pin_bottom_3D_rot.getY();
+                double flat_pos_csup_pin_bottom_z = ball_pos_csup_pin_bottom_z
+                        + flat_pos_csup_pin_bottom_3D_rot.getZ();
+
+                setFlatPos(flat_pos_csup_pin_bottom_x,
+                        flat_pos_csup_pin_bottom_y, flat_pos_csup_pin_bottom_z);
+                if (debug)
+                    System.out.println("rotated setPos for csupport: \n"
+                            + getFlatPos().toString());
 
             } else {
 
-                //vee_pos_csup_pin_bottom_x = ball_pos_csup_pin_bottom_x + 0;
+                // vee_pos_csup_pin_bottom_x = ball_pos_csup_pin_bottom_x + 0;
                 vee_pos_csup_pin_bottom_y = ball_pos_csup_pin_bottom_y;
                 vee_pos_csup_pin_bottom_z = ball_pos_csup_pin_bottom_z + 0;
 
@@ -311,406 +361,520 @@
                 double flat_pos_csup_pin_bottom_y = ball_pos_csup_pin_bottom_y + 10.0;
                 double flat_pos_csup_pin_bottom_z = ball_pos_csup_pin_bottom_z + 0;
 
-                setFlatPos(flat_pos_csup_pin_bottom_x,flat_pos_csup_pin_bottom_y,flat_pos_csup_pin_bottom_z);
-                if(debug) System.out.println("setPos for csupport: \n" + getFlatPos().toString());
-
-            }
-        }
+                setFlatPos(flat_pos_csup_pin_bottom_x,
+                        flat_pos_csup_pin_bottom_y, flat_pos_csup_pin_bottom_z);
+                if (debug)
+                    System.out.println("setPos for csupport: \n"
+                            + getFlatPos().toString());
+
+            }
+        }
+
         protected void setPos() {
-            if(debug) System.out.printf("%s: setPos for %s\n",this.getClass().getSimpleName(),getName());
+            if (debug)
+                System.out.printf("%s: setPos for %s\n", this.getClass()
+                        .getSimpleName(), getName());
             calcAndSetFlatPos();
-            setBallPos(ball_pos_csup_pin_bottom_x,ball_pos_csup_pin_bottom_y,ball_pos_csup_pin_bottom_z);
-            setVeePos(vee_pos_csup_pin_bottom_x,vee_pos_csup_pin_bottom_y,vee_pos_csup_pin_bottom_z);
-            if(debug) {
-                System.out.printf("%s: survey positions for %s\n",this.getClass().getSimpleName(),getName());
+            setBallPos(ball_pos_csup_pin_bottom_x, ball_pos_csup_pin_bottom_y,
+                    ball_pos_csup_pin_bottom_z);
+            setVeePos(vee_pos_csup_pin_bottom_x, vee_pos_csup_pin_bottom_y,
+                    vee_pos_csup_pin_bottom_z);
+            if (debug) {
+                System.out.printf("%s: survey positions for %s\n", this
+                        .getClass().getSimpleName(), getName());
                 printSurveyPos();
             }
         }
+
         protected void setCenter() {
             // this is never used since it's only a reference volume
             setCenter(null);
         }
+
         protected void setBoxDim() {
         }
 
     }
-
-
-
 
     public static class SupportTop extends SurveyVolume {
         // Top only needs a vertical offset to be specified
         private static final double ball_pos_csup_bearings_top_z = 146.4;
-        //these are for the box surrounding the whole support including modules
+        // these are for the box surrounding the whole support including modules
         protected static final double support_top_length = SupportBottom.support_bottom_length;
         protected static final double support_top_width = SupportBottom.support_bottom_width;
         protected static final double support_top_height = SupportBottom.support_bottom_height;
 
-        public SupportTop(String name, SurveyVolume mother, AlignmentCorrection alignmentCorrection) {
-            super(name,mother, alignmentCorrection);
+        public SupportTop(String name, SurveyVolume mother,
+                AlignmentCorrection alignmentCorrection) {
+            super(name, mother, alignmentCorrection);
             init();
         }
-        public SupportTop(String name, SurveyVolume mother, AlignmentCorrection alignmentCorrection, SurveyVolume referenceGeom) {
-            super(name,mother,alignmentCorrection, referenceGeom);
+
+        public SupportTop(String name, SurveyVolume mother,
+                AlignmentCorrection alignmentCorrection,
+                SurveyVolume referenceGeom) {
+            super(name, mother, alignmentCorrection, referenceGeom);
             init();
         }
-        public SupportTop(String name, SurveyVolume mother, AlignmentCorrection alignmentCorrection, List<SurveyVolume> referenceGeom) {
-            super(name,mother,alignmentCorrection, referenceGeom);
+
+        public SupportTop(String name, SurveyVolume mother,
+                AlignmentCorrection alignmentCorrection,
+                List<SurveyVolume> referenceGeom) {
+            super(name, mother, alignmentCorrection, referenceGeom);
             init();
         }
 
         protected void setPos() {
-            if(debug) System.out.printf("%s: setPos for %s\n",this.getClass().getSimpleName(),getName());
-            // the top has the same bearing positions as the bottom c-support except for the offset vertically from base plate
+            if (debug)
+                System.out.printf("%s: setPos for %s\n", this.getClass()
+                        .getSimpleName(), getName());
+            // the top has the same bearing positions as the bottom c-support
+            // except for the offset vertically from base plate
             // the tilt angle is independent though.
-            setBallPos(SupportBottom.ball_pos_csup_bearings_bottom_x, SupportBottom.ball_pos_csup_bearings_bottom_y, ball_pos_csup_bearings_top_z);
-            setVeePos(SupportBottom.vee_pos_csup_bearings_bottom_x, SupportBottom.vee_pos_csup_bearings_bottom_y, ball_pos_csup_bearings_top_z);
+            setBallPos(SupportBottom.ball_pos_csup_bearings_bottom_x,
+                    SupportBottom.ball_pos_csup_bearings_bottom_y,
+                    ball_pos_csup_bearings_top_z);
+            setVeePos(SupportBottom.vee_pos_csup_bearings_bottom_x,
+                    SupportBottom.vee_pos_csup_bearings_bottom_y,
+                    ball_pos_csup_bearings_top_z);
             // build the rotation to find the proper location of the flat
-            Rotation rot_csup_top = 
-                    new Rotation(RotationOrder.XYZ, 
-                            SupportPlateTop.support_plate_top_tilt_angle, 0.0, 0.0 );
-
-            // apply to flat local position (as for bottom it is an arbitrary offset)
-            Vector3D flat_pos_csup_bearings_top_3D_rot = 
-                    rot_csup_top.applyTo(new Vector3D(0.0,10.0,0.0));
+            Rotation rot_csup_top = new Rotation(RotationOrder.XYZ,
+                    SupportPlateTop.support_plate_top_tilt_angle, 0.0, 0.0);
+
+            // apply to flat local position (as for bottom it is an arbitrary
+            // offset)
+            Vector3D flat_pos_csup_bearings_top_3D_rot = rot_csup_top
+                    .applyTo(new Vector3D(0.0, 10.0, 0.0));
 
             // translate the flat position
-            final double flat_pos_csup_bearings_top_x = getBallPos().x() + flat_pos_csup_bearings_top_3D_rot.getX();
-            final double flat_pos_csup_bearings_top_y = getBallPos().y() + flat_pos_csup_bearings_top_3D_rot.getY();
-            final double flat_pos_csup_bearings_top_z = getBallPos().z() + flat_pos_csup_bearings_top_3D_rot.getZ();
-            setFlatPos(flat_pos_csup_bearings_top_x,flat_pos_csup_bearings_top_y,flat_pos_csup_bearings_top_z);
-
-            // since we don't care (no volume is built) about the local position of the bearings in the pin coord system we'll get rid of it
-            // and find the bearings position in the base coordinate system directly
-            if(referenceGeom==null) {
+            final double flat_pos_csup_bearings_top_x = getBallPos().x()
+                    + flat_pos_csup_bearings_top_3D_rot.getX();
+            final double flat_pos_csup_bearings_top_y = getBallPos().y()
+                    + flat_pos_csup_bearings_top_3D_rot.getY();
+            final double flat_pos_csup_bearings_top_z = getBallPos().z()
+                    + flat_pos_csup_bearings_top_3D_rot.getZ();
+            setFlatPos(flat_pos_csup_bearings_top_x,
+                    flat_pos_csup_bearings_top_y, flat_pos_csup_bearings_top_z);
+
+            // since we don't care (no volume is built) about the local position
+            // of the bearings in the pin coord system we'll get rid of it
+            // and find the bearings position in the base coordinate system
+            // directly
+            if (referenceGeom == null) {
                 throw new RuntimeException("No ref found for " + getName());
             }
             /*
-            for(SurveyVolume ref : referenceGeom) {
-
-                if(debug) {
-                    System.out.printf("%s: survey positions before ref %s transform\n",this.getClass().getSimpleName(),ref.getName());
-                    printSurveyPos();
-                }
-
-                if(debug) System.out.printf("%s: Ref %s coord\n%s\n",this.getClass().getSimpleName(), ref.getName(),ref.getCoord().toString());
-
-                ref.getCoord().getTransformation().transform(ballPos);
-                ref.getCoord().getTransformation().transform(veePos);
-                ref.getCoord().getTransformation().transform(flatPos);
-
-                if(debug) {
-                    System.out.printf("%s: survey positions after ref %s transform\n",this.getClass().getSimpleName(),ref.getName());
-                    printSurveyPos();
-                }
-            }
-            */
-            if(debug) {
-                System.out.printf("%s: survey positions for %s\n",this.getClass().getSimpleName(),getName());
+             * for(SurveyVolume ref : referenceGeom) {
+             * 
+             * if(debug) {
+             * System.out.printf("%s: survey positions before ref %s transform\n"
+             * ,this.getClass().getSimpleName(),ref.getName());
+             * printSurveyPos(); }
+             * 
+             * if(debug)
+             * System.out.printf("%s: Ref %s coord\n%s\n",this.getClass
+             * ().getSimpleName(), ref.getName(),ref.getCoord().toString());
+             * 
+             * ref.getCoord().getTransformation().transform(ballPos);
+             * ref.getCoord().getTransformation().transform(veePos);
+             * ref.getCoord().getTransformation().transform(flatPos);
+             * 
+             * if(debug) {
+             * System.out.printf("%s: survey positions after ref %s transform\n"
+             * ,this.getClass().getSimpleName(),ref.getName());
+             * printSurveyPos(); } }
+             */
+            if (debug) {
+                System.out.printf("%s: survey positions for %s\n", this
+                        .getClass().getSimpleName(), getName());
                 printSurveyPos();
             }
         }
+
         protected void setCenter() {
-            setCenter(support_top_width/2.0+1.0, support_top_length/2.0 + (17.00-10.50/2.0), -1.0 * (support_top_height/2.0 - (12.70-6.66-1.34)));
-        }
+            setCenter(support_top_width / 2.0 + 1.0, support_top_length / 2.0
+                    + (17.00 - 10.50 / 2.0), -1.0
+                    * (support_top_height / 2.0 - (12.70 - 6.66 - 1.34)));
+        }
+
         protected void setBoxDim() {
-            setBoxDim(support_top_width,support_top_length,support_top_height);
+            setBoxDim(support_top_width, support_top_length, support_top_height);
         }
         /*
-        protected void applyReferenceTransformation() {
-         
-            if(debug) {
-                System.out.printf("%s: coord system before ref transformations:\n%s\n",this.getClass().getSimpleName(),getCoord().toString());
-            }
-
-            for(SurveyVolume ref : referenceGeom) {
-
-                if(debug) {
-                    //System.out.printf("%s: survey positions before ref %s transform\n",this.getClass().getSimpleName(),ref.getName());
-                    //printSurveyPos();
-                    System.out.printf("%s: coord system before ref %s transform:\n%s\n",this.getClass().getSimpleName(),ref.getName(),getCoord().toString());
-                }
-
-                if(debug) System.out.printf("%s: Ref %s coord\n%s\n",this.getClass().getSimpleName(), ref.getName(),ref.getCoord().toString());
-                
-                getCoord().transform(ref.getCoord().getTransformation());
-                
-                //ref.getCoord().getTransformation().transform(ballPos);
-                //ref.getCoord().getTransformation().transform(veePos);
-                //ref.getCoord().getTransformation().transform(flatPos);
-
-                if(debug) {
-                    //System.out.printf("%s: survey positions after ref %s transform\n",this.getClass().getSimpleName(),ref.getName());
-                    //printSurveyPos();
-                    System.out.printf("%s: coord system after ref %s transform:\n%s\n",this.getClass().getSimpleName(),ref.getName(),getCoord().toString());
-                }
-            }
-            
-            if(debug) {
-                System.out.printf("%s: coord system after ref transformations:\n%s\n",this.getClass().getSimpleName(),getCoord().toString());
-            }
-            
-            
-        }
+         * protected void applyReferenceTransformation() {
+         * 
+         * if(debug) {
+         * System.out.printf("%s: coord system before ref transformations:\n%s\n"
+         * ,this.getClass().getSimpleName(),getCoord().toString()); }
+         * 
+         * for(SurveyVolume ref : referenceGeom) {
+         * 
+         * if(debug) {
+         * //System.out.printf("%s: survey positions before ref %s transform\n"
+         * ,this.getClass().getSimpleName(),ref.getName()); //printSurveyPos();
+         * System
+         * .out.printf("%s: coord system before ref %s transform:\n%s\n",this
+         * .getClass().getSimpleName(),ref.getName(),getCoord().toString()); }
+         * 
+         * if(debug)
+         * System.out.printf("%s: Ref %s coord\n%s\n",this.getClass().getSimpleName
+         * (), ref.getName(),ref.getCoord().toString());
+         * 
+         * getCoord().transform(ref.getCoord().getTransformation());
+         * 
+         * //ref.getCoord().getTransformation().transform(ballPos);
+         * //ref.getCoord().getTransformation().transform(veePos);
+         * //ref.getCoord().getTransformation().transform(flatPos);
+         * 
+         * if(debug) {
+         * //System.out.printf("%s: survey positions after ref %s transform\n"
+         * ,this.getClass().getSimpleName(),ref.getName()); //printSurveyPos();
+         * System
+         * .out.printf("%s: coord system after ref %s transform:\n%s\n",this
+         * .getClass().getSimpleName(),ref.getName(),getCoord().toString()); } }
+         * 
+         * if(debug) {
+         * System.out.printf("%s: coord system after ref transformations:\n%s\n"
+         * ,this.getClass().getSimpleName(),getCoord().toString()); }
+         * 
+         * 
+         * }
          */
     }
 
-
-
     public static class SupportBottom extends SurveyVolume {
-        // "bearings" are points on axis of rotation on the inside of the c-support frame where the insert get's attached
+        // "bearings" are points 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 of the c-support
         private static final double ball_pos_csup_bearings_bottom_x = 240.0 - 265.0 + 14.0;
         private static final double ball_pos_csup_bearings_bottom_y = (-6.0 + 22.0);
-        private static final double ball_pos_csup_bearings_bottom_z = 14.7;     
-        private static final double vee_pos_csup_bearings_bottom_x = 240.0- 129.0;
+        private static final double ball_pos_csup_bearings_bottom_z = 14.7;
+        private static final double vee_pos_csup_bearings_bottom_x = 240.0 - 129.0;
         private static final double vee_pos_csup_bearings_bottom_y = (-6.0 + 22.0);
         private static final double vee_pos_csup_bearings_bottom_z = 14.7;
 
-        //these are for the box surrounding the whole support including modules
+        // these are for the box surrounding the whole support including modules
         protected static final double support_bottom_length = SupportPlateBottom.support_plate_bottom_length;
-        protected static final double support_bottom_width = (25.0-5.0) + TestRunModuleL13.module_box_L13_length;
-        protected static final double support_bottom_height = SupportPlateBottom.support_plate_bottom_height - SupportPlateBottom.support_plate_pocket_depth + TestRunModuleL13.module_box_L13_width + SupportPlateBottom.pedestal_height_L1;
-
-
-        public SupportBottom(String name, SurveyVolume mother, AlignmentCorrection alignmentCorrection, SurveyVolume referenceGeom) {
-            super(name,mother,alignmentCorrection, referenceGeom);
+        protected static final double support_bottom_width = (25.0 - 5.0)
+                + TestRunModuleL13.module_box_L13_length;
+        protected static final double support_bottom_height = SupportPlateBottom.support_plate_bottom_height
+                - SupportPlateBottom.support_plate_pocket_depth
+                + TestRunModuleL13.module_box_L13_width
+                + SupportPlateBottom.pedestal_height_L1;
+
+        public SupportBottom(String name, SurveyVolume mother,
+                AlignmentCorrection alignmentCorrection,
+                SurveyVolume referenceGeom) {
+            super(name, mother, alignmentCorrection, referenceGeom);
             init();
         }
 
         protected void setPos() {
 
-            if(debug) System.out.printf("%s: setPos for %s\n",this.getClass().getSimpleName(),getName());
-            
-            // 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 here
+            if (debug)
+                System.out.printf("%s: setPos for %s\n", this.getClass()
+                        .getSimpleName(), getName());
+
+            // 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
+            // here
 
             // build the rotation to find the proper location of the flat
-            Rotation rot_csup = 
-                    new Rotation(RotationOrder.XYZ, 
-                            SupportPlateBottom.support_plate_bottom_tilt_angle, 0.0, 0.0 );
+            Rotation rot_csup = new Rotation(RotationOrder.XYZ,
+                    SupportPlateBottom.support_plate_bottom_tilt_angle, 0.0,
+                    0.0);
             // apply to flat local position
-            Vector3D flat_pos_csup_bearings_bottom_3D_rot = 
-                    rot_csup.applyTo(new Vector3D(0.0,10.0,0.0));
+            Vector3D flat_pos_csup_bearings_bottom_3D_rot = rot_csup
+                    .applyTo(new Vector3D(0.0, 10.0, 0.0));
             // translate
-            final double flat_pos_csup_bearings_bottom_x = ball_pos_csup_bearings_bottom_x + flat_pos_csup_bearings_bottom_3D_rot.getX();
-            final double flat_pos_csup_bearings_bottom_y = ball_pos_csup_bearings_bottom_y + flat_pos_csup_bearings_bottom_3D_rot.getY();
-            final double flat_pos_csup_bearings_bottom_z = ball_pos_csup_bearings_bottom_z + flat_pos_csup_bearings_bottom_3D_rot.getZ();
+            final double flat_pos_csup_bearings_bottom_x = ball_pos_csup_bearings_bottom_x
+                    + flat_pos_csup_bearings_bottom_3D_rot.getX();
+            final double flat_pos_csup_bearings_bottom_y = ball_pos_csup_bearings_bottom_y
+                    + flat_pos_csup_bearings_bottom_3D_rot.getY();
+            final double flat_pos_csup_bearings_bottom_z = ball_pos_csup_bearings_bottom_z
+                    + flat_pos_csup_bearings_bottom_3D_rot.getZ();
 
             // make vectors
-            setBallPos(ball_pos_csup_bearings_bottom_x,ball_pos_csup_bearings_bottom_y,ball_pos_csup_bearings_bottom_z);
-            setVeePos(vee_pos_csup_bearings_bottom_x,vee_pos_csup_bearings_bottom_y,vee_pos_csup_bearings_bottom_z);    
-            setFlatPos(flat_pos_csup_bearings_bottom_x,flat_pos_csup_bearings_bottom_y,flat_pos_csup_bearings_bottom_z);
-
+            setBallPos(ball_pos_csup_bearings_bottom_x,
+                    ball_pos_csup_bearings_bottom_y,
+                    ball_pos_csup_bearings_bottom_z);
+            setVeePos(vee_pos_csup_bearings_bottom_x,
+                    vee_pos_csup_bearings_bottom_y,
+                    vee_pos_csup_bearings_bottom_z);
+            setFlatPos(flat_pos_csup_bearings_bottom_x,
+                    flat_pos_csup_bearings_bottom_y,
+                    flat_pos_csup_bearings_bottom_z);
 
             // create the coordinate system of the c-support bearings
-            //HPSTestRunTracker2014GeomDef.Coord csup_bearings_bottom_coord = new HPSTestRunTracker2014GeomDef.Coord(ball_pos_csup_bearings_bottom, vee_pos_csup_bearings_bottom, flat_pos_csup_bearings_bottom);       
-
-            // since we don't care (no volume is built) about the local position of the bearings in the pin coord system we'll get rid of it
-            // and find the bearings position in the base coordinate system directly
-            if(referenceGeom==null) {
+            // HPSTestRunTracker2014GeomDef.Coord csup_bearings_bottom_coord =
+            // new
+            // HPSTestRunTracker2014GeomDef.Coord(ball_pos_csup_bearings_bottom,
+            // vee_pos_csup_bearings_bottom, flat_pos_csup_bearings_bottom);
+
+            // since we don't care (no volume is built) about the local position
+            // of the bearings in the pin coord system we'll get rid of it
+            // and find the bearings position in the base coordinate system
+            // directly
+            if (referenceGeom == null) {
                 throw new RuntimeException("No ref found for " + getName());
             }
             /*
-            for(SurveyVolume ref : referenceGeom) {
-
-                if(debug) {
-                    System.out.printf("%s: survey positions before ref %s transform\n",this.getClass().getSimpleName(),ref.getName());
-                    printSurveyPos();
-                }
-
-                if(debug) System.out.printf("%s: Ref %s coord\n%s\n",this.getClass().getSimpleName(), ref.getName(),ref.getCoord().toString());
-
-                ref.getCoord().getTransformation().transform(ballPos);
-                ref.getCoord().getTransformation().transform(veePos);
-                ref.getCoord().getTransformation().transform(flatPos);
-
-                if(debug) {
-                    System.out.printf("%s: survey positions after ref %s transform\n",this.getClass().getSimpleName(),ref.getName());
-                    printSurveyPos();
-                }
-            }
-            */
-            if(debug) {
-                System.out.printf("%s: survey positions for %s\n",this.getClass().getSimpleName(),getName());
+             * for(SurveyVolume ref : referenceGeom) {
+             * 
+             * if(debug) {
+             * System.out.printf("%s: survey positions before ref %s transform\n"
+             * ,this.getClass().getSimpleName(),ref.getName());
+             * printSurveyPos(); }
+             * 
+             * if(debug)
+             * System.out.printf("%s: Ref %s coord\n%s\n",this.getClass
+             * ().getSimpleName(), ref.getName(),ref.getCoord().toString());
+             * 
+             * ref.getCoord().getTransformation().transform(ballPos);
+             * ref.getCoord().getTransformation().transform(veePos);
+             * ref.getCoord().getTransformation().transform(flatPos);
+             * 
+             * if(debug) {
+             * System.out.printf("%s: survey positions after ref %s transform\n"
+             * ,this.getClass().getSimpleName(),ref.getName());
+             * printSurveyPos(); } }
+             */
+            if (debug) {
+                System.out.printf("%s: survey positions for %s\n", this
+                        .getClass().getSimpleName(), getName());
                 printSurveyPos();
             }
 
         }
+
         protected void setCenter() {
-            setCenter(support_bottom_width/2.0+1.0, support_bottom_length/2.0 + (17.00-10.50/2.0), support_bottom_height/2.0 - (12.70-6.66-1.34));
-        }
+            setCenter(support_bottom_width / 2.0 + 1.0, support_bottom_length
+                    / 2.0 + (17.00 - 10.50 / 2.0), support_bottom_height / 2.0
+                    - (12.70 - 6.66 - 1.34));
+        }
+
         protected void setBoxDim() {
-            setBoxDim(support_bottom_width,support_bottom_length,support_bottom_height);
-        }
-
-    }
-
+            setBoxDim(support_bottom_width, support_bottom_length,
+                    support_bottom_height);
+        }
+
+    }
 
     protected static abstract class SupportPlate extends SurveyVolume {
-        protected static final double support_plate_pocket_depth = 6.65; // Tim's sketchup, drawing says 6.66mm?
+        protected static final double support_plate_pocket_depth = 6.65; // Tim's
+                                                                         // sketchup,
+                                                                         // drawing
+                                                                         // says
+                                                                         // 6.66mm?
         protected static final double pedestal_height_L1 = 11.00;
         protected static final double pedestal_height_L2 = 9.50;
         protected static final double pedestal_height_L3 = 8.00;
         protected static final double pedestal_height_L4 = 10.00;
         protected static final double pedestal_height_L5 = 7.00;
-        public SupportPlate(SurveyVolume mother, SurveyVolume referenceGeom, String name, String material) {
-            super(name,mother,null, referenceGeom);
+
+        public SupportPlate(SurveyVolume mother, SurveyVolume referenceGeom,
+                String name, String material) {
+            super(name, mother, null, referenceGeom);
             setMaterial(material);
         }
-        public SupportPlate(SurveyVolume mother, List<SurveyVolume> referenceGeom, String name, String material) {
-            super(name,mother,null, referenceGeom);
+
+        public SupportPlate(SurveyVolume mother,
+                List<SurveyVolume> referenceGeom, String name, String material) {
+            super(name, mother, null, referenceGeom);
             setMaterial(material);
         }
 
     }
-
-
-
-
 
     public static class SupportPlateBottom extends SupportPlate {
         // support plate references
-        // use a settable rotation to effectively determine the flat and therefore the tilt of the support 
-        protected static final double support_plate_bottom_tilt_angle = 0.0; 
+        // use a settable rotation to effectively determine the flat and
+        // therefore the tilt of the support
+        protected static final double support_plate_bottom_tilt_angle = 0.0;
         protected static final double support_plate_bottom_height = 12.7;
         protected static final double support_plate_bottom_length = 736.1;
         protected static final double support_plate_bottom_width = 120.0;
 
-        public SupportPlateBottom(String name, SurveyVolume mother, SurveyVolume referenceGeom, String material) {
+        public SupportPlateBottom(String name, SurveyVolume mother,
+                SurveyVolume referenceGeom, String material) {
             super(mother, referenceGeom, name, material);
-            init();             
-        }
-        public SupportPlateBottom(String name, SurveyVolume mother, List<SurveyVolume> referenceGeom, String material) {
+            init();
+        }
+
+        public SupportPlateBottom(String name, SurveyVolume mother,
+                List<SurveyVolume> referenceGeom, String material) {
             super(mother, referenceGeom, name, material);
-            init();             
-        }
+            init();
+        }
+
         protected void setPos() {
-            if(debug) System.out.printf("%s: setPos for %s\n",this.getClass().getSimpleName(),getName());
-            
-            ballPos = new BasicHep3Vector(1.0, (17.0-5.0), 6.66+1.34); 
-            veePos = new BasicHep3Vector(ballPos.x() + support_plate_bottom_length, ballPos.y(),ballPos.z());
-            flatPos = new BasicHep3Vector(ballPos.x(), ballPos.y() + support_plate_bottom_length,ballPos.z());
-
-            if(referenceGeom==null) {
+            if (debug)
+                System.out.printf("%s: setPos for %s\n", this.getClass()
+                        .getSimpleName(), getName());
+
+            ballPos = new BasicHep3Vector(1.0, (17.0 - 5.0), 6.66 + 1.34);
+            veePos = new BasicHep3Vector(ballPos.x()
+                    + support_plate_bottom_length, ballPos.y(), ballPos.z());
+            flatPos = new BasicHep3Vector(ballPos.x(), ballPos.y()
+                    + support_plate_bottom_length, ballPos.z());
+
+            if (referenceGeom == null) {
                 throw new RuntimeException("No ref found for " + getName());
             }
             /*
-            for(SurveyVolume ref : referenceGeom) {
-
-                if(debug) {
-                    System.out.printf("%s: survey positions before ref %s transform\n",this.getClass().getSimpleName(),ref.getName());
-                    printSurveyPos();
-                }
-
-                if(debug) System.out.printf("%s: Ref %s coord\n%s\n",this.getClass().getSimpleName(), ref.getName(),ref.getCoord().toString());
-
-                ref.getCoord().getTransformation().transform(ballPos);
-                ref.getCoord().getTransformation().transform(veePos);
-                ref.getCoord().getTransformation().transform(flatPos);
-
-                if(debug) {
-                    System.out.printf("%s: survey positions after ref %s transform\n",this.getClass().getSimpleName(),ref.getName());
-                    printSurveyPos();
-                }
-            }
-            */
-            if(debug) {
-                System.out.printf("%s: survey positions for %s\n",this.getClass().getSimpleName(),getName());
+             * for(SurveyVolume ref : referenceGeom) {
+             * 
+             * if(debug) {
+             * System.out.printf("%s: survey positions before ref %s transform\n"
+             * ,this.getClass().getSimpleName(),ref.getName());
+             * printSurveyPos(); }
+             * 
+             * if(debug)
+             * System.out.printf("%s: Ref %s coord\n%s\n",this.getClass
+             * ().getSimpleName(), ref.getName(),ref.getCoord().toString());
+             * 
+             * ref.getCoord().getTransformation().transform(ballPos);
+             * ref.getCoord().getTransformation().transform(veePos);
+             * ref.getCoord().getTransformation().transform(flatPos);
+             * 
+             * if(debug) {
+             * System.out.printf("%s: survey positions after ref %s transform\n"
+             * ,this.getClass().getSimpleName(),ref.getName());
+             * printSurveyPos(); } }
+             */
+            if (debug) {
+                System.out.printf("%s: survey positions for %s\n", this
+                        .getClass().getSimpleName(), getName());
                 printSurveyPos();
             }
         }
+
         protected void setCenter() {
-            setCenter(support_plate_bottom_width/2.0, support_plate_bottom_length/2.0, -1.0 * support_plate_bottom_height/2.0);
-        }
+            setCenter(support_plate_bottom_width / 2.0,
+                    support_plate_bottom_length / 2.0, -1.0
+                            * support_plate_bottom_height / 2.0);
+        }
+
         @Override
         protected void setBoxDim() {
-            setBoxDim(support_plate_bottom_width,support_plate_bottom_length,support_plate_bottom_height);
-        }
-    }
-
+            setBoxDim(support_plate_bottom_width, support_plate_bottom_length,
+                    support_plate_bottom_height);
+        }
+    }
 
     public static class SupportPlateTop extends SupportPlate {
         // support plate references
-        // use a settable rotation to effectively determine the flat and therefore the tilt of the support 
-        protected static final double support_plate_top_tilt_angle = 0.0; 
+        // use a settable rotation to effectively determine the flat and
+        // therefore the tilt of the support
+        protected static final double support_plate_top_tilt_angle = 0.0;
         protected static final double support_plate_top_length = SupportPlateBottom.support_plate_bottom_length;
         protected static final double support_plate_top_width = SupportPlateBottom.support_plate_bottom_width;
         protected static final double support_plate_top_height = SupportPlateBottom.support_plate_bottom_height;
 
-        public SupportPlateTop(String name, SurveyVolume mother, SurveyVolume referenceGeom, String material) {
-            super(mother,referenceGeom, name,material);
+        public SupportPlateTop(String name, SurveyVolume mother,
+                SurveyVolume referenceGeom, String material) {
+            super(mother, referenceGeom, name, material);
             init();
         }
+
         protected void setPos() {
-            if(debug) System.out.printf("%s: setPos for %s\n",this.getClass().getSimpleName(),getName());
-            
-            ballPos = new BasicHep3Vector(1.0, (17.0-5.0), -1.0 * (6.66+1.34)); 
-            veePos = new BasicHep3Vector(ballPos.x() + support_plate_top_width, ballPos.y(),ballPos.z());
-            flatPos = new BasicHep3Vector(ballPos.x(), ballPos.y() + support_plate_top_length,ballPos.z());
-
-            if(referenceGeom==null) {
+            if (debug)
+                System.out.printf("%s: setPos for %s\n", this.getClass()
+                        .getSimpleName(), getName());
+
+            ballPos = new BasicHep3Vector(1.0, (17.0 - 5.0), -1.0
+                    * (6.66 + 1.34));
+            veePos = new BasicHep3Vector(ballPos.x() + support_plate_top_width,
+                    ballPos.y(), ballPos.z());
+            flatPos = new BasicHep3Vector(ballPos.x(), ballPos.y()
+                    + support_plate_top_length, ballPos.z());
+
+            if (referenceGeom == null) {
                 throw new RuntimeException("No ref found for " + getName());
             }
             /*
-            for(SurveyVolume ref : referenceGeom) {
-
-                if(debug) System.out.printf("%s: survey positions before ref %s transform\n",this.getClass().getSimpleName(),ref.getName());
-                if(debug) printSurveyPos();
-
-                if(debug) System.out.printf("%s: Ref %s coord\n%s\n",this.getClass().getSimpleName(), ref.getName(),ref.getCoord().toString());
-
-                ref.getCoord().getTransformation().transform(ballPos);
-                ref.getCoord().getTransformation().transform(veePos);
-                ref.getCoord().getTransformation().transform(flatPos);
-
-                if(debug) System.out.printf("%s: survey positions after ref %s transform\n",this.getClass().getSimpleName(),ref.getName());
-                if(debug) printSurveyPos();
-            }
-            */
-            if(debug) {
-                System.out.printf("%s: survey positions for %s\n",this.getClass().getSimpleName(),getName());
+             * for(SurveyVolume ref : referenceGeom) {
+             * 
+             * if(debug)
+             * System.out.printf("%s: survey positions before ref %s transform\n"
+             * ,this.getClass().getSimpleName(),ref.getName()); if(debug)
+             * printSurveyPos();
+             * 
+             * if(debug)
+             * System.out.printf("%s: Ref %s coord\n%s\n",this.getClass
+             * ().getSimpleName(), ref.getName(),ref.getCoord().toString());
+             * 
+             * ref.getCoord().getTransformation().transform(ballPos);
+             * ref.getCoord().getTransformation().transform(veePos);
+             * ref.getCoord().getTransformation().transform(flatPos);
+             * 
+             * if(debug)
+             * System.out.printf("%s: survey positions after ref %s transform\n"
+             * ,this.getClass().getSimpleName(),ref.getName()); if(debug)
+             * printSurveyPos(); }
+             */
+            if (debug) {
+                System.out.printf("%s: survey positions for %s\n", this
+                        .getClass().getSimpleName(), getName());
                 printSurveyPos();
             }
         }
+
         protected void setCenter() {
-            setCenter(support_plate_top_width/2.0, support_plate_top_length/2.0,  support_plate_top_height/2.0);
-        }
+            setCenter(support_plate_top_width / 2.0,
+                    support_plate_top_length / 2.0,
+                    support_plate_top_height / 2.0);
+        }
+
         @Override
         protected void setBoxDim() {
-            setBoxDim(support_plate_top_width, support_plate_top_length, support_plate_top_height);
-        }
-    }
-
-
-
+            setBoxDim(support_plate_top_width, support_plate_top_length,
+                    support_plate_top_height);
+        }
+    }
 
     public static class TestRunModuleL45 extends TestRunModule {
 
-        protected static final double module_box_L45_length = 205.2 + box_extra_length; // includes lexan spacer and cold block
-        protected static final double module_box_L45_height = 12.5 + box_extra_height; // includes screws height
-        protected static final double module_box_L45_width = 65.3-12.0 +  box_extra_width; 
+        protected static final double module_box_L45_length = 205.2 + box_extra_length; // includes
+                                                                                        // lexan
+                                                                                        // spacer
+                                                                                        // and
+                                                                                        // cold
+                                                                                        // block
+        protected static final double module_box_L45_height = 12.5 + box_extra_height; // includes
+                                                                                       // screws
+                                                                                       // height
+        protected static final double module_box_L45_width = 65.3 - 12.0 + box_extra_width;
         protected static final double dist_lower_sensor_edge_to_cold_block_mounting_surface = 7.662;
 
-
-        public TestRunModuleL45(String name, SurveyVolume mother, int layer,String half) {
+        public TestRunModuleL45(String name, SurveyVolume mother, int layer,
+                String half) {
             super(name, mother, layer, half);
         }
-        public TestRunModuleL45(String name, SurveyVolume mother, SurveyVolume ref, int layer, String half) {
+
+        public TestRunModuleL45(String name, SurveyVolume mother,
+                SurveyVolume ref, int layer, String half) {
             super(name, mother, ref, layer, half);
         }
+
         protected double getColdBlockThickness() {
             return TestRunColdBlockL45.coldblock_L45_thickness;
         }
+
         protected double getModuleBoxLength() {
             return module_box_L45_length;
         }
+
         protected double getModuleBoxWidth() {
             return module_box_L45_width;
         }
+
         protected double getModuleBoxHeight() {
             return module_box_L45_height;
         }
+
         protected double get_dist_lower_sensor_edge_to_cold_block_mounting_surface() {
             return dist_lower_sensor_edge_to_cold_block_mounting_surface;
         }
@@ -718,195 +882,364 @@
     }
 
     public static class TestRunModuleL13 extends TestRunModule {
-        protected static final double module_box_L13_length = 205.2 + box_extra_length; // includes lexan spacer and cold block
-        protected static final double module_box_L13_height = 12.5 + box_extra_height; // includes screws height
-        protected static final double module_box_L13_width = 71.3 - 13.0 + box_extra_width; // height from cold block to encapsulate the whole module
+        protected static final double module_box_L13_length = 205.2 + box_extra_length; // includes
+                                                                                        // lexan
+                                                                                        // spacer
+                                                                                        // and
+                                                                                        // cold
+                                                                                        // block
+        protected static final double module_box_L13_height = 12.5 + box_extra_height; // includes
+                                                                                       // screws
+                                                                                       // height
+        protected static final double module_box_L13_width = 71.3 - 13.0 + box_extra_width; // height
+                                                                                            // from
+                                                                                            // cold
+                                                                                            // block
+                                                                                            // to
+                                                                                            // encapsulate
+                                                                                            // the
+                                                                                            // whole
+                                                                                            // module
         protected static final double dist_lower_sensor_edge_to_cold_block_mounting_surface = 12.66;
 
-        public TestRunModuleL13(String name, SurveyVolume mother, int layer, String half) {
+        public TestRunModuleL13(String name, SurveyVolume mother, int layer,
+                String half) {
             super(name, mother, layer, half);
         }
-        public TestRunModuleL13(String name, SurveyVolume mother, SurveyVolume ref, int layer, String half) {
+
+        public TestRunModuleL13(String name, SurveyVolume mother,
+                SurveyVolume ref, int layer, String half) {
             super(name, mother, ref, layer, half);
         }
+
         protected double getColdBlockThickness() {
             return TestRunColdBlockL13.coldblock_L13_thickness;
-        }   
+        }
+
         protected double getModuleBoxLength() {
             return module_box_L13_length;
         }
+
         protected double getModuleBoxWidth() {
             return module_box_L13_width;
         }
+
         protected double getModuleBoxHeight() {
             return module_box_L13_height;
         }
+
         protected double get_dist_lower_sensor_edge_to_cold_block_mounting_surface() {
             return dist_lower_sensor_edge_to_cold_block_mounting_surface;
         }
     }
 
-
     public static abstract class TestRunModule extends BaseModule {
-        protected final static double box_extra_length = 10.0;// random at this point
-        protected final static double box_extra_width = 15.0;// random at this point
-        protected final static double box_extra_height = 1.0;// random at this point
-
-        public TestRunModule(String name, SurveyVolume mother, int layer, String half) {
-            super(name, mother,null,layer, half);
+        protected final static double box_extra_length = 10.0;// random at this
+                                                              // point
+        protected final static double box_extra_width = 15.0;// random at this
+                                                             // point
+        protected final static double box_extra_height = 1.0;// random at this
+                                                             // point
+
+        public TestRunModule(String name, SurveyVolume mother, int layer,
+                String half) {
+            super(name, mother, null, layer, half);
             init();
-        }           
-        public TestRunModule(String name, SurveyVolume mother, SurveyVolume ref, int layer, String half) {
-            super(name, mother,null,ref,layer, half);
+        }
+
+        public TestRunModule(String name, SurveyVolume mother,
+                SurveyVolume ref, int layer, String half) {
+            super(name, mother, null, ref, layer, half);
             init();
-        }           
+        }
+
         protected abstract double getColdBlockThickness();
+
         protected abstract double getModuleBoxLength();
+
         protected abstract double getModuleBoxWidth();
+
         protected abstract double getModuleBoxHeight();
+
         protected abstract double get_dist_lower_sensor_edge_to_cold_block_mounting_surface();
 
         protected void setBoxDim() {
-            setBoxDim(getModuleBoxLength(),getModuleBoxHeight(),getModuleBoxWidth());
-        }
+            setBoxDim(getModuleBoxLength(), getModuleBoxHeight(),
+                    getModuleBoxWidth());
+        }
+
         protected void setCenter() {
-            setCenter(getModuleBoxLength()/2.0-5.0, 0.0, getModuleBoxWidth()/2.0-box_extra_width/5.0); 
-        }           
+            setCenter(getModuleBoxLength() / 2.0 - 5.0, 0.0,
+                    getModuleBoxWidth() / 2.0 - box_extra_width / 5.0);
+        }
+
         protected void setPos() {
 
-            if(debug) System.out.printf("%s: setPos for %s\n",this.getClass().getSimpleName(),getName());
-            
-
-            if(isBottom()) {
+            if (debug)
+                System.out.printf("%s: setPos for %s\n", this.getClass()
+                        .getSimpleName(), getName());
+
+            if (isBottom()) {
                 switch (getLayer()) {
                 case 1:
-                    ballPos = new BasicHep3Vector(25.0, 661.1, SupportPlateBottom.pedestal_height_L1-SupportPlateBottom.support_plate_pocket_depth);
-                    veePos = new BasicHep3Vector(95.0, 661.1, SupportPlateBottom.pedestal_height_L1-SupportPlateBottom.support_plate_pocket_depth);
-                    flatPos = new BasicHep3Vector(60.0, 667.10, SupportPlateBottom.pedestal_height_L1-SupportPlateBottom.support_plate_pocket_depth);
+                    ballPos = new BasicHep3Vector(
+                            25.0,
+                            661.1,
+                            SupportPlateBottom.pedestal_height_L1
+                                    - SupportPlateBottom.support_plate_pocket_depth);
+                    veePos = new BasicHep3Vector(
+                            95.0,
+                            661.1,
+                            SupportPlateBottom.pedestal_height_L1
+                                    - SupportPlateBottom.support_plate_pocket_depth);
+                    flatPos = new BasicHep3Vector(
+                            60.0,
+                            667.10,
+                            SupportPlateBottom.pedestal_height_L1
+                                    - SupportPlateBottom.support_plate_pocket_depth);
                     break;
                 case 2:
-                    ballPos = new BasicHep3Vector(25.0, 561.1, SupportPlateBottom.pedestal_height_L2-SupportPlateBottom.support_plate_pocket_depth);
-                    veePos = new BasicHep3Vector(95.0, 561.1, SupportPlateBottom.pedestal_height_L2-SupportPlateBottom.support_plate_pocket_depth);
-                    flatPos = new BasicHep3Vector(60.0, 567.10, SupportPlateBottom.pedestal_height_L2-SupportPlateBottom.support_plate_pocket_depth);   
+                    ballPos = new BasicHep3Vector(
+                            25.0,
+                            561.1,
+                            SupportPlateBottom.pedestal_height_L2
+                                    - SupportPlateBottom.support_plate_pocket_depth);
+                    veePos = new BasicHep3Vector(
+                            95.0,
+                            561.1,
+                            SupportPlateBottom.pedestal_height_L2
+                                    - SupportPlateBottom.support_plate_pocket_depth);
+                    flatPos = new BasicHep3Vector(
+                            60.0,
+                            567.10,
+                            SupportPlateBottom.pedestal_height_L2
+                                    - SupportPlateBottom.support_plate_pocket_depth);
                     break;
                 case 3:
-                    ballPos = new BasicHep3Vector(25.0, 461.1, SupportPlateBottom.pedestal_height_L3-SupportPlateBottom.support_plate_pocket_depth);
-                    veePos = new BasicHep3Vector(95.0, 461.1, SupportPlateBottom.pedestal_height_L3-SupportPlateBottom.support_plate_pocket_depth);
-                    flatPos = new BasicHep3Vector(60.0, 467.10, SupportPlateBottom.pedestal_height_L3-SupportPlateBottom.support_plate_pocket_depth);
+                    ballPos = new BasicHep3Vector(
+                            25.0,
+                            461.1,
+                            SupportPlateBottom.pedestal_height_L3
+                                    - SupportPlateBottom.support_plate_pocket_depth);
+                    veePos = new BasicHep3Vector(
+                            95.0,
+                            461.1,
+                            SupportPlateBottom.pedestal_height_L3
+                                    - SupportPlateBottom.support_plate_pocket_depth);
+                    flatPos = new BasicHep3Vector(
+                            60.0,
+                            467.10,
+                            SupportPlateBottom.pedestal_height_L3
+                                    - SupportPlateBottom.support_plate_pocket_depth);
                     break;
                 case 4:
-                    ballPos = new BasicHep3Vector(25.0, 261.1, SupportPlateBottom.pedestal_height_L4-SupportPlateBottom.support_plate_pocket_depth);
-                    veePos = new BasicHep3Vector(95.0, 261.1, SupportPlateBottom.pedestal_height_L4-SupportPlateBottom.support_plate_pocket_depth);
-                    flatPos = new BasicHep3Vector(60.0, 267.10, SupportPlateBottom.pedestal_height_L4-SupportPlateBottom.support_plate_pocket_depth);
+                    ballPos = new BasicHep3Vector(
+                            25.0,
+                            261.1,
+                            SupportPlateBottom.pedestal_height_L4
+                                    - SupportPlateBottom.support_plate_pocket_depth);
+                    veePos = new BasicHep3Vector(
+                            95.0,
+                            261.1,
+                            SupportPlateBottom.pedestal_height_L4
+                                    - SupportPlateBottom.support_plate_pocket_depth);
+                    flatPos = new BasicHep3Vector(
+                            60.0,
+                            267.10,
+                            SupportPlateBottom.pedestal_height_L4
+                                    - SupportPlateBottom.support_plate_pocket_depth);
                     break;
                 case 5:
-                    ballPos = new BasicHep3Vector(25.0, 61.1, SupportPlateBottom.pedestal_height_L5-SupportPlateBottom.support_plate_pocket_depth);
-                    veePos = new BasicHep3Vector(95.0, 61.1, SupportPlateBottom.pedestal_height_L5-SupportPlateBottom.support_plate_pocket_depth);
-                    flatPos = new BasicHep3Vector(60.0, 67.10, SupportPlateBottom.pedestal_height_L5-SupportPlateBottom.support_plate_pocket_depth);
+                    ballPos = new BasicHep3Vector(
+                            25.0,
+                            61.1,
+                            SupportPlateBottom.pedestal_height_L5
+                                    - SupportPlateBottom.support_plate_pocket_depth);
+                    veePos = new BasicHep3Vector(
+                            95.0,
+                            61.1,
+                            SupportPlateBottom.pedestal_height_L5
+                                    - SupportPlateBottom.support_plate_pocket_depth);
+                    flatPos = new BasicHep3Vector(
+                            60.0,
+                            67.10,
+                            SupportPlateBottom.pedestal_height_L5
+                                    - SupportPlateBottom.support_plate_pocket_depth);
                     break;
                 default:
-                    System.out.printf("ERROR invalid layer %d for half %s\n",getLayer(),getHalf());
+                    System.out.printf("ERROR invalid layer %d for half %s\n",
+                            getLayer(), getHalf());
                     System.exit(1);
                     break;
                 }
 
             } else {
                 // 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
+                // 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
 
                 switch (getLayer()) {
                 case 1:
-                    ballPos = new BasicHep3Vector(25.0, 676.1, -1.0 * (SupportPlateBottom.pedestal_height_L1-SupportPlateBottom.support_plate_pocket_depth));
-                    veePos = new BasicHep3Vector(95.0, 676.1, -1.0 * (SupportPlateBottom.pedestal_height_L1-SupportPlateBottom.support_plate_pocket_depth));
-                    flatPos = new BasicHep3Vector(60.0, 670.1, -1.0 * (SupportPlateBottom.pedestal_height_L1-SupportPlateBottom.support_plate_pocket_depth));
+                    ballPos = new BasicHep3Vector(
+                            25.0,
+                            676.1,
+                            -1.0
+                                    * (SupportPlateBottom.pedestal_height_L1 - SupportPlateBottom.support_plate_pocket_depth));
+                    veePos = new BasicHep3Vector(
+                            95.0,
+                            676.1,
+                            -1.0
+                                    * (SupportPlateBottom.pedestal_height_L1 - SupportPlateBottom.support_plate_pocket_depth));
+                    flatPos = new BasicHep3Vector(
+                            60.0,
+                            670.1,
+                            -1.0
+                                    * (SupportPlateBottom.pedestal_height_L1 - SupportPlateBottom.support_plate_pocket_depth));
                     break;
                 case 2:
-                    ballPos = new BasicHep3Vector(25.0, 576.1, -1.0 * (SupportPlateBottom.pedestal_height_L2-SupportPlateBottom.support_plate_pocket_depth));
-                    veePos = new BasicHep3Vector(95.0, 576.1, -1.0 * (SupportPlateBottom.pedestal_height_L2-SupportPlateBottom.support_plate_pocket_depth));
-                    flatPos = new BasicHep3Vector(60.0, 570.1, -1.0 * (SupportPlateBottom.pedestal_height_L2-SupportPlateBottom.support_plate_pocket_depth));
+                    ballPos = new BasicHep3Vector(
+                            25.0,
+                            576.1,
+                            -1.0
+                                    * (SupportPlateBottom.pedestal_height_L2 - SupportPlateBottom.support_plate_pocket_depth));
+                    veePos = new BasicHep3Vector(
+                            95.0,
+                            576.1,
+                            -1.0
+                                    * (SupportPlateBottom.pedestal_height_L2 - SupportPlateBottom.support_plate_pocket_depth));
+                    flatPos = new BasicHep3Vector(
+                            60.0,
+                            570.1,
+                            -1.0
+                                    * (SupportPlateBottom.pedestal_height_L2 - SupportPlateBottom.support_plate_pocket_depth));
                     break;
                 case 3:
-                    ballPos = new BasicHep3Vector(25.0, 476.1, -1.0 * (SupportPlateBottom.pedestal_height_L3-SupportPlateBottom.support_plate_pocket_depth));
-                    veePos = new BasicHep3Vector(95.0, 476.1, -1.0 * (SupportPlateBottom.pedestal_height_L3-SupportPlateBottom.support_plate_pocket_depth));
-                    flatPos =new BasicHep3Vector(60.0, 470.1, -1.0 * (SupportPlateBottom.pedestal_height_L3-SupportPlateBottom.support_plate_pocket_depth));
+                    ballPos = new BasicHep3Vector(
+                            25.0,
+                            476.1,
+                            -1.0
+                                    * (SupportPlateBottom.pedestal_height_L3 - SupportPlateBottom.support_plate_pocket_depth));
+                    veePos = new BasicHep3Vector(
+                            95.0,
+                            476.1,
+                            -1.0
+                                    * (SupportPlateBottom.pedestal_height_L3 - SupportPlateBottom.support_plate_pocket_depth));
+                    flatPos = new BasicHep3Vector(
+                            60.0,
+                            470.1,
+                            -1.0
+                                    * (SupportPlateBottom.pedestal_height_L3 - SupportPlateBottom.support_plate_pocket_depth));
                     break;
                 case 4:
-                    ballPos = new BasicHep3Vector(25.0, 276.1, -1.0 * (SupportPlateBottom.pedestal_height_L4-SupportPlateBottom.support_plate_pocket_depth));
-                    veePos = new BasicHep3Vector(95.0, 276.1, -1.0 * (SupportPlateBottom.pedestal_height_L4-SupportPlateBottom.support_plate_pocket_depth));
-                    flatPos = new BasicHep3Vector(60.0, 270.1, -1.0 * (SupportPlateBottom.pedestal_height_L4-SupportPlateBottom.support_plate_pocket_depth));
+                    ballPos = new BasicHep3Vector(
+                            25.0,
+                            276.1,
+                            -1.0
+                                    * (SupportPlateBottom.pedestal_height_L4 - SupportPlateBottom.support_plate_pocket_depth));
+                    veePos = new BasicHep3Vector(
+                            95.0,
+                            276.1,
+                            -1.0
+                                    * (SupportPlateBottom.pedestal_height_L4 - SupportPlateBottom.support_plate_pocket_depth));
+                    flatPos = new BasicHep3Vector(
+                            60.0,
+                            270.1,
+                            -1.0
+                                    * (SupportPlateBottom.pedestal_height_L4 - SupportPlateBottom.support_plate_pocket_depth));
                     break;
                 case 5:
-                    ballPos = new BasicHep3Vector(25.0, 76.1, -1.0 * (SupportPlateBottom.pedestal_height_L5-SupportPlateBottom.support_plate_pocket_depth));
-                    veePos = new BasicHep3Vector(95.0, 76.1, -1.0 * (SupportPlateBottom.pedestal_height_L5-SupportPlateBottom.support_plate_pocket_depth));
-                    flatPos = new BasicHep3Vector(60.0, 70.1, -1.0 * (SupportPlateBottom.pedestal_height_L5-SupportPlateBottom.support_plate_pocket_depth));
+                    ballPos = new BasicHep3Vector(
+                            25.0,
+                            76.1,
+                            -1.0
+                                    * (SupportPlateBottom.pedestal_height_L5 - SupportPlateBottom.support_plate_pocket_depth));
+                    veePos = new BasicHep3Vector(
+                            95.0,
+                            76.1,
+                            -1.0
+                                    * (SupportPlateBottom.pedestal_height_L5 - SupportPlateBottom.support_plate_pocket_depth));
+                    flatPos = new BasicHep3Vector(
+                            60.0,
+                            70.1,
+                            -1.0
+                                    * (SupportPlateBottom.pedestal_height_L5 - SupportPlateBottom.support_plate_pocket_depth));
                     break;
                 default:
-                    System.out.printf("ERROR invalid layer %d for half %s\n",getLayer(),getHalf());
+                    System.out.printf("ERROR invalid layer %d for half %s\n",
+                            getLayer(), getHalf());
                     System.exit(1);
                     break;
                 }
             }
 
-            if(debug) {
-                System.out.printf("%s: survey positions for %s\n",this.getClass().getSimpleName(),getName());
+            if (debug) {
+                System.out.printf("%s: survey positions for %s\n", this
+                        .getClass().getSimpleName(), getName());
                 printSurveyPos();
             }
 
             /*
-            // walk through the reference volumes
-            if(referenceGeom!=null) {
-                for(SurveyVolume ref : referenceGeom) {
-
-                    if(debug) {
-                        System.out.printf("%s: survey positions before ref %s transform\n",this.getClass().getSimpleName(),ref.getName());
-                        printSurveyPos();
-                    }
-
-                    if(debug) System.out.printf("%s: Ref %s coord\n%s\n",this.getClass().getSimpleName(), ref.getName(),ref.getCoord().toString());
-
-                    ref.getCoord().getTransformation().transform(ballPos);
-                    ref.getCoord().getTransformation().transform(veePos);
-                    ref.getCoord().getTransformation().transform(flatPos);
-
-                    if(debug) {
-                        System.out.printf("%s: survey positions after ref %s transform\n",this.getClass().getSimpleName(),ref.getName());
-                        printSurveyPos();
-                    }
-                }
-            }
-            */
-
-        }
-
-    }
-
+             * // walk through the reference volumes if(referenceGeom!=null) {
+             * for(SurveyVolume ref : referenceGeom) {
+             * 
+             * if(debug) {
+             * System.out.printf("%s: survey positions before ref %s transform\n"
+             * ,this.getClass().getSimpleName(),ref.getName());
+             * printSurveyPos(); }
+             * 
+             * if(debug)
+             * System.out.printf("%s: Ref %s coord\n%s\n",this.getClass
+             * ().getSimpleName(), ref.getName(),ref.getCoord().toString());
+             * 
+             * ref.getCoord().getTransformation().transform(ballPos);
+             * ref.getCoord().getTransformation().transform(veePos);
+             * ref.getCoord().getTransformation().transform(flatPos);
+             * 
+             * if(debug) {
+             * System.out.printf("%s: survey positions after ref %s transform\n"
+             * ,this.getClass().getSimpleName(),ref.getName());
+             * printSurveyPos(); } } }
+             */
+
+        }
+
+    }
 
     public static abstract class BaseModule extends SurveyVolume {
         protected int layer;
         protected String half;
 
-        public BaseModule(String name, SurveyVolume mother, AlignmentCorrection alignmentCorrection, int layer, String half) {
+        public BaseModule(String name, SurveyVolume mother,
+                AlignmentCorrection alignmentCorrection, int layer, String half) {
             super(name, mother, alignmentCorrection);
             setLayer(layer);
             setHalf(half);
             isValid();
         }
-        public BaseModule(String name, SurveyVolume mother, AlignmentCorrection alignmentCorrection, SurveyVolume ref, int layer, String half) {
+
+        public BaseModule(String name, SurveyVolume mother,
+                AlignmentCorrection alignmentCorrection, SurveyVolume ref,
+                int layer, String half) {
             super(name, mother, alignmentCorrection, ref);
             setLayer(layer);
             setHalf(half);
             isValid();
         }
+
         private void isValid() {
-            if(half!="bottom" && half!="top") {
-                System.out.printf("ERROR invalid half %s for BaseModule\n",half);
+            if (half != "bottom" && half != "top") {
+                System.out.printf("ERROR invalid half %s for BaseModule\n",
+                        half);
                 System.exit(1);
             }
         }
+
         public int getLayer() {
             return layer;
         }
+
         public void setLayer(int layer) {
             this.layer = layer;
         }
@@ -925,123 +1258,165 @@
 
     }
 
-
-
     public abstract static class TestRunHalfModule extends BaseModule {
 
-        // Find the coordinate system of the half-modules w.r.t. to the module survey points
-        // We are going to know the sensor center position w.r.t. module coordinate system so the half-module 
-        // is really just a dummy volume to contain the daughters. Therefore place it at the same place 
+        // Find the coordinate system of the half-modules w.r.t. to the module
+        // survey points
+        // We are going to know the sensor center position w.r.t. module
+        // coordinate system so the half-module
+        // is really just a dummy volume to contain the daughters. Therefore
+        // place it at the same place
         // as where the sensor coordinate system will be to make things simpler.
 
         // Distance from sensor to CF edge: 180mm
         // Distance from CF edge to screw hole: 30mm
         // Distance from screw hole to edge of cold block: 33.75mm
         // Distance from edge of cold block to hole/ball position: 5mm
-        protected static final double dist_sensor_center_to_coldblock_hole_vdir = (180.0 - 30.0 + (33.75 - 5.0)) - Sensor.length/2.0;   
-        protected static final double half_module_thickness = TestRunHalfModule.getHybridThickness() + TestRunHalfModule.getCFThickness() + HalfModuleLamination.thickness;
+        protected static final double dist_sensor_center_to_coldblock_hole_vdir = (180.0 - 30.0 + (33.75 - 5.0))
+                - Sensor.length / 2.0;
+        protected static final double half_module_thickness = TestRunHalfModule
+                .getHybridThickness()
+                + TestRunHalfModule.getCFThickness()
+                + HalfModuleLamination.thickness;
+        // protected static final double half_module_length =
+        // TestRunHalfModule.getCFLength();
         protected static final double half_module_length = 200.0;
         protected static final double half_module_width = 6.83 + Sensor.width;
 
         protected double stereo_angle = 0.0;
 
-        public TestRunHalfModule(String name, SurveyVolume mother, AlignmentCorrection alignmentCorrection, int layer, String half) {
-            super(name,mother, alignmentCorrection, layer, half);
+        public TestRunHalfModule(String name, SurveyVolume mother,
+                AlignmentCorrection alignmentCorrection, int layer, String half) {
+            super(name, mother, alignmentCorrection, layer, half);
         }
 
         protected void setCenter() {
-            // Find distance to center in the local coordinate system 
-            // Note that this can be different between axial and stereo since the survey positions determine the local coordinate 
+            // Find distance to center in the local coordinate system
+            // Note that this can be different between axial and stereo since
+            // the survey positions determine the local coordinate
             // system now.
             // I'm not sure this feels good but this has to be done somewhere
-//            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.width/2.0 ); 
-            
-            double box_center_local_x =  TestRunHalfModule.getLength()/2.0 - ( (170.00 + 10.00) - Sensor.length/2.0); 
-            double box_center_local_y = - Sensor.getSensorThickness()/2.0 - HalfModuleLamination.thickness - CarbonFiber.thickness + half_module_thickness/2.0; 
-            double box_center_local_z = TestRunHalfModule.getWidth()/2.0 - ( 12.66 - (8.83 -3.00) + Sensor.width/2.0 ); 
-            
-            
-            if(useSiStripsConvention) {
-                //setCenter(box_center_local_z, box_center_local_x, box_center_local_y); 
-                setCenter(-1.0*box_center_local_z, box_center_local_x, box_center_local_y); 
+            // 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.width/2.0 );
+
+            double box_center_local_x = TestRunHalfModule.getLength() / 2.0
+                    - ((170.00 + 10.00) - Sensor.length / 2.0);
+            double box_center_local_y = -Sensor.getSensorThickness() / 2.0
+                    - HalfModuleLamination.thickness - CarbonFiber.thickness
+                    + half_module_thickness / 2.0;
+            double box_center_local_z = TestRunHalfModule.getWidth() / 2.0
+                    - (12.66 - (8.83 - 3.00) + Sensor.width / 2.0);
+
+            if (useSiStripsConvention) {
+                // setCenter(box_center_local_z, box_center_local_x,
+                // box_center_local_y);
+                setCenter(-1.0 * 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); 
-            }
-        }
+                setCenter(box_center_local_x, box_center_local_y,
+                        box_center_local_z);
+            }
+        }
+
         protected void setBoxDim() {
-            //setBoxDim(getLength(), getThickness(), getWidth());
-            
-            if(useSiStripsConvention) {
-                setBoxDim(getWidth(),getLength(),getThickness());
-                //setBoxDim(getSensorWidth(),getSensorLength(),getSensorThickness());
+            // setBoxDim(getLength(), getThickness(), getWidth());
+
+            if (useSiStripsConvention) {
+                setBoxDim(getWidth(), getLength(), getThickness());
+                // setBoxDim(getSensorWidth(),getSensorLength(),getSensorThickness());
             } else {
                 setBoxDim(getLength(), getThickness(), getWidth());
-                //setBoxDim(getSensorLength(),getSensorThickness(),getSensorWidth());
-            }
-            
-        }
+                // setBoxDim(getSensorLength(),getSensorThickness(),getSensorWidth());
+            }
+
+        }
+
+        protected abstract void setStereoAngle();
+
         protected double getStereoAngle() {
             return stereo_angle;
         }
+
         protected void setStereoAngle(double stereo_angle) {
             this.stereo_angle = stereo_angle;
         }
+
         public static double getCFThickness() {
             return CarbonFiber.thickness;
         }
+
         public static double getCFLength() {
             return CarbonFiber.length;
         }
+
         public static double getCFWidth() {
             return CarbonFiber.width;
         }
+
         public static double getHybridLength() {
             return Hybrid.hybrid_length;
         }
+
         public static double getHybridWidth() {
             return Hybrid.hybrid_width;
         }
+
         public static double getHybridThickness() {
             return Hybrid.hybrid_thickness;
         }
+
         public static double getThickness() {
             return half_module_thickness;
         }
+
         public static double getLength() {
             return half_module_length;
         }
+
         public static double getWidth() {
             return half_module_width;
         }
 
-
-    }
-
+    }
 
     public static class TestRunHalfModuleAxial extends TestRunHalfModule {
 
-        public TestRunHalfModuleAxial(String name, SurveyVolume mother, AlignmentCorrection alignmentCorrection, int layer, String half) {
+        public TestRunHalfModuleAxial(String name, SurveyVolume mother,
+                AlignmentCorrection alignmentCorrection, int layer, String half) {
             super(name, mother, alignmentCorrection, layer, half);
             init();
         }
 
         protected void setPos() {
-            if(debug) System.out.printf("%s: setPos for %s\n",this.getClass().getSimpleName(),getName());
-            
-            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;
-
-            double ball_pos_halfmod_local_x =  dist_sensor_center_to_coldblock_hole_vdir;
-            double ball_pos_halfmod_local_y =  -1.0* (coldBlockThick/2.0 + TestRunHalfModule.getCFThickness() + HalfModuleLamination.thickness + Sensor.getSensorThickness()/2.0);
-            if(useFakeHalfModuleAxialPos) {
-                ball_pos_halfmod_local_x = ball_pos_halfmod_local_x*2.0;
-                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.width/2.0;
-            
-            
+            if (debug)
+                System.out.printf("%s: setPos for %s\n", this.getClass()
+                        .getSimpleName(), getName());
+
+            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;
+
+            double ball_pos_halfmod_local_x = dist_sensor_center_to_coldblock_hole_vdir;
+            double ball_pos_halfmod_local_y = -1.0
+                    * (coldBlockThick / 2.0
+                            + TestRunHalfModule.getCFThickness()
+                            + HalfModuleLamination.thickness + Sensor
+                            .getSensorThickness() / 2.0);
+            if (useFakeHalfModuleAxialPos) {
+                ball_pos_halfmod_local_x = ball_pos_halfmod_local_x * 2.0;
+                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.width / 2.0;
+
             double vee_pos_halfmod_local_x;
             double vee_pos_halfmod_local_y;
             double vee_pos_halfmod_local_z;
@@ -1049,80 +1424,110 @@
             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.width/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.width/2.0;
-                flat_pos_halfmod_local_x =  ball_pos_halfmod_local_x + Sensor.length/2.0;
-                flat_pos_halfmod_local_y =  ball_pos_halfmod_local_y;
-                flat_pos_halfmod_local_z =  ball_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.width/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.width / 2.0;
+                flat_pos_halfmod_local_x = ball_pos_halfmod_local_x
+                        + Sensor.length / 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.length/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());
+                vee_pos_halfmod_local_x = ball_pos_halfmod_local_x
+                        + Sensor.length / 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());
                 printSurveyPos();
             }
 
         }
-        
-        
-        
-    }
-
+
+        @Override
+        protected void setStereoAngle() {
+            // do nothing here
+        }
+
+    }
 
     public static class TestRunHalfModuleStereo extends TestRunHalfModule {
 
-        public TestRunHalfModuleStereo(String name, SurveyVolume mother, AlignmentCorrection alignmentCorrection, int layer, String half) {
+        public TestRunHalfModuleStereo(String name, SurveyVolume mother,
+                AlignmentCorrection alignmentCorrection, int layer, String half) {
             super(name, mother, alignmentCorrection, 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.");
+            if (layer <= 3)
+                stereo_angle = -0.1;
+            else if (layer >= 4 && layer <= 5)
+                stereo_angle = -0.05;
+            if (layer > 3 || layer < 1)
+                throw new RuntimeException("Layer " + layer
+                        + " is not defined.");
             init();
-            //setExplicitRotation();
+            // setExplicitRotation();
         }
 
         protected void setPos() {
-            
-            if(debug) System.out.printf("%s: setPos for %s\n",this.getClass().getSimpleName(),getName());
-            
-            //very similar to axial, see note below
-
-            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;
-//            // 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.width/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);
-            
+
+            if (debug)
+                System.out.printf("%s: setPos for %s\n", this.getClass()
+                        .getSimpleName(), getName());
+
+            // very similar to axial, see note below
+
+            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;
+            // // 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.width/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;
@@ -1133,158 +1538,198 @@
             double flat_pos_halfmod_local_y;
             double flat_pos_halfmod_local_z;
 
-            ball_pos_halfmod_local_x =  dist_sensor_center_to_coldblock_hole_vdir;
+            ball_pos_halfmod_local_x = dist_sensor_center_to_coldblock_hole_vdir;
             // note minus sign to separate from axial
-            ball_pos_halfmod_local_y =  -1.0 * (-1.0* (coldBlockThick/2.0 + TestRunHalfModule.getCFThickness() + HalfModuleLamination.thickness + Sensor.getSensorThickness()/2.0));
-            ball_pos_halfmod_local_z =  dist_lower_sensor_edge_to_cold_block_mounting_surface + Sensor.width/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.width/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.width/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.width/2.0;
-                flat_pos_halfmod_local_x =  ball_pos_halfmod_local_x + Sensor.length/2.0;
-                flat_pos_halfmod_local_y =  ball_pos_halfmod_local_y;
-                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.thickness + Sensor
+                            .getSensorThickness() / 2.0));
+            ball_pos_halfmod_local_z = dist_lower_sensor_edge_to_cold_block_mounting_surface
+                    + Sensor.width / 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.width/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.width/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.width / 2.0;
+                flat_pos_halfmod_local_x = ball_pos_halfmod_local_x
+                        + Sensor.length / 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.length/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());
+
+                vee_pos_halfmod_local_x = ball_pos_halfmod_local_x
+                        + Sensor.length / 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());
                 printSurveyPos();
             }
-        
-        }
-
-
-
-
+
+        }
 
         protected void applyGenericCoordinateSystemCorrections() {
             // Apply whatever corrections we want to the final volume as created
-            // Maybe alignment corrections too but should be done in the top level
+            // 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
+            // My rotations here are active rotations in the mother coordinate
+            // system frame
             // Sloppy description of the frame
             // u: direction along long edge of half module i.e. along strips
             // v: normal to sensor plane
             // w: perpendicular to the sensor
 
-            // flip around u 
-            Rotation r1 = new Rotation(new Vector3D(1,0,0),Math.PI);
+            // flip around u
+            Rotation r1 = new Rotation(new Vector3D(1, 0, 0), Math.PI);
             // apply stereo angle around v
-            Rotation r2 = new Rotation(new Vector3D(0,1,0),stereo_angle);
+            Rotation r2 = new Rotation(new Vector3D(0, 1, 0), stereo_angle);
             // Build full rotation
             Rotation r = r2.applyTo(r1);
-            //Rotation r = r1;
-            if(debug) System.out.printf("%s: Coord before corrections\n%s\n", getClass().getSimpleName(),getCoord().toString());
-            if(debug) System.out.printf("%s: box center before corrections\n%s\n", getClass().getSimpleName(),getBoxDim().toString());
+            // Rotation r = r1;
+            if (debug)
+                System.out.printf("%s: Coord before corrections\n%s\n",
+                        getClass().getSimpleName(), getCoord().toString());
+            if (debug)
+                System.out.printf("%s: box center before corrections\n%s\n",
+                        getClass().getSimpleName(), getBoxDim().toString());
             getCoord().rotateApache(r);
-            if(debug) System.out.printf("%s: Coord after corrections\n%s\n", getClass().getSimpleName(),getCoord().toString());
-            if(debug) System.out.printf("%s: box center after corrections\n%s\n", getClass().getSimpleName(),getBoxDim().toString());
-
-
-        }
-
-
-    }
-
-    public static abstract class TestRunColdBlock extends SurveyVolume {        
+            if (debug)
+                System.out.printf("%s: Coord after corrections\n%s\n",
+                        getClass().getSimpleName(), getCoord().toString());
+            if (debug)
+                System.out.printf("%s: box center after corrections\n%s\n",
+                        getClass().getSimpleName(), getBoxDim().toString());
+
+        }
+
+        @Override
+        protected void setStereoAngle() {
+            if (this.layer <= 3)
+                stereo_angle = -0.1;
+            else if (layer >= 4 && layer <= 5)
+                stereo_angle = -0.05;
+            if (layer > 3 || layer < 1)
+                throw new RuntimeException("Layer " + layer
+                        + " is not defined.");
+        }
+
+    }
+
+    public static abstract class TestRunColdBlock extends SurveyVolume {
         private int layer;
+
         public TestRunColdBlock(String name, SurveyVolume mother, int layer) {
             super(name, mother, null);
             setLayer(layer);
             init();
         }
+
         protected abstract double getWidth();
+
         protected abstract double getLength();
+
         protected abstract double getHeight();
+
         public int getLayer() {
             return layer;
         }
+
         public void setLayer(int layer) {
             this.layer = layer;
         }
+
         protected void setCenter() {
-            setCenter(getLength()/2.0, 0.0, getWidth()/2.0); 
-        }
+            setCenter(getLength() / 2.0, 0.0, getWidth() / 2.0);
+        }
+
         protected void setPos() {
-            if(debug) System.out.printf("%s: setPos for %s\n",this.getClass().getSimpleName(),getName());
-            
+            if (debug)
+                System.out.printf("%s: setPos for %s\n", this.getClass()
+                        .getSimpleName(), getName());
+
             // cold block position w.r.t. module box coordinate system
             // this is a dummy coordinate system, make it simple
             // edge of cold block on the mounting surface
-            final double ball_pos_coldblock_local_x =  -5.00; 
-            final double ball_pos_coldblock_local_y =  0.00;
-            final double ball_pos_coldblock_local_z =  0.00;
-            final double vee_pos_coldblock_local_x =  ball_pos_coldblock_local_x + 1.0; //arbitrary distance 
-            final double vee_pos_coldblock_local_y =  ball_pos_coldblock_local_y;  
-            final double vee_pos_coldblock_local_z =  ball_pos_coldblock_local_z;  
-            final double flat_pos_coldblock_local_x =  ball_pos_coldblock_local_x;  
-            final double flat_pos_coldblock_local_y =  ball_pos_coldblock_local_y + 1.0;  //arbitrary distance 
-            final double flat_pos_coldblock_local_z =  ball_pos_coldblock_local_z;  
-            setBallPos(ball_pos_coldblock_local_x, ball_pos_coldblock_local_y, ball_pos_coldblock_local_z);
-            setVeePos(vee_pos_coldblock_local_x, vee_pos_coldblock_local_y,vee_pos_coldblock_local_z);
-            setFlatPos(flat_pos_coldblock_local_x, flat_pos_coldblock_local_y,flat_pos_coldblock_local_z);
-            
-            if(debug) {
-                System.out.printf("%s: survey positions for %s\n",this.getClass().getSimpleName(),getName());
+            final double ball_pos_coldblock_local_x = -5.00;
+            final double ball_pos_coldblock_local_y = 0.00;
+            final double ball_pos_coldblock_local_z = 0.00;
+            final double vee_pos_coldblock_local_x = ball_pos_coldblock_local_x + 1.0; // arbitrary
+                                                                                       // distance
+            final double vee_pos_coldblock_local_y = ball_pos_coldblock_local_y;
+            final double vee_pos_coldblock_local_z = ball_pos_coldblock_local_z;
+            final double flat_pos_coldblock_local_x = ball_pos_coldblock_local_x;
+            final double flat_pos_coldblock_local_y = ball_pos_coldblock_local_y + 1.0; // arbitrary
+                                                                                        // distance
+            final double flat_pos_coldblock_local_z = ball_pos_coldblock_local_z;
+            setBallPos(ball_pos_coldblock_local_x, ball_pos_coldblock_local_y,
+                    ball_pos_coldblock_local_z);
+            setVeePos(vee_pos_coldblock_local_x, vee_pos_coldblock_local_y,
+                    vee_pos_coldblock_local_z);
+            setFlatPos(flat_pos_coldblock_local_x, flat_pos_coldblock_local_y,
+                    flat_pos_coldblock_local_z);
+
+            if (debug) {
+                System.out.printf("%s: survey positions for %s\n", this
+                        .getClass().getSimpleName(), getName());
                 printSurveyPos();
             }
-            
-        }
+
+        }
+
         protected void setBoxDim() {
             setBoxDim(getLength(), getHeight(), getWidth());
         }
     }
 
-    public static class TestRunColdBlockL13 extends TestRunColdBlock {          
+    public static class TestRunColdBlockL13 extends TestRunColdBlock {
         protected static final double coldblock_L13_length = 82.00;
         protected static final double coldblock_L13_width = 52.50;
         protected static final double coldblock_L13_thickness = 6.00;
@@ -1292,21 +1737,25 @@
         public TestRunColdBlockL13(String name, SurveyVolume mother, int layer) {
             super(name, mother, layer);
         }
+
         protected double getWidth() {
             return coldblock_L13_width;
         }
+
         protected double getLength() {
             return coldblock_L13_length;
         }
+
         protected double getHeight() {
             return coldblock_L13_thickness;
         }
+
         protected double getThickness() {
             return getHeight();
         }
     }
 
-    public static class TestRunColdBlockL45 extends TestRunColdBlock {          
+    public static class TestRunColdBlockL45 extends TestRunColdBlock {
         protected static final double coldblock_L45_length = 82.00;
         protected static final double coldblock_L45_width = 51.00;
         protected static final double coldblock_L45_thickness = 6.00;
@@ -1314,536 +1763,692 @@
         public TestRunColdBlockL45(String name, SurveyVolume mother, int layer) {
             super(name, mother, layer);
         }
+
         protected double getWidth() {
             return coldblock_L45_width;
         }
+
         protected double getLength() {
             return coldblock_L45_length;
         }
+
         protected double getHeight() {
             return coldblock_L45_thickness;
         }
+
         protected double getThickness() {
             return getHeight();
         }
     }
 
+    public abstract static class BaseSensor extends HalfModuleComponent {
+        public BaseSensor(String name, SurveyVolume mother,
+                AlignmentCorrection alignmentCorrection, int id) {
+            super(name, mother, alignmentCorrection, id);
+        }
+    }
 
     /**
-     * Silicon sensor @SurveyVolume.
-     * The coordinate system is located at the same position and orientation as the half-module.
+     * 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 length= 100.00; 
-        static final double width = 40.34; 
+    public static class Sensor extends BaseSensor {
+        static final double length = 100.00;
+        static final double width = 40.34;
         static final double thickness = 0.32;
         static final double height = thickness;
-        public Sensor(String name, SurveyVolume mother, AlignmentCorrection alignmentCorrection, int id) {
+
+        public Sensor(String name, SurveyVolume mother,
+                AlignmentCorrection alignmentCorrection, int id) {
             super(name, mother, alignmentCorrection, id);
             init();
         }
+
         public static double getSensorThickness() {
             return height;
         }
+
         protected void setPos() {
-            
-            if(debug) System.out.printf("%s: setPos for %s\n",this.getClass().getSimpleName(),getName());
-
-            setBallPos(0,0,0);
-            setVeePos(ballPos.x() + width/2.0, ballPos.y(), ballPos.z());
-            setFlatPos(ballPos.x(),ballPos.y() + length/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());
+
+            if (debug)
+                System.out.printf("%s: setPos for %s\n", this.getClass()
+                        .getSimpleName(), getName());
+
+            setBallPos(0, 0, 0);
+            setVeePos(ballPos.x() + width / 2.0, ballPos.y(), ballPos.z());
+            setFlatPos(ballPos.x(), ballPos.y() + length / 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());
                 printSurveyPos();
             }
-            
-        }
+
+        }
+
         protected void setCenter() {
-            setCenter(0,0,0);
-        }
+            setCenter(0, 0, 0);
+        }
+
         protected void setBoxDim() {
-            if(useSiStripsConvention) {
-                setBoxDim(width,length,thickness);
+            if (useSiStripsConvention) {
+                setBoxDim(width, length, thickness);
             } else {
-                setBoxDim(length,thickness,width);
-            }
-        }
+                setBoxDim(length, thickness, width);
+            }
+        }
+
         protected double getThickness() {
             return thickness;
         }
+
         protected double getHeigth() {
             return thickness;
         }
+
         protected double getWidth() {
             return width;
         }
+
         protected double getLength() {
             return length;
-        }           
+        }
     }
 
     /**
-     * Active part of the @Sensor @SurveyVolume.
-     * The coordinate system is located at the same position and orientation as the sensor.
+     * 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 length= 98.33;
+        private static final double length = 98.33;
         private static final double width = 38.3399;
         private static final double thickness = Sensor.thickness;
+
         public ActiveSensor(String name, SurveyVolume m) {
             super(name, m, null);
             init();
         }
+
         public static double getActiveSensorLength() {
             return length;
         }
+
         public static double getActiveSensorWidth() {
             return width;
         }
+
         public static double getActiveSensorHeight() {
             return thickness;
         }
+
         public static double getActiveSensorThickness() {
             return getActiveSensorHeight();
         }
+
         protected void setPos() {
-            
-            if(debug) System.out.printf("%s: setPos for %s\n",this.getClass().getSimpleName(),getName());
-
-            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());
+
+            if (debug)
+                System.out.printf("%s: setPos for %s\n", this.getClass()
+                        .getSimpleName(), getName());
+
+            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());
                 printSurveyPos();
             }
         }
+
         protected void setCenter() {
-            setCenter(0,0,0);
-        }
+            setCenter(0, 0, 0);
+        }
+
         protected void setBoxDim() {
 
-            setBoxDim(getActiveSensorWidth(), getActiveSensorLength(), getActiveSensorThickness());
-
-//            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.
+     * 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 length = Sensor.length; //184.0;
-        protected static final double width = Sensor.width - 2.34;//40.0; // -2.0; // width under the sensor, 2mm wider under hybrid.
+        protected static final double length = Sensor.length; // 184.0;
+        protected static final double width = Sensor.width - 2.34; // 40.0; //
+                                                                   // -2.0; //
+                                                                   // width
+                                                                   // under the
+                                                                   // sensor,
+                                                                   // 2mm wider
+                                                                   // under
+                                                                   // hybrid.
         protected static final double 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.width/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.width/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.width/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;
-
-            //double ball_pos_kapton_local_x =  Sensor.width/2.0 + 6.83 - 6.0 - width/2.0;
-            //double ball_pos_kapton_local_y =  Sensor.length/2.0 - 170.0 - 10.0 + 8.5 + length/2.0;
-            //double ball_pos_kapton_local_z = -1.0 * (Sensor.getSensorThickness()/2.0 + HalfModuleLamination.thickness/2.0);
-
-            double ball_pos_kapton_local_x =  0;
-            double ball_pos_kapton_local_y =  0;
-            double ball_pos_kapton_local_z = -1.0 * (Sensor.getSensorThickness()/2.0 + HalfModuleLamination.thickness/2.0);
-            
-            //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);
-
-            ballPos = new BasicHep3Vector(ball_pos_kapton_local_x,ball_pos_kapton_local_y,ball_pos_kapton_local_z);
-            veePos = new BasicHep3Vector(ballPos.x() + 1.0,ballPos.y(),ballPos.z());
-            flatPos = new BasicHep3Vector(ballPos.x(),ballPos.y()+ 1.0,ballPos.z());
-            
-            
-            if(debug) {
-                System.out.printf("%s: survey positions for %s\n",this.getClass().getSimpleName(),getName());
+            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.width/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.width/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.width/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;
+
+            // double ball_pos_kapton_local_x = Sensor.width/2.0 + 6.83 - 6.0 -
+            // width/2.0;
+            // double ball_pos_kapton_local_y = Sensor.length/2.0 - 170.0 - 10.0
+            // + 8.5 + length/2.0;
+            // double ball_pos_kapton_local_z = -1.0 *
+            // (Sensor.getSensorThickness()/2.0 +
+            // HalfModuleLamination.thickness/2.0);
+
+            double ball_pos_kapton_local_x = 0;
+            double ball_pos_kapton_local_y = 0;
+            double ball_pos_kapton_local_z = -1.0
+                    * (Sensor.getSensorThickness() / 2.0 + HalfModuleLamination.thickness / 2.0);
+
+            // 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);
+
+            ballPos = new BasicHep3Vector(ball_pos_kapton_local_x,
+                    ball_pos_kapton_local_y, ball_pos_kapton_local_z);
+            veePos = new BasicHep3Vector(ballPos.x() + 1.0, ballPos.y(),
+                    ballPos.z());
+            flatPos = new BasicHep3Vector(ballPos.x(), ballPos.y() + 1.0,
+                    ballPos.z());
+
+            if (debug) {
+                System.out.printf("%s: survey positions for %s\n", this
+                        .getClass().getSimpleName(), getName());
                 printSurveyPos();
             }
         }
+
         protected void setCenter() {
             setCenter(0.0, 0.0, 0.0);
-            //setCenter(getWidth()/2.0, getLength()/2.0,0.0);
-            //setCenter(getWidth()/2.0, getLength()/2.0,0.0);
-        }
-        protected  double getThickness() {
+            // setCenter(getWidth()/2.0, getLength()/2.0,0.0);
+            // setCenter(getWidth()/2.0, getLength()/2.0,0.0);
+        }
+
+        protected double getThickness() {
             return thickness;
         }
-        protected  double getHeigth() {
+
+        protected double getHeigth() {
             return getThickness();
         }
-        protected  double getWidth() {
+
+        protected double getWidth() {
             return width;
         }
-        protected  double getLength() {
+
+        protected double getLength() {
             return length;
         }
+
         protected void setBoxDim() {
-            setBoxDim(getWidth(),getLength(),getThickness());
-            //setBoxDim(getLength(),getThickness(),getWidth());
+            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.
+     * 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 length = Sensor.length;
-        protected static  final double width = 36.02;
-        protected static  final double thickness = 0.203;
+        protected static final double length = Sensor.length; // 200.;
+        protected static final double width = 36.02; // 45.;
+        protected static final double thickness = 0.203; // 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.width/2.0 + 12.66) + 8.83 - 3.00;
-//            final double vee_pos_cf_local_x =  ball_pos_cf_local_x + 1.0; // arbitrary distance
-//            final double vee_pos_cf_local_y =  ball_pos_cf_local_y;
-//            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.width/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.width/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);
- 
-            
-            //final double ball_pos_cf_local_x =  Sensor.width/2.0 + 6.83 - width/2.0;
-            //final double ball_pos_cf_local_y =  Sensor.length/2.0 - 170.0 - 10.0 + length/2.0;
-            //final double ball_pos_cf_local_z =  -1 * ( Sensor.getSensorThickness()/2.0 + HalfModuleLamination.thickness + TestRunHalfModule.getCFThickness()/2.0 );
-
-            final double ball_pos_cf_local_x =  0;
-            final double ball_pos_cf_local_y =  0;
-            final double ball_pos_cf_local_z =  -1 * ( Sensor.getSensorThickness()/2.0 + HalfModuleLamination.thickness + TestRunHalfModule.getCFThickness()/2.0 );
-            
-            ballPos = new BasicHep3Vector(ball_pos_cf_local_x, ball_pos_cf_local_y, ball_pos_cf_local_z);
-            veePos = new BasicHep3Vector(ballPos.x() + 1.0, ballPos.y(), ballPos.z());
-            flatPos = new BasicHep3Vector(ballPos.x(), ballPos.y() + 1.0, ballPos.z());
-            
-            
-            
-            if(debug) {
-                System.out.printf("%s: survey positions for %s\n",this.getClass().getSimpleName(),getName());
+
+            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.width/2.0 +
+            // 12.66) + 8.83 - 3.00;
+            // final double vee_pos_cf_local_x = ball_pos_cf_local_x + 1.0; //
+            // arbitrary distance
+            // final double vee_pos_cf_local_y = ball_pos_cf_local_y;
+            // 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.width/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.width/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);
+
+            // final double ball_pos_cf_local_x = Sensor.width/2.0 + 6.83 -
+            // width/2.0;
+            // final double ball_pos_cf_local_y = Sensor.length/2.0 - 170.0 -
+            // 10.0 + length/2.0;
+            // final double ball_pos_cf_local_z = -1 * (
+            // Sensor.getSensorThickness()/2.0 + HalfModuleLamination.thickness
+            // + TestRunHalfModule.getCFThickness()/2.0 );
+
+            final double ball_pos_cf_local_x = 0;
+            final double ball_pos_cf_local_y = 0;
+            final double ball_pos_cf_local_z = -1
+                    * (Sensor.getSensorThickness() / 2.0
+                            + HalfModuleLamination.thickness + TestRunHalfModule
+                            .getCFThickness() / 2.0);
+
+            ballPos = new BasicHep3Vector(ball_pos_cf_local_x,
+                    ball_pos_cf_local_y, ball_pos_cf_local_z);
+            veePos = new BasicHep3Vector(ballPos.x() + 1.0, ballPos.y(),
+                    ballPos.z());
+            flatPos = new BasicHep3Vector(ballPos.x(), ballPos.y() + 1.0,
+                    ballPos.z());
+
+            if (debug) {
+                System.out.printf("%s: survey positions for %s\n", this
+                        .getClass().getSimpleName(), getName());
                 printSurveyPos();
             }
-            
-        }
+
+        }
+
         protected void setCenter() {
             setCenter(0.0, 0.0, 0.0);
-            //setCenter(getWidth()/2.0, getLength()/2.0, 0.0);
-            //setCenter(getLength()/2.0, 0.0, getWidth()/2.0);
-        }
+            // setCenter(getWidth()/2.0, getLength()/2.0, 0.0);
+            // setCenter(getLength()/2.0, 0.0, getWidth()/2.0);
+        }
+
         protected double getThickness() {
             return thickness;
         }
+
         protected double getWidth() {
             return width;
         }
+
         protected double getLength() {
             return length;
         }
+
         protected double getHeigth() {
             return getThickness();
         }
+
         protected void setBoxDim() {
-            setBoxDim(getWidth(),getLength(),getThickness());
-            //setBoxDim(getLength(),getThickness(),getWidth());
+            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.
+     * 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.length; // sensor b-to-b with hybrid
-        protected static final double hybrid_width  = Sensor.width;
-        protected static final double hybrid_thickness = 4.0/64.0*inch;
+        protected static final double hybrid_length = 170.0 - Sensor.length; // sensor
+                                                                             // b-to-b
+                                                                             // with
+                                                                             // hybrid
+        protected static final double hybrid_width = Sensor.width;
+        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.width/2.0);
-//            final double vee_pos_hybrid_local_x =  ball_pos_hybrid_local_x + 1.0; // arbitrary distance
-//            final double vee_pos_hybrid_local_y =  ball_pos_hybrid_local_y;
-//            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.width/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.width/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);
-            
-            final double ball_pos_hybrid_local_x =  0.0;
-            final double ball_pos_hybrid_local_y =  Sensor.length/2.0 - 170.0 + hybrid_length/2.0;
-            final double ball_pos_hybrid_local_z = -1.0*Sensor.getSensorThickness()/2.0 + hybrid_thickness/2.0;
-            
-            ballPos = new BasicHep3Vector(ball_pos_hybrid_local_x,ball_pos_hybrid_local_y, ball_pos_hybrid_local_z);
-            veePos = new BasicHep3Vector(ballPos.x() + 1.0, ballPos.y(), ballPos.z());
-            flatPos = new BasicHep3Vector(ballPos.x(), ballPos.y() + 1.0, ballPos.z());
-            
-            
-            
-            if(debug) {
-                System.out.printf("%s: survey positions for %s\n",this.getClass().getSimpleName(),getName());
+
+            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.width/2.0);
+            // final double vee_pos_hybrid_local_x = ball_pos_hybrid_local_x +
+            // 1.0; // arbitrary distance
+            // final double vee_pos_hybrid_local_y = ball_pos_hybrid_local_y;
+            // 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.width/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.width/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);
+
+            final double ball_pos_hybrid_local_x = 0.0;
+            final double ball_pos_hybrid_local_y = Sensor.length / 2.0 - 170.0
+                    + hybrid_length / 2.0;
+            final double ball_pos_hybrid_local_z = -1.0
+                    * Sensor.getSensorThickness() / 2.0 + hybrid_thickness
+                    / 2.0;
+
+            ballPos = new BasicHep3Vector(ball_pos_hybrid_local_x,
+                    ball_pos_hybrid_local_y, ball_pos_hybrid_local_z);
+            veePos = new BasicHep3Vector(ballPos.x() + 1.0, ballPos.y(),
+                    ballPos.z());
+            flatPos = new BasicHep3Vector(ballPos.x(), ballPos.y() + 1.0,
+                    ballPos.z());
+
+            if (debug) {
+                System.out.printf("%s: survey positions for %s\n", this
+                        .getClass().getSimpleName(), getName());
                 printSurveyPos();
             }
         }
+
         protected void setCenter() {
             setCenter(0.0, 0.0, 0.0);
-            //setCenter(getWidth()/2.0, getLength()/2.0, 0.0);
-            //setCenter(getLength()/2.0, 0.0, getWidth()/2.0);
-        }
+            // 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());
-        }
-    }
-
+            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 mother, AlignmentCorrection alignmentCorrection, int id) {
+
+        public HalfModuleComponent(String name, SurveyVolume mother,
+                AlignmentCorrection alignmentCorrection, int id) {
             super(name, mother, alignmentCorrection);
             this.id = id;
         }
+
         protected abstract double getThickness();
+
         protected abstract double getHeigth();
+
         protected abstract double getWidth();
+
         protected abstract double getLength();
+
         public int getId() {
             return id;
         }
-    }       
-
-    
-    
-   
+    }
 
     public static class TestRunHalfModuleBundle extends HalfModuleBundle {
         protected SurveyVolume carbonFiber = null;
         protected SurveyVolume hybrid = null;
-        TestRunHalfModuleBundle(SurveyVolume hm) {         
+
+        TestRunHalfModuleBundle(SurveyVolume hm) {
             super(hm);
         }
     }
 
-
-    protected TestRunHalfModuleAxial createTestRunHalfModuleAxial(String volName,
-            BaseModule mother, AlignmentCorrection alignmentCorrection,
-            int layer, String half) {
-      return new TestRunHalfModuleAxial(volName, mother, alignmentCorrection, layer, half);
-        
-    }
-
+    protected TestRunHalfModuleAxial createTestRunHalfModuleAxial(
+            String volName, BaseModule mother,
+            AlignmentCorrection alignmentCorrection, int layer, String half) {
+        return new TestRunHalfModuleAxial(volName, mother, alignmentCorrection,
+                layer, half);
+
+    }
 
     protected TestRunHalfModuleStereo createTestRunHalfModuleStereo(
             String volName, BaseModule mother,
             AlignmentCorrection alignmentCorrection, int layer, String half) {
-        return new TestRunHalfModuleStereo(volName, mother, alignmentCorrection, layer, half);
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.lcsim.geometry.compact.converter.HPSTrackerGeometryDefinition#getHalfModuleBundle(org.lcsim.geometry.compact.converter.HPSTestRunTracker2014GeometryDefinition.BaseModule, java.lang.String)
+        return new TestRunHalfModuleStereo(volName, mother,
+                alignmentCorrection, layer, half);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.lcsim.geometry.compact.converter.HPSTrackerGeometryDefinition#
+     * getHalfModuleBundle
+     * (org.lcsim.geometry.compact.converter.HPSTestRunTracker2014GeometryDefinition
+     * .BaseModule, java.lang.String)
      */
-    protected HalfModuleBundle getHalfModuleBundle(BaseModule module, String halfModuleName) {
-        BaseModuleBundle m = getModuleBundle(module.getLayer(), module.getHalf());
+    protected HalfModuleBundle getHalfModuleBundle(BaseModule module,
+            String halfModuleName) {
+        BaseModuleBundle m = getModuleBundle(module.getLayer(),
+                module.getHalf());
         HalfModuleBundle hm = null;
-        // TODO this needs to change when I build quarter-modules for the long half-modules.
-        if(m!=null) {
-            if( m instanceof TestRunModuleBundle) {   
+        // TODO this needs to change when I build quarter-modules for the long
+        // half-modules.
+        if (m != null) {
+            if (m instanceof TestRunModuleBundle) {
                 TestRunModuleBundle mtr = (TestRunModuleBundle) m;
-                if(halfModuleName.contains("axial")) {
+                if (halfModuleName.contains("axial")) {
                     hm = mtr.halfModuleAxial;
+                } else if (halfModuleName.contains("stereo")) {
+                    hm = mtr.halfModuleStereo;
+                } else {
+                    throw new RuntimeException(
+                            "No axial or stereo string found in half module bundle name "
+                                    + halfModuleName);
                 }
-                else if(halfModuleName.contains("stereo")) {
-                    hm = mtr.halfModuleStereo;
-                }
-                else {
-                    throw new RuntimeException("No axial or stereo string found in half module bundle name " + halfModuleName);
-                }
-            }
-            else {
-                throw new RuntimeException("The type of this module bundle is incorrect. Should be a TestRunModuleBundle.");
+            } else {
+                throw new RuntimeException(
+                        "The type of this module bundle is incorrect. Should be a TestRunModuleBundle.");
             }
         } else {
-            throw new RuntimeException("No module found for " + module.getLayer() + " and half " + module.getHalf());
+            throw new RuntimeException("No module found for "
+                    + module.getLayer() + " and half " + module.getHalf());
         }
         return hm;
     }
 
-
-    /* (non-Javadoc)
-     * @see org.lcsim.geometry.compact.converter.HPSTrackerBuilder#getOldGeomDefLayerFromVolumeName(java.lang.String)
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.lcsim.geometry.compact.converter.HPSTrackerBuilder#
+     * getOldGeomDefLayerFromVolumeName(java.lang.String)
      */
     public int getOldGeomDefLayerFromVolumeName(String name) {
-        
+
         String half = getHalfFromName(name);
         int l = getLayerFromVolumeName(name);
         boolean isTopLayer = false;
-        if(half=="top") isTopLayer=true;
-        else if(half=="bottom") isTopLayer = false;
-        else throw new RuntimeException("no half found from " + name);
+        if (half == "top")
+            isTopLayer = true;
+        else if (half == "bottom")
+            isTopLayer = false;
+        else
+            throw new RuntimeException("no half found from " + name);
         boolean isAxial = isAxialFromName(name);
         return getOldLayerDefinition(isTopLayer, l, isAxial);
     }
 
-    /* (non-Javadoc)
-     * @see org.lcsim.geometry.compact.converter.HPSTrackerBuilder#getOldLayerDefinition(boolean, int, boolean)
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.lcsim.geometry.compact.converter.HPSTrackerBuilder#getOldLayerDefinition
+     * (boolean, int, boolean)
      */
     public int getOldLayerDefinition(boolean isTopLayer, int l, boolean isAxial) {
-        int layer=-1;
-        if(isAxial) {
-            if(isTopLayer) {
-                layer = 2*l-1;
-            }
-            else {
-                layer = 2*l;
+        int layer = -1;
+        if (isAxial) {
+            if (isTopLayer) {
+                layer = 2 * l - 1;
+            } else {
+                layer = 2 * l;
             }
         } else {
-            if(isTopLayer) {
-                layer = 2*l;
+            if (isTopLayer) {
+                layer = 2 * l;
             } else {
-                layer = 2*l-1;
+                layer = 2 * l - 1;
             }
         }
         return layer;
     }
 
-
-    
-    /* (non-Javadoc)
-     * @see org.lcsim.geometry.compact.converter.HPSTrackerBuilder#getMillepedeLayer(java.lang.String)
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.lcsim.geometry.compact.converter.HPSTrackerBuilder#getMillepedeLayer
+     * (java.lang.String)
      */
     public int getMillepedeLayer(String name) {
-       return getOldGeomDefLayerFromVolumeName(name);
-    }
-    
-
-
-
+        return getOldGeomDefLayerFromVolumeName(name);
+    }
 
 }
-
-
-
-

Modified: java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/HPSTracker2014GeometryDefinition.java
 =============================================================================
--- java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/HPSTracker2014GeometryDefinition.java	(original)
+++ java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/HPSTracker2014GeometryDefinition.java	Thu Dec  1 12:39:07 2016
@@ -18,7 +18,6 @@
 import org.lcsim.geometry.compact.converter.HPSTestRunTracker2014GeometryDefinition.Sensor;
 import org.lcsim.geometry.compact.converter.HPSTestRunTracker2014GeometryDefinition.TestRunHalfModule;
 
-
 /**
  * 
  * Geometry information for the HPS tracker 2014
@@ -26,9 +25,12 @@
  * @author Per Hansson Adrian <[log in to unmask]>
  *
  */
- public class HPSTracker2014GeometryDefinition extends HPSTrackerGeometryDefinition {
-    
-    private static final Logger LOGGER = Logger.getLogger(HPSTracker2014GeometryDefinition.class.getPackage().getName());
+public class HPSTracker2014GeometryDefinition extends
+        HPSTrackerGeometryDefinition {
+
+    private static final Logger LOGGER = Logger
+            .getLogger(HPSTracker2014GeometryDefinition.class.getPackage()
+                    .getName());
 
     public HPSTracker2014GeometryDefinition(boolean debug, Element node) {
         super(debug, node);
@@ -38,319 +40,413 @@
         doBottom = true;
         doTop = true;
         layerBitMask = 0x3F;
-     }
-
-    /* (non-Javadoc)
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
      * @see org.lcsim.geometry.compact.converter.HPSTrackerBuilder#build()
      */
     public void build() {
 
-        if(isDebug()) System.out.printf("%s: constructing the geometry objects\n", this.getClass().getSimpleName());
-        
+        if (isDebug())
+            System.out.printf("%s: constructing the geometry objects\n", this
+                    .getClass().getSimpleName());
+
         // Create alignment correction objects
-        // THis is really a ugly approach with MP corrections initialized before and 
+        // THis is really a ugly approach with MP corrections initialized before
+        // and
         // the survey corrections based on the XML node
-        // TODO: FIX THIS!
+        // FIX THIS! //TODO
         AlignmentCorrection alignmentCorrections = new AlignmentCorrection();
         alignmentCorrections.setNode(node);
         AlignmentCorrection supBotCorr = getL13UChannelAlignmentCorrection(false);
         supBotCorr.setNode(node);
-        AlignmentCorrection supTopCorr = this.getL13UChannelAlignmentCorrection(true);
+        AlignmentCorrection supTopCorr = this
+                .getL13UChannelAlignmentCorrection(true);
         supTopCorr.setNode(node);
-        
-        // Build the geometry from the basic building blocks in the geometry definition class
+
+        // 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
-        HPSTrackerGeometryDefinition.TrackingVolume tracking = new HPSTrackerGeometryDefinition.TrackingVolume("trackingVolume",null);
+        HPSTrackerGeometryDefinition.TrackingVolume tracking = new HPSTrackerGeometryDefinition.TrackingVolume(
+                "trackingVolume", null);
         surveyVolumes.add(tracking);
 
         PSVacuumChamber chamber = new PSVacuumChamber("chamber", tracking, null);
         surveyVolumes.add(chamber);
-        
-        SvtBox svtBox = new SvtBox("base",chamber, null);
+
+        SvtBox svtBox = new SvtBox("base", chamber, null);
         surveyVolumes.add(svtBox);
 
-        SvtBoxBasePlate svtBoxBasePlate = new SvtBoxBasePlate("base_plate",svtBox,null);
+        SvtBoxBasePlate svtBoxBasePlate = new SvtBoxBasePlate("base_plate",
+                svtBox, null);
         surveyVolumes.add(svtBoxBasePlate);
-                             
-        SupportRingL13BottomKinMount supportRingKinL13Bottom = new SupportRingL13BottomKinMount("c_support_kin_L13b", svtBox, supBotCorr); 
-        surveyVolumes.add(supportRingKinL13Bottom);        
-        
-        UChannelL13 uChannelL13Bottom = new UChannelL13Bottom("support_bottom_L13", svtBox, alignmentCorrections, supportRingKinL13Bottom); 
+
+        SupportRingL13BottomKinMount supportRingKinL13Bottom = new SupportRingL13BottomKinMount(
+                "c_support_kin_L13b", svtBox, supBotCorr);
+        surveyVolumes.add(supportRingKinL13Bottom);
+
+        UChannelL13 uChannelL13Bottom = new UChannelL13Bottom(
+                "support_bottom_L13", svtBox, alignmentCorrections,
+                supportRingKinL13Bottom);
         surveyVolumes.add(uChannelL13Bottom);
-        
-        UChannelL13Plate uChannelL13BottomPlate = new UChannelL13BottomPlate("support_plate_bottom_L13", svtBox, null, uChannelL13Bottom); 
+
+        UChannelL13Plate uChannelL13BottomPlate = new UChannelL13BottomPlate(
+                "support_plate_bottom_L13", svtBox, null, uChannelL13Bottom);
         surveyVolumes.add(uChannelL13BottomPlate);
-        
-        SupportRingL13TopKinMount supportRingKinL13Top = new SupportRingL13TopKinMount("c_support_kin_L13t", svtBox, supTopCorr); 
+
+        SupportRingL13TopKinMount supportRingKinL13Top = new SupportRingL13TopKinMount(
+                "c_support_kin_L13t", svtBox, supTopCorr);
         surveyVolumes.add(supportRingKinL13Top);
-                
-        UChannelL13Top uChannelL13Top = new UChannelL13Top("support_top_L13", svtBox, alignmentCorrections, supportRingKinL13Top); 
+
+        UChannelL13Top uChannelL13Top = new UChannelL13Top("support_top_L13",
+                svtBox, alignmentCorrections, supportRingKinL13Top);
         surveyVolumes.add(uChannelL13Top);
-        
-        UChannelL13Plate uChannelL13TopPlate = new UChannelL13TopPlate("support_plate_top_L13", svtBox, null, uChannelL13Top); 
+
+        UChannelL13Plate uChannelL13TopPlate = new UChannelL13TopPlate(
+                "support_plate_top_L13", svtBox, null, uChannelL13Top);
         surveyVolumes.add(uChannelL13TopPlate);
-        
-        UChannelL46 uChannelL46Bottom = new UChannelL46Bottom("support_bottom_L46", svtBox, alignmentCorrections);
+
+        UChannelL46 uChannelL46Bottom = new UChannelL46Bottom(
+                "support_bottom_L46", svtBox, alignmentCorrections);
         surveyVolumes.add(uChannelL46Bottom);
-        
-        UChannelL46Plate uChannelL46BottomPlate = new UChannelL46BottomPlate("support_plate_bottom_L46", svtBox, null, uChannelL46Bottom);
+
+        UChannelL46Plate uChannelL46BottomPlate = new UChannelL46BottomPlate(
+                "support_plate_bottom_L46", svtBox, null, uChannelL46Bottom);
         surveyVolumes.add(uChannelL46BottomPlate);
 
-        UChannelL46 uChannelL46Top = new UChannelL46Top("support_top_L46", svtBox, alignmentCorrections);
+        UChannelL46 uChannelL46Top = new UChannelL46Top("support_top_L46",
+                svtBox, alignmentCorrections);
         surveyVolumes.add(uChannelL46Top);
-        
-        UChannelL46Plate uChannelL46TopPlate = new UChannelL46TopPlate("support_plate_top_L46", svtBox, null, uChannelL46Top);
+
+        UChannelL46Plate uChannelL46TopPlate = new UChannelL46TopPlate(
+                "support_plate_top_L46", svtBox, null, uChannelL46Top);
         surveyVolumes.add(uChannelL46TopPlate);
-        
-        for(int l=1; l<=6;++l) {
-            if(doLayer(l)) {
-                if(doBottom) makeModuleBundle(l,"bottom");
-                if(doTop)    makeModuleBundle(l,"top");
+
+        for (int l = 1; l <= 6; ++l) {
+            if (doLayer(l)) {
+                if (doBottom)
+                    makeModuleBundle(l, "bottom");
+                if (doTop)
+                    makeModuleBundle(l, "top");
             }
-        }       
-
-        LOGGER.info(String.format("%s: Constructed %d geometry objects", this.getClass().getSimpleName(), surveyVolumes.size()));
-        LOGGER.info(String.format("%s: Constructed %d module bundles", this.getClass().getSimpleName(),modules.size()));
-
-        if(isDebug()) {
-            System.out.printf("%s: DONE constructing the geometry objects\n", this.getClass().getSimpleName());
-            System.out.printf("%s: List of the survey volumes built\n", this.getClass().getSimpleName());
-            for(SurveyVolume bg : surveyVolumes) {
+        }
+
+        LOGGER.info(String.format("%s: Constructed %d geometry objects", this
+                .getClass().getSimpleName(), surveyVolumes.size()));
+        LOGGER.info(String.format("%s: Constructed %d module bundles", this
+                .getClass().getSimpleName(), modules.size()));
+
+        if (isDebug()) {
+            System.out.printf("%s: DONE constructing the geometry objects\n",
+                    this.getClass().getSimpleName());
+            System.out.printf("%s: List of the survey volumes built\n", this
+                    .getClass().getSimpleName());
+            for (SurveyVolume bg : surveyVolumes) {
                 System.out.printf("-------\n%s\n", bg.toString());
             }
         }
-        if(isDebug()) {
-            System.out.printf("%s: List of the module bundles built\n", this.getClass().getSimpleName());
-            for(BaseModuleBundle bundle : this.modules) {
+        if (isDebug()) {
+            System.out.printf("%s: List of the module bundles built\n", this
+                    .getClass().getSimpleName());
+            for (BaseModuleBundle bundle : this.modules) {
                 bundle.print();
             }
         }
-    }
-    
-    /**
-     * {@link SurveyVolume} volume defining the pair spectrometer (PS) vacuum chamber
-     * Reference: tracking volume coordinate system
-     * Origin: same as reference
-     * Orientation:  u - points in x direction (towards positron side), v - points upstream
+
+    }
+
+    /**
+     * {@link SurveyVolume} volume defining the pair spectrometer (PS) vacuum
+     * chamber Reference: tracking volume coordinate system Origin: same as
+     * reference Orientation: u - points in x direction (towards positron side),
+     * v - points upstream
+     * 
+     * @author Per Hansson Adrian <[log in to unmask]>
+     *
      */
     public static class PSVacuumChamber extends SurveyVolume {
-        
-        public static final double height = PS_vac_box_inner_height; 
+        public static final double height = PS_vac_box_inner_height;
         public static final double width = PS_vac_box_inner_width;
         public static final double length = PS_vac_box_inner_length;
-                       
-        public PSVacuumChamber(String name, SurveyVolume mother, AlignmentCorrection alignmentCorrection) {
+
+        public PSVacuumChamber(String name, SurveyVolume mother,
+                AlignmentCorrection alignmentCorrection) {
             super(name, mother, alignmentCorrection);
             init();
-         }
-        
+        }
+
         protected void setCenter() {
             setCenter(0, 0, 0);
         }
+
         protected void setBoxDim() {
-            setBoxDim(width,length,height);
-        }
+            setBoxDim(width, length, height);
+        }
+
         protected void setPos() {
-            ballPos = new BasicHep3Vector(SvtBox.center_to_target_x, SvtBox.center_to_target_y, SvtBox.center_to_target_z);
-            veePos = new BasicHep3Vector(ballPos.x() + 1, ballPos.y(), ballPos.z());
-            flatPos = new BasicHep3Vector(ballPos.x(), ballPos.y(), ballPos.z()-1);
-            
-        }
-    }
-    
-    
-    /**
-     * {@link SurveyVolume} volume defining the SVT box envelope 
-     * Reference: PS vacuum chamber coordinate system. Note that the PS vacuum chamber box is placed w.r.t. this box and the target positions.
-     * Origin: intersection of midplanes vertically and horizontally
-     * Orientation: same as reference
+            ballPos = new BasicHep3Vector(SvtBox.center_to_target_x,
+                    SvtBox.center_to_target_y, SvtBox.center_to_target_z);
+            veePos = new BasicHep3Vector(ballPos.x() + 1, ballPos.y(),
+                    ballPos.z());
+            flatPos = new BasicHep3Vector(ballPos.x(), ballPos.y(),
+                    ballPos.z() - 1);
+
+        }
+    }
+
+    /**
+     * {@link SurveyVolume} volume defining the SVT box envelope Reference: PS
+     * vacuum chamber coordinate system. Note that the PS vacuum chamber box is
+     * placed w.r.t. this box and the target positions. Origin: intersection of
+     * midplanes vertically and horizontally Orientation: same as reference
+     * 
+     * @author Per Hansson Adrian <[log in to unmask]>
+     *
      */
     public static class SvtBox extends SurveyVolume {
-        public static final double height = 6.740*inch;
+        public static final double height = 6.740 * inch;
         public static final double width = SvtBoxBasePlate.width;
         public static final double length = SvtBoxBasePlate.length;
-        
-        // position of the target w.r.t. center of this box. 
+
+        // position of the target w.r.t. center of this box.
         // the coordinate frame is the JLab coordinates..confusing.
-        public static final double center_to_target_z = 13.777*inch;
-        public static final double center_to_target_x = 0.84*inch;
+        public static final double center_to_target_z = 13.777 * inch;
+        public static final double center_to_target_x = 0.84 * inch;
         public static final double center_to_target_y = 0.0;
-                               
-        public SvtBox(String name, SurveyVolume mother, AlignmentCorrection alignmentCorrection) {
+
+        public SvtBox(String name, SurveyVolume mother,
+                AlignmentCorrection alignmentCorrection) {
             super(name, mother, alignmentCorrection);
             init();
-         }
-        
+        }
+
         protected void setCenter() {
-            setCenter(0,0,0);
-        }
-        protected void setBoxDim() {
-            setBoxDim(width,length,height);
-        }
-        protected void setPos() {
-            
-            ballPos = new BasicHep3Vector(0, 0, 0);
-            veePos = new BasicHep3Vector(ballPos.x()+1, ballPos.y(), ballPos.z());
-            flatPos = new BasicHep3Vector(ballPos.x(), ballPos.y()+1, ballPos.z());            
-        }
-    }
-    
-    
-    /**
-     * {@link SurveyVolume} volume defining the base plate of the SVT box.
-     * Reference: {@link SvtBox}  coordinate system.
-     * Origin: surface of base plate intersection with center of hole for adjustment screw on positron side
-     * Orientation: same as reference
-     */
-    public static class SvtBoxBasePlate extends SurveyVolume {
-        public static final double length = 50.5*inch;
-        public static final double width = 16.0*inch;
-        public static final double height = 0.25*inch;
-        public static final double kin_mount_to_edge_of_plate_x = (8.0-5.0)*inch; 
-        public static final double kin_mount_to_edge_of_plate_y = 0.375*inch;
-        public static final double adj_screw_height = 0.13*inch; // amount screw sticks out from plate
-        public static final double adj_screw_width = 0.13*inch; // amount screw sticks out on side
-        
-        
-        public SvtBoxBasePlate(String name, SurveyVolume mother, AlignmentCorrection alignmentCorrection) {
-           super(name, mother, alignmentCorrection);
-           setMaterial("Aluminum");
-           init();
-        }
-        
-        protected void setCenter() {
-            final double x = -kin_mount_to_edge_of_plate_x + SvtBoxBasePlate.width/2.0;
-            final double y = -kin_mount_to_edge_of_plate_y + SvtBoxBasePlate.length/2.0;
-            final double z = -SvtBoxBasePlate.height/2.0;     
-            setCenter(new BasicHep3Vector(x, y, z));
-        }
+            setCenter(0, 0, 0);
+        }
+
         protected void setBoxDim() {
             setBoxDim(width, length, height);
         }
+
         protected void setPos() {
-            final double x = -width/2.0 + kin_mount_to_edge_of_plate_x;
-            final double y = -length/2.0 + kin_mount_to_edge_of_plate_y;
-            final double z = -SvtBox.height/2.0 + height;
+
+            ballPos = new BasicHep3Vector(0, 0, 0);
+            veePos = new BasicHep3Vector(ballPos.x() + 1, ballPos.y(),
+                    ballPos.z());
+            flatPos = new BasicHep3Vector(ballPos.x(), ballPos.y() + 1,
+                    ballPos.z());
+
+        }
+    }
+
+    /**
+     * {@link SurveyVolume} volume defining the base plate of the SVT box.
+     * Reference: {@link SvtBox} coordinate system. Origin: surface of base
+     * plate intersection with center of hole for adjustment screw on positron
+     * side Orientation: same as reference
+     * 
+     * @author Per Hansson Adrian <[log in to unmask]>
+     *
+     */
+    public static class SvtBoxBasePlate extends SurveyVolume {
+        public static final double length = 50.5 * inch;
+        public static final double width = 16.0 * inch;
+        public static final double height = 0.25 * inch;
+        public static final double kin_mount_to_edge_of_plate_x = (8.0 - 5.0)
+                * inch;
+        public static final double kin_mount_to_edge_of_plate_y = 0.375 * inch;
+        public static final double adj_screw_height = 0.13 * inch; // amount
+                                                                   // screw
+                                                                   // sticks out
+                                                                   // from plate
+        public static final double adj_screw_width = 0.13 * inch; // amount
+                                                                  // screw
+                                                                  // sticks out
+                                                                  // on side
+
+        public SvtBoxBasePlate(String name, SurveyVolume mother,
+                AlignmentCorrection alignmentCorrection) {
+            super(name, mother, alignmentCorrection);
+            setMaterial("Aluminum");
+            init();
+        }
+
+        protected void setCenter() {
+            final double x = -kin_mount_to_edge_of_plate_x
+                    + SvtBoxBasePlate.width / 2.0;
+            final double y = -kin_mount_to_edge_of_plate_y
+                    + SvtBoxBasePlate.length / 2.0;
+            final double z = -SvtBoxBasePlate.height / 2.0;
+            setCenter(new BasicHep3Vector(x, y, z));
+        }
+
+        protected void setBoxDim() {
+            setBoxDim(width, length, height);
+        }
+
+        protected void setPos() {
+            final double x = -width / 2.0 + kin_mount_to_edge_of_plate_x;
+            final double y = -length / 2.0 + kin_mount_to_edge_of_plate_y;
+            final double z = -SvtBox.height / 2.0 + height;
             ballPos = new BasicHep3Vector(x, y, z);
-            veePos = new BasicHep3Vector(ballPos.x()+1, ballPos.y(), ballPos.z());
-            flatPos = new BasicHep3Vector(ballPos.x(), ballPos.y()+1, ballPos.z());
-        }
-        
-    }
-    
-    /**
-     * {@link SurveyVolume} volume defining the coordinate system of the support ring
-     *  Reference: @SvtBoxBasePlate
-     *  Origin: pin position of support ring (electron side)
-     *  Orientation: slot position is vee position (positron side) i.e u points towards the positron side and v in the upstream beam direction
+            veePos = new BasicHep3Vector(ballPos.x() + 1, ballPos.y(),
+                    ballPos.z());
+            flatPos = new BasicHep3Vector(ballPos.x(), ballPos.y() + 1,
+                    ballPos.z());
+        }
+
+    }
+
+    /**
+     * {@link SurveyVolume} volume defining the coordinate system of the support
+     * ring Reference: @SvtBoxBasePlate Origin: pin position of support ring
+     * (electron side) Orientation: slot position is vee position (positron
+     * side) i.e u points towards the positron side and v in the upstream beam
+     * direction
+     * 
+     * @author Per Hansson Adrian <[log in to unmask]>
      *
      */
     public static class SupportRing extends SurveyVolume {
-        private static final double plateThickness = 0.35*inch; 
-
-        public SupportRing(String name, SurveyVolume mother, AlignmentCorrection alignmentCorrection, SurveyVolume ref) {
-           super(name, mother, alignmentCorrection, ref);
-           init();
-        }
+        private static final double plateThickness = 0.35 * inch;
+
+        public SupportRing(String name, SurveyVolume mother,
+                AlignmentCorrection alignmentCorrection, SurveyVolume ref) {
+            super(name, mother, alignmentCorrection, ref);
+            init();
+        }
+
         protected void setCenter() {
-            setCenter(null); //dummy
-        }
+            setCenter(null); // dummy
+        }
+
         protected void setBoxDim() {
             // do nothing
         }
+
         protected void setPos() {
 
-            final double ball_pos_x = -SvtBoxBasePlate.kin_mount_to_edge_of_plate_x + SvtBoxBasePlate.width/2.0 - 6.997*inch;
-            final double ball_pos_y = -SvtBoxBasePlate.kin_mount_to_edge_of_plate_y + SvtBoxBasePlate.length -28.543*inch;
+            final double ball_pos_x = -SvtBoxBasePlate.kin_mount_to_edge_of_plate_x
+                    + SvtBoxBasePlate.width / 2.0 - 6.997 * inch;
+            final double ball_pos_y = -SvtBoxBasePlate.kin_mount_to_edge_of_plate_y
+                    + SvtBoxBasePlate.length - 28.543 * inch;
             final double ball_pos_z = 0.0;
 
-            
-            final double vee_pos_x = -SvtBoxBasePlate.kin_mount_to_edge_of_plate_x + SvtBoxBasePlate.width/2.0 + 6.622*inch;
-            final double vee_pos_y = -SvtBoxBasePlate.kin_mount_to_edge_of_plate_y + SvtBoxBasePlate.length - 28.116*inch;
+            final double vee_pos_x = -SvtBoxBasePlate.kin_mount_to_edge_of_plate_x
+                    + SvtBoxBasePlate.width / 2.0 + 6.622 * inch;
+            final double vee_pos_y = -SvtBoxBasePlate.kin_mount_to_edge_of_plate_y
+                    + SvtBoxBasePlate.length - 28.116 * inch;
             final double vee_pos_z = 0.0;
-            
-            
+
             ballPos = new BasicHep3Vector(ball_pos_x, ball_pos_y, ball_pos_z);
             veePos = new BasicHep3Vector(vee_pos_x, vee_pos_y, vee_pos_z);
-            flatPos = new BasicHep3Vector(0,0,0);
+            flatPos = new BasicHep3Vector(0, 0, 0);
 
             Hep3Vector uPrime = VecOp.unit(VecOp.sub(veePos, ballPos));
-            Rotation r = new Rotation(new Vector3D(1,0,0),new Vector3D(0,0,1), new Vector3D(uPrime.v()), new Vector3D(0,0,1));
-            Hep3Vector vPrime = new BasicHep3Vector(r.applyTo(new Vector3D(0, 1, 0)).toArray());
+            Rotation r = new Rotation(new Vector3D(1, 0, 0), new Vector3D(0, 0,
+                    1), new Vector3D(uPrime.v()), new Vector3D(0, 0, 1));
+            Hep3Vector vPrime = new BasicHep3Vector(r.applyTo(
+                    new Vector3D(0, 1, 0)).toArray());
             flatPos = VecOp.add(ballPos, vPrime);
         }
     }
-        
-    /**
-     * Abstract {@link SurveyVolume} volume defining a coordinate system from the kinematic mount positions for support channels
+
+    /**
+     * Abstract {@link SurveyVolume} volume defining a coordinate system from
+     * the kinematic mount positions for support channels
+     * 
+     * @author Per Hansson Adrian <[log in to unmask]>
+     *
      */
     public abstract static class SupportRingL13KinMount extends SurveyVolume {
 
-        public static final double kin_mount_offset_vertically = 0.093*inch; 
+        public static final double kin_mount_offset_vertically = 0.093 * inch;
         protected static final double kin_mount_pos_x = -138.665;
-        protected static final double kin_mount_pos_y =  -67.855;
-
-        public SupportRingL13KinMount(String name, SurveyVolume mother, AlignmentCorrection alignmentCorrection) {
-           super(name, mother, alignmentCorrection);
-        }
+        protected static final double kin_mount_pos_y = -67.855;
+
+        public SupportRingL13KinMount(String name, SurveyVolume mother,
+                AlignmentCorrection alignmentCorrection) {
+            super(name, mother, alignmentCorrection);
+        }
+
         protected void setCenter() {
-            setCenter(null); //dummy
-        }
+            setCenter(null); // dummy
+        }
+
         protected void setBoxDim() {
             // do nothing
         }
+
         protected void setPos() {
-            ballPos = new BasicHep3Vector(kin_mount_pos_x, kin_mount_pos_y, getKinMountVerticalPos());
-
-            final double vee_pos_x = ballPos.x()+1; // random positive offset
+            ballPos = new BasicHep3Vector(kin_mount_pos_x, kin_mount_pos_y,
+                    getKinMountVerticalPos());
+
+            final double vee_pos_x = ballPos.x() + 1; // random positive offset
             final double vee_pos_y = ballPos.y();
             final double vee_pos_z = ballPos.z();
             veePos = new BasicHep3Vector(vee_pos_x, vee_pos_y, vee_pos_z);
 
             final double flat_pos_x = ballPos.x();
-            final double flat_pos_y = ballPos.y() + 1.0; // random positive offset
+            final double flat_pos_y = ballPos.y() + 1.0; // random positive
+                                                         // offset
             final double flat_pos_z = ballPos.z();
-            flatPos = new BasicHep3Vector(flat_pos_x,flat_pos_y,flat_pos_z);
-        }
+            flatPos = new BasicHep3Vector(flat_pos_x, flat_pos_y, flat_pos_z);
+        }
+
         abstract protected double getKinMountVerticalPos();
     }
-    
-    /**
-     * {@link SurveyVolume} volume defining a coordinate system from the kinematic mount positions for support channels
-     *  Reference: {@link SvtBox} coordinate system
-     *  Origin: cone mount (it's on the electron side)
-     *  Orientation: ball is cone mount, slot mount is vee position and flat is along beam line pointing upstream
-     */
-    public static class SupportRingL13BottomKinMount extends SupportRingL13KinMount {
-
-        protected static final double kin_mount_pos_z =  -67.996;
-
-        public SupportRingL13BottomKinMount(String name, SurveyVolume mother, AlignmentCorrection alignmentCorrection) {
-           super(name, mother, alignmentCorrection);
-           init();
+
+    /**
+     * {@link SurveyVolume} volume defining a coordinate system from the
+     * kinematic mount positions for support channels Reference: {@link SvtBox}
+     * coordinate system Origin: cone mount (it's on the electron side)
+     * Orientation: ball is cone mount, slot mount is vee position and flat is
+     * along beam line pointing upstream
+     * 
+     * @author Per Hansson Adrian <[log in to unmask]>
+     *
+     */
+    public static class SupportRingL13BottomKinMount extends
+            SupportRingL13KinMount {
+
+        protected static final double kin_mount_pos_z = -67.996;
+
+        public SupportRingL13BottomKinMount(String name, SurveyVolume mother,
+                AlignmentCorrection alignmentCorrection) {
+            super(name, mother, alignmentCorrection);
+            init();
         }
 
         @Override
         protected double getKinMountVerticalPos() {
             return kin_mount_pos_z;
         }
-        
-    }
-    
-    /**
-     * {@link SurveyVolume} volume defining a coordinate system from the kinematic mount positions for support channels
-     *  Reference: @SupportRing coordinate system
-     *  Origin: cone mount (it's on the electron side)
-     *  Orientation: ball is cone mount, slot mount is vee position and flat is along beamline pointing upstream
-     */
-    public static class SupportRingL13TopKinMount extends SupportRingL13KinMount {
-        //public static final double mount_surface_wrt_baseplate_vertically = 5.388*inch;
-        protected static final double kin_mount_pos_z =  56.857;
-
-        public SupportRingL13TopKinMount(String name, SurveyVolume mother, AlignmentCorrection alignmentCorrection) {
-           super(name, mother, alignmentCorrection);
-           init();
+
+    }
+
+    /**
+     * {@link SurveyVolume} volume defining a coordinate system from the
+     * kinematic mount positions for support channels Reference: @SupportRing
+     * coordinate system Origin: cone mount (it's on the electron side)
+     * Orientation: ball is cone mount, slot mount is vee position and flat is
+     * along beamline pointing upstream
+     * 
+     * @author Per Hansson Adrian <[log in to unmask]>
+     *
+     */
+    public static class SupportRingL13TopKinMount extends
+            SupportRingL13KinMount {
+        // public static final double mount_surface_wrt_baseplate_vertically =
+        // 5.388*inch;
+        protected static final double kin_mount_pos_z = 56.857;
+
+        public SupportRingL13TopKinMount(String name, SurveyVolume mother,
+                AlignmentCorrection alignmentCorrection) {
+            super(name, mother, alignmentCorrection);
+            init();
         }
 
         @Override
@@ -358,185 +454,253 @@
             return kin_mount_pos_z;
         }
 
-//        protected void setPos() {
-//            final double ball_pos_x = (7.0 - 5.444) *inch;
-//            final double ball_pos_y = 0.574*inch;
-//            final double ball_pos_z = mount_surface_wrt_baseplate_vertically + kin_mount_offset_vertically;
-//            ballPos = new BasicHep3Vector(ball_pos_x, ball_pos_y, ball_pos_z);
-//            
-//            final double vee_pos_x = (2*7.0)*inch;
-//            final double vee_pos_y = ball_pos_y;
-//            final double vee_pos_z = ball_pos_z;
-//            veePos = new BasicHep3Vector(vee_pos_x, vee_pos_y, vee_pos_z);
-//            
-//            final double flat_pos_x = ball_pos_x;
-//            final double flat_pos_y = ball_pos_y + 1.0; // random distance
-//            final double flat_pos_z = ball_pos_z;
-//            flatPos = new BasicHep3Vector(flat_pos_x,flat_pos_y,flat_pos_z);
-//        }
-    }
-        
-    /**
-     * Abstract {@link SurveyVolume} volume defining the coordinate system of the L1-3 u-channels
+        // protected void setPos() {
+        // final double ball_pos_x = (7.0 - 5.444) *inch;
+        // final double ball_pos_y = 0.574*inch;
+        // final double ball_pos_z = mount_surface_wrt_baseplate_vertically +
+        // kin_mount_offset_vertically;
+        // ballPos = new BasicHep3Vector(ball_pos_x, ball_pos_y, ball_pos_z);
+        //
+        // final double vee_pos_x = (2*7.0)*inch;
+        // final double vee_pos_y = ball_pos_y;
+        // final double vee_pos_z = ball_pos_z;
+        // veePos = new BasicHep3Vector(vee_pos_x, vee_pos_y, vee_pos_z);
+        //
+        // final double flat_pos_x = ball_pos_x;
+        // final double flat_pos_y = ball_pos_y + 1.0; // random distance
+        // final double flat_pos_z = ball_pos_z;
+        // flatPos = new BasicHep3Vector(flat_pos_x,flat_pos_y,flat_pos_z);
+        // }
+    }
+
+    /**
+     * Abstract {@link SurveyVolume} volume defining the coordinate system of
+     * the L1-3 u-channels
+     * 
+     * @author Per Hansson Adrian <[log in to unmask]>
      */
     public abstract static class UChannelL13 extends SurveyVolume {
-        public final static double length = UChannelL13Plate.length;
-        public static final double width = UChannelL13Plate.width;
-        public static final double height = 2.575*inch;
-        public static final double kin_mount_to_edge_of_plate_x = width/2.0-4.0*inch;
-        public static final double side_plate_cone_y = 2.0*inch;
-
-        public UChannelL13(String name, SurveyVolume m, AlignmentCorrection alignmentCorrection, SurveyVolume ref) {
+        protected final static double length = UChannelL13Plate.length;
+        private static final double width = UChannelL13Plate.width;
+        public static final double height = 2.575 * inch;
+        // private static final double kin_mount_to_edge_of_plate_x =
+        // width/2.0-4.0*inch;
+        public static final double side_plate_cone_y = 2.0 * inch;
+
+        public UChannelL13(String name, SurveyVolume m,
+                AlignmentCorrection alignmentCorrection, SurveyVolume ref) {
             super(name, m, alignmentCorrection, ref);
         }
 
         protected void setBoxDim() {
-            setBoxDim(getWidth(),getLength(),getHeight());
-        }
+            setBoxDim(getWidth(), getLength(), getHeight());
+        }
+
         protected double getLength() {
+            System.out.println("UChannelL13 getLength");
+
             return length;
         }
+
         protected double getWidth() {
             return width;
         }
+
         protected double getHeight() {
             return height;
         }
     }
-    
-    /**
-     * {@link SurveyVolume} volume defining the coordinate system of the bottom L1-3 u-channel 
-     *  Reference: {@link SupportRingL13BottomKinMount} coordinate system
-     *  Origin: midpoint between upstream survey cones
-     *  Orientation: u - width pointing towards electron side, v - pointing along the U-channel in the beam direction
+
+    /**
+     * {@link SurveyVolume} volume defining the coordinate system of the bottom
+     * L1-3 u-channel Reference: {@link SupportRingL13BottomKinMount} coordinate
+     * system Origin: midpoint between upstream survey cones Orientation: u -
+     * width pointing towards electron side, v - pointing along the U-channel in
+     * the beam direction
+     * 
+     * @author Per Hansson Adrian <[log in to unmask]>
+     *
      */
     public static class UChannelL13Bottom extends UChannelL13 {
-        private final static double cone_to_edge_of_plate_y = 12.25*inch; 
-        private final static Hep3Vector ball_kinMount = new BasicHep3Vector(SupportRingL13BottomKinMount.kin_mount_pos_x,SupportRingL13BottomKinMount.kin_mount_pos_y,SupportRingL13BottomKinMount.kin_mount_pos_z);
+        protected final static double cone_to_edge_of_plate_y = 12.25 * inch;
+        private final static Hep3Vector ball_kinMount = new BasicHep3Vector(
+                SupportRingL13BottomKinMount.kin_mount_pos_x,
+                SupportRingL13BottomKinMount.kin_mount_pos_y,
+                SupportRingL13BottomKinMount.kin_mount_pos_z);
 
         public UChannelL13Bottom(String name, SurveyVolume m,
                 AlignmentCorrection alignmentCorrection, SurveyVolume ref) {
             super(name, m, alignmentCorrection, ref);
             init();
         }
+
+        protected void setCenter() {
+            System.out.println("UChannelL13Bottom setCenter");
+            final double x = 0.0;
+            final double y = cone_to_edge_of_plate_y - length / 2.0;
+            final double z = -side_plate_cone_y - UChannelL13Plate.height
+                    + height / 2.0;
+            setCenter(x, y, z);
+        }
+
+        protected void setPos() {
+            System.out.println("UChannelL13Bottom setPos");
+            ballPos = VecOp.sub(UChannelL13BottomSurveyBalls.ball_pos,
+                    ball_kinMount);
+            Hep3Vector veeOffset = UChannelL13BottomSurveyBalls.getVeeOffset();
+            veePos = VecOp.add(ballPos, veeOffset);
+            Hep3Vector flatOffset = UChannelL13BottomSurveyBalls
+                    .getFlatOffset();
+            flatPos = VecOp.add(ballPos, flatOffset);
+
+            // ballPos = VecOp.sub(UChannelL13BottomSurveyBalls.ball_pos,
+            // ball_kinMount);
+            // veePos = new BasicHep3Vector(ballPos.x()-1, ballPos.y(),
+            // ballPos.z());
+            // flatPos = new BasicHep3Vector(ballPos.x(), ballPos.y()-1,
+            // ballPos.z());
+        }
+    }
+
+    /**
+     * Position of the center of the survey balls when engaging the cones in the
+     * side plates of the U-channel. This is at nominal position.
+     * 
+     * @author Per Hansson Adrian <[log in to unmask]>
+     *
+     */
+    private static class UChannelL13BottomSurveyBalls {
+
+        // Shawn's calculated point at midpoint between two forward survey balls
+        protected final static Hep3Vector ball_pos = new BasicHep3Vector(
+                -46.446, 241.184, -8.423);
+
+        // Nominal Design FWD Right (x,y,z) BWD Right (x,y,z) FWD Left (x,y,z,)
+        // BWD Left (x,y,z)
+        //
+        // Layer 1-3, Lower -6.493, -.332, 9.353 -6.253, -.332, 1.483 2.836,
+        // -.332, 9.638 3.076, -.332, 1.767
+        //
+        // Layer 1-3, Upper -6.512, .332, 9.978 -6.272, .332, 2.107 2.817, .332,
+        // 10.262 3.057, .332, 2.392
+
+        protected static final Hep3Vector fwd_right = new BasicHep3Vector(
+                -6.493, 9.353, -.332);
+        protected static final Hep3Vector bwd_right = new BasicHep3Vector(
+                -6.253, 1.483, -.332);
+        protected static final Hep3Vector fwd_left = new BasicHep3Vector(2.836,
+                9.638, -.332);
+
+        // protected static final Hep3Vector bwd_left = new
+        // BasicHep3Vector(3.076, 1.767, -.332);
+
+        protected static Hep3Vector getVeeOffset() {
+            return VecOp.mult(0.5, VecOp.sub(fwd_right, fwd_left));
+        }
+
+        protected static Hep3Vector getFlatOffset() {
+            return VecOp.sub(bwd_right, fwd_right);
+        }
+    }
+
+    /**
+     * {@link SurveyVolume} volume defining the coordinate system of the top
+     * L1-3 u-channel Reference: SupportRingL13TopKinMount coordinate system
+     * Origin: midpoint between upstream survey cones Orientation: u - width
+     * pointing towards positron side, v - pointing along the U-channel in the
+     * beam direction Note that this is flipped w.r.t. bottom support.
+     * 
+     * @author Per Hansson Adrian <[log in to unmask]>
+     *
+     */
+    public static class UChannelL13Top extends UChannelL13 {
+        private final static Hep3Vector ball_kinMount = new BasicHep3Vector(
+                SupportRingL13TopKinMount.kin_mount_pos_x,
+                SupportRingL13TopKinMount.kin_mount_pos_y,
+                SupportRingL13TopKinMount.kin_mount_pos_z);
+
+        private final static double cone_to_side_plate_pin_y = (14.5 - 3.125)
+                * inch;
+        private final static double side_plate_pin_to_edge_of_plate_y = (16.0 - 14.5)
+                * inch;
+        protected final static double cone_to_edge_of_plate_y = cone_to_side_plate_pin_y
+                + side_plate_pin_to_edge_of_plate_y;
+
+        public UChannelL13Top(String name, SurveyVolume m,
+                AlignmentCorrection alignmentCorrection, SurveyVolume ref) {
+            super(name, m, alignmentCorrection, ref);
+            init();
+        }
+
         protected void setCenter() {
             final double x = 0.0;
-            final double y = cone_to_edge_of_plate_y - length/2.0;
-            final double z = -side_plate_cone_y - UChannelL13Plate.height + height/2.0;
-            setCenter(x,y,z);
-        }
+            final double y = cone_to_edge_of_plate_y - length / 2.0;
+            final double z = -side_plate_cone_y - UChannelL13Plate.height
+                    + height / 2.0;
+            setCenter(x, y, z);
+        }
+
         protected void setPos() {
-            ballPos = VecOp.sub(UChannelL13BottomSurveyBalls.ball_pos, ball_kinMount);
-            Hep3Vector veeOffset = UChannelL13BottomSurveyBalls.getVeeOffset();
-            veePos = VecOp.add(ballPos, veeOffset);
-            Hep3Vector flatOffset = UChannelL13BottomSurveyBalls.getFlatOffset();
-            flatPos = VecOp.add(ballPos, flatOffset);
-            
-//            ballPos = VecOp.sub(UChannelL13BottomSurveyBalls.ball_pos, ball_kinMount);
-//            veePos = new BasicHep3Vector(ballPos.x()-1, ballPos.y(), ballPos.z());
-//            flatPos = new BasicHep3Vector(ballPos.x(), ballPos.y()-1, ballPos.z());
-        }
-    }
-    
-    /**
-     * Position of the center of the survey balls when engaging the cones in the side plates of the U-channel. 
-     * This is at nominal position.
-     */
-    private static class UChannelL13BottomSurveyBalls  {
-        
-     // Shawn's calculated point at midpoint between two forward survey balls
-        protected final static Hep3Vector ball_pos = new BasicHep3Vector(-46.446, 241.184, -8.423);
-
-        //Nominal Design  FWD Right (x,y,z)   BWD Right (x,y,z)   FWD Left (x,y,z,)   BWD Left (x,y,z)
-        //
-        //Layer 1-3, Lower     -6.493, -.332, 9.353    -6.253, -.332, 1.483    2.836, -.332, 9.638     3.076, -.332, 1.767
-        //                
-        //Layer 1-3, Upper     -6.512, .332, 9.978     -6.272, .332, 2.107     2.817, .332, 10.262     3.057, .332, 2.392
-
-        
-        protected static final Hep3Vector fwd_right = new BasicHep3Vector(-6.493, 9.353,-.332);
-        protected static final Hep3Vector bwd_right = new BasicHep3Vector(-6.253, 1.483, -.332);
-        protected static final Hep3Vector fwd_left = new BasicHep3Vector( 2.836, 9.638, -.332);
-        //protected static final Hep3Vector bwd_left = new BasicHep3Vector(3.076, 1.767, -.332);
-        
-        protected static Hep3Vector getVeeOffset() {
-            return  VecOp.mult(0.5,VecOp.sub(fwd_right, fwd_left));
-        }
-        protected static Hep3Vector getFlatOffset() {
-            return VecOp.sub(bwd_right, fwd_right);
-        }
-    }
-    
-    /**
-     * {@link SurveyVolume} volume defining the coordinate system of the top L1-3 u-channel 
-     *  Reference: SupportRingL13TopKinMount coordinate system
-     *  Origin: midpoint between upstream survey cones
-     *  Orientation: u - width pointing towards positron side, v - pointing along the U-channel in the beam direction
-     *  Note that this is flipped w.r.t. bottom support.
-     */
-    public static class UChannelL13Top extends UChannelL13 {
-        private final static Hep3Vector ball_kinMount = new BasicHep3Vector(SupportRingL13TopKinMount.kin_mount_pos_x,SupportRingL13TopKinMount.kin_mount_pos_y,SupportRingL13TopKinMount.kin_mount_pos_z);
-
-        private final static double length = UChannelL13.length;
-        private final static double cone_to_side_plate_pin_y = (14.5-3.125)*inch; 
-        private final static double side_plate_pin_to_edge_of_plate_y = (16.0-14.5)*inch; 
-        private final static double cone_to_edge_of_plate_y = cone_to_side_plate_pin_y + side_plate_pin_to_edge_of_plate_y;
-        
-        public UChannelL13Top(String name, SurveyVolume m,
-                AlignmentCorrection alignmentCorrection, SurveyVolume ref) {
-            super(name, m, alignmentCorrection, ref);
-            init();
-        }
-        protected void setCenter() {
-            final double x = 0.0;
-            final double y = cone_to_edge_of_plate_y - length/2.0;
-            final double z = -side_plate_cone_y - UChannelL13Plate.height + height/2.0;
-            setCenter(x,y,z);
-        }
-        protected void setPos() {
-            ballPos = VecOp.sub(UChannelL13TopSurveyBalls.ball_pos, ball_kinMount);
+            ballPos = VecOp.sub(UChannelL13TopSurveyBalls.ball_pos,
+                    ball_kinMount);
             Hep3Vector veeOffset = UChannelL13TopSurveyBalls.getVeeOffset();
             veePos = VecOp.add(ballPos, veeOffset);
             Hep3Vector flatOffset = UChannelL13TopSurveyBalls.getFlatOffset();
             flatPos = VecOp.add(ballPos, flatOffset);
-            
-        }
+
+        }
+
         protected double getLength() {
-           return length;
-        }
-    }
-       
-    /**
-     * Position of the center of the survey balls when engaging the cones in the side plates of the U-channel. 
-     * This is at nominal position.
-     */
-    private static class UChannelL13TopSurveyBalls  {
-        
-     // Shawn's calculated point at midpoint between two forward survey balls
-        protected final static Hep3Vector ball_pos = new BasicHep3Vector(-46.930, 257.052, 8.423);
-        
-        //Nominal Design  FWD Right (x,y,z)   BWD Right (x,y,z)   FWD Left (x,y,z,)   BWD Left (x,y,z)
+            return length;
+        }
+    }
+
+    /**
+     * Position of the center of the survey balls when engaging the cones in the
+     * side plates of the U-channel. This is at nominal position.
+     * 
+     * @author Per Hansson Adrian <[log in to unmask]>
+     *
+     */
+    private static class UChannelL13TopSurveyBalls {
+
+        // Shawn's calculated point at midpoint between two forward survey balls
+        protected final static Hep3Vector ball_pos = new BasicHep3Vector(
+                -46.930, 257.052, 8.423);
+
+        // Nominal Design FWD Right (x,y,z) BWD Right (x,y,z) FWD Left (x,y,z,)
+        // BWD Left (x,y,z)
         //
-        //Layer 1-3, Lower     -6.493, -.332, 9.353    -6.253, -.332, 1.483    2.836, -.332, 9.638     3.076, -.332, 1.767
-        //                
-        //Layer 1-3, Upper     -6.512, .332, 9.978     -6.272, .332, 2.107     2.817, .332, 10.262     3.057, .332, 2.392
-
-        
-        protected static final Hep3Vector fwd_right = new BasicHep3Vector(-6.512, 9.978, .332);
-        //protected static final Hep3Vector bwd_right = new BasicHep3Vector(-6.272, 2.107, .332);
-        protected static final Hep3Vector fwd_left = new BasicHep3Vector( 2.817, 10.262, .332);
-        protected static final Hep3Vector bwd_left = new BasicHep3Vector(3.057, 2.392, .332);
-        
+        // Layer 1-3, Lower -6.493, -.332, 9.353 -6.253, -.332, 1.483 2.836,
+        // -.332, 9.638 3.076, -.332, 1.767
+        //
+        // Layer 1-3, Upper -6.512, .332, 9.978 -6.272, .332, 2.107 2.817, .332,
+        // 10.262 3.057, .332, 2.392
+
+        protected static final Hep3Vector fwd_right = new BasicHep3Vector(
+                -6.512, 9.978, .332);
+        // protected static final Hep3Vector bwd_right = new
+        // BasicHep3Vector(-6.272, 2.107, .332);
+        protected static final Hep3Vector fwd_left = new BasicHep3Vector(2.817,
+                10.262, .332);
+        protected static final Hep3Vector bwd_left = new BasicHep3Vector(3.057,
+                2.392, .332);
+
         protected static Hep3Vector getVeeOffset() {
-            return  VecOp.mult(0.5,VecOp.sub(fwd_left, fwd_right));
-        }
+            return VecOp.mult(0.5, VecOp.sub(fwd_left, fwd_right));
+        }
+
         protected static Hep3Vector getFlatOffset() {
             return VecOp.sub(bwd_left, fwd_left);
         }
     }
-    
-    /**
-     * Abstract {@link SurveyVolume} volume defining the coordinate system of the u-channel plate
+
+    /**
+     * Abstract {@link SurveyVolume} volume defining the coordinate system of
+     * the u-channel plate
+     * 
+     * @author Per Hansson Adrian <[log in to unmask]>
+     *
      */
     public abstract static class UChannelPlate extends SurveyVolume {
         public UChannelPlate(String name, SurveyVolume m,
@@ -544,43 +708,53 @@
             super(name, m, alignmentCorrection, ref);
         }
 
-        // the kin mount cone is recessed into the plate meaning that the effective pivot axis is 
+        // the kin mount cone is recessed into the plate meaning that the
+        // effective pivot axis is
         // also recessed into the plate from the surface
-        public static final double dist_from_plate_surface_to_pivot_point = 0.0295*inch;
-    }
-
-    /**
-     * Abstract {@link SurveyVolume} volume defining the coordinate system of the u-channel plate
+        public static final double dist_from_plate_surface_to_pivot_point = 0.0295 * inch;
+    }
+
+    /**
+     * Abstract {@link SurveyVolume} volume defining the coordinate system of
+     * the u-channel plate
+     * 
+     * @author Per Hansson Adrian <[log in to unmask]>
+     *
      */
     public abstract static class UChannelL13Plate extends UChannelPlate {
         private final static double pocket_depth_L1 = 0.025;
         private final static double pocket_depth_L2 = pocket_depth_L1 + 0.059;
         private final static double pocket_depth_L3 = pocket_depth_L2 + 0.059;
-        //private final static double module_mounting_hole_to_hole_x =3.937*inch;
-        private static final double width = 9.25*inch;
-        protected static final double height = 0.375*inch;
-        protected final static double length = 16.0*inch;
-        
-
-        
+        // private final static double module_mounting_hole_to_hole_x
+        // =3.937*inch;
+        protected static final double width = 9.25 * inch;
+        protected static final double height = 0.375 * inch;
+        protected final static double length = 16.0 * inch;
+
         public UChannelL13Plate(String name, SurveyVolume m,
                 AlignmentCorrection alignmentCorrection, SurveyVolume ref) {
             super(name, m, alignmentCorrection, ref);
             setMaterial("Aluminum");
         }
-        
+
         /**
          * Get pocket depth for this plate
+         * 
          * @param layer
          * @return pocket depth
          */
         public static double getPocketDepth(int layer) {
-             if(layer==1) return pocket_depth_L1;
-             else if(layer==2) return pocket_depth_L2;
-             else if(layer==3) return pocket_depth_L3;
-             else {
-                 throw new RuntimeException("Trying to create a L1-3 module with invalid layer nr: " + layer);
-             }
+            if (layer == 1)
+                return pocket_depth_L1;
+            else if (layer == 2)
+                return pocket_depth_L2;
+            else if (layer == 3)
+                return pocket_depth_L3;
+            else {
+                throw new RuntimeException(
+                        "Trying to create a L1-3 module with invalid layer nr: "
+                                + layer);
+            }
         }
 
         protected void setBoxDim() {
@@ -588,32 +762,36 @@
         }
 
         protected void setPos() {
-           ballPos = new BasicHep3Vector(0, 0, 0);
-           veePos = new BasicHep3Vector(1, 0, 0);
-           flatPos = new BasicHep3Vector(0, 1, 0);
-        }
-        
+            ballPos = new BasicHep3Vector(0, 0, 0);
+            veePos = new BasicHep3Vector(1, 0, 0);
+            flatPos = new BasicHep3Vector(0, 1, 0);
+        }
+
         public double getWidth() {
             return width;
         }
-        public double getLength() { 
+
+        public double getLength() {
             return length;
         }
+
         public double getHeight() {
             return height;
         }
-        
-    }
-        
-    
-    /**
-     * {@link SurveyVolume} volume defining the coordinate system of the bottom u-channel plate
-     * Reference:  @UChannelL13Bottom coordinate system
-     * Origin:  same as reference
-     * Orientation: same as reference
+
+    }
+
+    /**
+     * {@link SurveyVolume} volume defining the coordinate system of the bottom
+     * u-channel plate Reference: @UChannelL13Bottom coordinate system Origin:
+     * same as reference Orientation: same as reference
+     *
+     * @author Per Hansson Adrian <[log in to unmask]>
+     *
      */
     public static class UChannelL13BottomPlate extends UChannelL13Plate {
-        protected final static double L1_module_pin_to_edge_of_plate = (16.0-4.126)*inch;
+        protected final static double L1_module_pin_to_edge_of_plate = (16.0 - 4.126)
+                * inch;
 
         public UChannelL13BottomPlate(String name, SurveyVolume m,
                 AlignmentCorrection alignmentCorrection, SurveyVolume ref) {
@@ -623,21 +801,25 @@
 
         protected void setCenter() {
             final double x = 0.0;
-            final double y = UChannelL13Bottom.cone_to_edge_of_plate_y - length/2.0;
-            final double z = -UChannelL13.side_plate_cone_y - height/2.0;
-            setCenter(x,y,z);
-        }
-
-    }
-    
-    /**
-     * {@link SurveyVolume} volume defining the coordinate system of the bottom u-channel plate
-     * Reference:  @UChannelL13Bottom coordinate system
-     * Origin:  same as reference
-     * Orientation: same as reference     
+            final double y = UChannelL13Bottom.cone_to_edge_of_plate_y
+                    - getLength() / 2.0;
+            final double z = -UChannelL13.side_plate_cone_y - getHeight() / 2.0;
+            setCenter(x, y, z);
+        }
+
+    }
+
+    /**
+     * {@link SurveyVolume} volume defining the coordinate system of the bottom
+     * u-channel plate Reference: @UChannelL13Bottom coordinate system Origin:
+     * same as reference Orientation: same as reference
+     *
+     * @author Per Hansson Adrian <[log in to unmask]>
+     *
      */
     public static class UChannelL13TopPlate extends UChannelL13Plate {
-        protected final static double L1_module_pin_to_edge_of_plate = (16.0-2.75)*inch;
+        protected final static double L1_module_pin_to_edge_of_plate = (16.0 - 2.75)
+                * inch;
 
         public UChannelL13TopPlate(String name, SurveyVolume m,
                 AlignmentCorrection alignmentCorrection, SurveyVolume ref) {
@@ -647,247 +829,297 @@
 
         protected void setCenter() {
             final double x = 0.0;
-            final double y = UChannelL13Top.cone_to_edge_of_plate_y - length/2.0;
-            final double z = -UChannelL13.side_plate_cone_y - height/2.0;
-            setCenter(x,y,z);
-        }
-       
-    }
-        
+            final double y = UChannelL13Top.cone_to_edge_of_plate_y
+                    - getLength() / 2.0;
+            final double z = -UChannelL13.side_plate_cone_y - getHeight() / 2.0;
+            setCenter(x, y, z);
+        }
+
+    }
+
     /**
      * Abstract {@link SurveyVolume} volume defining the L4-6 u-channel volume
+     * 
+     * @author Per Hansson Adrian <[log in to unmask]>
      */
     public abstract static class UChannelL46 extends SurveyVolume {
 
         protected static final double width = UChannelL46Plate.width;
         protected static final double length = UChannelL46Plate.length;
-        protected static final double height = 2.575*inch;
-        //private static final double kin_mount_to_edge_of_plate_x = width/2.0-5.75*inch;
-        //private static final double kin_mount_to_edge_of_plate_y = 0.2*inch;
-        protected static final double side_plate_cone_y = 2.0*inch;
-        
+        protected static final double height = 2.575 * inch;
+        // private static final double kin_mount_to_edge_of_plate_x =
+        // width/2.0-5.75*inch;
+        // private static final double kin_mount_to_edge_of_plate_y = 0.2*inch;
+        protected static final double side_plate_cone_y = 2.0 * inch;
+
         public UChannelL46(String name, SurveyVolume m,
                 AlignmentCorrection alignmentCorrection) {
             super(name, m, alignmentCorrection);
         }
 
         protected void setBoxDim() {
-            setBoxDim(width,length,height);
-        }        
-    }
-                 
-    /**
-     * {@link SurveyVolume} volume defining the coordinate system of the u-channel 
-     *  Reference: SVTBox coordinate system
-     *  Origin: midpoint between upstream survey cones
-     *  Orientation: u - width pointing towards electron side, v - pointing along the U-channel in the beam direction
+            setBoxDim(width, length, height);
+        }
+
+    }
+
+    /**
+     * {@link SurveyVolume} volume defining the coordinate system of the
+     * u-channel Reference: SVTBox coordinate system Origin: midpoint between
+     * upstream survey cones Orientation: u - width pointing towards electron
+     * side, v - pointing along the U-channel in the beam direction
+     * 
+     * @author Per Hansson Adrian <[log in to unmask]>
      *
      */
     public static class UChannelL46Bottom extends UChannelL46 {
-                
-        protected static final double cone_to_edge_of_plate_y = 2.75*inch;
-
-        public UChannelL46Bottom(String name, SurveyVolume m, AlignmentCorrection alignmentCorrection) {
+
+        protected static final double cone_to_edge_of_plate_y = 2.75 * inch;
+
+        public UChannelL46Bottom(String name, SurveyVolume m,
+                AlignmentCorrection alignmentCorrection) {
             super(name, m, alignmentCorrection);
             init();
         }
+
         protected void setCenter() {
             final double x = 0.0;
-            final double y = -cone_to_edge_of_plate_y + length/2.0;
-            final double z = -side_plate_cone_y - UChannelL46Plate.height + height/2.0;
-            setCenter(x,y,z);
-        }
+            final double y = -cone_to_edge_of_plate_y + length / 2.0;
+            final double z = -side_plate_cone_y - UChannelL46Plate.height
+                    + height / 2.0;
+            setCenter(x, y, z);
+        }
+
         protected void setPos() {
             ballPos = UChannelL46BottomSurveyBalls.ball_pos;
             Hep3Vector veeOffset = UChannelL46BottomSurveyBalls.getVeeOffset();
             veePos = VecOp.add(ballPos, veeOffset);
-            Hep3Vector flatOffset = UChannelL46BottomSurveyBalls.getFlatOffset();
+            Hep3Vector flatOffset = UChannelL46BottomSurveyBalls
+                    .getFlatOffset();
             flatPos = VecOp.add(ballPos, flatOffset);
         }
     }
-    
-    /**
-     * Position of the center of the survey balls when engaging the cones in the side plates of the U-channel.
-     *
-     */
-    private static class UChannelL46BottomSurveyBalls  {
-        
+
+    /**
+     * Position of the center of the survey balls when engaging the cones in the
+     * side plates of the U-channel.
+     * 
+     * @author Per Hansson Adrian <[log in to unmask]>
+     *
+     */
+    private static class UChannelL46BottomSurveyBalls {
+
         // Shawn's calculated point at midpoint between two forward survey balls
-        protected final static Hep3Vector ball_pos = new BasicHep3Vector(-5.857, -157.776, -8.423);
-        
-        private static final double cone_fwd_right_x = -7.019*inch;
-        private static final double cone_fwd_right_y = -6.419*inch;
-        private static final double cone_fwd_right_z = -0.332*inch;
-
-        //private static final double cone_bwd_right_x = -6.539*inch;
-        //private static final double cone_bwd_right_y = -22.159*inch;
-        //private static final double cone_bwd_right_z = -0.332*inch;
-
-        private static final double cone_fwd_left_x = 6.558*inch;
-        private static final double cone_fwd_left_y = -6.005*inch;
-        private static final double cone_fwd_left_z = -0.332*inch;
-
-        private static final double cone_bwd_left_x = 7.038*inch;
-        private static final double cone_bwd_left_y = -21.745*inch;
-        private static final double cone_bwd_left_z = -0.332*inch;
-        
-        protected static final Hep3Vector fwd_right = new BasicHep3Vector(cone_fwd_right_x, cone_fwd_right_y, cone_fwd_right_z);
-        protected static final Hep3Vector fwd_left = new BasicHep3Vector(cone_fwd_left_x, cone_fwd_left_y, cone_fwd_left_z);
-        //protected static final Hep3Vector bwd_right = new BasicHep3Vector(cone_bwd_right_x, cone_bwd_right_y, cone_bwd_right_z);
-        protected static final Hep3Vector bwd_left = new BasicHep3Vector(cone_bwd_left_x, cone_bwd_left_y, cone_bwd_left_z);
-        
+        protected final static Hep3Vector ball_pos = new BasicHep3Vector(
+                -5.857, -157.776, -8.423);
+
+        private static final double cone_fwd_right_x = -7.019 * inch;
+        private static final double cone_fwd_right_y = -6.419 * inch;
+        private static final double cone_fwd_right_z = -0.332 * inch;
+
+        // private static final double cone_bwd_right_x = -6.539*inch;
+        // private static final double cone_bwd_right_y = -22.159*inch;
+        // private static final double cone_bwd_right_z = -0.332*inch;
+
+        private static final double cone_fwd_left_x = 6.558 * inch;
+        private static final double cone_fwd_left_y = -6.005 * inch;
+        private static final double cone_fwd_left_z = -0.332 * inch;
+
+        private static final double cone_bwd_left_x = 7.038 * inch;
+        private static final double cone_bwd_left_y = -21.745 * inch;
+        private static final double cone_bwd_left_z = -0.332 * inch;
+
+        protected static final Hep3Vector fwd_right = new BasicHep3Vector(
+                cone_fwd_right_x, cone_fwd_right_y, cone_fwd_right_z);
+        protected static final Hep3Vector fwd_left = new BasicHep3Vector(
+                cone_fwd_left_x, cone_fwd_left_y, cone_fwd_left_z);
+        // protected static final Hep3Vector bwd_right = new
+        // BasicHep3Vector(cone_bwd_right_x, cone_bwd_right_y,
+        // cone_bwd_right_z);
+        protected static final Hep3Vector bwd_left = new BasicHep3Vector(
+                cone_bwd_left_x, cone_bwd_left_y, cone_bwd_left_z);
+
         protected static Hep3Vector getVeeOffset() {
-            return  VecOp.mult(0.5,VecOp.sub(fwd_right, fwd_left));
-        }
+            return VecOp.mult(0.5, VecOp.sub(fwd_right, fwd_left));
+        }
+
         protected static Hep3Vector getFlatOffset() {
             return VecOp.sub(bwd_left, fwd_left);
         }
     }
-  
-    /**
-     * {@link SurveyVolume} volume defining the coordinate system of the u-channel 
-     * Reference: {@link HPSTracker2014GeometryDefinition.SVTBox} coordinate system
-     * Origin: midpoint between upstream survey cones
-     * Orientation: u - width pointing towards electron side, v - pointing along the U-channel in the beam direction
+
+    /**
+     * {@link SurveyVolume} volume defining the coordinate system of the
+     * u-channel Reference: {@link SVTBox} coordinate system Origin: midpoint
+     * between upstream survey cones Orientation: u - width pointing towards
+     * electron side, v - pointing along the U-channel in the beam direction
+     * 
+     * @author Per Hansson Adrian <[log in to unmask]>
+     *
      */
     public static class UChannelL46Top extends UChannelL46 {
-        
-        private static final double cone_to_side_plate_pin_y = (0.875-0.25)*inch;
-        private static final double side_plate_pin_to_edge_of_plate_y = 1.5*inch;
-        
-        protected static final double cone_to_edge_of_plate_y = cone_to_side_plate_pin_y + side_plate_pin_to_edge_of_plate_y;
-        
-        public UChannelL46Top(String name, SurveyVolume m, AlignmentCorrection alignmentCorrection) {
+
+        private static final double cone_to_side_plate_pin_y = (0.875 - 0.25)
+                * inch;
+        private static final double side_plate_pin_to_edge_of_plate_y = 1.5 * inch;
+
+        protected static final double cone_to_edge_of_plate_y = cone_to_side_plate_pin_y
+                + side_plate_pin_to_edge_of_plate_y;
+
+        public UChannelL46Top(String name, SurveyVolume m,
+                AlignmentCorrection alignmentCorrection) {
             super(name, m, alignmentCorrection);
             init();
         }
+
         protected void setCenter() {
             final double x = 0.0;
-            final double y = -cone_to_edge_of_plate_y + length/2.0;
-            final double z = -side_plate_cone_y - UChannelL46Plate.height + height/2.0;
-            setCenter(x,y,z);
-        }
+            final double y = -cone_to_edge_of_plate_y + length / 2.0;
+            final double z = -side_plate_cone_y - UChannelL46Plate.height
+                    + height / 2.0;
+            setCenter(x, y, z);
+        }
+
         protected void setPos() {
-            
+
             ballPos = UChannelL46TopSurveyBalls.ball_pos;
             Hep3Vector veeOffset = UChannelL46TopSurveyBalls.getVeeOffset();
             veePos = VecOp.add(ballPos, veeOffset);
             Hep3Vector flatOffset = UChannelL46TopSurveyBalls.getFlatOffset();
             flatPos = VecOp.add(ballPos, flatOffset);
-            
-            //ballPos = ball_pos;
-            //veePos = new BasicHep3Vector(ballPos.x()+1, ballPos.y(), ballPos.z()); // note sign change on random offset w.r.t. bottom
-            //flatPos = new BasicHep3Vector(ballPos.x(), ballPos.y()-1, ballPos.z()); // random offset
-        }
-    }
-        
-    /**
-     * Position of the center of the survey balls when engaging the cones in the side plates of the U-channel.
-     * 
-     * @author Per Hansson Adrian <[log in to unmask]>
-     *
-     */
-    private static class UChannelL46TopSurveyBalls  {
+
+            // ballPos = ball_pos;
+            // veePos = new BasicHep3Vector(ballPos.x()+1, ballPos.y(),
+            // ballPos.z()); // note sign change on random offset w.r.t. bottom
+            // flatPos = new BasicHep3Vector(ballPos.x(), ballPos.y()-1,
+            // ballPos.z()); // random offset
+        }
+    }
+
+    /**
+     * Position of the center of the survey balls when engaging the cones in the
+     * side plates of the U-channel.
+     * 
+     * @author Per Hansson Adrian <[log in to unmask]>
+     *
+     */
+    private static class UChannelL46TopSurveyBalls {
 
         // Shawn's calculated point at midpoint between two forward survey balls
-        protected final static Hep3Vector ball_pos = new BasicHep3Vector(-6.341, -141.909, 8.423);
-
-        protected static final double cone_fwd_right_x = -7.038*inch;
-        protected static final double cone_fwd_right_y = -5.794*inch;
-        protected static final double cone_fwd_right_z = 0.332*inch;
-
-        protected static final double cone_bwd_right_x = -6.558*inch;
-        protected static final double cone_bwd_right_y = -21.535*inch;
-        protected static final double cone_bwd_right_z = 0.332*inch;
-
-        protected static final double cone_fwd_left_x = 6.539*inch;
-        protected static final double cone_fwd_left_y = -5.380*inch;
-        protected static final double cone_fwd_left_z = 0.332*inch;
-
-        protected static final double cone_bwd_left_x = 7.019*inch;
-        protected static final double cone_bwd_left_y = -21.121*inch;
-        protected static final double cone_bwd_left_z = 0.332*inch;
-
-        protected static final Hep3Vector fwd_right = new BasicHep3Vector(cone_fwd_right_x, cone_fwd_right_y, cone_fwd_right_z);
-        protected static final Hep3Vector fwd_left = new BasicHep3Vector(cone_fwd_left_x, cone_fwd_left_y, cone_fwd_left_z);
-        protected static final Hep3Vector bwd_right = new BasicHep3Vector(cone_bwd_right_x, cone_bwd_right_y, cone_bwd_right_z);
-        //protected static final Hep3Vector bwd_left = new BasicHep3Vector(cone_bwd_left_x, cone_bwd_left_y, cone_bwd_left_z);
+        protected final static Hep3Vector ball_pos = new BasicHep3Vector(
+                -6.341, -141.909, 8.423);
+
+        protected static final double cone_fwd_right_x = -7.038 * inch;
+        protected static final double cone_fwd_right_y = -5.794 * inch;
+        protected static final double cone_fwd_right_z = 0.332 * inch;
+
+        protected static final double cone_bwd_right_x = -6.558 * inch;
+        protected static final double cone_bwd_right_y = -21.535 * inch;
+        protected static final double cone_bwd_right_z = 0.332 * inch;
+
+        protected static final double cone_fwd_left_x = 6.539 * inch;
+        protected static final double cone_fwd_left_y = -5.380 * inch;
+        protected static final double cone_fwd_left_z = 0.332 * inch;
+
+        protected static final double cone_bwd_left_x = 7.019 * inch;
+        protected static final double cone_bwd_left_y = -21.121 * inch;
+        protected static final double cone_bwd_left_z = 0.332 * inch;
+
+        protected static final Hep3Vector fwd_right = new BasicHep3Vector(
+                cone_fwd_right_x, cone_fwd_right_y, cone_fwd_right_z);
+        protected static final Hep3Vector fwd_left = new BasicHep3Vector(
+                cone_fwd_left_x, cone_fwd_left_y, cone_fwd_left_z);
+        protected static final Hep3Vector bwd_right = new BasicHep3Vector(
+                cone_bwd_right_x, cone_bwd_right_y, cone_bwd_right_z);
+
+        // protected static final Hep3Vector bwd_left = new
+        // BasicHep3Vector(cone_bwd_left_x, cone_bwd_left_y, cone_bwd_left_z);
 
         protected static Hep3Vector getVeeOffset() {
-            return  VecOp.mult(0.5,VecOp.sub(fwd_left, fwd_right));
-        }
+            return VecOp.mult(0.5, VecOp.sub(fwd_left, fwd_right));
+        }
+
         protected static Hep3Vector getFlatOffset() {
             return VecOp.sub(bwd_right, fwd_right);
         }
     }
-    
-    /**
-     * Abstract {@link SurveyVolume}  defining the coordinate system of the u-channel plates     
+
+    /**
+     * Abstract {@link SurveyVolume} defining the coordinate system of the
+     * u-channel plates
+     * 
+     * @author Per Hansson Adrian <[log in to unmask]>
+     *
      */
     public abstract static class UChannelL46Plate extends UChannelPlate {
         public final static double pocket_depth_L4 = 0.1;
         public final static double pocket_depth_L5 = pocket_depth_L4 + 0.118;
         public final static double pocket_depth_L6 = pocket_depth_L5 + 0.118;
-        public final static double module_mounting_hole_to_hole_x =7.874*inch;
-        public static final double width = 13.5*inch;
-        public static final double length = 21.0*inch;
-        public static final double height = 0.5*inch;
-        
+        public final static double module_mounting_hole_to_hole_x = 7.874 * inch;
+        public static final double width = 13.5 * inch;
+        public static final double length = 21.0 * inch;
+        public static final double height = 0.5 * inch;
+
         public UChannelL46Plate(String name, SurveyVolume m,
                 AlignmentCorrection alignmentCorrection, SurveyVolume ref) {
             super(name, m, alignmentCorrection, ref);
             setMaterial("Aluminum");
         }
-        
+
         /**
          * Get pocket depth for this plate
+         * 
          * @param layer
          * @return pocket depth
          */
         public static double getPocketDepth(int layer) {
-             if(layer==4) return pocket_depth_L4;
-             else if(layer==5) return pocket_depth_L5;
-             else if(layer==6) return pocket_depth_L6;
-             else {
-                 throw new RuntimeException("Trying to create a L4-6 module with invalid layer nr: " + layer);
-             }
+            if (layer == 4)
+                return pocket_depth_L4;
+            else if (layer == 5)
+                return pocket_depth_L5;
+            else if (layer == 6)
+                return pocket_depth_L6;
+            else {
+                throw new RuntimeException(
+                        "Trying to create a L4-6 module with invalid layer nr: "
+                                + layer);
+            }
         }
 
         protected void setBoxDim() {
-            setBoxDim(getWidth(),getLength(),getHeight());
+            setBoxDim(getWidth(), getLength(), getHeight());
         }
 
         protected void setPos() {
-           ballPos = new BasicHep3Vector(0, 0, 0);
-           veePos = new BasicHep3Vector(1, 0, 0);
-           flatPos = new BasicHep3Vector(0, 1, 0);
-        }
-        
+            ballPos = new BasicHep3Vector(0, 0, 0);
+            veePos = new BasicHep3Vector(1, 0, 0);
+            flatPos = new BasicHep3Vector(0, 1, 0);
+        }
+
         public double getWidth() {
             return width;
         }
-        
+
         public double getLength() {
             return length;
         }
-        
+
         public double getHeight() {
             return height;
         }
     }
-    
-    /**
-     * {@link SurveyVolume}  defining the coordinate system of the bottom u-channel plate
-     * Reference:  @UChannelL13Bottom coordinate system
-     * Origin:  same as reference
-     * Orientation: same as reference
+
+    /**
+     * {@link SurveyVolume} defining the coordinate system of the bottom
+     * u-channel plate Reference: @UChannelL13Bottom coordinate system Origin:
+     * same as reference Orientation: same as reference
      *
      * @author Per Hansson Adrian <[log in to unmask]>
      *
      */
     public static class UChannelL46BottomPlate extends UChannelL46Plate {
-        protected final static double L4_module_pin_to_edge_of_plate = 3.125*inch;
-        
+        protected final static double L4_module_pin_to_edge_of_plate = 3.125 * inch;
+
         public UChannelL46BottomPlate(String name, SurveyVolume m,
                 AlignmentCorrection alignmentCorrection, SurveyVolume ref) {
             super(name, m, alignmentCorrection, ref);
@@ -896,25 +1128,24 @@
 
         protected void setCenter() {
             final double x = 0.0;
-            final double y = -UChannelL46Bottom.cone_to_edge_of_plate_y + length/2.0;
-            final double z = -UChannelL46.side_plate_cone_y - height/2.0;
-            setCenter(x,y,z);
-        }
-       
-    }
-    
-    
-    /**
-     * {@link SurveyVolume} defining the coordinate system of the top u-channel plate
-     * Reference:  @UChannelL13Top coordinate system
-     * Origin:  same as reference
-     * Orientation: same as reference
+            final double y = -UChannelL46Bottom.cone_to_edge_of_plate_y
+                    + length / 2.0;
+            final double z = -UChannelL46.side_plate_cone_y - height / 2.0;
+            setCenter(x, y, z);
+        }
+
+    }
+
+    /**
+     * {@link SurveyVolume} defining the coordinate system of the top u-channel
+     * plate Reference: @UChannelL13Top coordinate system Origin: same as
+     * reference Orientation: same as reference
      *
      * @author Per Hansson Adrian <[log in to unmask]>
      *
      */
     public static class UChannelL46TopPlate extends UChannelL46Plate {
-        protected final static double L4_module_pin_to_edge_of_plate = 1.75*inch;
+        protected final static double L4_module_pin_to_edge_of_plate = 1.75 * inch;
 
         public UChannelL46TopPlate(String name, SurveyVolume m,
                 AlignmentCorrection alignmentCorrection, SurveyVolume ref) {
@@ -924,277 +1155,365 @@
 
         protected void setCenter() {
             final double x = 0.0;
-            final double y = -UChannelL46Top.cone_to_edge_of_plate_y + length/2.0;
-            final double z = -UChannelL46.side_plate_cone_y - height/2.0;
-            setCenter(x,y,z);
-        }
-       
-    }
-  
+            final double y = -UChannelL46Top.cone_to_edge_of_plate_y + length
+                    / 2.0;
+            final double z = -UChannelL46.side_plate_cone_y - height / 2.0;
+            setCenter(x, y, z);
+        }
+
+    }
+
     /**
      * {@link SurveyVolume} volume defining the coordinate system of module L1-3
-     * Reference:  @UChannelL13Bottom coordinate system
-     * Origin:  hole position on mounting surface (on electron side)
-     * Orientation: u - is normal to the surface pointing vertically down, v - points along module away from hybrid side (i.e. positron direction).
+     * Reference: @UChannelL13Bottom coordinate system Origin: hole position on
+     * mounting surface (on electron side) Orientation: u - is normal to the
+     * surface pointing vertically down, v - points along module away from
+     * hybrid side (i.e. positron direction).
+     * 
+     * @author Per Hansson Adrian <[log in to unmask]>
      *
      */
     public abstract static class ModuleL13 extends BaseModule {
-        private final static double box_extra_length = 10.0;// random at this point
-        private final static double box_extra_height = -0.45*inch;// random at this point
-        private final static double box_extra_width = 0.5*inch;// random at this point
-        
-        private static final double tension_lever_y = 2.5*inch;
-        // TODO the dimension of this volume is padded manually. Check if this can cause overlap problems
-        public static final double length = 8.0*inch + box_extra_length;  
-        public static final double height = 1.0*inch + box_extra_height;
-        private static final double width = tension_lever_y + 0.04*inch + box_extra_width;
-        //private static final double hole_to_end_of_module_x = 7.750*inch;
-        //private static final double hole_to_module_edge_height_dir = height - 0.875*inch;
-        protected static final double hole_to_center_of_plate_width_dir = 3.75*inch;
-        private static final double hole_to_module_edge_length_dir = 0.25*inch;
-        
-        public ModuleL13(String name, SurveyVolume mother, AlignmentCorrection alignmentCorrection, SurveyVolume ref) {
-            super(name, mother, alignmentCorrection, ref, getLayerFromVolumeName(name), getHalfFromName(name));
-            
-        }
+        private final static double box_extra_length = 10.0;// random at this
+                                                            // point
+        private final static double box_extra_height = -0.45 * inch;// random at
+                                                                    // this
+                                                                    // point
+        private final static double box_extra_width = 0.5 * inch;// random at
+                                                                 // this point
+
+        private static final double tension_lever_y = 2.5 * inch;
+        // TODO the dimension of this volume is padded manually. Check if this
+        // can cause overlap problems
+        public static final double length = 8.0 * inch + box_extra_length;
+        public static final double height = 1.0 * inch + box_extra_height;
+        private static final double width = tension_lever_y + 0.04 * inch
+                + box_extra_width;
+        // private static final double hole_to_end_of_module_x = 7.750*inch;
+        // private static final double hole_to_module_edge_height_dir = height -
+        // 0.875*inch;
+        protected static final double hole_to_center_of_plate_width_dir = 3.75 * inch;
+        private static final double hole_to_module_edge_length_dir = 0.25 * inch;
+
+        public ModuleL13(String name, SurveyVolume mother,
+                AlignmentCorrection alignmentCorrection, SurveyVolume ref) {
+            super(name, mother, alignmentCorrection, ref,
+                    getLayerFromVolumeName(name), getHalfFromName(name));
+
+        }
+
         protected void setCenter() {
-            final double x = -width/2.0;
-            final double y = -hole_to_module_edge_length_dir + length/2.0;
-            //center this volume around the center of the module which is the same as the cone for L1
-            //final double z = hole_to_module_edge_height_dir - height/2.0;
+            final double x = -width / 2.0;
+            final double y = -hole_to_module_edge_length_dir + length / 2.0;
+            // center this volume around the center of the module which is the
+            // same as the cone for L1
+            // final double z = hole_to_module_edge_height_dir - height/2.0;
             final double z = -Math.abs(getHoleModuleCenterOffset());
-            setCenter(x,y,z);
-        }
+            setCenter(x, y, z);
+        }
+
         protected void setBoxDim() {
             setBoxDim(width, length, height);
         }
+
         protected abstract void setPos();
+
         protected abstract double getHoleModuleCenterOffset();
+
         protected abstract Hep3Vector getHolePosition();
     }
-    
+
     public abstract static class ModuleL13Top extends ModuleL13 {
+        protected static final double cone_to_hole_across_uchannel = -95.25;
+
         public ModuleL13Top(String name, SurveyVolume mother,
                 AlignmentCorrection alignmentCorrection, SurveyVolume ref) {
             super(name, mother, alignmentCorrection, ref);
         }
+
         protected void setPos() {
             ballPos = getHolePosition();
-            veePos = new BasicHep3Vector(ballPos.x(), ballPos.y(), ballPos.z()-1.0);
-            flatPos = new BasicHep3Vector(ballPos.x()+1, ballPos.y(), ballPos.z());
-        }
+            veePos = new BasicHep3Vector(ballPos.x(), ballPos.y(),
+                    ballPos.z() - 1.0);
+            flatPos = new BasicHep3Vector(ballPos.x() + 1, ballPos.y(),
+                    ballPos.z());
+        }
+
         protected double getHoleModuleCenterOffset() {
-            return UChannelL13Top.cone_to_edge_of_plate_y - UChannelL13TopPlate.L1_module_pin_to_edge_of_plate;
-        }
-
-    }
-    
+            return UChannelL13Top.cone_to_edge_of_plate_y
+                    - UChannelL13TopPlate.L1_module_pin_to_edge_of_plate;
+        }
+
+    }
+
     public abstract static class ModuleL13Bot extends ModuleL13 {
+        protected static final double cone_to_hole_across_uchannel = 95.25;
+
         public ModuleL13Bot(String name, SurveyVolume mother,
                 AlignmentCorrection alignmentCorrection, SurveyVolume ref) {
             super(name, mother, alignmentCorrection, ref);
         }
+
         protected void setPos() {
             ballPos = getHolePosition();
-            veePos = new BasicHep3Vector(ballPos.x(), ballPos.y(), ballPos.z()-1.0);
-            flatPos = new BasicHep3Vector(ballPos.x()-1, ballPos.y(), ballPos.z());
-        }
+            veePos = new BasicHep3Vector(ballPos.x(), ballPos.y(),
+                    ballPos.z() - 1.0);
+            flatPos = new BasicHep3Vector(ballPos.x() - 1, ballPos.y(),
+                    ballPos.z());
+        }
+
         protected double getHoleModuleCenterOffset() {
-            return UChannelL13Bottom.cone_to_edge_of_plate_y - UChannelL13BottomPlate.L1_module_pin_to_edge_of_plate;
-        }
-    }    
-    
+            return UChannelL13Bottom.cone_to_edge_of_plate_y
+                    - UChannelL13BottomPlate.L1_module_pin_to_edge_of_plate;
+        }
+    }
+
     public static class ModuleL1Bot extends ModuleL13Bot {
+        protected final static double cone_to_hole_along_uchannel = 9.525;
+        protected final static double cone_to_hole_vertical_from_uchannel = -51.435;
 
         public ModuleL1Bot(String name, SurveyVolume mother,
                 AlignmentCorrection alignmentCorrection, SurveyVolume ref) {
             super(name, mother, alignmentCorrection, ref);
             init();
         }
+
         protected Hep3Vector getHolePosition() {
-            double x = 95.25;
-            double y = 9.525;
-            double z = -51.435;
+            double x = cone_to_hole_across_uchannel;
+            double y = cone_to_hole_along_uchannel;
+            double z = cone_to_hole_vertical_from_uchannel;
             return new BasicHep3Vector(x, y, z);
         }
-        
-    }    
-   
+
+    }
+
     public static class ModuleL1Top extends ModuleL13Top {
 
+        protected final static double cone_to_hole_along_uchannel = -9.525;
+        protected final static double cone_to_hole_vertical_from_uchannel = -51.435;
+
         public ModuleL1Top(String name, SurveyVolume mother,
                 AlignmentCorrection alignmentCorrection, SurveyVolume ref) {
             super(name, mother, alignmentCorrection, ref);
             init();
         }
-       
+
         protected Hep3Vector getHolePosition() {
-            double x = -95.25; // note minus sign compared to bottom
-            double y = -9.525;
-            double z = -51.435;
+            double x = cone_to_hole_across_uchannel; // note minus sign compared
+                                                     // to bottom
+            double y = cone_to_hole_along_uchannel;
+            double z = cone_to_hole_vertical_from_uchannel;
             return new BasicHep3Vector(x, y, z);
         }
-        
-    }
-        
+
+    }
+
     public static class ModuleL2Bot extends ModuleL13Bot {
 
+        protected final static double cone_to_hole_along_uchannel = 109.525;
+        protected final static double cone_to_hole_vertical_from_uchannel = ModuleL1Bot.cone_to_hole_vertical_from_uchannel - 1.5;
+
         public ModuleL2Bot(String name, SurveyVolume mother,
                 AlignmentCorrection alignmentCorrection, SurveyVolume ref) {
             super(name, mother, alignmentCorrection, ref);
             init();
         }
+
         protected Hep3Vector getHolePosition() {
-            double x = 95.25;
-            double y = 109.525;
-            double z = -51.435 - 1.5;
+            double x = cone_to_hole_across_uchannel;
+            double y = cone_to_hole_along_uchannel;
+            double z = cone_to_hole_vertical_from_uchannel;
             return new BasicHep3Vector(x, y, z);
         }
-        
-    }
-    
+
+    }
+
     public static class ModuleL2Top extends ModuleL13Top {
+        protected final static double cone_to_hole_along_uchannel = 90.475;
+        protected final static double cone_to_hole_vertical_from_uchannel = ModuleL1Top.cone_to_hole_vertical_from_uchannel - 1.5;
 
         public ModuleL2Top(String name, SurveyVolume mother,
                 AlignmentCorrection alignmentCorrection, SurveyVolume ref) {
             super(name, mother, alignmentCorrection, ref);
             init();
         }
-       
+
         protected Hep3Vector getHolePosition() {
-            double x = -95.25; // note minus sign compared to bottom
-            double y = 90.475;
-            double z = -51.435 - 1.5;
+            double x = cone_to_hole_across_uchannel; // note minus sign compared
+                                                     // to bottom
+            double y = cone_to_hole_along_uchannel;
+            double z = cone_to_hole_vertical_from_uchannel;
             return new BasicHep3Vector(x, y, z);
         }
-        
-    }
-        
+
+    }
+
     public static class ModuleL3Bot extends ModuleL13Bot {
+        protected final static double cone_to_hole_along_uchannel = 209.525;
+        protected final static double cone_to_hole_vertical_from_uchannel = ModuleL1Bot.cone_to_hole_vertical_from_uchannel - 2 * 1.5;
 
         public ModuleL3Bot(String name, SurveyVolume mother,
                 AlignmentCorrection alignmentCorrection, SurveyVolume ref) {
             super(name, mother, alignmentCorrection, ref);
             init();
         }
+
         protected Hep3Vector getHolePosition() {
-            double x = 95.25;
-            double y = 209.525;
-            double z = -51.435 - 2*1.5;
+            double x = cone_to_hole_across_uchannel;
+            double y = cone_to_hole_along_uchannel;
+            double z = cone_to_hole_vertical_from_uchannel;
             return new BasicHep3Vector(x, y, z);
         }
-        
-    }
-        
+
+    }
+
     public static class ModuleL3Top extends ModuleL13Top {
+        protected final static double cone_to_hole_along_uchannel = 190.475;
+        protected final static double cone_to_hole_vertical_from_uchannel = ModuleL1Top.cone_to_hole_vertical_from_uchannel - 2 * 1.5;
 
         public ModuleL3Top(String name, SurveyVolume mother,
                 AlignmentCorrection alignmentCorrection, SurveyVolume ref) {
             super(name, mother, alignmentCorrection, ref);
             init();
         }
-       
+
         protected Hep3Vector getHolePosition() {
-            double x = -95.25; // note minus sign compared to bottom
-            double y = 190.475;
-            double z = -51.435 - 2*1.5;
+            double x = cone_to_hole_across_uchannel; // note minus sign compared
+                                                     // to bottom
+            double y = cone_to_hole_along_uchannel;
+            double z = cone_to_hole_vertical_from_uchannel;
             return new BasicHep3Vector(x, y, z);
         }
-        
-    }
-                
-    /**
-     * Abstract {@link SurveyVolume} volume defining the coordinate system of module L4-6
+
+    }
+
+    /**
+     * Abstract {@link SurveyVolume} volume defining the coordinate system of
+     * module L4-6
      * 
      * @author Per Hansson Adrian <[log in to unmask]>
      *
      */
     public abstract static class ModuleL46 extends BaseModule {
-        protected final static double hole_to_center_of_plate_width_dir = 5.875*inch;
-        protected final static double hole_to_module_edge_height_dir = 0.875*inch;
-        protected static final double hole_to_module_edge_length_dir = 0.25*inch;
-        private final static double box_extra_length = 0.0;// random at this point
-        private final static double box_extra_height = -0.45*inch;// random at this point
-        private final static double box_extra_width = 0.5*inch;// random at this point
-        
-        private static final double tension_lever_y = 2.5*inch;
+        protected final static double hole_to_center_of_plate_width_dir = 5.875 * inch;
+        protected final static double hole_to_module_edge_height_dir = 0.875 * inch;
+        protected static final double hole_to_module_edge_length_dir = 0.25 * inch;
+        private final static double box_extra_length = 0.0;// random at this
+                                                           // point
+        private final static double box_extra_height = -0.45 * inch;// random at
+                                                                    // this
+                                                                    // point
+        private final static double box_extra_width = 0.5 * inch;// random at
+                                                                 // this point
+
+        private static final double tension_lever_y = 2.5 * inch;
         // TODO the dimension of the L4-6 module is completely made up
-        public static final double length = 12.25*inch + box_extra_length;
-        public static final double height = 1.0*inch + box_extra_height;
-        public static final double width = tension_lever_y + 0.04*inch + box_extra_width;
-        
-        public ModuleL46(String name, SurveyVolume mother, AlignmentCorrection alignmentCorrection, SurveyVolume ref) {
-            super(name, mother, alignmentCorrection, ref, getLayerFromVolumeName(name), getHalfFromName(name));
-            
-        }
+        public static final double length = 12.25 * inch + box_extra_length;
+        public static final double height = 1.0 * inch + box_extra_height;
+        public static final double width = tension_lever_y + 0.04 * inch
+                + box_extra_width;
+
+        public ModuleL46(String name, SurveyVolume mother,
+                AlignmentCorrection alignmentCorrection, SurveyVolume ref) {
+            super(name, mother, alignmentCorrection, ref,
+                    getLayerFromVolumeName(name), getHalfFromName(name));
+
+        }
+
         protected void setCenter() {
-            final double x = -width/2.0;
-            final double y = -hole_to_module_edge_length_dir + length/2.0;
+            final double x = -width / 2.0;
+            final double y = -hole_to_module_edge_length_dir + length / 2.0;
             final double z = -Math.abs(getHoleModuleCenterOffset());
-            //final double z = -hole_to_module_edge_height_dir + height/2.0;
-            setCenter(x,y,z);
-        }
+            // final double z = -hole_to_module_edge_height_dir + height/2.0;
+            setCenter(x, y, z);
+        }
+
         protected void setBoxDim() {
             setBoxDim(width, length, height);
         }
+
         protected abstract void setPos();
+
         protected abstract double getHoleModuleCenterOffset();
+
         protected abstract Hep3Vector getHole();
     }
-    
-    
-    /**
-     * Abstract {@link SurveyVolume} volume defining the coordinate system of bottom modules for L4-6
-     * Reference:  @UChannelL46Bottom coordinate system
-     * Origin:  hole position on mounting surface (electron side)
-     * Orientation: u - is normal to the mounting surface pointing vertically down, v - points along module towards positron side.
+
+    /**
+     * Abstract {@link SurveyVolume} volume defining the coordinate system of
+     * bottom modules for L4-6 Reference: @UChannelL46Bottom coordinate system
+     * Origin: hole position on mounting surface (electron side) Orientation: u
+     * - is normal to the mounting surface pointing vertically down, v - points
+     * along module towards positron side.
      * 
      * @author Per Hansson Adrian <[log in to unmask]>
      *
      */
     public static abstract class ModuleL46Bot extends ModuleL46 {
+        // positions are in the mother (U-channel) coord. systtem as usual
+        protected final static double x = 149.225; // distance from survey ball
+                                                   // to hole mounting surface
+        protected final static double y = 9.525; // distance along U-channel
+        protected final static double z = -53.34; // distance normal to the
+                                                  // U-channel plate
 
         public ModuleL46Bot(String name, SurveyVolume mother,
                 AlignmentCorrection alignmentCorrection, SurveyVolume ref) {
             super(name, mother, alignmentCorrection, ref);
         }
+
         protected void setPos() {
             ballPos = getHole();
-            veePos = new BasicHep3Vector(ballPos.x(), ballPos.y(), ballPos.z()-1.0);
-            flatPos = new BasicHep3Vector(ballPos.x()-1.0, ballPos.y(), ballPos.z());
-        }
+            veePos = new BasicHep3Vector(ballPos.x(), ballPos.y(),
+                    ballPos.z() - 1.0);
+            flatPos = new BasicHep3Vector(ballPos.x() - 1.0, ballPos.y(),
+                    ballPos.z());
+        }
+
         protected double getHoleModuleCenterOffset() {
-            return UChannelL46Bottom.cone_to_edge_of_plate_y - UChannelL46BottomPlate.L4_module_pin_to_edge_of_plate;
-        }
-    }
-    
-    /**
-     * Abstract {@link SurveyVolume} volume defining the coordinate system of top modules for L4-6
-     * Reference:  @UChannelL46Top coordinate system
-     * Origin:  hole position on mounting surface (electron side when installed)
-     * Orientation: u - is normal to the mounting surface pointing vertically down, v - points along module towards electron side when installed.
+            return UChannelL46Bottom.cone_to_edge_of_plate_y
+                    - UChannelL46BottomPlate.L4_module_pin_to_edge_of_plate;
+        }
+    }
+
+    /**
+     * Abstract {@link SurveyVolume} volume defining the coordinate system of
+     * top modules for L4-6 Reference: @UChannelL46Top coordinate system Origin:
+     * hole position on mounting surface (electron side when installed)
+     * Orientation: u - is normal to the mounting surface pointing vertically
+     * down, v - points along module towards electron side when installed.
      * 
      * @author Per Hansson Adrian <[log in to unmask]>
      *
      */
     public static abstract class ModuleL46Top extends ModuleL46 {
+        // positions are in the mother (U-channel) coord. systtem as usual
+        protected final static double x = -149.225; // distance from survey ball
+                                                    // to hole mounting surface
+        protected final static double y = -9.525; // distance along U-channel
+        protected final static double z = -53.34; // distance normal to the
+                                                  // U-channel plate
 
         public ModuleL46Top(String name, SurveyVolume mother,
                 AlignmentCorrection alignmentCorrection, SurveyVolume ref) {
             super(name, mother, alignmentCorrection, ref);
         }
+
         protected void setPos() {
             ballPos = getHole();
-            veePos = new BasicHep3Vector(ballPos.x(), ballPos.y(), ballPos.z()-1.0);
-            flatPos = new BasicHep3Vector(ballPos.x()+1.0, ballPos.y(), ballPos.z());
-        }
+            veePos = new BasicHep3Vector(ballPos.x(), ballPos.y(),
+                    ballPos.z() - 1.0);
+            flatPos = new BasicHep3Vector(ballPos.x() + 1.0, ballPos.y(),
+                    ballPos.z());
+        }
+
         protected double getHoleModuleCenterOffset() {
-            return UChannelL46Top.cone_to_edge_of_plate_y - UChannelL46TopPlate.L4_module_pin_to_edge_of_plate;
-        }
-
-    }
-    
-    
+            return UChannelL46Top.cone_to_edge_of_plate_y
+                    - UChannelL46TopPlate.L4_module_pin_to_edge_of_plate;
+        }
+
+    }
+
     public static class ModuleL4Bot extends ModuleL46Bot {
 
         public ModuleL4Bot(String name, SurveyVolume mother,
@@ -1204,17 +1523,11 @@
         }
 
         protected Hep3Vector getHole() {
-            double x = 149.225;
-            double y = 9.525;
-            double z = -53.34;
-            //double x = hole_to_center_of_plate_width_dir;   
-            //double y = -getHoleModuleCenterOffset(); //Note minus sign compared to top
-            //double z = -UChannelL46.side_plate_cone_y - UChannelL46Plate.pocket_depth_L4;
             return new BasicHep3Vector(x, y, z);
         }
-        
-    }
-    
+
+    }
+
     public static class ModuleL4Top extends ModuleL46Top {
 
         public ModuleL4Top(String name, SurveyVolume mother,
@@ -1224,18 +1537,11 @@
         }
 
         protected Hep3Vector getHole() {
-            double x = -149.225;
-            double y = -9.525;
-            double z = -53.34;
-//            double x = -1*hole_to_center_of_plate_width_dir;   
-//            double y = -getHoleModuleCenterOffset();
-//            double z = -UChannelL46.side_plate_cone_y - UChannelL46Plate.pocket_depth_L4;
             return new BasicHep3Vector(x, y, z);
         }
-        
-    }
-    
-    
+
+    }
+
     public static class ModuleL5Bot extends ModuleL46Bot {
 
         public ModuleL5Bot(String name, SurveyVolume mother,
@@ -1245,14 +1551,13 @@
         }
 
         protected Hep3Vector getHole() {
-            double x = 149.225;
-            double y = 209.525;
-            double z = -53.34 - 3.0;
-            return new BasicHep3Vector(x, y, z);
-        }
-
-    }
-    
+            double y_local = y + 200.0;
+            double z_local = z - 3.0;
+            return new BasicHep3Vector(x, y_local, z_local);
+        }
+
+    }
+
     public static class ModuleL5Top extends ModuleL46Top {
 
         public ModuleL5Top(String name, SurveyVolume mother,
@@ -1262,10 +1567,9 @@
         }
 
         protected Hep3Vector getHole() {
-            double x = -149.225;
-            double y = 190.475;
-            double z = -53.34 - 3.0;
-            return new BasicHep3Vector(x, y, z);
+            double y_local = y + 200.0;
+            double z_local = z - 3.0;
+            return new BasicHep3Vector(x, y_local, z_local);
         }
 
     }
@@ -1279,14 +1583,13 @@
         }
 
         protected Hep3Vector getHole() {
-            double x = 149.225;
-            double y = 409.525;
-            double z = -53.34 - 2*3.0;
-            return new BasicHep3Vector(x, y, z);
-        }
-
-    }
-    
+            double y_local = y + 200.0 * 2;
+            double z_local = z - 2 * 3.0;
+            return new BasicHep3Vector(x, y_local, z_local);
+        }
+
+    }
+
     public static class ModuleL6Top extends ModuleL46Top {
 
         public ModuleL6Top(String name, SurveyVolume mother,
@@ -1296,35 +1599,30 @@
         }
 
         protected Hep3Vector getHole() {
-            double x = -149.225;
-            double y = 390.475;
-            double z = -53.34 - 2*3.0;
-            return new BasicHep3Vector(x, y, z);
-        }
-
-    }
-
-
-
-
+            double y_local = y + 2 * 200.0;
+            double z_local = z - 2 * 3.0;
+            return new BasicHep3Vector(x, y_local, z_local);
+        }
+
+    }
 
     public abstract static class LongHalfModule extends BaseModule {
 
-        //private static final double randomoffset = 5.0; 
+        // private static final double randomoffset = 5.0;
         public static final double width = Sensor.width; // + randomoffset;
-        public static final double length = Sensor.length;// + randomoffset/10.0;
-        public static final double height = Sensor.height + HalfLongModuleLamination.height;
-        protected final static double sensor_z = 0.23*inch;
-
+        public static final double length = Sensor.length;// +
+                                                          // randomoffset/10.0;
+        public static final double height = Sensor.height
+                + HalfLongModuleLamination.height;
+        protected final static double sensor_z = 0.23 * inch;
 
         public LongHalfModule(String name, SurveyVolume mother,
-                AlignmentCorrection alignmentCorrection, int layer,
-                String half) {
+                AlignmentCorrection alignmentCorrection, int layer, String half) {
             super(name, mother, alignmentCorrection, layer, half);
         }
 
         protected abstract Hep3Vector getSensorPosition();
-        
+
         protected void setBoxDim() {
             setBoxDim(width, length, height);
         }
@@ -1332,29 +1630,29 @@
         protected void setCenter() {
             double x = 0.0;
             double y = 0.0;
-            double z = +0.5*Sensor.height - height/2.0;;
-            setCenter(x,y,z);
+            double z = +0.5 * Sensor.height - height / 2.0;
+            ;
+            setCenter(x, y, z);
         }
 
         protected void setPos() {
-            ballPos = getSensorPosition(); //TODO make this get each coordinate instead.
-            veePos  = new BasicHep3Vector(ballPos.x()+1, ballPos.y(), ballPos.z());
-            flatPos  = new BasicHep3Vector(ballPos.x(), ballPos.y()+1, ballPos.z());
-        }
-        
-    }
-
-
+            ballPos = getSensorPosition(); // TODO make this get each coordinate
+                                           // instead.
+            veePos = new BasicHep3Vector(ballPos.x() + 1, ballPos.y(),
+                    ballPos.z());
+            flatPos = new BasicHep3Vector(ballPos.x(), ballPos.y() + 1,
+                    ballPos.z());
+        }
+
+    }
 
     public static class LongAxialHoleHalfModule extends LongHalfModule {
 
-        private final static double sensor_x = 1.382*inch;
-        private final static double sensor_y = 3.887*inch;
-
+        private final static double sensor_x = 1.382 * inch;
+        private final static double sensor_y = 3.887 * inch;
 
         public LongAxialHoleHalfModule(String name, SurveyVolume mother,
-                AlignmentCorrection alignmentCorrection, int layer,
-                String half) {
+                AlignmentCorrection alignmentCorrection, int layer, String half) {
             super(name, mother, alignmentCorrection, layer, half);
             init();
         }
@@ -1362,678 +1660,833 @@
         protected Hep3Vector getSensorPosition() {
             return new BasicHep3Vector(-sensor_x, sensor_y, -sensor_z);
         }
-        
-
-    }
-
-
-    
-    
-    public abstract static class LongAxialSlotHalfModuleBase extends LongHalfModule {
-
-        private final static double sensor_x = 1.382*inch;
-        private final static double sensor_y = 7.863*inch;
+
+    }
+
+    public abstract static class LongAxialSlotHalfModuleBase extends
+            LongHalfModule {
+
+        private final static double sensor_x = 1.382 * inch;
+        private final static double sensor_y = 7.863 * inch;
 
         public LongAxialSlotHalfModuleBase(String name, SurveyVolume mother,
-                AlignmentCorrection alignmentCorrection, int layer,
-                String half) {
+                AlignmentCorrection alignmentCorrection, int layer, String half) {
             super(name, mother, alignmentCorrection, layer, half);
         }
-       
+
         protected Hep3Vector getSensorPosition() {
             return new BasicHep3Vector(-sensor_x, sensor_y, -sensor_z);
         }
 
     }
 
-    public static class LongAxialSlotHalfModule extends LongAxialSlotHalfModuleBase {
-
-        private final static double sensor_x = 1.382*inch;
-        private final static double sensor_y = 7.863*inch;
-
+    public static class LongAxialSlotHalfModule extends
+            LongAxialSlotHalfModuleBase {
+
+        private final static double sensor_x = 1.382 * inch;
+        private final static double sensor_y = 7.863 * inch;
 
         public LongAxialSlotHalfModule(String name, SurveyVolume mother,
-                AlignmentCorrection alignmentCorrection, int layer,
-                String half) {
+                AlignmentCorrection alignmentCorrection, int layer, String half) {
             super(name, mother, alignmentCorrection, layer, half);
             init();
         }
-       
+
         protected Hep3Vector getSensorPosition() {
             return new BasicHep3Vector(-sensor_x, sensor_y, -sensor_z);
         }
     }
-    
 
     public abstract static class LongStereoHalfModule extends LongHalfModule {
 
-        protected final static double sensor_z = 0.52*inch;
+        protected final static double sensor_z = 0.52 * inch;
         protected final static double stereo_angle = 0.05;
-        
+
         public LongStereoHalfModule(String name, SurveyVolume mother,
                 AlignmentCorrection alignmentCorrection, int layer, String half) {
             super(name, mother, alignmentCorrection, layer, half);
         }
-        
-        
+
         protected void applyGenericCoordinateSystemCorrections() {
 
             // Rotate these into the right place for the stereo
-            // My rotations here are active rotations in the mother coordinate system frame
+            // My rotations here are active rotations in the mother coordinate
+            // system frame
 
             // flip around v ~ along the strips
-            Rotation r1 = new Rotation(new Vector3D(0,1,0),Math.PI);
+            Rotation r1 = new Rotation(new Vector3D(0, 1, 0), Math.PI);
             // apply stereo angle around w ~ normal to the sensor plane
-            Rotation r2 = new Rotation(new Vector3D(0,0,1),stereo_angle);
+            Rotation r2 = new Rotation(new Vector3D(0, 0, 1), stereo_angle);
             // Build full rotation
             Rotation r = r2.applyTo(r1);
-            //Rotation r = r1;
-            if(debug) {
-                System.out.printf("%s: LongStereoHalfModule Generic Corrections\n", getClass().getSimpleName());
-                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());
+            // Rotation r = r1;
+            if (debug) {
+                System.out.printf(
+                        "%s: LongStereoHalfModule Generic Corrections\n",
+                        getClass().getSimpleName());
+                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);
-            
-            if(debug) {
-                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());
+
+            if (debug) {
+                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 class LongStereoHoleHalfModule extends LongStereoHalfModule {
 
-        private final static double sensor_x = 1.282*inch;
-        private final static double sensor_y = 3.889*inch;
+        private final static double sensor_x = 1.282 * inch;
+        private final static double sensor_y = 3.889 * inch;
 
         public LongStereoHoleHalfModule(String name, SurveyVolume mother,
-                AlignmentCorrection alignmentCorrection, int layer,
-                String half) {
+                AlignmentCorrection alignmentCorrection, int layer, String half) {
             super(name, mother, alignmentCorrection, layer, half);
             init();
-        }
-
-        protected Hep3Vector getSensorPosition() {
-           return new BasicHep3Vector(-sensor_x, sensor_y, -sensor_z);
-        }
-
-    }
-
-
-    
-    public static abstract class LongStereoSlotHalfModuleBase extends LongStereoHalfModule {
-
-        private final static double sensor_x = 1.481*inch;
-        private final static double sensor_y = 7.861*inch;
-        
-        public LongStereoSlotHalfModuleBase(String name, SurveyVolume mother,
-                AlignmentCorrection alignmentCorrection, int layer,
-                String half) {
-            super(name, mother, alignmentCorrection, layer, half);
         }
 
         protected Hep3Vector getSensorPosition() {
             return new BasicHep3Vector(-sensor_x, sensor_y, -sensor_z);
         }
-    }
-
-    public static class LongStereoSlotHalfModule extends LongStereoSlotHalfModuleBase {
+
+    }
+
+    public static abstract class LongStereoSlotHalfModuleBase extends
+            LongStereoHalfModule {
+
+        private final static double sensor_x = 1.481 * inch;
+        private final static double sensor_y = 7.861 * inch;
+
+        public LongStereoSlotHalfModuleBase(String name, SurveyVolume mother,
+                AlignmentCorrection alignmentCorrection, int layer, String half) {
+            super(name, mother, alignmentCorrection, layer, half);
+        }
+
+        protected Hep3Vector getSensorPosition() {
+            return new BasicHep3Vector(-sensor_x, sensor_y, -sensor_z);
+        }
+    }
+
+    public static class LongStereoSlotHalfModule extends
+            LongStereoSlotHalfModuleBase {
         public LongStereoSlotHalfModule(String name, SurveyVolume mother,
-                AlignmentCorrection alignmentCorrection, int layer,
-                String half) {
+                AlignmentCorrection alignmentCorrection, int layer, String half) {
             super(name, mother, alignmentCorrection, layer, half);
             init();
         }
     }
-    
-
-    /**
-     * {@link SurveyVolume} volume defining the coordinate system of the axial half-module in module L1-3
-     * Reference:  @ModuleL13Bot coordinate system
-     * Origin:  sensor center
-     * Orientation: w - is normal to the surface pointing from p-side to n-side, v - points along strips away from signal bond pads
-     *
-     */
-    public static class HalfModuleAxial extends HPSTestRunTracker2014GeometryDefinition.TestRunHalfModule {
+
+    /**
+     * {@link SurveyVolume} volume defining the coordinate system of the axial
+     * half-module in module L1-3 Reference: @ModuleL13Bot coordinate system
+     * Origin: sensor center Orientation: w - is normal to the surface pointing
+     * from p-side to n-side, v - points along strips away from signal bond pads
+     * 
+     * @author Per Hansson Adrian <[log in to unmask]>
+     *
+     */
+    public static class HalfModuleAxial extends
+            HPSTestRunTracker2014GeometryDefinition.TestRunHalfModule {
         // Sensor positions from Shawn's 3D model
-        public static final double sensor_x = -1.543*inch;
-        public static final double sensor_y = 4.868*inch;
-        public static final double sensor_z = -0.23*inch;
-        
+        public static final double sensor_x = -1.543 * inch;
+        public static final double sensor_y = 4.868 * inch;
+        public static final double sensor_z = -0.23 * inch;
+
         public HalfModuleAxial(String name, SurveyVolume mother,
                 AlignmentCorrection alignmentCorrection, int layer, String half) {
             super(name, mother, alignmentCorrection, layer, half);
             init();
         }
+
         protected void setPos() {
             ballPos = getSensorPosition();
-            veePos  = new BasicHep3Vector(ballPos.x()+1, ballPos.y(), ballPos.z());
-            flatPos  = new BasicHep3Vector(ballPos.x(), ballPos.y()+1, ballPos.z());
-        }
+            veePos = new BasicHep3Vector(ballPos.x() + 1, ballPos.y(),
+                    ballPos.z());
+            flatPos = new BasicHep3Vector(ballPos.x(), ballPos.y() + 1,
+                    ballPos.z());
+        }
+
         protected Hep3Vector getSensorPosition() {
             return new BasicHep3Vector(sensor_x, sensor_y, sensor_z);
         }
+
         protected void setCenter() {
-            double x = -1.0 * (TestRunHalfModule.getWidth()/2.0 - ( 12.66 - (8.83 -3.00) + Sensor.width/2.0 ) ); 
-            double y =  TestRunHalfModule.getLength()/2.0 - ( (170.00 + 10.00) - Sensor.length/2.0); 
-            double z = -Sensor.getSensorThickness()/2.0 - HPSTestRunTracker2014GeometryDefinition.HalfModuleLamination.thickness - CarbonFiber.thickness + half_module_thickness/2.0; 
-            setCenter(x, y, z); 
-        }
-    }
-    
-    
-    
-    
-   
-    /**
-     * {@link SurveyVolume} volume defining the coordinate system of the stereo half-module in module L1-3
-     * Reference:  @ModuleL13Bot coordinate system
-     * Origin:  sensor center
-     * Orientation: same as axial - the module is rotated later.
-     *
-     */
-    public static class HalfModuleStereo extends HPSTestRunTracker2014GeometryDefinition.TestRunHalfModule {
-        
-        public static final double sensor_z = -0.52*inch;
-        
+            double x = -1.0
+                    * (TestRunHalfModule.getWidth() / 2.0 - (12.66 - (8.83 - 3.00) + Sensor.width / 2.0));
+            double y = TestRunHalfModule.getLength() / 2.0
+                    - ((170.00 + 10.00) - Sensor.length / 2.0);
+            double z = -Sensor.getSensorThickness()
+                    / 2.0
+                    - HPSTestRunTracker2014GeometryDefinition.HalfModuleLamination.thickness
+                    - CarbonFiber.thickness + half_module_thickness / 2.0;
+            setCenter(x, y, z);
+        }
+
+        @Override
+        protected void setStereoAngle() {
+            // do nothing here
+        }
+    }
+
+    /**
+     * {@link SurveyVolume} volume defining the coordinate system of the stereo
+     * half-module in module L1-3 Reference: @ModuleL13Bot coordinate system
+     * Origin: sensor center Orientation: same as axial - the module is rotated
+     * later.
+     * 
+     * @author Per Hansson Adrian <[log in to unmask]>
+     *
+     */
+    public static class HalfModuleStereo extends
+            HPSTestRunTracker2014GeometryDefinition.TestRunHalfModule {
+
+        public static final double sensor_z = -0.52 * inch;
+        protected static final double stereo_angle_value = 0.1;
+
         public HalfModuleStereo(String name, SurveyVolume mother,
                 AlignmentCorrection alignmentCorrection, int layer, String half) {
             super(name, mother, alignmentCorrection, layer, half);
-            if(layer>=1 && layer<=3) stereo_angle = 0.1;
-            else throw new RuntimeException("Layer " + layer + " is ill-defined for test run modules");
-            init();
-        }
+            setStereoAngle();
+            init();
+        }
+
         protected void setPos() {
             // Sensor positions from Shawn's 3D model
             final double x = HalfModuleAxial.sensor_x;
             final double y = HalfModuleAxial.sensor_y;
             final double z = sensor_z;
             ballPos = new BasicHep3Vector(x, y, z);
-            veePos  = new BasicHep3Vector(ballPos.x()+1, ballPos.y(), ballPos.z());
-            flatPos  = new BasicHep3Vector(ballPos.x(), ballPos.y()+1, ballPos.z());
-        }
+            veePos = new BasicHep3Vector(ballPos.x() + 1, ballPos.y(),
+                    ballPos.z());
+            flatPos = new BasicHep3Vector(ballPos.x(), ballPos.y() + 1,
+                    ballPos.z());
+        }
+
         protected void setCenter() {
-            double x = -1.0 * (TestRunHalfModule.getWidth()/2.0 - ( 12.66 - (8.83 -3.00) + Sensor.width/2.0 ) ); 
-            double y =  TestRunHalfModule.getLength()/2.0 - ( (170.00 + 10.00) - Sensor.length/2.0); 
-            double z = -Sensor.getSensorThickness()/2.0 - HPSTestRunTracker2014GeometryDefinition.HalfModuleLamination.thickness - CarbonFiber.thickness + half_module_thickness/2.0; 
-            setCenter(x, y, z); 
-        }
+            double x = -1.0
+                    * (TestRunHalfModule.getWidth() / 2.0 - (12.66 - (8.83 - 3.00) + Sensor.width / 2.0));
+            double y = TestRunHalfModule.getLength() / 2.0
+                    - ((170.00 + 10.00) - Sensor.length / 2.0);
+            double z = -Sensor.getSensorThickness()
+                    / 2.0
+                    - HPSTestRunTracker2014GeometryDefinition.HalfModuleLamination.thickness
+                    - CarbonFiber.thickness + half_module_thickness / 2.0;
+            setCenter(x, y, z);
+        }
+
         protected void applyGenericCoordinateSystemCorrections() {
-            
-            // Rotate into the right place for the stereo - just offset compared to axial before this.
-            // My rotations here are active rotations in the mother coordinate system frame
+
+            // Rotate into the right place for the stereo - just offset compared
+            // to axial before this.
+            // My rotations here are active rotations in the mother coordinate
+            // system frame
             // Sloppy description of the frame:
             // x: direction along strips towards the readout bonds/apv25's
-            // v: normal to sensor plane pointing from the back-plane (n-side) to strip side (p-side)
+            // v: normal to sensor plane pointing from the back-plane (n-side)
+            // to strip side (p-side)
             // w: measurement direction with direction from right hand-rule
 
             // flip around strip direction - sign doesn't matter
-            Rotation r1 = new Rotation(new Vector3D(0,1,0),Math.PI);
+            Rotation r1 = new Rotation(new Vector3D(0, 1, 0), Math.PI);
             // apply stereo angle around v
-            Rotation r2 = new Rotation(new Vector3D(0,0,1),stereo_angle);
+            Rotation r2 = new Rotation(new Vector3D(0, 0, 1), stereo_angle);
             // Build full rotation
             Rotation r = r2.applyTo(r1);
-            //Rotation r = r1;
-            if(debug) System.out.printf("%s: Coord before corrections\n%s\n", getClass().getSimpleName(),getCoord().toString());
-            if(debug) System.out.printf("%s: box center before corrections\n%s\n", getClass().getSimpleName(),getBoxDim().toString());
+            // Rotation r = r1;
+            if (debug)
+                System.out.printf("%s: Coord before corrections\n%s\n",
+                        getClass().getSimpleName(), getCoord().toString());
+            if (debug)
+                System.out.printf("%s: box center before corrections\n%s\n",
+                        getClass().getSimpleName(), getBoxDim().toString());
             getCoord().rotateApache(r);
-            if(debug) System.out.printf("%s: Coord after corrections\n%s\n", getClass().getSimpleName(),getCoord().toString());
-            if(debug) System.out.printf("%s: box center after corrections\n%s\n", getClass().getSimpleName(),getBoxDim().toString());
-
-        }
-
-        
-    }
-    
-    
-    public static class HalfLongModuleLamination extends HPSTestRunTracker2014GeometryDefinition.HalfModuleComponent {
+            if (debug)
+                System.out.printf("%s: Coord after corrections\n%s\n",
+                        getClass().getSimpleName(), getCoord().toString());
+            if (debug)
+                System.out.printf("%s: box center after corrections\n%s\n",
+                        getClass().getSimpleName(), getBoxDim().toString());
+
+        }
+
+        protected void setStereoAngle() {
+            stereo_angle = stereo_angle_value;
+        }
+
+    }
+
+    public static class HalfLongModuleLamination extends
+            HPSTestRunTracker2014GeometryDefinition.HalfModuleComponent {
         protected static final double width = Sensor.width;
         protected static final double length = Sensor.length;
         protected static final double height = 0.050;
-        
+
         public HalfLongModuleLamination(String name, SurveyVolume mother, int id) {
             super(name, mother, null, id);
-           init();
+            init();
         }
 
         protected double getThickness() {
             return height;
         }
+
         protected double getHeigth() {
             return height;
         }
+
         protected double getWidth() {
             return width;
         }
+
         protected double getLength() {
             return length;
         }
+
         protected void setPos() {
-            //offset enough to make them face-to-face
-            ballPos = new BasicHep3Vector(0, 0, -(Sensor.getSensorThickness()/2.0 + height/2.0));
-            veePos = new BasicHep3Vector(ballPos.x()+1, ballPos.y(), ballPos.z());
-            flatPos = new BasicHep3Vector(ballPos.x(), ballPos.y()+1, ballPos.z());
-        }
+            // offset enough to make them face-to-face
+            ballPos = new BasicHep3Vector(0, 0,
+                    -(Sensor.getSensorThickness() / 2.0 + height / 2.0));
+            veePos = new BasicHep3Vector(ballPos.x() + 1, ballPos.y(),
+                    ballPos.z());
+            flatPos = new BasicHep3Vector(ballPos.x(), ballPos.y() + 1,
+                    ballPos.z());
+        }
+
         protected void setCenter() {
-            setCenter(0, 0, 0);            
-        }
+            setCenter(0, 0, 0);
+        }
+
         protected void setBoxDim() {
             setBoxDim(width, length, height);
         }
-    }    
-    
-    
-    
-    /**
-     * Create the module. 
-     * @param layer - of the module
-     * @param half - top or bottom half of the tracker
-     */
-    protected void makeModuleBundle(int layer, String half) 
-    {
-
-        if(isDebug()) System.out.printf("%s: makeModule for layer %d %s \n", this.getClass().getSimpleName(), layer, half);
-
-
-        // build the module name
-        String volName = "module_L"+ layer + (half=="bottom"?"b":"t");      
-
-        // 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
+    }
+
+    /**
+     * Create the module.
+     * 
+     * @param layer
+     *            - of the module
+     * @param half
+     *            - top or bottom half of the tracker
+     */
+    protected void makeModuleBundle(int layer, String half) {
+
         final SurveyVolume mother = getSurveyVolume(SvtBox.class);
         final SurveyVolume ref;
         AlignmentCorrection alignmentCorrection = new AlignmentCorrection();
         alignmentCorrection.setNode(node);
-        if(half == "bottom") {
-            if(layer < 4) {
+        if (half == "bottom") {
+            if (layer < 4) {
                 ref = getSurveyVolume(UChannelL13Bottom.class);
             } else {
                 ref = getSurveyVolume(UChannelL46Bottom.class);
             }
         } else {
-            if(layer < 4) {
+            if (layer < 4) {
                 ref = getSurveyVolume(UChannelL13Top.class);
             } else {
                 ref = getSurveyVolume(UChannelL46Top.class);
             }
         }
 
-        //Create the module
-        BaseModule module;
-        if(half == "bottom") {
-            if(layer==1) {
-                module = new ModuleL1Bot(volName, mother, alignmentCorrection, ref); 
-            } else if(layer==2) {
-                module = new ModuleL2Bot(volName, mother, alignmentCorrection, ref); 
-            } else if(layer==3) {
-                module = new ModuleL3Bot(volName, mother, alignmentCorrection, ref); 
-            } else if(layer==4) {
-                module = new ModuleL4Bot(volName, mother, alignmentCorrection, ref); 
-            } else if(layer==5) {
-                module = new ModuleL5Bot(volName, mother, alignmentCorrection, ref); 
-            } else if(layer==6) {
-                module = new ModuleL6Bot(volName, mother, alignmentCorrection, ref); 
-            } else {
-                throw new UnsupportedOperationException("Layer " + layer + " not implemented yet for bottom");
-            }
-        } else {
-            if(layer==1) {
-                module = new ModuleL1Top(volName, mother, alignmentCorrection, ref); 
-            } else if(layer==2) {
-                module = new ModuleL2Top(volName, mother, alignmentCorrection, ref); 
-            } else if(layer==3) {
-                module = new ModuleL3Top(volName, mother, alignmentCorrection, ref); 
-            } else if(layer==4) {
-                module = new ModuleL4Top(volName, mother, alignmentCorrection, ref); 
-            } else if(layer==5) {
-                module = new ModuleL5Top(volName, mother, alignmentCorrection, ref); 
-            } else if(layer==6) {
-                module = new ModuleL6Top(volName, mother, alignmentCorrection, ref); 
-            } else {
-                throw new UnsupportedOperationException("Layer " + layer + " not implemented yet for top");
-            }
-        }
-
+        makeModuleBundle(layer, half, mother, ref);
+
+    }
+
+    /**
+     * Create the module.
+     * 
+     * @param layer
+     *            - of the module
+     * @param half
+     *            - top or bottom half of the tracker
+     * @param mother
+     *            - mother volume
+     * @param ref
+     *            - reference volume
+     */
+    protected void makeModuleBundle(int layer, String half,
+            SurveyVolume mother, SurveyVolume ref) {
+
+        if (isDebug())
+            System.out.printf("%s: makeModule for layer %d %s \n", this
+                    .getClass().getSimpleName(), layer, half);
+
+        // Create the module
+        BaseModule module = createModule(half, layer, mother, ref);
 
         // create the bundle for this module
         // need to create it and add to list before half-module is created
         // as it uses the list to find the bundle. Ugly. TODO fix this.
         BaseModuleBundle bundle;
-        
-        if(layer<=3) {
+
+        if (layer <= 3) {
             bundle = new TestRunModuleBundle(module);
             addModuleBundle(bundle);
-            if(doAxial) makeHalfModule("axial", module);
-            //        if(doColdBlock) makeColdBlock(module);
-            if(doStereo) makeHalfModule("stereo", module);
+            if (doAxial)
+                makeHalfModule("axial", module);
+            // if(doColdBlock) makeColdBlock(module);
+            if (doStereo)
+                makeHalfModule("stereo", module);
         } else {
             bundle = new LongModuleBundle(module);
             addModuleBundle(bundle);
-            if(doAxial) {
-                makeLongHalfModule("axial","hole", module);
-                makeLongHalfModule("axial","slot", module);
+            if (doAxial) {
+                makeLongHalfModule("axial", "hole", module);
+                makeLongHalfModule("axial", "slot", module);
             }
-            //        if(doColdBlock) makeColdBlock(module);
-            if(doStereo) {
-                makeLongHalfModule("stereo","hole", module);
-                makeLongHalfModule("stereo","slot", module);
+            // if(doColdBlock) makeColdBlock(module);
+            if (doStereo) {
+                makeLongHalfModule("stereo", "hole", module);
+                makeLongHalfModule("stereo", "slot", module);
             }
         }
 
-
-
-        if(isDebug()) {
-            System.out.printf("%s: created module bundle:\n", this.getClass().getSimpleName());
+        if (isDebug()) {
+            System.out.printf("%s: created module bundle:\n", this.getClass()
+                    .getSimpleName());
             bundle.print();
-            System.out.printf("%s: Now there are %d  modules\n", this.getClass().getSimpleName(),modules.size());
-        }
-
-        
-
-    }
-
-    /**
-     *    
+            System.out.printf("%s: Now there are %d  modules\n", this
+                    .getClass().getSimpleName(), modules.size());
+        }
+
+    }
+
+    /**
+     * Create a {@link BaseModule} object.
+     * 
+     * @param half
+     *            - top or bottom string
+     * @param layer
+     *            - layer integer
+     * @param mother
+     *            - mother {@link SurveyVolume}
+     * @param ref
+     *            - reference {@link SurveyVolume}
+     * @return the created {@link BaseModule}
+     */
+    protected BaseModule createModule(String half, int layer,
+            SurveyVolume mother, SurveyVolume ref) {
+
+        // build the module name
+        String volName = "module_L" + layer + (half == "bottom" ? "b" : "t");
+
+        // find alignment corrections
+        AlignmentCorrection alignmentCorrection = new AlignmentCorrection();
+        alignmentCorrection.setNode(node);
+
+        BaseModule module;
+        if (half == "bottom") {
+            if (layer == 1) {
+                module = new ModuleL1Bot(volName, mother, alignmentCorrection,
+                        ref);
+            } else if (layer == 2) {
+                module = new ModuleL2Bot(volName, mother, alignmentCorrection,
+                        ref);
+            } else if (layer == 3) {
+                module = new ModuleL3Bot(volName, mother, alignmentCorrection,
+                        ref);
+            } else if (layer == 4) {
+                module = new ModuleL4Bot(volName, mother, alignmentCorrection,
+                        ref);
+            } else if (layer == 5) {
+                module = new ModuleL5Bot(volName, mother, alignmentCorrection,
+                        ref);
+            } else if (layer == 6) {
+                module = new ModuleL6Bot(volName, mother, alignmentCorrection,
+                        ref);
+            } else {
+                throw new UnsupportedOperationException("Layer " + layer
+                        + " not implemented yet for bottom");
+            }
+        } else {
+            if (layer == 1) {
+                module = new ModuleL1Top(volName, mother, alignmentCorrection,
+                        ref);
+            } else if (layer == 2) {
+                module = new ModuleL2Top(volName, mother, alignmentCorrection,
+                        ref);
+            } else if (layer == 3) {
+                module = new ModuleL3Top(volName, mother, alignmentCorrection,
+                        ref);
+            } else if (layer == 4) {
+                module = new ModuleL4Top(volName, mother, alignmentCorrection,
+                        ref);
+            } else if (layer == 5) {
+                module = new ModuleL5Top(volName, mother, alignmentCorrection,
+                        ref);
+            } else if (layer == 6) {
+                module = new ModuleL6Top(volName, mother, alignmentCorrection,
+                        ref);
+            } else {
+                throw new UnsupportedOperationException("Layer " + layer
+                        + " not implemented yet for top");
+            }
+        }
+        return module;
+    }
+
+    /**
+     * @author Per Hansson Adrian <[log in to unmask]>
+     *
      */
     public static class LongModuleBundle extends BaseModuleBundle {
-        
         public HalfModuleBundle halfModuleAxialHole = null;
         public HalfModuleBundle halfModuleStereoHole = null;
         public HalfModuleBundle halfModuleAxialSlot = null;
         public HalfModuleBundle halfModuleStereoSlot = null;
         protected SurveyVolume coldBlock = null;
-        
+
         public LongModuleBundle(BaseModule m) {
             super(m);
         }
-        
+
         public void print() {
-            if(module!=null) System.out.printf("%s: %s\n", this.getClass().getSimpleName(),module.toString());
-            if(halfModuleAxialHole!=null) halfModuleAxialHole.print();
-            if(halfModuleAxialSlot!=null) halfModuleAxialSlot.print();
-            if(coldBlock!=null)System.out.printf("%s: %s\n", this.getClass().getSimpleName(),coldBlock.getName());
-            if(halfModuleStereoHole!=null) halfModuleStereoHole.print();
-            if(halfModuleStereoSlot!=null) halfModuleStereoSlot.print();
-        }
-    }
-
-    /**
-     *     
+            if (module != null)
+                System.out.printf("%s: %s\n", this.getClass().getSimpleName(),
+                        module.toString());
+            if (halfModuleAxialHole != null)
+                halfModuleAxialHole.print();
+            if (halfModuleAxialSlot != null)
+                halfModuleAxialSlot.print();
+            if (coldBlock != null)
+                System.out.printf("%s: %s\n", this.getClass().getSimpleName(),
+                        coldBlock.getName());
+            if (halfModuleStereoHole != null)
+                halfModuleStereoHole.print();
+            if (halfModuleStereoSlot != null)
+                halfModuleStereoSlot.print();
+        }
+    }
+
+    /**
+     * @author Per Hansson Adrian <[log in to unmask]>
+     *
      */
     public static class LongHalfModuleBundle extends HalfModuleBundle {
         public LongHalfModuleBundle() {
             super();
         }
+
         public LongHalfModuleBundle(SurveyVolume hm) {
             super(hm);
         }
     }
-        
+
     /**
      * Create the half-module.
-     * @param side - stereo or axial
-     * @param type - hole or slot
-     * @param mother to the half-module
-     */
-    protected void makeLongHalfModule(String side, String type , BaseModule mother) {
-        
+     * 
+     * @param side
+     *            - stereo or axial
+     * @param type
+     *            - hole or slot
+     * @param mother
+     *            to the half-module
+     */
+    protected void makeLongHalfModule(String side, String type,
+            BaseModule mother) {
+
         String moduleName = mother.getName();
-    
-        if(isDebug()) System.out.printf("%s: makeHalfModule for %s %s %s \n", this.getClass().getSimpleName(), moduleName, side, type);
-        
+
+        if (isDebug())
+            System.out.printf("%s: makeHalfModule for %s %s %s \n", this
+                    .getClass().getSimpleName(), moduleName, side, type);
+
         String volName = moduleName + "_halfmodule_" + side + "_" + type;
-    
+
         // top or bottom?
         String half = mother.getHalf();
         boolean isTopLayer = !mother.isBottom();
-    
+
         // find layer
         int layer = mother.getLayer();
-    
+
         // axial or stereo
         boolean isAxial = isAxialFromName(volName);
-    
+
         // hole or slot
         boolean isHole = isHoleFromName(volName);
-        
+
         // find layer according to Millepede layer definition
-        int millepedeLayer = getMillepedeLayer(isTopLayer, layer, isAxial, isHole);
-        
+        int millepedeLayer = getMillepedeLayer(isTopLayer, layer, isAxial,
+                isHole);
+
         // find alignment correction to this volume
-        AlignmentCorrection alignmentCorrection =  getHalfModuleAlignmentCorrection(isTopLayer, millepedeLayer);
+        AlignmentCorrection alignmentCorrection = getHalfModuleAlignmentCorrection(
+                isTopLayer, millepedeLayer);
         alignmentCorrection.setNode(node);
-       
-        
+
         // find the module bundle that it will be added to
-        //TestRunModuleBundle bundle  = (TestRunModuleBundle)getModuleBundle(mother);
-        //TestRunHalfModuleBundle halfModuleBundle;
-        LongModuleBundle bundle  = (LongModuleBundle)getModuleBundle(mother);
-        
+        // TestRunModuleBundle bundle =
+        // (TestRunModuleBundle)getModuleBundle(mother);
+        // TestRunHalfModuleBundle halfModuleBundle;
+        LongModuleBundle bundle = (LongModuleBundle) getModuleBundle(mother);
+
         // Build the half-module bundle and half-module
-        //TODO clean this up to a separate method
+        // TODO clean this up to a separate method
         LongHalfModule halfModule;
         HalfModuleBundle halfModuleBundle;
-        if(isAxial) {
+        if (isAxial) {
             halfModuleBundle = new LongHalfModuleBundle();
-            if(isHole) {
-                halfModule = new LongAxialHoleHalfModule(volName, mother, alignmentCorrection, layer, half);
+            if (isHole) {
+                halfModule = new LongAxialHoleHalfModule(volName, mother,
+                        alignmentCorrection, layer, half);
                 bundle.halfModuleAxialHole = halfModuleBundle;
             } else {
-                halfModule = createLongAxialSlotHalfModule(volName, mother, alignmentCorrection, layer, half);
+                halfModule = createLongAxialSlotHalfModule(volName, mother,
+                        alignmentCorrection, layer, half);
                 bundle.halfModuleAxialSlot = halfModuleBundle;
             }
         } else {
             halfModuleBundle = new LongHalfModuleBundle();
-            if(isHole) {
-                halfModule = new LongStereoHoleHalfModule(volName, mother, alignmentCorrection, layer, half);
+            if (isHole) {
+                halfModule = new LongStereoHoleHalfModule(volName, mother,
+                        alignmentCorrection, layer, half);
                 bundle.halfModuleStereoHole = halfModuleBundle;
             } else {
-                halfModule = createLongStereoSlotHalfModule(volName, mother, alignmentCorrection, layer, half);
+                halfModule = createLongStereoSlotHalfModule(volName, mother,
+                        alignmentCorrection, layer, half);
                 bundle.halfModuleStereoSlot = halfModuleBundle;
             }
-        } 
+        }
         halfModuleBundle.halfModule = halfModule;
-    
-        // create the half module components 
+
+        // create the half module components
         makeHalfModuleComponentSensor(halfModule);
 
         makeLongHalfModuleComponentKapton(halfModule);
 
-        //makeHalfModuleComponentCF(halfModule);
-    
-        //makeHalfModuleComponentHybrid(halfModule);    
+        // makeHalfModuleComponentCF(halfModule);
+
+        // makeHalfModuleComponentHybrid(halfModule);
+
     }
 
     protected void makeLongHalfModuleComponentKapton(BaseModule mother) {
-        
-        if(isDebug()) System.out.printf("%s: makeHalfModuleComponentKapton for %s \n", this.getClass().getSimpleName(), mother.getName());
-    
+
+        if (isDebug())
+            System.out.printf("%s: makeHalfModuleComponentKapton for %s \n",
+                    this.getClass().getSimpleName(), mother.getName());
+
         String volName = mother.getName() + "_lamination";
-    
+
         // Build the half-module
-    
-        //  id is hard coded
+
+        // id is hard coded
         int component_number = 2;
-    
-        HalfLongModuleLamination lamination = new HalfLongModuleLamination(volName,mother,component_number);
+
+        HalfLongModuleLamination lamination = new HalfLongModuleLamination(
+                volName, mother, component_number);
         lamination.setMaterial("Kapton");
-    
-    
-        HalfModuleBundle hm = getHalfModuleBundle((BaseModule) mother.getMother(), mother.getName());
+
+        HalfModuleBundle hm = getHalfModuleBundle(
+                (BaseModule) mother.getMother(), mother.getName());
         hm.lamination = lamination;
-    
-    }
-
-    protected HPSTestRunTracker2014GeometryDefinition.TestRunHalfModule createTestRunHalfModuleAxial(String volName,
-            BaseModule mother, AlignmentCorrection alignmentCorrection,
-            int layer, String half) {
-        return new HalfModuleAxial(volName, mother, alignmentCorrection, layer, half);
-        
-    }
-    
-    protected HPSTestRunTracker2014GeometryDefinition.TestRunHalfModule createTestRunHalfModuleStereo(String volName,
-            BaseModule mother, AlignmentCorrection alignmentCorrection,
-            int layer, String half) {
-        return new HalfModuleStereo(volName, mother, alignmentCorrection, layer, half);
-        
-    }
-    
-    /**
-     * Create {@link LongAxialSlotHalfModule} {@link SurveyVolume}. 
+
+    }
+
+    protected HPSTestRunTracker2014GeometryDefinition.TestRunHalfModule createTestRunHalfModuleAxial(
+            String volName, BaseModule mother,
+            AlignmentCorrection alignmentCorrection, int layer, String half) {
+        return new HalfModuleAxial(volName, mother, alignmentCorrection, layer,
+                half);
+
+    }
+
+    protected HPSTestRunTracker2014GeometryDefinition.TestRunHalfModule createTestRunHalfModuleStereo(
+            String volName, BaseModule mother,
+            AlignmentCorrection alignmentCorrection, int layer, String half) {
+        return new HalfModuleStereo(volName, mother, alignmentCorrection,
+                layer, half);
+
+    }
+
+    /**
+     * Create {@link LongAxialSlotHalfModule} {@link SurveyVolume}.
+     * 
      * @param name
      * @param mother
      * @param alignmentCorrection
      * @param layer
      * @param half
-     */
-    protected LongHalfModule createLongAxialSlotHalfModule(String name, SurveyVolume mother,
-            AlignmentCorrection alignmentCorrection, int layer,
-            String half) {
-        return new LongAxialSlotHalfModule(name, mother, alignmentCorrection, layer, half);
-    }
-
-    /**
-     * Create {@link LongStereoSlotHalfModule} {@link SurveyVolume}. 
+     * @return
+     */
+    protected LongHalfModule createLongAxialSlotHalfModule(String name,
+            SurveyVolume mother, AlignmentCorrection alignmentCorrection,
+            int layer, String half) {
+        return new LongAxialSlotHalfModule(name, mother, alignmentCorrection,
+                layer, half);
+    }
+
+    /**
+     * Create {@link LongStereoSlotHalfModule} {@link SurveyVolume}.
+     * 
      * @param name
      * @param mother
      * @param alignmentCorrection
      * @param layer
      * @param half
-     */
-    protected LongHalfModule createLongStereoSlotHalfModule(String name, SurveyVolume mother,
-            AlignmentCorrection alignmentCorrection, int layer,
-            String half) {
-        return new LongStereoSlotHalfModule(name, mother, alignmentCorrection, layer, half);
-    }
-
-    /* (non-Javadoc)
-     * @see org.lcsim.geometry.compact.converter.HPSTrackerGeometryDefinition#getHalfModuleBundle(org.lcsim.geometry.compact.converter.HPSTestRunTracker2014GeometryDefinition.BaseModule, java.lang.String)
-     */
-    protected HalfModuleBundle getHalfModuleBundle(BaseModule module, String halfModuleName) {
+     * @return
+     */
+    protected LongHalfModule createLongStereoSlotHalfModule(String name,
+            SurveyVolume mother, AlignmentCorrection alignmentCorrection,
+            int layer, String half) {
+        return new LongStereoSlotHalfModule(name, mother, alignmentCorrection,
+                layer, half);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.lcsim.geometry.compact.converter.HPSTrackerGeometryDefinition#
+     * getHalfModuleBundle
+     * (org.lcsim.geometry.compact.converter.HPSTestRunTracker2014GeometryDefinition
+     * .BaseModule, java.lang.String)
+     */
+    protected HalfModuleBundle getHalfModuleBundle(BaseModule module,
+            String halfModuleName) {
         BaseModuleBundle moduleBundle = getModuleBundle(module);
         HalfModuleBundle hm = null;
-        if(moduleBundle!=null) {
-            if( moduleBundle instanceof TestRunModuleBundle) {   
+        if (moduleBundle != null) {
+            if (moduleBundle instanceof TestRunModuleBundle) {
                 TestRunModuleBundle mtr = (TestRunModuleBundle) moduleBundle;
-                if(halfModuleName.contains("axial")) {
+                if (halfModuleName.contains("axial")) {
                     hm = mtr.halfModuleAxial;
+                } else if (halfModuleName.contains("stereo")) {
+                    hm = mtr.halfModuleStereo;
+                } else {
+                    throw new RuntimeException(
+                            "NO axial or stereo string found in half module bundle name "
+                                    + halfModuleName);
                 }
-                else if(halfModuleName.contains("stereo")) {
-                    hm = mtr.halfModuleStereo;
-                }
-                else {
-                    throw new RuntimeException("NO axial or stereo string found in half module bundle name " + halfModuleName);
-                }
-            } 
-            else if(moduleBundle instanceof LongModuleBundle) {
+            } else if (moduleBundle instanceof LongModuleBundle) {
                 LongModuleBundle longModuleBundle = (LongModuleBundle) moduleBundle;
-                if(halfModuleName.contains("axial")) {
-                    if(halfModuleName.contains("hole")) {
+                if (halfModuleName.contains("axial")) {
+                    if (halfModuleName.contains("hole")) {
                         hm = longModuleBundle.halfModuleAxialHole;
-                    } else if(halfModuleName.contains("slot")) {
+                    } else if (halfModuleName.contains("slot")) {
                         hm = longModuleBundle.halfModuleAxialSlot;
                     } else {
-                        throw new RuntimeException("This half-module name \"" + halfModuleName +  " \" is invalid. Need to contain hole or slot for this type.");
+                        throw new RuntimeException(
+                                "This half-module name \""
+                                        + halfModuleName
+                                        + " \" is invalid. Need to contain hole or slot for this type.");
                     }
-                } else if(halfModuleName.contains("stereo")) {
-                    if(halfModuleName.contains("hole")) {
+                } else if (halfModuleName.contains("stereo")) {
+                    if (halfModuleName.contains("hole")) {
                         hm = longModuleBundle.halfModuleStereoHole;
-                    } else if(halfModuleName.contains("slot")) {
+                    } else if (halfModuleName.contains("slot")) {
                         hm = longModuleBundle.halfModuleStereoSlot;
                     } else {
-                        throw new RuntimeException("This half-module name \"" + halfModuleName +  " \" is invalid. Need to contain hole or slot for this type.");
+                        throw new RuntimeException(
+                                "This half-module name \""
+                                        + halfModuleName
+                                        + " \" is invalid. Need to contain hole or slot for this type.");
                     }
                 } else {
-                    throw new RuntimeException("This half-module name \"" + halfModuleName +  " \" is invalid. Need to contain axial or stereo.");
+                    throw new RuntimeException(
+                            "This half-module name \""
+                                    + halfModuleName
+                                    + " \" is invalid. Need to contain axial or stereo.");
                 }
-            }
-            else {
-                throw new NotImplementedException("This type of module bundle is not implemented!?");
+            } else {
+                throw new NotImplementedException(
+                        "This type of module bundle is not implemented!?");
             }
         } else {
-            throw new RuntimeException("Couldn't find module " + module.getName() + " and layer "  + module.getLayer() + " and half " + module.getHalf());
+            throw new RuntimeException("Couldn't find module "
+                    + module.getName() + " and layer " + module.getLayer()
+                    + " and half " + module.getHalf());
         }
         return hm;
     }
-    
-    /* (non-Javadoc)
-     * @see org.lcsim.geometry.compact.converter.HPSTrackerBuilder#getMillepedeLayer(java.lang.String)
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.lcsim.geometry.compact.converter.HPSTrackerBuilder#getMillepedeLayer
+     * (java.lang.String)
      */
     public int getMillepedeLayer(String name) {
-        
+
         boolean isTopLayer = getHalfFromName(name).equals("top") ? true : false;
-    
+
         // find layer
         int layer = getLayerFromVolumeName(name);
 
         // axial or stereo
         boolean isAxial = isAxialFromName(name);
 
-        // use default layer numbering for L1-3    
-        if(layer<4) {
-            return  getOldLayerDefinition(isTopLayer, layer, isAxial);
-        }
-     
+        // use default layer numbering for L1-3
+        if (layer < 4) {
+            return getOldLayerDefinition(isTopLayer, layer, isAxial);
+        }
+
         // hole or slot
         boolean isHole = isHoleFromName(name);
 
-        return  getMillepedeLayer(isTopLayer, layer, isAxial, isHole);
-
-    }
-
-    /**
-     * Definition relating the sensors and layer number used in millepede for this detector.
+        return getMillepedeLayer(isTopLayer, layer, isAxial, isHole);
+
+    }
+
+    /**
+     * Definition relating the sensors and layer number used in millepede for
+     * this detector.
+     * 
      * @param isTopLayer
      * @param layer
      * @param isAxial
      * @param isHole
-     */
-    public int getMillepedeLayer(boolean isTopLayer, int layer, boolean isAxial, boolean isHole) {
+     * @return
+     */
+    public int getMillepedeLayer(boolean isTopLayer, int layer,
+            boolean isAxial, boolean isHole) {
         int l = -1;
         // use default layer numbering for L1-3
-        if(layer<4) {
+        if (layer < 4) {
             l = getOldLayerDefinition(isTopLayer, layer, isAxial);
         } else {
-            // Scheme: 
+            // Scheme:
             // For top modules axial layer is odd and stereo is even.
             // Hole vs slot given by example below:
             // e.g. top layer 4:
-            // axial -  hole: 7
-            // axial -  slot: 9
+            // axial - hole: 7
+            // axial - slot: 9
             // stereo - hole: 8
-            // axial -  slot: 10
-            
-            l = 7 + (layer-4)*4;
+            // axial - slot: 10
+
+            l = 7 + (layer - 4) * 4;
             int s = -1;
-            if(isTopLayer) {
+            if (isTopLayer) {
                 s = 0;
-                if(isAxial) {
+                if (isAxial) {
                     s += 0;
                 } else {
                     s += 1;
                 }
-                if(isHole) {
+                if (isHole) {
                     s += 0;
                 } else {
                     s += 2;
                 }
             } else {
                 s = 0;
-                if(!isAxial) {
+                if (!isAxial) {
                     s += 0;
                 } else {
                     s += 1;
                 }
-                if(isHole) {
+                if (isHole) {
                     s += 0;
                 } else {
                     s += 2;
@@ -2041,11 +2494,16 @@
             }
             l = l + s;
         }
-        
-        if(l<0) throw new RuntimeException("Error getting the millepede layer.");
-        
-        if(isDebug()) System.out.printf("%s: %s %d %s %s -> MP layer %d\n",getClass().getSimpleName(),isTopLayer?"top":"bottom", layer, isAxial?"axial":"stereo", isHole?"hole":"slot", l);
-        
+
+        if (l < 0)
+            throw new RuntimeException("Error getting the millepede layer.");
+
+        if (isDebug())
+            System.out.printf("%s: %s %d %s %s -> MP layer %d\n", getClass()
+                    .getSimpleName(), isTopLayer ? "top" : "bottom", layer,
+                    isAxial ? "axial" : "stereo", isHole ? "hole" : "slot", l);
+
         return l;
     }
+
 }

Modified: java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/HPSTracker2014JavaBuilder.java
 =============================================================================
--- java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/HPSTracker2014JavaBuilder.java	(original)
+++ java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/HPSTracker2014JavaBuilder.java	Thu Dec  1 12:39:07 2016
@@ -7,7 +7,8 @@
 
 import org.jdom.Element;
 import org.lcsim.detector.ILogicalVolume;
-import org.lcsim.geometry.compact.converter.HPSTestRunTracker2014GeometryDefinition.Sensor;
+import org.lcsim.geometry.compact.converter.HPSTestRunTracker2014GeometryDefinition.BaseSensor;
+//import org.lcsim.geometry.compact.converter.HPSTestRunTracker2014GeometryDefinition.Sensor;
 import org.lcsim.geometry.compact.converter.HPSTracker2014GeometryDefinition.LongHalfModuleBundle;
 import org.lcsim.geometry.compact.converter.HPSTracker2014GeometryDefinition.LongModuleBundle;
 import org.lcsim.geometry.compact.converter.HPSTracker2014GeometryDefinition.PSVacuumChamber;
@@ -18,185 +19,230 @@
 import org.lcsim.geometry.compact.converter.HPSTrackerGeometryDefinition.TestRunModuleBundle;
 import org.lcsim.geometry.compact.converter.HPSTrackerGeometryDefinition.TrackingVolume;
 
-
 /**
  * Class used by java converter to build java run time objects for the detector
- * It encapsulates and adds the LCDD specific information to the generic @HPSTestRunTracker2014Builder. 
+ * It encapsulates and adds the LCDD specific information to the generic
+ * @HPSTestRunTracker2014Builder.
  * 
  * @author Per Hansson Adrian <[log in to unmask]>
  *
  */
 public class HPSTracker2014JavaBuilder extends HPSTestRunTracker2014JavaBuilder {
 
-    
-    
     /**
      * Default constructor
-     * @param node 
+     * 
+     * @param node
      */
     public HPSTracker2014JavaBuilder(boolean debugFlag, Element node) {
         super(debugFlag, node);
     }
-    
-    
-    
-    
+
     /**
      * Build the JAVA geometry objects from the geometry definition.
-     * @param trackingVolume - the reference volume.
+     * 
+     * @param trackingVolume
+     *            - the reference volume.
      */
     public void build(ILogicalVolume trackingVolume) {
 
         // build geometry
         setBuilder(createGeometryDefinition(this._debug, node));
-        
-        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());
-        
+
+        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 JAVA geometry objects\n", getClass().getSimpleName());
-        
+        if (isDebug())
+            System.out.printf("%s: DONE build the base geometry objects\n",
+                    getClass().getSimpleName());
+
+        if (isDebug())
+            System.out.printf("%s: build the JAVA geometry objects\n",
+                    getClass().getSimpleName());
+
         // initialize the list to store a reference to each object
         javaSurveyVolumes = new ArrayList<JavaSurveyVolume>();
 
-        // Go through the list of volumes to build that is created in the generic builder class
-        JavaSurveyVolume tracking = new JavaSurveyVolume(_builder.getSurveyVolume(TrackingVolume.class), trackingVolume);
+        // Go through the list of volumes to build that is created in the
+        // generic builder class
+        JavaSurveyVolume tracking = new JavaSurveyVolume(
+                _builder.getSurveyVolume(TrackingVolume.class), trackingVolume);
         add(tracking);
-        JavaSurveyVolume chamber = new JavaGhostSurveyVolume(_builder.getSurveyVolume(PSVacuumChamber.class), tracking);
+        JavaSurveyVolume chamber = new JavaGhostSurveyVolume(
+                _builder.getSurveyVolume(PSVacuumChamber.class), tracking);
         add(chamber);
-        setBaseTrackerGeometry(new JavaSurveyVolume(_builder.getSurveyVolume(SvtBox.class), chamber,1));
+        setBaseTrackerGeometry(new JavaSurveyVolume(
+                _builder.getSurveyVolume(SvtBox.class), chamber, 1));
         add(getBaseTrackerGeometry());
-        JavaSurveyVolume svtBoxBasePlate = new JavaGhostSurveyVolume(_builder.getSurveyVolume(SvtBoxBasePlate.class), getBaseTrackerGeometry());
+        JavaSurveyVolume svtBoxBasePlate = new JavaGhostSurveyVolume(
+                _builder.getSurveyVolume(SvtBoxBasePlate.class),
+                getBaseTrackerGeometry());
         add(svtBoxBasePlate);
 
-        
-        // build modules    
-        
-        if(isDebug()) System.out.printf("%s: build JAVA modules\n", getClass().getSimpleName());
+        // build modules
+
+        if (isDebug())
+            System.out.printf("%s: build JAVA modules\n", getClass()
+                    .getSimpleName());
 
         // Loop over all modules created
-        for(BaseModuleBundle mod : _builder.modules) {
+        for (BaseModuleBundle mod : _builder.modules) {
             BaseModuleBundle m = mod;
-            if(isDebug()) { 
-                System.out.printf("%s: build module %s (layer %d half %s)\n", getClass().getSimpleName(),m.module.getName(),m.getLayer(),m.getHalf());
+            if (isDebug()) {
+                System.out.printf("%s: build module %s (layer %d half %s)\n",
+                        getClass().getSimpleName(), m.module.getName(),
+                        m.getLayer(), m.getHalf());
                 m.print();
             }
 
-            // Find the mother among the objects using its name, should probably have a better way...
+            // Find the mother among the objects using its name, should probably
+            // have a better way...
             String name_mother = m.getMother().getName();
             JavaSurveyVolume mother = null;
-            for(JavaSurveyVolume g : javaSurveyVolumes) {
-                if(g.getName().equals(name_mother)) {
+            for (JavaSurveyVolume g : javaSurveyVolumes) {
+                if (g.getName().equals(name_mother)) {
                     mother = g;
                     break;
                 }
             }
             // Check that it had a mother
-            if(mother==null) throw new RuntimeException("Cound't find mother to module " + m.module.getName());
-
-            if(isDebug()) System.out.printf("%s: found mother %s to module %s\n", getClass().getSimpleName(),mother.getName(),m.module.getName());
-            
+            if (mother == null)
+                throw new RuntimeException("Cound't find mother to module "
+                        + m.module.getName());
+
+            // if(isDebug())
+            System.out.printf("%s: found ewfsdhf mother %s to module %s\n",
+                    getClass().getSimpleName(), mother.getName(),
+                    m.module.getName());
+
             // put the module in the list of objects that will be added to LCDD
             addModule(m, mother);
-            
-            if(isDebug()) System.out.printf("%s: DONE build module %s\n", getClass().getSimpleName(), m.module.getName());
-
-            
+
+            if (isDebug())
+                System.out.printf("%s: DONE build module %s\n", getClass()
+                        .getSimpleName(), m.module.getName());
+
         }
-        
-        if(isDebug()) System.out.printf("%s: DONE build JAVA modules\n", getClass().getSimpleName());
-
-        
-        //System.out.printf("%s: Built %d JAVA geometry objects\n", getClass().getSimpleName(),javaSurveyVolumes.size());
-        
-        if(isDebug()) {
-            System.out.printf("%s: DONE building the JAVA geometry objects\n", getClass().getSimpleName());
-            System.out.printf("%s: List of all the JAVA geometry objects built\n", this.getClass().getSimpleName());
-            for(JavaSurveyVolume bg : javaSurveyVolumes) {
+
+        // if(isDebug())
+        System.out.printf("%s: DONE build JAVA modules\n", getClass()
+                .getSimpleName());
+
+        // System.out.printf("%s: Built %d JAVA geometry objects\n",
+        // getClass().getSimpleName(),javaSurveyVolumes.size());
+
+        if (isDebug()) {
+            System.out.printf("%s: DONE building the JAVA geometry objects\n",
+                    getClass().getSimpleName());
+            System.out.printf(
+                    "%s: List of all the JAVA geometry objects built\n", this
+                            .getClass().getSimpleName());
+            for (JavaSurveyVolume bg : javaSurveyVolumes) {
                 System.out.printf("-------\n%s\n", bg.toString());
             }
         }
 
-
         // Set visualization features
-        //setVis();
-
+        // setVis();
 
     }
 
     /**
      * Rules for adding the JAVA module geometry.
-     * @param bundle - module to be added
-     * @param mother - mother JAVA geometry object
-     */
-    private void addModule(BaseModuleBundle bundle, JavaSurveyVolume mother) {
-        if(bundle instanceof TestRunModuleBundle) {
-               addTestRunModule((TestRunModuleBundle) bundle, mother);
-           } else if(bundle instanceof LongModuleBundle) {
-               addLongModule((LongModuleBundle) bundle, mother);
-           } else {
-               throw new RuntimeException("The bundle is of unknown class type!");
-           }
-    }
-    
+     * 
+     * @param bundle
+     *            - module to be added
+     * @param mother
+     *            - mother JAVA geometry object
+     */
+    protected void addModule(BaseModuleBundle bundle, JavaSurveyVolume mother) {
+        if (bundle instanceof TestRunModuleBundle) {
+            addTestRunModule((TestRunModuleBundle) bundle, mother);
+        } else if (bundle instanceof LongModuleBundle) {
+            addLongModule((LongModuleBundle) bundle, mother);
+        } else {
+            throw new RuntimeException("The bundle is of unknown class type!");
+        }
+    }
+
     /**
      * Rules for adding the LCDD module geometry.
-     * @param bundle - module to be added
-     * @param mother - mother LCDD geometry object
-     */
-    private void addLongModule(LongModuleBundle bundle, JavaSurveyVolume mother) {
-        // This could perhaps be fixed if there is a relation with daughters in geometry definition?
+     * 
+     * @param bundle
+     *            - module to be added
+     * @param mother
+     *            - mother LCDD geometry object
+     */
+    protected void addLongModule(LongModuleBundle bundle,
+            JavaSurveyVolume mother) {
+        // This could perhaps be fixed if there is a relation with daughters in
+        // geometry definition?
         // create the module
-        JavaSurveyVolume lcddM = new JavaGhostSurveyVolume(bundle.module, mother);
+        JavaSurveyVolume lcddM = new JavaGhostSurveyVolume(bundle.module,
+                mother);
         add(lcddM);
-        if(bundle.halfModuleAxialHole!=null)  addLongHalfModule(bundle.halfModuleAxialHole,lcddM);
-        if(bundle.halfModuleAxialSlot!=null)  addLongHalfModule(bundle.halfModuleAxialSlot,lcddM);
-        //if(bundle.coldBlock!=null)        add(new LCDDSurveyVolume(bundle.coldBlock, lcdd, lcddM));     
-        if(bundle.halfModuleStereoHole!=null)  addLongHalfModule(bundle.halfModuleStereoHole,lcddM);
-        if(bundle.halfModuleStereoSlot!=null)  addLongHalfModule(bundle.halfModuleStereoSlot,lcddM);
-    }
-
-
-
-    private void addLongHalfModule(HalfModuleBundle bundle2, JavaSurveyVolume mother) {
+        if (bundle.halfModuleAxialHole != null)
+            addLongHalfModule(bundle.halfModuleAxialHole, lcddM);
+        if (bundle.halfModuleAxialSlot != null)
+            addLongHalfModule(bundle.halfModuleAxialSlot, lcddM);
+        // if(bundle.coldBlock!=null) add(new LCDDSurveyVolume(bundle.coldBlock,
+        // lcdd, lcddM));
+        if (bundle.halfModuleStereoHole != null)
+            addLongHalfModule(bundle.halfModuleStereoHole, lcddM);
+        if (bundle.halfModuleStereoSlot != null)
+            addLongHalfModule(bundle.halfModuleStereoSlot, lcddM);
+    }
+
+    protected void addLongHalfModule(HalfModuleBundle bundle2,
+            JavaSurveyVolume mother) {
+
         LongHalfModuleBundle bundle = (LongHalfModuleBundle) bundle2;
+
         // Create the half-module
-        // This is not a ghost element but reflects the module 
+        // This is not a ghost element but reflects the module
         // concept in the old compact description
         int oldCompactModuleId = 0;
-        JavaSurveyVolume lcddHM = new JavaSurveyVolume(bundle.halfModule, mother,oldCompactModuleId);
+        JavaSurveyVolume lcddHM = new JavaSurveyVolume(bundle.halfModule,
+                mother, oldCompactModuleId);
+
         add(lcddHM);
-        
-        // ComponentNumber is taken from old geometry where it is simply a counter when adding the xml daughters to the TestRunModule.
-        // It is simply 0 for sensor and 1 for carbon fiber in the old geometry 
-        int componentNumber = ((Sensor)bundle.sensor).getId();
+
+        // ComponentNumber is taken from old geometry where it is simply a
+        // counter when adding the xml daughters to the TestRunModule.
+        // It is simply 0 for sensor and 1 for carbon fiber in the old geometry
+        int componentNumber = ((BaseSensor) bundle.sensor).getId();
 
         // create the sensor
-        JavaSurveyVolume lcddS = new JavaSurveyVolume(bundle.sensor, lcddHM, componentNumber);
+        JavaSurveyVolume lcddS = new JavaSurveyVolume(bundle.sensor, lcddHM,
+                componentNumber);
         add(lcddS);
 
         // create the active sensor
-        JavaSurveyVolume lcddAS = new JavaSurveyVolume(bundle.activeSensor, lcddS, componentNumber);
+        JavaSurveyVolume lcddAS = new JavaSurveyVolume(bundle.activeSensor,
+                lcddS, componentNumber);
         add(lcddAS);
-        
-//      if(isDebug()) {
-//          System.out.printf("%s: added sensor %s \n",this.getClass().getSimpleName(), lcddS.getName());
-//          System.out.printf("%s: local coordinate system\n%s\n",this.getClass().getSimpleName(), bundle.sensor.getCoord().toString());
-//          dsd
-//      }
-        
-        
-    }
-    
+
+        // if(isDebug()) {
+        System.out.printf("%s: added sensor %s \n", this.getClass()
+                .getSimpleName(), lcddS.getName());
+        System.out.printf("%s: local coordinate system\n%s\n", this.getClass()
+                .getSimpleName(), bundle.sensor.getCoord().toString());
+        // dsd
+        // }
+
+    }
+
     @Override
-    public HPSTrackerGeometryDefinition createGeometryDefinition(boolean debug, Element node) {
+    public HPSTrackerGeometryDefinition createGeometryDefinition(boolean debug,
+            Element node) {
         return new HPSTracker2014GeometryDefinition(debug, node);
     }
-    
-    
 
 }

Modified: java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/HPSTracker2014LCDDBuilder.java
 =============================================================================
--- java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/HPSTracker2014LCDDBuilder.java	(original)
+++ java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/HPSTracker2014LCDDBuilder.java	Thu Dec  1 12:39:07 2016
@@ -2,7 +2,7 @@
 
 import org.jdom.Element;
 import org.lcsim.geometry.compact.converter.HPSTestRunTracker2014GeometryDefinition.TestRunHalfModuleBundle;
-import org.lcsim.geometry.compact.converter.HPSTracker2014GeometryDefinition.LongHalfModuleBundle;
+//import org.lcsim.geometry.compact.converter.HPSTracker2014GeometryDefinition.LongHalfModuleBundle;
 import org.lcsim.geometry.compact.converter.HPSTracker2014GeometryDefinition.LongModuleBundle;
 import org.lcsim.geometry.compact.converter.HPSTracker2014GeometryDefinition.PSVacuumChamber;
 import org.lcsim.geometry.compact.converter.HPSTracker2014GeometryDefinition.SvtBox;
@@ -27,216 +27,293 @@
 
     public HPSTracker2014LCDDBuilder(boolean debugFlag, Element node,
             LCDD lcdd, SensitiveDetector sens) {
-        
+
         super(debugFlag, node, lcdd, sens);
-        
-    }
-    
-    
-    /* (non-Javadoc)
-     * @see org.lcsim.geometry.compact.converter.HPSTestRunTracker2014LCDDBuilder#setBuilder()
+
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.lcsim.geometry.compact.converter.HPSTestRunTracker2014LCDDBuilder
+     * #setBuilder()
      */
     public void setBuilder() {
         setBuilder(createGeometryDefinition(_debug, node));
     }
-    
-    /* (non-Javadoc)
-     * @see org.lcsim.geometry.compact.converter.HPSTestRunTracker2014LCDDBuilder#build(org.lcsim.geometry.compact.converter.lcdd.util.Volume)
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.lcsim.geometry.compact.converter.HPSTestRunTracker2014LCDDBuilder
+     * #build(org.lcsim.geometry.compact.converter.lcdd.util.Volume)
      */
     public void build(Volume worldVolume) {
 
         // set and build geometry
         setBuilder();
 
-        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());
+        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());
-
-
-        LCDDSurveyVolume trackingGeometry = new LCDDSurveyVolume(_builder.getSurveyVolume(TrackingVolume.class), worldVolume);
+        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());
+
+        LCDDSurveyVolume trackingGeometry = new LCDDSurveyVolume(
+                _builder.getSurveyVolume(TrackingVolume.class), worldVolume);
         add(trackingGeometry);
 
-//        baseSurveyVolume = new LCDDSurveyVolume(_builder.getSurveyVolume(PSVacuumChamber.class), lcdd, trackingGeometry);
-//        add(baseSurveyVolume); 
-        LCDDSurveyVolume vacuumChamberVolume = new LCDDGhostSurveyVolume(_builder.getSurveyVolume(PSVacuumChamber.class), trackingGeometry);
-        add(vacuumChamberVolume); 
-
-//        LCDDSurveyVolume svtBox = new LCDDSurveyVolume(_builder.getSurveyVolume(SvtBox.class), lcdd, baseSurveyVolume);
-//        add(svtBox); 
-
-        LCDDSurveyVolume svtBox = new LCDDSurveyVolume(_builder.getSurveyVolume(SvtBox.class), lcdd, vacuumChamberVolume);
+        // baseSurveyVolume = new
+        // LCDDSurveyVolume(_builder.getSurveyVolume(PSVacuumChamber.class),
+        // lcdd, trackingGeometry);
+        // add(baseSurveyVolume);
+        LCDDSurveyVolume vacuumChamberVolume = new LCDDGhostSurveyVolume(
+                _builder.getSurveyVolume(PSVacuumChamber.class),
+                trackingGeometry);
+        add(vacuumChamberVolume);
+
+        // LCDDSurveyVolume svtBox = new
+        // LCDDSurveyVolume(_builder.getSurveyVolume(SvtBox.class), lcdd,
+        // baseSurveyVolume);
+        // add(svtBox);
+
+        LCDDSurveyVolume svtBox = new LCDDSurveyVolume(
+                _builder.getSurveyVolume(SvtBox.class), lcdd,
+                vacuumChamberVolume);
         baseSurveyVolume = svtBox;
-        add(baseSurveyVolume); 
-
-       
-        LCDDSurveyVolume svtBoxBasePlate = new LCDDSurveyVolume(_builder.getSurveyVolume(SvtBoxBasePlate.class), lcdd, svtBox);
-        add(svtBoxBasePlate); 
-
-        
-        LCDDSurveyVolume uChannelL13Bottom = new LCDDGhostSurveyVolume(_builder.getSurveyVolume(UChannelL13Bottom.class),  svtBox);
+        add(baseSurveyVolume);
+
+        LCDDSurveyVolume svtBoxBasePlate = new LCDDSurveyVolume(
+                _builder.getSurveyVolume(SvtBoxBasePlate.class), lcdd, svtBox);
+        add(svtBoxBasePlate);
+
+        LCDDSurveyVolume uChannelL13Bottom = new LCDDGhostSurveyVolume(
+                _builder.getSurveyVolume(UChannelL13Bottom.class), svtBox);
         add(uChannelL13Bottom);
-        
-        LCDDSurveyVolume uChannelL13BottomPlate = new LCDDSurveyVolume(_builder.getSurveyVolume(UChannelL13BottomPlate.class), lcdd, svtBox);
+
+        LCDDSurveyVolume uChannelL13BottomPlate = new LCDDSurveyVolume(
+                _builder.getSurveyVolume(UChannelL13BottomPlate.class), lcdd,
+                svtBox);
         add(uChannelL13BottomPlate);
 
-        LCDDSurveyVolume uChannelL13Top = new LCDDGhostSurveyVolume(_builder.getSurveyVolume(UChannelL13Top.class), svtBox);
+        LCDDSurveyVolume uChannelL13Top = new LCDDGhostSurveyVolume(
+                _builder.getSurveyVolume(UChannelL13Top.class), svtBox);
         add(uChannelL13Top);
-        
-        LCDDSurveyVolume uChannelL13TopPlate = new LCDDSurveyVolume(_builder.getSurveyVolume(UChannelL13TopPlate.class), lcdd, svtBox);
+
+        LCDDSurveyVolume uChannelL13TopPlate = new LCDDSurveyVolume(
+                _builder.getSurveyVolume(UChannelL13TopPlate.class), lcdd,
+                svtBox);
         add(uChannelL13TopPlate);
-        
-        LCDDSurveyVolume uChannelL46Bottom = new LCDDGhostSurveyVolume(_builder.getSurveyVolume(UChannelL46Bottom.class), svtBox);
-        add(uChannelL46Bottom);        
-        
-        LCDDSurveyVolume uChannelL46BottomPlate = new LCDDSurveyVolume(_builder.getSurveyVolume(UChannelL46BottomPlate.class), lcdd, svtBox);
-        add(uChannelL46BottomPlate);        
-
-        LCDDSurveyVolume uChannelL46Top = new LCDDGhostSurveyVolume(_builder.getSurveyVolume(UChannelL46Top.class), svtBox);
-        add(uChannelL46Top);        
-        
-        LCDDSurveyVolume uChannelL46TopPlate = new LCDDSurveyVolume(_builder.getSurveyVolume(UChannelL46TopPlate.class), lcdd, svtBox);
-        add(uChannelL46TopPlate);        
-
-        
-        // build modules    
-
-        if(isDebug()) System.out.printf("%s: build modules\n", getClass().getSimpleName());
-
+
+        LCDDSurveyVolume uChannelL46Bottom = new LCDDGhostSurveyVolume(
+                _builder.getSurveyVolume(UChannelL46Bottom.class), svtBox);
+        add(uChannelL46Bottom);
+
+        LCDDSurveyVolume uChannelL46BottomPlate = new LCDDSurveyVolume(
+                _builder.getSurveyVolume(UChannelL46BottomPlate.class), lcdd,
+                svtBox);
+        add(uChannelL46BottomPlate);
+
+        LCDDSurveyVolume uChannelL46Top = new LCDDGhostSurveyVolume(
+                _builder.getSurveyVolume(UChannelL46Top.class), svtBox);
+        add(uChannelL46Top);
+
+        LCDDSurveyVolume uChannelL46TopPlate = new LCDDSurveyVolume(
+                _builder.getSurveyVolume(UChannelL46TopPlate.class), lcdd,
+                svtBox);
+        add(uChannelL46TopPlate);
+
+        // build modules
+
+        if (isDebug())
+            System.out
+                    .printf("%s: build modules\n", getClass().getSimpleName());
+
+        addModules();
+
+        System.out.printf("%s: Built %d LCDD geometry objects\n", getClass()
+                .getSimpleName(), lcddSurveyVolumes.size());
+
+        if (isDebug()) {
+            System.out.printf(
+                    "%s: List of all %d LCDD geometry objects built\n", this
+                            .getClass().getSimpleName(), lcddSurveyVolumes
+                            .size());
+            for (SurveyVolumeImpl bg : lcddSurveyVolumes) {
+                System.out.printf("-------\n%s\n", bg.toString());
+            }
+        }
+
+        // Set visualization features
+        setVisualization();
+
+    }
+
+    /**
+     * Rules for adding the LCDD modules.
+     */
+    protected void addModules() {
         // Loop over all modules created
-        for(BaseModuleBundle mod : _builder.modules) {
-            //SVTModuleBundle m = (SVTModuleBundle) mod;
+        for (BaseModuleBundle mod : _builder.modules) {
+            // SVTModuleBundle m = (SVTModuleBundle) mod;
             BaseModuleBundle m = mod;
-            if(isDebug()) { 
-                System.out.printf("%s: module layer %d half %s\n", getClass().getSimpleName(),m.getLayer(),m.getHalf());
+            if (isDebug()) {
+                System.out.printf("%s: module layer %d half %s\n", getClass()
+                        .getSimpleName(), m.getLayer(), m.getHalf());
                 m.print();
             }
 
-            // Find the mother among the LCDD objects using its name, should probably have a better way...
+            // Find the mother among the LCDD objects using its name, should
+            // probably have a better way...
             String name_mother = m.getMother().getName();
             LCDDSurveyVolume mother = null;
-            for(LCDDSurveyVolume g : lcddSurveyVolumes) {
-                if(g.getName().equals(name_mother)) {
+            for (LCDDSurveyVolume g : lcddSurveyVolumes) {
+                if (g.getName().equals(name_mother)) {
                     mother = g;
                     break;
                 }
             }
             // Check that it had a mother
-            if(mother==null) throw new RuntimeException("Cound't find mother to module layer " + m.getLayer() + " half "+ m.getHalf());
-
-            if(isDebug()) System.out.printf("%s: found mother %s for module layer %d half %s\n", getClass().getSimpleName(),mother.getName(),m.getLayer(),m.getHalf());
+            if (mother == null)
+                throw new RuntimeException(
+                        "Cound't find mother to module layer " + m.getLayer()
+                                + " half " + m.getHalf());
+
+            if (isDebug())
+                System.out.printf(
+                        "%s: found mother %s for module layer %d half %s\n",
+                        getClass().getSimpleName(), mother.getName(),
+                        m.getLayer(), m.getHalf());
 
             // add the module to the list of objects that will be added to LCDD
             addModule(m, mother);
 
         }
-
-
-       
-        
-        System.out.printf("%s: Built %d LCDD geometry objects\n", getClass().getSimpleName(), lcddSurveyVolumes.size());
-        
-        if(isDebug()) {
-            System.out.printf("%s: List of all %d LCDD geometry objects built\n", this.getClass().getSimpleName(), lcddSurveyVolumes.size());
-            for(SurveyVolumeImpl bg : lcddSurveyVolumes) {
-                System.out.printf("-------\n%s\n", bg.toString());
-            }
+    }
+
+    /**
+     * Rules for adding the LCDD module geometry.
+     * 
+     * @param bundle
+     *            - module to be added
+     * @param mother
+     *            - mother LCDD geometry object
+     */
+    protected void addModule(BaseModuleBundle bundle, LCDDSurveyVolume mother) {
+        if (bundle instanceof TestRunModuleBundle) {
+            addTestRunModule((TestRunModuleBundle) bundle, mother);
+        } else if (bundle instanceof LongModuleBundle) {
+            addLongModule((LongModuleBundle) bundle, mother);
+        } else {
+            throw new RuntimeException("The bundle is of unknown class type!");
         }
-
-
-
-        // Set visualization features
-        setVisualization();
-
-    }    
-    
+    }
+
     /**
      * Rules for adding the LCDD module geometry.
-     * @param bundle - module to be added
-     * @param mother - mother LCDD geometry object
-     */
-    private void addModule(BaseModuleBundle bundle, LCDDSurveyVolume mother) {
-       if(bundle instanceof TestRunModuleBundle) {
-           addTestRunModule((TestRunModuleBundle) bundle, mother);
-       } else if(bundle instanceof LongModuleBundle) {
-           addLongModule((LongModuleBundle) bundle, mother);
-       } else {
-           throw new RuntimeException("The bundle is of unknown class type!");
-       }
-    }
-  
+     * 
+     * @param bundle
+     *            - module to be added
+     * @param mother
+     *            - mother LCDD geometry object
+     */
+    protected void addLongModule(LongModuleBundle bundle,
+            LCDDSurveyVolume mother) {
+        LCDDSurveyVolume lcddM = new LCDDGhostSurveyVolume(bundle.module,
+                mother);
+        // LCDDSurveyVolume lcddM = new LCDDSurveyVolume(bundle.module, lcdd,
+        // mother);
+        add(lcddM);
+        if (bundle.halfModuleAxialHole != null)
+            addLongHalfModule(bundle.halfModuleAxialHole, lcddM);
+        if (bundle.halfModuleAxialSlot != null)
+            addLongHalfModule(bundle.halfModuleAxialSlot, lcddM);
+        if (bundle.coldBlock != null)
+            add(new LCDDSurveyVolume(bundle.coldBlock, lcdd, lcddM));
+        if (bundle.halfModuleStereoHole != null)
+            addLongHalfModule(bundle.halfModuleStereoHole, lcddM);
+        if (bundle.halfModuleStereoSlot != null)
+            addLongHalfModule(bundle.halfModuleStereoSlot, lcddM);
+    }
+
     /**
      * Rules for adding the LCDD module geometry.
-     * @param bundle - module to be added
-     * @param mother - mother LCDD geometry object
-     */
-    protected void addLongModule(LongModuleBundle bundle, LCDDSurveyVolume mother) {
-        LCDDSurveyVolume lcddM = new LCDDGhostSurveyVolume(bundle.module, mother);
-        //LCDDSurveyVolume lcddM = new LCDDSurveyVolume(bundle.module, lcdd, mother);
+     * 
+     * @param bundle
+     *            - module to be added
+     * @param mother
+     *            - mother LCDD geometry object
+     */
+    protected void addTestRunModule(TestRunModuleBundle bundle,
+            LCDDSurveyVolume mother) {
+        // This could perhaps be fixed if there is a relation with daughters in
+        // geometry definition?
+        // create the module
+        LCDDSurveyVolume lcddM = new LCDDGhostSurveyVolume(bundle.module,
+                mother);
+        // SurveyVolume(bundle.module, lcdd, mother);
         add(lcddM);
-        if(bundle.halfModuleAxialHole!=null)  addLongHalfModule(bundle.halfModuleAxialHole,lcddM);
-        if(bundle.halfModuleAxialSlot!=null)  addLongHalfModule(bundle.halfModuleAxialSlot,lcddM);
-        if(bundle.coldBlock!=null)        add(new LCDDSurveyVolume(bundle.coldBlock, lcdd, lcddM));     
-        if(bundle.halfModuleStereoHole!=null)  addLongHalfModule(bundle.halfModuleStereoHole,lcddM);
-        if(bundle.halfModuleStereoSlot!=null)  addLongHalfModule(bundle.halfModuleStereoSlot,lcddM);
-    }
-    
-    
-    
-    /**
-     * Rules for adding the LCDD module geometry.
-     * @param bundle - module to be added
-     * @param mother - mother LCDD geometry object
-     */
-    protected void addTestRunModule(TestRunModuleBundle bundle, LCDDSurveyVolume mother) {
-        // This could perhaps be fixed if there is a relation with daughters in geometry definition?
-        // create the module
-        LCDDSurveyVolume lcddM = new LCDDGhostSurveyVolume(bundle.module, mother);
-        //SurveyVolume(bundle.module, lcdd, mother);
-        add(lcddM);
-        if(bundle.halfModuleAxial!=null)  addTestRunHalfModule(bundle.halfModuleAxial,lcddM);
-        if(bundle.coldBlock!=null)        add(new LCDDSurveyVolume(bundle.coldBlock, lcdd, lcddM));     
-        if(bundle.halfModuleStereo!=null) addTestRunHalfModule((TestRunHalfModuleBundle)bundle.halfModuleStereo,lcddM);
-    }
-
-    
-    
+        if (bundle.halfModuleAxial != null)
+            addTestRunHalfModule(bundle.halfModuleAxial, lcddM);
+        if (bundle.coldBlock != null)
+            add(new LCDDSurveyVolume(bundle.coldBlock, lcdd, lcddM));
+        if (bundle.halfModuleStereo != null)
+            addTestRunHalfModule(
+                    (TestRunHalfModuleBundle) bundle.halfModuleStereo, lcddM);
+    }
+
     /**
      * Rules for adding the LCDD half module geometry.
-     * @param bundle - module to be added
-     * @param mother - mother LCDD geometry object
-     */
-    private void addLongHalfModule(HalfModuleBundle bundle2, LCDDSurveyVolume mother) {
-        LongHalfModuleBundle bundle = (LongHalfModuleBundle) bundle2;
-        
+     * 
+     * @param bundle
+     *            - module to be added
+     * @param mother
+     *            - mother LCDD geometry object
+     */
+    protected void addLongHalfModule(HalfModuleBundle bundle2,
+            LCDDSurveyVolume mother) {
+        // LongHalfModuleBundle bundle = (LongHalfModuleBundle) bundle2;
+        HalfModuleBundle bundle = bundle2;
         // create the half-module
-        LCDDSurveyVolume lcddHM = new LCDDSurveyVolume(bundle.halfModule, lcdd, mother);
+        LCDDSurveyVolume lcddHM = new LCDDSurveyVolume(bundle.halfModule, lcdd,
+                mother);
         add(lcddHM);
         // create the sensor
-        LCDDSurveyVolume lcddS = new LCDDSurveyVolume(bundle.sensor, lcdd, lcddHM);
+        LCDDSurveyVolume lcddS = new LCDDSurveyVolume(bundle.sensor, lcdd,
+                lcddHM);
         add(lcddS);
         // create the active sensor
-        LCDDSurveyVolume lcddAS = new LCDDSurveyVolume(bundle.activeSensor, lcdd, lcddS);
+        LCDDSurveyVolume lcddAS = new LCDDSurveyVolume(bundle.activeSensor,
+                lcdd, lcddS);
         add(lcddAS);
         // create the lamination
-        LCDDSurveyVolume lcddL = new LCDDSurveyVolume(bundle.lamination, lcdd, lcddHM);
-        add(lcddL);
+        if (bundle.lamination != null) {
+            LCDDSurveyVolume lcddL = new LCDDSurveyVolume(bundle.lamination,
+                    lcdd, lcddHM);
+            add(lcddL);
+        }
         /*
-        // create the carbon fiber frame
-        LCDDSurveyVolume lcddCF = new LCDDSurveyVolume(bundle.carbonFiber, lcdd, lcddHM);
-        add(lcddCF);
-        // create the hybrid frame
-        LCDDSurveyVolume lcddH = new LCDDSurveyVolume(bundle.hybrid, lcdd, lcddHM);
-        add(lcddH);
-*/
-    }   
-    
+         * // create the carbon fiber frame LCDDSurveyVolume lcddCF = new
+         * LCDDSurveyVolume(bundle.carbonFiber, lcdd, lcddHM); add(lcddCF); //
+         * create the hybrid frame LCDDSurveyVolume lcddH = new
+         * LCDDSurveyVolume(bundle.hybrid, lcdd, lcddHM); add(lcddH);
+         */
+    }
+
     @Override
     public HPSTrackerGeometryDefinition createGeometryDefinition(boolean debug,
             Element node) {

Modified: java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/HPSTracker2014v1GeometryDefinition.java
 =============================================================================
--- java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/HPSTracker2014v1GeometryDefinition.java	(original)
+++ java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/HPSTracker2014v1GeometryDefinition.java	Thu Dec  1 12:39:07 2016
@@ -7,7 +7,7 @@
 /**
  * 
  * Updated geometry information for the HPS tracker 2014
- * 
+
  * @author Per Hansson Adrian <[log in to unmask]>
  *
  */
@@ -93,9 +93,10 @@
 
     
     /**
-     * PI rotation around generic z-axis 
+     * PI rotation around generic z-axis
+     * @return
      */
-    private static Rotation getSlotRotation() {
+    protected static Rotation getSlotRotation() {
         return new Rotation(new Vector3D(0,0,1),Math.PI);
     }
     

Modified: java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/HPSTrackerBuilder.java
 =============================================================================
--- java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/HPSTrackerBuilder.java	(original)
+++ java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/HPSTrackerBuilder.java	Thu Dec  1 12:39:07 2016
@@ -21,7 +21,7 @@
 
     private static final Logger LOGGER = Logger.getLogger(HPSTrackerBuilder.class.getPackage().getName());
 
-    private boolean debug = true;
+    private boolean debug = false;
     public List<BaseModuleBundle> modules = new ArrayList<BaseModuleBundle>();
     protected List<SurveyVolume> surveyVolumes = new ArrayList<SurveyVolume>();
     protected Element node;
@@ -266,51 +266,37 @@
     }
     
     public static String getHalfFromName(String name) {
-        String half = "";
-        if (name.contains("bottom")) {
-            half = "bottom";
-        }
-        if (name.contains("top")) {
-            // check that both sides are not found
-            if (half.equals("bottom")) {
-                throw new RuntimeException("found both halfs from name  " + name);
-            } else {
-                half = "top";
-            }
-        }
+        boolean matchBottom = Pattern.matches(".*bottom.*", name);
+        boolean matchTop = Pattern.matches(".*top.*", name);
+        
+        if(matchBottom && matchTop)
+            throw new RuntimeException("found both halfs from name  " + name);
+
+        if(matchBottom)
+            return "bottom";
+        if(matchTop)
+            return "top";
+
         // check for other signatures
-        if (half.isEmpty()) {
-            Pattern pattern = Pattern.compile(".*_L[1-6][1-6]?([a-z]).*");
-            Matcher matcher = pattern.matcher(name);
-            if(matcher.matches()) {
-                if(matcher.group(1).equals("t")) {
-                    half = "top";
-                } else if(matcher.group(1).equals("b")) {
-                    half = "bottom";
-                }
-            }
-        }
-        if (half.isEmpty()) {
-            System.out.println("found no half from " + name);
-            throw new RuntimeException("found no half from " + name);
-        } else {
-            return half;
-
-        }
+        Pattern pattern = Pattern.compile(".*_L\\d\\d?(t|b).*");
+        Matcher matcher = pattern.matcher(name);
+        if(matcher.matches()) {
+            if(matcher.group(1).equals("t"))
+                return "top";
+            else if(matcher.group(1).equals("b"))
+                return "bottom";
+            else
+                throw new RuntimeException("I should never get here from name " + name);
+        } 
+        throw new RuntimeException("Couldn't find half from " + name);
     }
 
     public static int getLayerFromVolumeName(String name) {
-        int layer = -1;
-        for (int i = 1; i <= 6; ++i) {
-            if (name.contains(String.format("module_L%d", i))) {
-                layer = i;
-            }
-        }
-        if (layer == -1) {
-            System.out.println("cannot find layer from " + name);
-            System.exit(1);
-        }
-        return layer;
+        Matcher matcher = Pattern.compile(".*module_L(\\d+).*").matcher(name);
+        if(matcher.matches())
+            return Integer.parseInt( matcher.group(1));
+        else
+            throw new RuntimeException("cannot find layer from " + name);
     }
 
     public static boolean isBase(String name) {
@@ -330,7 +316,7 @@
     }
     
     public static boolean isModule(String name) {
-        return Pattern.matches("module_L[1-6][bt]$", name);
+        return Pattern.matches("module_L\\d+[bt]$", name);
     }
     
     public static int getUChannelSupportLayer(String name) {
@@ -632,7 +618,7 @@
     /**
      * Get hole or slot key name from string
      * 
-     * @param name "hole" or "slot"
+     * @param name.
      * @return hole or not boolean
      */
     public static boolean isHoleFromName(String name) {
@@ -649,7 +635,10 @@
     /**
      * Extract old definition of Test Run sensor number.
      * 
-     * @return the geometric layer according to Test Run definition
+     * @param isTopLayer - top or bottom layer
+     * @param l - layer
+     * @param isAxial - axial or stereo sensor
+     * @return
      */
     public int getOldGeomDefLayerFromVolumeName(String name) {
 
@@ -669,7 +658,8 @@
     /**
      * Get the layer number consistent with the old geometry definition.
      * 
-     * @return the older layer definition
+     * @param module name that contains layer and half information.
+     * @return the layer.
      */
     public int getOldLayerDefinition(boolean isTopLayer, int l, boolean isAxial) {
         int layer = -1;

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

November 2017
August 2017
July 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013

ATOM RSS1 RSS2



LISTSERV.SLAC.STANFORD.EDU

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager

Privacy Notice, Security Notice and Terms of Use