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

Working on ci_GEM, volume issue

parent 56570e61
No related branches found
No related tags found
1 merge request!26Fix material
Pipeline #7714 failed
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 @@ ...@@ -45,7 +45,7 @@
<!-- change this --> <!-- change this -->
<comment>Common Generic visualization attributes</comment> <comment>Common Generic visualization attributes</comment>
<display> <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> </display>
<!-- Define detector --> <!-- Define detector -->
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
</comment> </comment>
<detector id="ci_GEM_id" name="ci_GEM" type="ci_GEM" insideTrackingVolume="false" vis="ci_GEMVis"> <detector id="ci_GEM_id" name="ci_GEM" type="ci_GEM" insideTrackingVolume="false" vis="ci_GEMVis">
<material name="Ar10CO2"/> <!-- G4_Galactic --> <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="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="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" /> <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 ...@@ -16,37 +16,34 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens
double ROut = dims.rmax(); // Outer radius double ROut = dims.rmax(); // Outer radius
double RIn = dims.rmin(); // Inner radius double RIn = dims.rmin(); // Inner radius
double ShiftZ = dims.delta(); double ShiftZ = dims.delta();
double PosX = dims.posx(); double X = dims.x();
double PosZ = dims.posz(); double Z = dims.z();
int Nlayers = dims.nlayers(); int Nlayers = dims.nlayers();
Material mat = desc.material(detElem.materialStr()); 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); Tube ci_GEM_GVol_Solid(RIn, ROut, SizeZ / 2., 0., 360 * deg);
Volume detVol("ci_GEM_GVol_Logic", ci_GEM_GVol_Solid, mat); 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++) for (cml_coll_t c(detElem, _U(layer)); c; c++)
{ {
xml_comp_t x_layer = c; xml_comp_t x_layer = c;
string layer_name = detName + _toString(c.id(), "_layer%d"); string layer_name = detName + _toString(c.id(), "_layer%d");
Volume layer_vol(layer_name, Tube(c.rmin(), c.rmax(), c.z() ), mat ); Volume layer_vol(layer_name, Tube(c.rmin(), c.rmax(), c.z() ), mat );
Position layer_pos(0, 0, fnz); layer_vol.
pv = envelopeVol.placeVolume(layer_vol, layer_pos); Position layer_pos(0, 0, 0);
pv.addPhysVolID("layer", c.id() ); 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); det.setPlacement(detPV);
return det; return det;
} }
// clang-format off // clang-format off
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment