Skip to content

Commit

Permalink
enable pw optimisation
Browse files Browse the repository at this point in the history
  • Loading branch information
maciacco committed Oct 1, 2024
1 parent 3f72471 commit a9fcf2b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Detectors/Base/include/DetectorsBase/GeometryManagerParam.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ namespace o2

struct GeometryManagerParam : public o2::conf::ConfigurableParamHelper<GeometryManagerParam> {
bool useParallelWorld = false;
bool usePwGeoBVH = false;
bool usePwCaching = false;

O2ParamDef(GeometryManagerParam, "GeometryManagerParam");
};
Expand Down
12 changes: 11 additions & 1 deletion Steer/src/O2MCApplication.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#include <cstdlib>

#include <Steer/O2MCApplication.h>
#include <fairmq/Channel.h>
#include <fairmq/Message.h>
Expand Down Expand Up @@ -188,9 +190,17 @@ bool O2MCApplicationBase::MisalignGeometry()
auto alignedgeomfile = o2::base::NameConf::getAlignedGeomFileName(confref.getOutPrefix());
gGeoManager->Export(alignedgeomfile.c_str());

auto& param = o2::GeometryManagerParam::Instance();

// fill parallel world geometry if activated
if (o2::GeometryManagerParam::Instance().useParallelWorld) {
if (param.useParallelWorld) {
TGeoParallelWorld* pw = gGeoManager->CreateParallelWorld("priority_sensors");
if (param.usePwGeoBVH) {
pw->SetAccelerationMode(TGeoParallelWorld::AccelerationMode::kBVH);
}
if (param.usePwCaching) {
TGeoNavigator::SetPWSafetyCaching(true);
}
for (auto det : listDetectors) {
if (dynamic_cast<o2::base::Detector*>(det)) {
((o2::base::Detector*)det)->fillParallelWorld();
Expand Down

0 comments on commit a9fcf2b

Please sign in to comment.