diff --git a/ci_GEM.xml b/ci_GEM.xml
index 9a0373299255e499dcc0f8723894db70541c4d9a..4a3e867e16b3378a10ef684b9274de77512c0115 100644
--- a/ci_GEM.xml
+++ b/ci_GEM.xml
@@ -45,7 +45,7 @@
<!-- change this -->
<comment>Common Generic visualization attributes</comment>
<display>
- <vis name="ci_GEMVis" alpha="0.4" r= "0.1" g="0.0" b="0.1" showDaughters="true" visible="true"/>
+ <vis name="ci_GEMVis" r= "0.8" g="0.4" b="0.3" alpha="0.8" showDaughters="true" visible="true"/>
</display>
<!-- Define detector -->
@@ -55,7 +55,7 @@
</comment>
<detector id="ci_GEM_id" name="ci_GEM" type="ci_GEM" insideTrackingVolume="false" vis="ci_GEMVis">
<material name="Ar10CO2"/> <!-- G4_Galactic -->
- <dimensions rmin="ci_GEM_rin" rmax="ci_GEM_rout" sizez="ci_GEM_sizez" delta="ci_GEM_shiftz" posz="ci_GEM_posz" posx="ci_GEM_posx" nlayers="ci_GEM_nlayers"/>
+ <dimensions rmin="ci_GEM_rin" rmax="ci_GEM_rout" sizez="ci_GEM_sizez" delta="ci_GEM_shiftz" z="ci_GEM_posz" x="ci_GEM_posx" nlayers="ci_GEM_nlayers"/>
<layer id="0" z="-sizez * 0.5 + (5 + 3. * id) * cm" inner_r="rmin + (1. + 0.5 * id) * cm" outer_r="rmax + (-25. + 2. * id) * cm" dz="1 * cm" />
<layer id="1" z="-sizez * 0.5 + (5 + 3. * id) * cm" inner_r="rmin + (1. + 0.5 * id) * cm" outer_r="rmax + (-25. + 2. * id) * cm" dz="1 * cm" />
<layer id="2" z="-sizez * 0.5 + (5 + 3. * id) * cm" inner_r="rmin + (1. + 0.5 * id) * cm" outer_r="rmax + (-25. + 2. * id) * cm" dz="1 * cm" />
diff --git a/src/ci_GEM.cpp b/src/ci_GEM.cpp
index 9751d979d540285c13e4cf028b6913e08be8ad1d..c806696ec4ab26288e5ced2637bfee6f4232b51c 100644
--- a/src/ci_GEM.cpp
+++ b/src/ci_GEM.cpp
@@ -16,37 +16,34 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens
double ROut = dims.rmax(); // Outer radius
double RIn = dims.rmin(); // Inner radius
double ShiftZ = dims.delta();
- double PosX = dims.posx();
- double PosZ = dims.posz();
+ double X = dims.x();
+ double Z = dims.z();
int Nlayers = dims.nlayers();
Material mat = desc.material(detElem.materialStr());
-
- Tube envelope(RIn, ROut, SizeZ, 0, 360 * deg);
- //Volume envelopeVol(detName + "_envelope", envelope, det.;
Tube ci_GEM_GVol_Solid(RIn, ROut, SizeZ / 2., 0., 360 * deg);
Volume detVol("ci_GEM_GVol_Logic", ci_GEM_GVol_Solid, mat);
+ detVol.setVisAttributes(desc.visAttributes(detElem.visStr()));
+ DetElement det(detName, detID);
+ Volume motherVol = desc.pickMotherVolume(det);
+ Transform3D tr(RotationZYX(0., 0., 0.), Position(0., 0., ShiftZ));
+ PlacedVolume detPV = motherVol.placeVolume(detVol, tr);
+
+ //Adding layers to placed volume
for (cml_coll_t c(detElem, _U(layer)); c; c++)
{
xml_comp_t x_layer = c;
string layer_name = detName + _toString(c.id(), "_layer%d");
Volume layer_vol(layer_name, Tube(c.rmin(), c.rmax(), c.z() ), mat );
- Position layer_pos(0, 0, fnz);
- pv = envelopeVol.placeVolume(layer_vol, layer_pos);
- pv.addPhysVolID("layer", c.id() );
+ layer_vol.
+ Position layer_pos(0, 0, 0);
+ detPV.placeVolume(layer_vol, layer_pos);
}
-
-
- detVol.setVisAttributes(desc.visAttributes(detElem.visStr()));
-
- DetElement det(detName, detID);
- Volume motherVol = desc.pickMotherVolume(det);
- Transform3D tr(RotationZYX(0., 0., 0.), Position(0., 0., ShiftZ));
- PlacedVolume detPV = motherVol.placeVolume(envelopeVol, tr);
det.setPlacement(detPV);
+
return det;
}
// clang-format off