Commit in lcsim/src/org/lcsim/recon/tracking/gtrdetector on MAIN
GtrDetector.java+82-831.9 -> 1.10
suppress printout

lcsim/src/org/lcsim/recon/tracking/gtrdetector
GtrDetector.java 1.9 -> 1.10
diff -u -r1.9 -r1.10
--- GtrDetector.java	8 May 2008 00:02:03 -0000	1.9
+++ GtrDetector.java	8 May 2008 01:18:21 -0000	1.10
@@ -3,7 +3,7 @@
  *
  * Created on July 30, 2005, 3:30 PM
  *
- * $Id: GtrDetector.java,v 1.9 2008/05/08 00:02:03 jeremy Exp $
+ * $Id: GtrDetector.java,v 1.10 2008/05/08 01:18:21 ngraf Exp $
  */
 
 package org.lcsim.recon.tracking.gtrdetector;
@@ -83,7 +83,7 @@
             }
             else if (subDet instanceof SiTrackerEndcap)
             {
-            	add((SiTrackerEndcap) subDet);
+                add((SiTrackerEndcap) subDet);
             }
         }
     }
@@ -383,7 +383,7 @@
                 
                 TwoSegment seg = new TwoSegment(global2D1, global2D2);
 //                System.out.println("2d segment: "+seg);
-
+                
                 TwoSpacePoint origin = new CartesianTwoPoint(0.,0.);
                 double rdist = seg.minimumDistance(origin);
 //                System.out.println("rdist: "+rdist + " rxy: "+rxy+" segment phi: "+seg.phi()+" point phi "+point.phi());
@@ -396,7 +396,7 @@
 //                System.out.println("v= "+v+ " u= "+u+" u1= "+u1+" u2= "+u2+" segment length= "+seg.length());
                 if(phi0<0.) phi0+=2.*PI;
                 BSurfXYPlane xyp = new BSurfXYPlane(rdist, phi0, u1, u2, globalP1.z(), globalP3.z());
-                            
+                
                 //System.out.println("XYPlane for sensor <" + sensor.getName() + ">");
                 //System.out.println(xyp);
             }
@@ -405,44 +405,44 @@
     
     private void add(SiTrackerEndcap e)
     {
-    	IDetectorElement de = e.getDetectorElement();
-
-    	for (IDetectorElement endcap : de.getChildren())
-    	{
-    		for (IDetectorElement layer : endcap.getChildren())
-    		{
-    			for (IDetectorElement wedge : layer.getChildren())
-    			{    					                    				    			    		
-    				for (IDetectorElement module : wedge.getChildren())
-    				{    	               
-    	                double x0 = calculateEndcapModuleX0(module);
-    	                
-    	                //System.out.println("module " + module.getName() + " x0 = " + x0);
-    					
-    					IDetectorElement sensor = null;
-    					for (IDetectorElement component : module.getChildren())
-    					{
-    						if (component.getGeometry().getPhysicalVolume().isSensitive())
-    						{
-    							sensor = component;    	   
-    							//System.out.println("sensor - " + component.getName());
-    							break;
-    						}
-    					}
-    	                
-    	                if (sensor == null)
-    	                    throw new RuntimeException("No sensor found!");
-    	                
-    					ISolid solid = sensor.getGeometry().getLogicalVolume().getSolid();
-    					
-    					// TODO: Create ZPlanes here!
-    				}
-    				
-    			}
-    		}
-    	}
-    	
-    }        
+        IDetectorElement de = e.getDetectorElement();
+        
+        for (IDetectorElement endcap : de.getChildren())
+        {
+            for (IDetectorElement layer : endcap.getChildren())
+            {
+                for (IDetectorElement wedge : layer.getChildren())
+                {
+                    for (IDetectorElement module : wedge.getChildren())
+                    {
+                        double x0 = calculateEndcapModuleX0(module);
+                        
+                        //System.out.println("module " + module.getName() + " x0 = " + x0);
+                        
+                        IDetectorElement sensor = null;
+                        for (IDetectorElement component : module.getChildren())
+                        {
+                            if (component.getGeometry().getPhysicalVolume().isSensitive())
+                            {
+                                sensor = component;
+                                //System.out.println("sensor - " + component.getName());
+                                break;
+                            }
+                        }
+                        
+                        if (sensor == null)
+                            throw new RuntimeException("No sensor found!");
+                        
+                        ISolid solid = sensor.getGeometry().getLogicalVolume().getSolid();
+                        
+                        // TODO: Create ZPlanes here!
+                    }
+                    
+                }
+            }
+        }
+        
+    }
     
     // return effective x/x0 for this layer
     private double calculateLayerX0( Layer layer)
@@ -460,63 +460,62 @@
     }
     
     private double calculateEndcapModuleX0(IDetectorElement module)
-    {    
-    	System.out.println(module.getName() + " - calculateModuleX0");
-    	double xOverX0 = 0.;
+    {
+        double xOverX0 = 0.;
         for (IPhysicalVolume component : module.getGeometry().getLogicalVolume().getDaughters())
         {
-        	ISolid solid = component.getLogicalVolume().getSolid();
-        	double thickness = 0.;
-        	if (solid instanceof Box)
-        	{
-        		thickness = ((Box)solid).getYHalfLength() * 2;
-        		//System.out.println("box thickness " + thickness);
-        	}
-        	else if (solid instanceof Trd)
-        	{
-        		thickness = ((Trd)solid).getYHalfLength1() * 2;
-        		//System.out.println("trd thickness " + thickness);
-        	}        	
-        	else if (solid instanceof Trap)
-        	{        		
-        		thickness = ((Trap)solid).getYHalfLength1() * 2;
-        		//System.out.println("trap thickness " + thickness);
-        	}
-        	else 
-        	{
-        		throw new RuntimeException("Unknown solid type " + solid.getClass().getCanonicalName() + " for module " + module.getName() + "!");
-        	}
+            ISolid solid = component.getLogicalVolume().getSolid();
+            double thickness = 0.;
+            if (solid instanceof Box)
+            {
+                thickness = ((Box)solid).getYHalfLength() * 2;
+                //System.out.println("box thickness " + thickness);
+            }
+            else if (solid instanceof Trd)
+            {
+                thickness = ((Trd)solid).getYHalfLength1() * 2;
+                //System.out.println("trd thickness " + thickness);
+            }
+            else if (solid instanceof Trap)
+            {
+                thickness = ((Trap)solid).getYHalfLength1() * 2;
+                //System.out.println("trap thickness " + thickness);
+            }
+            else
+            {
+                throw new RuntimeException("Unknown solid type " + solid.getClass().getCanonicalName() + " for module " + module.getName() + "!");
+            }
             IMaterial material = component.getLogicalVolume().getMaterial();
             double x0 = material.getRadiationLengthWithDensity();
             xOverX0 += thickness/(x0*cm);
         }
         return xOverX0;
-    }  
+    }
     
     private double calculateBarrelModuleX0(IDetectorElement module)
-    {    
-    	//System.out.println(module.getName() + " - calculateModuleX0");
-    	double xOverX0 = 0.;
+    {
+        //System.out.println(module.getName() + " - calculateModuleX0");
+        double xOverX0 = 0.;
         for (IPhysicalVolume component : module.getGeometry().getLogicalVolume().getDaughters())
         {
-        	ISolid solid = component.getLogicalVolume().getSolid();
-        	double thickness = 0.;
-        	if (solid instanceof Box)
-        	{
-        		thickness = ((Box)solid).getZHalfLength() * 2;
-        		//System.out.println("box thickness " + thickness);
-        	}
-        	else 
-        	{
-        		throw new RuntimeException("Unknown solid type " + solid.getClass().getCanonicalName() + " for module " + module.getName() + "!");
-        	}
+            ISolid solid = component.getLogicalVolume().getSolid();
+            double thickness = 0.;
+            if (solid instanceof Box)
+            {
+                thickness = ((Box)solid).getZHalfLength() * 2;
+                //System.out.println("box thickness " + thickness);
+            }
+            else
+            {
+                throw new RuntimeException("Unknown solid type " + solid.getClass().getCanonicalName() + " for module " + module.getName() + "!");
+            }
             IMaterial material = component.getLogicalVolume().getMaterial();
             double x0 = material.getRadiationLengthWithDensity();
             xOverX0 += thickness/(x0*cm);
         }
         return xOverX0;
-    }               
-        
+    }
+    
     public static void main(String[] args)
     {
         GtrDetector gtrdet = new  GtrDetector("sid01");
CVSspam 0.2.8