Skip to content

Commit

Permalink
Update DDFilteredView::parameters() to account for polycones in boole…
Browse files Browse the repository at this point in the history
…an solids
  • Loading branch information
fabiocos committed Feb 15, 2022
1 parent 97b1005 commit 0a18925
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions DetectorDescription/DDCMS/src/DDFilteredView.cc
Original file line number Diff line number Diff line change
Expand Up @@ -541,11 +541,20 @@ const std::vector<double> DDFilteredView::parameters() const {
not dd4hep::isA<dd4hep::PseudoTrap>(currVol.solid())) {
const TGeoCompositeShape* shape = static_cast<const TGeoCompositeShape*>(currVol->GetShape());
const TGeoBoolNode* boolean = shape->GetBoolNode();
while (boolean->GetLeftShape()->IsA() != TGeoBBox::Class()) {
while (boolean->GetLeftShape()->IsA() == TGeoCompositeShape::Class()) {
boolean = static_cast<const TGeoCompositeShape*>(boolean->GetLeftShape())->GetBoolNode();
}
const TGeoBBox* box = static_cast<const TGeoBBox*>(boolean->GetLeftShape());
return {box->GetDX(), box->GetDY(), box->GetDZ()};
if (boolean->GetLeftShape()->IsA() == TGeoBBox::Class()) {
const TGeoBBox* box = static_cast<const TGeoBBox*>(boolean->GetLeftShape());
return {box->GetDX(), box->GetDY(), box->GetDZ()};
} else if (boolean->GetLeftShape()->IsA() == TGeoPcon::Class()) {
const TGeoPcon* pcon = static_cast<const TGeoPcon*>(boolean->GetLeftShape());
double param[4];
pcon->GetBoundingCylinder(param);
return {param[0], param[1], param[2], param[3]};
} else {
throw cms::Exception("DDFilteredView") << "Unknown boolean solid component";
}
} else
return currVol.solid().dimensions();
}
Expand Down

0 comments on commit 0a18925

Please sign in to comment.