GeomConverter/src/org/lcsim/geometry/subdetector
diff -u -r1.5 -r1.6
--- SiTrackerBarrel.java 11 Oct 2006 00:16:23 -0000 1.5
+++ SiTrackerBarrel.java 11 Oct 2006 18:17:55 -0000 1.6
@@ -2,6 +2,10 @@
import hep.graphics.heprep.HepRep;
import hep.graphics.heprep.HepRepFactory;
+import hep.graphics.heprep.HepRepInstance;
+import hep.graphics.heprep.HepRepInstanceTree;
+import hep.graphics.heprep.HepRepType;
+import hep.graphics.heprep.HepRepTypeTree;
import java.util.ArrayList;
import java.util.HashMap;
@@ -261,6 +265,25 @@
public void appendHepRep(HepRepFactory factory, HepRep heprep)
{
+ HepRepInstanceTree instanceTree = heprep.getInstanceTreeTop("Detector","1.0");
+ HepRepTypeTree typeTree = heprep.getTypeTree("DetectorType","1.0");
+ HepRepType barrel = typeTree.getType("Barrel");
+
+ HepRepType type = factory.createHepRepType(barrel, getName());
+ type.addAttValue("drawAs","Cylinder");
+
+ for (SiTrackerBarrelLayer layer : _layers)
+ {
+ HepRepInstance instance = factory.createHepRepInstance(instanceTree, type);
+ instance.addAttValue("radius",layer.getInnerRadius());
+ factory.createHepRepPoint(instance,0,0,-layer.getZLength()/2);
+ factory.createHepRepPoint(instance,0,0,layer.getZLength()/2);
+
+ HepRepInstance instance2 = factory.createHepRepInstance(instanceTree, type);
+ instance2.addAttValue("radius",layer.getInnerRadius() + layer.getThickness());
+ factory.createHepRepPoint(instance2,0,0,-layer.getZLength()/2);
+ factory.createHepRepPoint(instance2,0,0,layer.getZLength()/2);
+ }
}
public boolean isBarrel()
GeomConverter/src/org/lcsim/geometry/subdetector/tracker/silicon
diff -u -r1.2 -r1.3
--- SiTrackerBarrelLayer.java 11 Oct 2006 00:08:34 -0000 1.2
+++ SiTrackerBarrelLayer.java 11 Oct 2006 18:17:56 -0000 1.3
@@ -123,6 +123,11 @@
return _z_length;
}
+ public double getThickness()
+ {
+ return (getOuterRadius() - getInnerRadius());
+ }
+
// public CoordinateTransformation3D getModuleCoordinates(int phi_index, int z_index)
// {
//