diff --git a/compact/ci_GEM.xml b/compact/ci_GEM.xml index 9d049d5ff41cf143db0287c7328c5b34349ba50b..7e9514f14a1ea03f0069ae1b5d502d2c025c6cf1 100644 --- a/compact/ci_GEM.xml +++ b/compact/ci_GEM.xml @@ -44,6 +44,7 @@ </comment> <detector id="ci_GEM_id" name="ci_GEM" type="ci_GEM" insideTrackingVolume="false" vis="ci_GEMVis" readout="ci_GEM_Hits"> <material name="Ar10CO2"/> + <position x="0" y="0" z="0"/> <dimensions rmin="ci_GEM_rin" rmax="ci_GEM_rout" z_length="ci_GEM_sizez" z_offset="ci_GEM_shiftz" z="ci_GEM_posz" x="ci_GEM_posx" number="ci_GEM_nlayers" rmax1="ci_HCAL_lay_rin -1. * cm"/> <layer id="0" z="-ci_GEM_sizez * 0.5 + (5 + 3. * 0) * cm" inner_r="ci_GEM_rin + (1. + 0.5 * 0) * cm" outer_r="ci_GEM_rout + (-25. + 2. * 0) * cm" dz="1 * cm" /> <layer id="1" z="-ci_GEM_sizez * 0.5 + (5 + 3. * 1) * cm" inner_r="ci_GEM_rin + (1. + 0.5 * 1) * cm" outer_r="ci_GEM_rout + (-25. + 2. * 1) * cm" dz="1 * cm" /> @@ -66,4 +67,4 @@ <plugins> </plugins> -</lccdd> \ No newline at end of file +</lccdd> diff --git a/src/ci_GEM.cpp b/src/ci_GEM.cpp index 2bd5ab042f7df9df7ce078ecc9af109a1ef08e4e..1b8e3203fe53c7714f0e20c0c9a14d6cc5b075bf 100644 --- a/src/ci_GEM.cpp +++ b/src/ci_GEM.cpp @@ -12,6 +12,7 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens std::string detName = detElem.nameStr(); int detID = detElem.id(); xml::Component dims = detElem.dimensions(); + xml::Component pos = detElem.position(); double SizeZ = dims.z_length(); // Size in Z direction double ROut = dims.rmax(); // Outer radius double RIn = dims.rmin(); // Inner radius @@ -45,7 +46,7 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens DetElement det(detName, detID); Volume motherVol = desc.pickMotherVolume(det); - Transform3D tr(RotationZYX(0.0, 0.0, 0.0), Position(0.0, 0.0, 0.0)); + Transform3D tr(RotationZYX(0.0, 0.0, 0.0), Position(pos.x(), pos.x(), pos.z())); PlacedVolume detPV = motherVol.placeVolume(detVol, tr); detPV.addPhysVolID("system", detID); det.setPlacement(detPV);