Print

Print


Commit in GeomConverter/src/org/lcsim/detector on MAIN
converter/compact/SiTrackerBarrelConverter.java+19-161.11 -> 1.12
tracker/silicon/SiTrackerBarrelModule.java+6-151.1 -> 1.2
+25-31
2 modified files
JM: Implementation of identifiers for SiSensor.

GeomConverter/src/org/lcsim/detector/converter/compact
SiTrackerBarrelConverter.java 1.11 -> 1.12
diff -u -r1.11 -r1.12
--- SiTrackerBarrelConverter.java	8 May 2007 00:53:30 -0000	1.11
+++ SiTrackerBarrelConverter.java	8 May 2007 01:22:27 -0000	1.12
@@ -229,7 +229,6 @@
         
 //      Build the layers.
         int nlayer = 0;
-        int sensorNumber = 0;
         for (Iterator i = node.getChildren("layer").iterator(); i.hasNext(); nlayer++)
         {
             // Get the next layer element.
@@ -349,6 +348,8 @@
 
             //String module_lkp_name = layer.getAttributeValue("module");
 
+            int moduleId=0;
+            
             // Loop over the number of modules in phi.
             for (int phicount = 0; phicount < nphi; phicount++)
             {
@@ -419,7 +420,7 @@
                                 module_place_name,
                                 moduleEnvelope,
                                 layer_volume,
-                                sensorNumber
+                                moduleId
                                 );
                     
                     String modulePath = 
@@ -429,11 +430,11 @@
                             module_place_name, 
                             layerDE, 
                             modulePath,
-                            phicount,
-                            zcount);
-                                                            
-                    ++sensorNumber;
-                                                            
+                            moduleId);
+                    
+                    // Increment the by-layer module number.
+                    ++moduleId;
+                                                                                                                        
                     // Adjust the x and y coordinates of the module.
                     x += dx;
                     y += dy;
@@ -470,7 +471,6 @@
     
     private void setupSensorDetectorElements(Subdetector subdet)
     {
-        //System.out.println("setupDetectorElements");
         int moduleId=0;
         for ( IDetectorElement layer : subdet.getDetectorElement().getChildren() )
         {
@@ -490,27 +490,29 @@
                         // Create the identifier for this sensor.
                         ExpandedIdentifier expId = new ExpandedIdentifier();
                         
-                        // system Id
+                        // Set the System ID.
                         expId.addValue(subdet.getSystemID());
                         
-                        // barrel-endcap
+                        // Set the barrel-endcap flag.
                         expId.addValue(0);
                         
-                        // layer
+                        // Set the layer number.
                         expId.addValue(layer.getGeometry().getPhysicalVolumePath().getLeafVolume().getCopyNumber());
                         
-                        // module
-                        expId.addValue(moduleId);
+                        // Set the module id from the DetectorElement.
+                        expId.addValue(((SiTrackerBarrelModule)module).getModuleId());
                         
-                        // sensor
+                        // Set the sensor id for double-sided.
                         expId.addValue(sensorId);
                         
-                        // Get the identifier dictionary.  (Subdetector doesn't have this ref yet.)
+                        // Get the identifier dictionary from the manager.  
+                        // Subdetector doesn't have this reference setup yet.
                         IIdentifierDictionary iddict = 
                             IdentifierDictionaryManager.getInstance().
                             getIdentifierDictionary( subdet.getReadout().getName() );
                         
-                        // Create the packed id using util method.  (No IdentifierHelper made yet.)
+                        // Create the packed id using util method.  
+                        // No IdentifierHelper is available yet.
                         IIdentifier id = IdentifierUtil.pack( expId, iddict );
                         
                         //System.out.println(pv.getName() + " is sens");
@@ -526,6 +528,7 @@
                         sensor.setOrientation(Orientation.PSIDE_POSITIVE_Z);
                         sensor.initialize();
                         
+                        // Incremenet sensorID for double-sided.
                         ++sensorId;                        
                     }
                 }

GeomConverter/src/org/lcsim/detector/tracker/silicon
SiTrackerBarrelModule.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- SiTrackerBarrelModule.java	20 Apr 2007 00:16:54 -0000	1.1
+++ SiTrackerBarrelModule.java	8 May 2007 01:22:27 -0000	1.2
@@ -10,28 +10,19 @@
  */ 
 public class SiTrackerBarrelModule extends DetectorElement
 {
-    private int phiNumber;
-    private int zNumber;
+    private int moduleId;
     
     public SiTrackerBarrelModule(String name,
             IDetectorElement parent,
             String path,
-            int phiNumber,
-            int zNumber) 
+            int moduleId) 
     {
         super(name, parent, path);
-        this.phiNumber = phiNumber;
-        this.zNumber = zNumber;
-        //System.out.println(name + " : " + path);
+        this.moduleId = moduleId;
     }
     
-    public int getPhiNumber()
+    public int getModuleId()
     {
-        return phiNumber;
-    }
-    
-    public int getZNumber()
-    {
-        return zNumber;
-    }
+        return moduleId;
+    }    
 }
\ No newline at end of file
CVSspam 0.2.8