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

Testing .cpp with w/o 2 using xml

parent a76a641a
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.
......@@ -40,7 +40,7 @@
<!-- change this -->
<comment>Common Generic visualization attributes</comment>
<display>
<vis name="ci_GEMVis" r= "0.8" g="0.4" b="0.3" alpha="0.8" 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 -->
......
......@@ -54,7 +54,7 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens
int detID = 1;
xml::Component dims = detElem.dimensions();
double SizeZ = 30. * dd4hep::cm; // Size in Z direction
double SizeZ = 30. * dd4hep::cm; // Size in Z direction
double ROut = 95. * dd4hep::cm; // Outer radius
double RIn = 10. * dd4hep::cm; // Inner radius
double ShiftZ = 0. * dd4hep::cm;
......@@ -71,26 +71,21 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens
PlacedVolume detPV = motherVol.placeVolume(detVol, RotationZYX(0,0,0));
detPV.addPhysVolID("system", detID);
det.setPlacement(detPV);
//detVol.setVisAttributes(desc.visAttributes(detElem.visStr()));
//Adding layers to placed volume
int layerNum = 0;
for (cml_coll_t c(detElem, _U(layer)); c; c++)
{
for (int layerNum = 0; layerNum < Nlayers; layerNum++){
xml_comp_t x_layer = c;
string layer_name = detName + _toString(layerNum, "_layer%d");
double lrmin, lrmax, lz;
lrmin = RIn + (1.0 + 0.5 * layerNum) * dd4hep::cm;
lrmax = ROut + (-25.0 + 2.0 * layerNum) * dd4hep::cm;
lz = sizez * 0.5 + (5.0 + 3. * layerNum) * dd4hep::cm;
Volume layer_vol(layer_name, Tube(lrmin, lrmax, lz ), mat);
Volume layer_vol(layer_name, Tube(lrmin, lrmax, 1.0 * dd4hep::cm), mat);
Position layer_pos(0, 0, lz);
DetElement layer(det, layer_name, detID);
//layer.setAttributes(desc, layer_vol, , , );//(region, limits, visable).
layer.setVisAttributes(desc.visAttributes(det.visStr()));
//layer.setAttributes(desc, layer_vol, desc.region(), desc.limits(), );//(region, limits, visable).
PlacedVolume layer_phv = detVol.placeVolume(layer_vol, layer_pos);
layer_phv.addPhysVolID("layer", layerNum);
layer.setPlacement(layer_phv);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment