-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support using VecGeom without VGDML (#1046)
* Update ReflFactory namespace for VecGeom v1.2.3 * Add CMake support for missing VGDML * Fix vecgeom build when VGDML is unavailable * Try configuring vecgeom to work with geant4 loader (nope) * Add VecgeomParamsOutput with diagnostic information * Make celer_debug_fail a public macro * Improve error checking * Remove G4GDMLParser call now that the scoped logger initailizes the UI manager * Warn if already-loaded vecgeom is not new enough * Fix vecgeom diagnostic messages
- Loading branch information
Showing
13 changed files
with
284 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
//----------------------------------*-C++-*----------------------------------// | ||
// Copyright 2023 UT-Battelle, LLC, and other Celeritas developers. | ||
// See the top-level COPYRIGHT file for details. | ||
// SPDX-License-Identifier: (Apache-2.0 OR MIT) | ||
//---------------------------------------------------------------------------// | ||
//! \file celeritas/ext/VecgeomParamsOutput.cc | ||
//---------------------------------------------------------------------------// | ||
#include "VecgeomParamsOutput.hh" | ||
|
||
#include "celeritas_config.h" | ||
#include "corecel/cont/Range.hh" | ||
#include "corecel/io/JsonPimpl.hh" | ||
|
||
#include "VecgeomParams.hh" // IWYU pragma: keep | ||
#if CELERITAS_USE_JSON | ||
# include <nlohmann/json.hpp> | ||
#endif | ||
|
||
namespace celeritas | ||
{ | ||
//---------------------------------------------------------------------------// | ||
/*! | ||
* Construct from shared vecgeom data. | ||
*/ | ||
VecgeomParamsOutput::VecgeomParamsOutput(SPConstVecgeomParams vecgeom) | ||
: vecgeom_(std::move(vecgeom)) | ||
{ | ||
CELER_EXPECT(vecgeom_); | ||
} | ||
|
||
//---------------------------------------------------------------------------// | ||
/*! | ||
* Write output to the given JSON object. | ||
*/ | ||
void VecgeomParamsOutput::output(JsonPimpl* j) const | ||
{ | ||
#if CELERITAS_USE_JSON | ||
using json = nlohmann::json; | ||
|
||
auto scalars = json::object({ | ||
{"max_depth", vecgeom_->max_depth()}, | ||
{"use_vgdml", vecgeom_->use_vgdml()}, | ||
{"use_surface_tracking", vecgeom_->use_surface_tracking()}, | ||
}); | ||
j->obj = json::object({{"scalars", std::move(scalars)}}); | ||
#else | ||
(void)sizeof(j); | ||
#endif | ||
} | ||
|
||
//---------------------------------------------------------------------------// | ||
} // namespace celeritas |
Oops, something went wrong.