Skip to content
Snippets Groups Projects
Commit ff4166c9 authored by guofangyi@ihep.ac.cn's avatar guofangyi@ihep.ac.cn
Browse files

correct id, add comment

parent 0784c8a3
No related branches found
No related tags found
No related merge requests found
......@@ -38,7 +38,7 @@
grid_size_x="1*cm"
grid_size_y="1*cm"
grid_size_z="1*cm"/-->
<id>block:8,layer:12,piece:12,bar:12</id>
<id>system:8,layer:12,block:12,bar:12</id>
</readout>
</readouts>
......
......@@ -88,7 +88,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
bar_odd.setSensitiveDetector(sens);
for(int iz=1; iz<=Nbarz_odd;iz++){
dd4hep::PlacedVolume plv = det_vol.placeVolume(bar_odd, Position((2*iphi-1)*barz_odd/2-lx, (2*iz-1)*barx/2-dim_y, (2*ilayer-1)*bary/2-dim_z));
plv.addPhysVolID("layer", ilayer).addPhysVolID("piece", iphi).addPhysVolID("bar", iz);
plv.addPhysVolID("layer", ilayer).addPhysVolID("block", iphi).addPhysVolID("bar", iz);
std::string barname = "CrystalBar_"+std::to_string(ilayer)+"_"+std::to_string(iphi)+"_"+std::to_string(iz);
dd4hep::DetElement sd(stavedet, barname, detid);
sd.setPlacement(plv);
......@@ -107,7 +107,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
//Loop in Z direction
for(int iz=1; iz<=Nbarz_even;iz++){
dd4hep::PlacedVolume plv = det_vol.placeVolume(bar_even, Position(lx-(2*iphi-1)*bary/2, (2*iz-1)*barz_even/2-dim_y, (2*ilayer-1)*bary/2-dim_z));
plv.addPhysVolID("layer", ilayer).addPhysVolID("piece", iphi).addPhysVolID("bar", iz);
plv.addPhysVolID("layer", ilayer).addPhysVolID("block", iphi).addPhysVolID("bar", iz);
std::string barname = "CrystalBar_"+std::to_string(ilayer)+"_"+std::to_string(iphi)+"_"+std::to_string(iz);
dd4hep::DetElement sd(stavedet, barname, detid);
sd.setPlacement(plv);
......@@ -125,7 +125,7 @@ static dd4hep::Ref_t create_detector(dd4hep::Detector& theDetector,
double posy = r0*cos(rotAngle) - dx*sin(rotAngle);
dd4hep::Transform3D transform(dd4hep::RotationZ(rotAngle)*dd4hep::RotationX(-90*degree), dd4hep::Position(posx, posy, 0.));
dd4hep::PlacedVolume plv = envelopeVol.placeVolume(det_vol, transform);
plv.addPhysVolID("block", i);
plv.addPhysVolID("system", i);
DetElement sd(ECAL, _toString(i,"trap%3d"), detid);
sd.setPlacement(plv);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment