GeomConverter/src/org/lcsim/detector/converter/compact
diff -u -r1.9 -r1.10
--- SiTrackerBarrelConverter.java 8 May 2007 00:17:30 -0000 1.9
+++ SiTrackerBarrelConverter.java 8 May 2007 00:30:59 -0000 1.10
@@ -19,17 +19,19 @@
import org.lcsim.detector.PhysicalVolume;
import org.lcsim.detector.Rotation3D;
import org.lcsim.detector.Transform3D;
+import org.lcsim.detector.identifier.ExpandedIdentifier;
+import org.lcsim.detector.identifier.IIdentifier;
import org.lcsim.detector.material.IMaterial;
import org.lcsim.detector.material.MaterialStore;
import org.lcsim.detector.solids.Box;
import org.lcsim.detector.solids.ISolid;
import org.lcsim.detector.solids.Tube;
+import org.lcsim.detector.tracker.silicon.ChargeCarrier;
import org.lcsim.detector.tracker.silicon.SiSensor;
import org.lcsim.detector.tracker.silicon.SiStrips;
-import org.lcsim.detector.tracker.silicon.ChargeCarrier;
-import org.lcsim.detector.tracker.silicon.SiSensor.Orientation;
import org.lcsim.detector.tracker.silicon.SiTrackerBarrelLayer;
import org.lcsim.detector.tracker.silicon.SiTrackerBarrelModule;
+import org.lcsim.detector.tracker.silicon.SiSensor.Orientation;
import org.lcsim.geometry.compact.Detector;
import org.lcsim.geometry.compact.Subdetector;
import org.lcsim.geometry.subdetector.SiTrackerBarrel;
@@ -466,7 +468,7 @@
private void setupSensorDetectorElements(Subdetector subdet)
{
//System.out.println("setupDetectorElements");
- int sensorID=0;
+ int moduleId=0;
for ( IDetectorElement layer : subdet.getDetectorElement().getChildren() )
{
for ( IDetectorElement module : layer.getChildren() )
@@ -477,24 +479,50 @@
IPhysicalVolume modulePhysVol =
modulePath.getLeafVolume();
+ int sensorId=0;
for ( IPhysicalVolume pv : modulePhysVol.getLogicalVolume().getDaughters())
{
if ( pv.isSensitive() )
{
+ // Create the identifier for this sensor.
+ ExpandedIdentifier expId = new ExpandedIdentifier();
+
+ // system Id
+ expId.addValue(subdet.getSystemID());
+
+ // barrel-endcap
+ expId.addValue(0);
+
+ // layer
+ expId.addValue(layer.getGeometry().getPhysicalVolumePath().getLeafVolume().getCopyNumber());
+
+ // module
+ expId.addValue(moduleId);
+
+ // sensor
+ expId.addValue(sensorId);
+
+ // Create the package id.
+ IIdentifier id = subdet.getDetectorElement().getIdentifierHelper().pack( expId );
+
//System.out.println(pv.getName() + " is sens");
//System.out.println("path : " + modulePath.toString() + "/" + pv.getName());
String sensorPath = modulePath.toString() + "/" + pv.getName();
- String sensorName = subdet.getName() + "_sensor" + sensorID;
- SiSensor sensor = new SiSensor(sensorID, sensorName, module, sensorPath);
+ String sensorName = subdet.getName() + "_module" + moduleId + "_sensor" + sensorId;
+ SiSensor sensor = new SiSensor(sensorId, sensorName, module, sensorPath);
+ sensor.setIdentifier( id );
sensor.setElectrodes(ChargeCarrier.HOLE,new SiStrips(3679,0.025,0));
// sensor.setElectrodes(ChargeCarrier.ELECTRON,new SiStrips(3679,0.025,1));
sensor.setElectrodeAngle(ChargeCarrier.HOLE,0.0);
// sensor.setElectrodeAngle(ChargeCarrier.ELECTRON,0.0);
sensor.setOrientation(Orientation.PSIDE_POSITIVE_Z);
sensor.initialize();
- ++sensorID;
+
+ ++sensorId;
}
}
+
+ ++moduleId;
}
}
}
GeomConverter/src/org/lcsim/geometry/compact/converter/lcdd
diff -u -r1.3 -r1.4
--- SiTrackerBarrel.java 18 Oct 2006 20:38:42 -0000 1.3
+++ SiTrackerBarrel.java 8 May 2007 00:30:59 -0000 1.4
@@ -187,7 +187,9 @@
//
//String module_lkp_name = layer.getAttributeValue("module");
-
+
+ int module = 0;
+
// Loop over the number of modules in phi.
for (int ii = 0; ii < nphi; ii++)
{
@@ -245,8 +247,10 @@
PhysVol module_physvol = new PhysVol(module_envelope);
module_physvol.setPosition(module_position);
module_physvol.setRotation(module_rotation);
- module_physvol.addPhysVolID("phi", ii);
- module_physvol.addPhysVolID("z", j);
+ //module_physvol.addPhysVolID("phi", ii);
+ //module_physvol.addPhysVolID("z", j);
+ module_physvol.addPhysVolID("module", module);
+ ++module;
layer_volume.addPhysVol(module_physvol);
// Adjust the x and y coordinates of the module.