LISTSERV mailing list manager LISTSERV 16.5

Help for LCDET-SVN Archives


LCDET-SVN Archives

LCDET-SVN Archives


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

LCDET-SVN Home

LCDET-SVN Home

LCDET-SVN  April 2015

LCDET-SVN April 2015

Subject:

r3593 - in /projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter: HPSTracker2014GeometryDefinition.java HPSTracker2014v1GeometryDefinition.java HPSTrackerBuilder.java

From:

[log in to unmask]

Reply-To:

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

Date:

Sat, 25 Apr 2015 22:24:06 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (295 lines)

Author: [log in to unmask]
Date: Sat Apr 25 15:23:58 2015
New Revision: 3593

Log:
Fixed bug that returned to base class of the half-module. Create base class to be more cleanly able to create a new converter by simply overriding one module. Add some docs, more needed. 

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

Modified: projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/HPSTracker2014GeometryDefinition.java
 =============================================================================
--- projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/HPSTracker2014GeometryDefinition.java	(original)
+++ projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/HPSTracker2014GeometryDefinition.java	Sat Apr 25 15:23:58 2015
@@ -1672,7 +1672,24 @@
 
     
     
-    public static class LongAxialSlotHalfModule extends LongHalfModule {
+    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) {
+            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;
@@ -1688,11 +1705,8 @@
         protected Hep3Vector getSensorPosition() {
             return new BasicHep3Vector(-sensor_x, sensor_y, -sensor_z);
         }
-       
-
-
-    }
-
+    }
+    
 
     public abstract static class LongStereoHalfModule extends LongHalfModule {
 
@@ -1717,12 +1731,18 @@
             // 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());
+            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());
-            if(debug) 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());
+            }
 
         }
         
@@ -1752,24 +1772,31 @@
 
 
     
-    public static class LongStereoSlotHalfModule extends LongStereoHalfModule {
+    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) {
             super(name, mother, alignmentCorrection, layer, half);
             init();
         }
-
-        protected Hep3Vector getSensorPosition() {
-            return new BasicHep3Vector(-sensor_x, sensor_y, -sensor_z);
-        }
-
-    }
-
+    }
+    
 
     /**
      * @SurveyVolume volume defining the coordinate system of the axial half-module in module L1-3
@@ -1908,12 +1935,7 @@
         protected void setBoxDim() {
             setBoxDim(width, length, height);
         }
-
-       
-        
-        
-    }
-    
+    }    
     
     
     
@@ -2139,11 +2161,10 @@
     
     
         // create the half module components 
-    
         makeHalfModuleComponentSensor(halfModule);
-    
+
         makeLongHalfModuleComponentKapton(halfModule);
-    
+
         //makeHalfModuleComponentCF(halfModule);
     
         //makeHalfModuleComponentHybrid(halfModule);
@@ -2192,12 +2213,30 @@
         
     }
     
+    /**
+     * Create {@link LongAxialSlotHalfModule} {@link SurveyVolume}. 
+     * @param name
+     * @param mother
+     * @param alignmentCorrection
+     * @param layer
+     * @param half
+     * @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
+     * @return
+     */
     protected LongHalfModule createLongStereoSlotHalfModule(String name, SurveyVolume mother,
             AlignmentCorrection alignmentCorrection, int layer,
             String half) {

Modified: projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/HPSTracker2014v1GeometryDefinition.java
 =============================================================================
--- projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/HPSTracker2014v1GeometryDefinition.java	(original)
+++ projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/HPSTracker2014v1GeometryDefinition.java	Sat Apr 25 15:23:58 2015
@@ -17,44 +17,63 @@
         super(debug, node);
     }
 
-    public static class LongAxialSlotHalfModule extends HPSTracker2014GeometryDefinition.LongAxialSlotHalfModule  {
+    public static class LongAxialSlotHalfModule extends HPSTracker2014GeometryDefinition.LongAxialSlotHalfModuleBase  {
 
         public LongAxialSlotHalfModule(String name, SurveyVolume mother,
                 AlignmentCorrection alignmentCorrection, int layer,
                 String half) {
             super(name, mother, alignmentCorrection, layer, half);
+            init();
         }
        
         @Override
         protected void applyGenericCoordinateSystemCorrections() {
+            
             super.applyGenericCoordinateSystemCorrections();
-            // apply 180 degree rotation around w ~ normal to the sensor plane
-            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());
+            
+            // apply 180 degree rotation around w to get hybrid on the correct side
+            
+            if(debug) {
+                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(getSlotRotation());
-            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());
+
+            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 LongStereoSlotHalfModule extends HPSTracker2014GeometryDefinition.LongStereoSlotHalfModule {
+    public static class LongStereoSlotHalfModule extends HPSTracker2014GeometryDefinition.LongStereoSlotHalfModuleBase {
 
         public LongStereoSlotHalfModule(String name, SurveyVolume mother,
                 AlignmentCorrection alignmentCorrection, int layer, String half) {
             super(name, mother, alignmentCorrection, layer, half);
+            init();
         }
         
         @Override
         protected void applyGenericCoordinateSystemCorrections() {
-            // TODO Auto-generated method stub
+            
             super.applyGenericCoordinateSystemCorrections();
-            // apply 180 degree rotation around w ~ normal to the sensor plane
-            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());
+
+            if(debug) {
+                System.out.printf("%s: v1 LongStereoSlotHalfModule 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(getSlotRotation());
-            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());
+            
+            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());
+            }
         }
+
+        
     }
 
     @Override
@@ -69,9 +88,7 @@
             SurveyVolume mother, AlignmentCorrection alignmentCorrection,
             int layer, String half) {
         
-        // TODO Auto-generated method stub
-        return super.createLongStereoSlotHalfModule(name, mother, alignmentCorrection,
-                layer, half);
+        return new LongStereoSlotHalfModule(name, mother, alignmentCorrection, layer, half);
     }
 
     

Modified: projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/HPSTrackerBuilder.java
 =============================================================================
--- projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/HPSTrackerBuilder.java	(original)
+++ projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/HPSTrackerBuilder.java	Sat Apr 25 15:23:58 2015
@@ -198,8 +198,8 @@
         public HalfModuleBundle() {
         }
         public void print() {
-            System.out.printf("%s: %s\n", this.getClass().getSimpleName(),halfModule.toString());
-            System.out.printf("%s: %s\n", this.getClass().getSimpleName(),activeSensor.toString());
+            if(halfModule!=null) System.out.printf("%s: %s\n", this.getClass().getSimpleName(),halfModule.toString());
+            if(activeSensor!=null) System.out.printf("%s: %s\n", this.getClass().getSimpleName(),activeSensor.toString());
         }
     }
 	

########################################################################
Use REPLY-ALL to reply to list

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

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

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