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
......@@ -72,25 +72,20 @@ static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens
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