GeomConverter/src/org/lcsim/geometry/compact/converter/lcdd
diff -u -r1.5 -r1.6
--- TPC.java 2 Jun 2008 20:37:00 -0000 1.5
+++ TPC.java 20 Jul 2011 21:53:57 -0000 1.6
@@ -41,6 +41,17 @@
double rmin = dimensions.getAttribute("inner_r").getDoubleValue();
double r = rmin;
+ // Displacement of TPC along z axis. This can be positive or negative.
+ double zpos = 0;
+ Element position = node.getChild("position");
+ if (position != null)
+ {
+ if (position.getAttribute("z") != null)
+ {
+ zpos = position.getAttribute("z").getDoubleValue();
+ }
+ }
+
Tube envelope = new Tube(detectorName+"_envelope");
Volume envelopeVolume = new Volume(detectorName+"_envelope_volume");
envelopeVolume.setMaterial(air);
@@ -112,6 +123,7 @@
envelope.setRMax(r);
envelope.setDeltaPhi(Math.PI*2);
PhysVol physvol = new PhysVol(envelopeVolume);
+ physvol.setZ(zpos);
physvol.addPhysVolID("system",id);
physvol.addPhysVolID("barrel",0);
motherVolume.addPhysVol(physvol);
GeomConverter/testResources/org/lcsim/geometry/subdetector
diff -u -r1.1 -r1.2
--- TPCTest.xml 12 Sep 2007 18:24:32 -0000 1.1
+++ TPCTest.xml 20 Jul 2011 21:53:58 -0000 1.2
@@ -26,6 +26,7 @@
<detectors>
<detector id="1" name="TPCTest" type="TPC" readout="TPCHits">
<dimensions inner_r = "100.0*cm" outer_z = "150.0*cm" />
+ <position z="10.0" /> <!-- Just a simple test of z displacement. -->
<layer repeat="10">
<slice material="Nitrogen" thickness="1.0*cm" sensitive="yes" />
</layer>