Skip to content

Commit

Permalink
LinearSortingPolicy: ignore unavailable extension error and adapt tre…
Browse files Browse the repository at this point in the history
…atment for it
  • Loading branch information
andresailer committed Feb 16, 2024
1 parent 36bd6ba commit 9889d01
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plugins/LinearSortingPolicy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,13 @@ namespace {

dd4hep::rec::DoubleParameters* para = nullptr;
try { // use existing map, or create a new one
para = ddsurf->detElement().extension<dd4hep::rec::DoubleParameters>();
para = ddsurf->detElement().extension<dd4hep::rec::DoubleParameters>(false);
if(not para) {
para = new dd4hep::rec::DoubleParameters;
ddsurf->detElement().addExtension<dd4hep::rec::DoubleParameters>(para);
}
para->doubleParameters["SortingPolicy"] = rValue;
} catch(...){
} catch(...) {
para = new dd4hep::rec::DoubleParameters;
para->doubleParameters["SortingPolicy"] = rValue;
ddsurf->detElement().addExtension<dd4hep::rec::DoubleParameters>(para);
Expand Down

0 comments on commit 9889d01

Please sign in to comment.