Print

Print


Author: [log in to unmask]
Date: Mon Dec  8 22:32:55 2014
New Revision: 3444

Log:
Fix and add printouts.

Modified:
    projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/detector/converter/compact/HPSTracker2014ConverterBase.java
    projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/SurveyVolume.java
    projects/lcsim/trunk/detector-framework/src/test/java/org/lcsim/geometry/subdetector/HPSTestRunTracker2014Test.java
    projects/lcsim/trunk/detector-framework/src/test/java/org/lcsim/geometry/subdetector/HPSTracker2014Test.java

Modified: projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/detector/converter/compact/HPSTracker2014ConverterBase.java
 =============================================================================
--- projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/detector/converter/compact/HPSTracker2014ConverterBase.java	(original)
+++ projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/detector/converter/compact/HPSTracker2014ConverterBase.java	Mon Dec  8 22:32:55 2014
@@ -36,7 +36,7 @@
  */
 public abstract class HPSTracker2014ConverterBase extends AbstractSubdetectorConverter {
 
-    protected boolean _debug = false;
+    protected boolean _debug = true;
     protected IMaterial trackingMaterial = null;
     protected static HPSTrackerJavaBuilder builder;
 
@@ -132,9 +132,9 @@
        
         if(_debug) System.out.printf("%s: DONE create stereo layers\n", getClass().getSimpleName());
        
-        if(_debug) {
+        //if(_debug) {
             printDEs();
-        }
+        //}
     }
 
 
@@ -499,6 +499,16 @@
         System.out.printf("%s: Print all %d detector elements in store\n", getClass().getSimpleName(),DetectorElementStore.getInstance().size());
         for(IDetectorElement e : DetectorElementStore.getInstance()) {
             System.out.printf("%s: Name: %s \n", getClass().getSimpleName(),e.getName());
+           /*
+            if(e.getIdentifier()==null) {
+                System.out.printf("%s: no id found\n", getClass().getSimpleName());
+            } else {
+                if(e.getExpandedIdentifier()==null) 
+                    System.out.printf("%s: no exp id found\n", getClass().getSimpleName());
+                else 
+                    System.out.printf("%s: %s \n", getClass().getSimpleName(),e.getExpandedIdentifier().toString());
+            } 
+            */
             if(e.hasGeometryInfo()) {
                 System.out.printf("%s: Position: %s \n", getClass().getSimpleName(),e.getGeometry().getPosition());
                 System.out.printf("%s: LocalToGlobal: \n%s \n", getClass().getSimpleName(),((Transform3D)e.getGeometry().getLocalToGlobal()).toString());

Modified: projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/SurveyVolume.java
 =============================================================================
--- projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/SurveyVolume.java	(original)
+++ projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/SurveyVolume.java	Mon Dec  8 22:32:55 2014
@@ -15,7 +15,7 @@
  * 
  */
 public abstract class SurveyVolume {
-	protected boolean debug = false;
+	protected boolean debug = true;
 	private String name;
 	private String material = "Vacuum";
 	private SurveyVolume mother;
@@ -53,7 +53,7 @@
 	protected abstract void setBoxDim();
 
 	protected void init() {
-	    if(debug) System.out.printf("%s: init %s\n",this.getClass().getSimpleName(),getName());
+	    if(debug) System.out.printf("%s: init SurveyVolume %s\n",this.getClass().getSimpleName(),getName());
         setPos();
 		setCoord();
 		applyReferenceTransformation();
@@ -61,7 +61,7 @@
 		setBoxDim();
 		applyGenericCoordinateSystemCorrections();
 		applyLocalAlignmentCorrections();
-        if(debug) System.out.printf("%s: init %s DONE\n",this.getClass().getSimpleName(),getName());
+        if(debug) System.out.printf("%s: init of SurveyVolume %s DONE\n",this.getClass().getSimpleName(),getName());
 	}
 
 	protected void applyGenericCoordinateSystemCorrections() {
@@ -70,10 +70,11 @@
 	}
 	protected void applyReferenceTransformation() {
 
-	    if(debug) System.out.printf("%s: applyReferenceTransformation for %s\n",this.getClass().getSimpleName(),getName());
-            	    
+	        	    
 	    if(referenceGeom!=null) {
-
+	        
+	        System.out.printf("%s: apply reference transformation for %s\n",this.getClass().getSimpleName(),getName());
+	        
 
 	        if(debug) System.out.printf("%s: coord system before %d ref transformations:\n%s\n",this.getClass().getSimpleName(),referenceGeom.size(),getCoord().toString());
 	        
@@ -94,7 +95,7 @@
 	        
 	    } else {
 	        
-	        if(debug) System.out.printf("%s: no ref geom for this volume\n",this.getClass().getSimpleName());
+	        System.out.printf("%s: no reference transformation exists for %s\n",this.getClass().getSimpleName(),getName());
 	        
 	    }
 
@@ -102,12 +103,13 @@
 	
 	private void applyLocalAlignmentCorrections() {
 	    // Apply alignment corrections to local coordinate system that is already built
-	    boolean debug_local = true;
-	    if(this.coord==null) throw new RuntimeException("no coordinate system was set before trying to apply alignment corrections.");
+	    boolean debug_local = false;
+	    if(this.coord==null) 
+	        throw new RuntimeException("no coordinate system was set before trying to apply alignment corrections.");
 
 	    if(alignmentCorrections!=null) {
 
-	        if(debug_local || debug) System.out.printf("%s: Apply alignment corrections to this coord system:\n%s\n",this.getClass().getSimpleName(),getCoord().toString());
+	        System.out.printf("%s: Apply alignment corrections to %s\n",this.getClass().getSimpleName(),this.getName());
 
 	        // translate
 	        if(alignmentCorrections.getTranslation()!=null) {			    
@@ -194,7 +196,7 @@
 	        if(debug_local || debug) System.out.printf("%s: coordinate system after alignment corrections:\n%s\n",this.getClass().getSimpleName(),getCoord().toString());
 
 	    } else {
-	        if(debug_local || debug) System.out.printf("%s: No aligment corrections to coordinate system\n", this.getClass().getSimpleName());
+            System.out.printf("%s: no alignment corrections exist for %s\n",this.getClass().getSimpleName(),this.getName());
 	    }
 
 	}

Modified: projects/lcsim/trunk/detector-framework/src/test/java/org/lcsim/geometry/subdetector/HPSTestRunTracker2014Test.java
 =============================================================================
--- projects/lcsim/trunk/detector-framework/src/test/java/org/lcsim/geometry/subdetector/HPSTestRunTracker2014Test.java	(original)
+++ projects/lcsim/trunk/detector-framework/src/test/java/org/lcsim/geometry/subdetector/HPSTestRunTracker2014Test.java	Mon Dec  8 22:32:55 2014
@@ -8,6 +8,8 @@
 import org.lcsim.detector.IDetectorElement;
 import org.lcsim.detector.IDetectorElementStore;
 import org.lcsim.detector.PhysicalVolumePath;
+import org.lcsim.detector.identifier.IExpandedIdentifier;
+import org.lcsim.detector.identifier.Identifier;
 import org.lcsim.geometry.Detector;
 import org.lcsim.geometry.GeometryReader;
 
@@ -39,12 +41,24 @@
 	public void test() {
 		
 		
+//	    IDetectorElementStore store =  DetectorElementStore.getInstance();
+//	    System.out.printf("%s: Printing %d DE:\n",this.getClass().getSimpleName(), store.size());
+//	    System.out.printf("%s: %50s %40s %50s %50s\n",this.getClass().getSimpleName(), "name", "pos", "path","mother");
+//	    for(IDetectorElement e : store) {
+//	        System.out.printf("%s: %50s %40s %50s %50s \n",this.getClass().getSimpleName(), e.getName(),e.hasGeometryInfo()?e.getGeometry().getPosition().toString():" - ",e.hasGeometryInfo()?((PhysicalVolumePath)e.getGeometry().getPath()).toString():" - ",e.getParent()==null?" - ":e.getParent().getName());
+//	    }
+		
 		IDetectorElementStore store =  DetectorElementStore.getInstance();
-		System.out.printf("%s: Printing %d DE:\n",this.getClass().getSimpleName(), store.size());
-		System.out.printf("%s: %50s %40s %50s %50s\n",this.getClass().getSimpleName(), "name", "pos", "path","mother");
-		for(IDetectorElement e : store) {
-			System.out.printf("%s: %50s %40s %50s %50s \n",this.getClass().getSimpleName(), e.getName(),e.hasGeometryInfo()?e.getGeometry().getPosition().toString():" - ",e.hasGeometryInfo()?((PhysicalVolumePath)e.getGeometry().getPath()).toString():" - ",e.getParent()==null?" - ":e.getParent().getName());
-		}
+        System.out.printf("%s: Printing %d DE:\n",this.getClass().getSimpleName(), store.size());
+        System.out.printf("%s: %50s %40s %50s %50s %s\n",this.getClass().getSimpleName(), "name", "pos", "path","mother", "expId");
+        for(IDetectorElement e : store) {
+            Identifier id = (Identifier) e.getIdentifier();
+            IExpandedIdentifier expId = null;
+            if(id.getGarbage()==false)
+                expId = e.getExpandedIdentifier();
+            System.out.printf("%s: %50s %40s %50s %50s %s\n",this.getClass().getSimpleName(), e.getName(),e.hasGeometryInfo()?e.getGeometry().getPosition().toString():" - ",e.hasGeometryInfo()?((PhysicalVolumePath)e.getGeometry().getPath()).toString():" - ",e.getParent()==null?" - ":e.getParent().getName(),expId==null?" no expId ":expId.toString());
+        }
+		
 	}
    
 

Modified: projects/lcsim/trunk/detector-framework/src/test/java/org/lcsim/geometry/subdetector/HPSTracker2014Test.java
 =============================================================================
--- projects/lcsim/trunk/detector-framework/src/test/java/org/lcsim/geometry/subdetector/HPSTracker2014Test.java	(original)
+++ projects/lcsim/trunk/detector-framework/src/test/java/org/lcsim/geometry/subdetector/HPSTracker2014Test.java	Mon Dec  8 22:32:55 2014
@@ -6,6 +6,8 @@
 import org.lcsim.detector.IDetectorElement;
 import org.lcsim.detector.IDetectorElementStore;
 import org.lcsim.detector.PhysicalVolumePath;
+import org.lcsim.detector.identifier.IExpandedIdentifier;
+import org.lcsim.detector.identifier.Identifier;
 import org.lcsim.geometry.Detector;
 import org.lcsim.geometry.GeometryReader;
 
@@ -41,9 +43,13 @@
         
         IDetectorElementStore store =  DetectorElementStore.getInstance();
         System.out.printf("%s: Printing %d DE:\n",this.getClass().getSimpleName(), store.size());
-        System.out.printf("%s: %50s %40s %50s %50s\n",this.getClass().getSimpleName(), "name", "pos", "path","mother");
+        System.out.printf("%s: %50s %40s %50s %50s %s\n",this.getClass().getSimpleName(), "name", "pos", "path","mother", "expId");
         for(IDetectorElement e : store) {
-            System.out.printf("%s: %50s %40s %50s %50s \n",this.getClass().getSimpleName(), e.getName(),e.hasGeometryInfo()?e.getGeometry().getPosition().toString():" - ",e.hasGeometryInfo()?((PhysicalVolumePath)e.getGeometry().getPath()).toString():" - ",e.getParent()==null?" - ":e.getParent().getName());
+            Identifier id = (Identifier) e.getIdentifier();
+            IExpandedIdentifier expId = null;
+            if(id.getGarbage()==false)
+                expId = e.getExpandedIdentifier();
+            System.out.printf("%s: %50s %40s %50s %50s %s\n",this.getClass().getSimpleName(), e.getName(),e.hasGeometryInfo()?e.getGeometry().getPosition().toString():" - ",e.hasGeometryInfo()?((PhysicalVolumePath)e.getGeometry().getPath()).toString():" - ",e.getParent()==null?" - ":e.getParent().getName(),expId==null?" no expId ":expId.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