Skip to content
Snippets Groups Projects
Commit 2b4ad3ed authored by Marshall Scott's avatar Marshall Scott
Browse files

Working on ci_GEM, volume issue

parent d7b3650f
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !12. Comments created here will be created in the context of that merge request.
......@@ -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" />
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment