Skip to content

Commit

Permalink
fix: Fix BinningValue conversions (#2333)
Browse files Browse the repository at this point in the history
In the ATLAS debug build, we're getting failures in the ActsEventCnv test:

```
ActsTrackingGeometrySvc                             FATAL in sysInitialize(): standard std::exception is caught
ActsTrackingGeometrySvc                             ERROR [json.exception.type_error.302] type must be number, but is string
ServiceManager                                      ERROR Unable to initialize service "ActsTrackingGeometrySvc"
```

This is because some compilation units in Plugins/Json try to convert a BinningValue without including the header UtilitiesJsonConverter.hpp which has the NLOHMANN_JSON_SERIALIZE_ENUM declaration for BinningValue. Thus, the conversion can work differently depending on the compilation unit, and the behavior can also depend on what gets inlined, so can differ between the optimized and debug build.

fixes #2331

Co-authored-by: scott-snyder <21222380+scott-snyder@users.noreply.github.com>
  • Loading branch information
andiwand and scott-snyder committed Jul 30, 2023
1 parent 4bc20bf commit d85d3fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions Plugins/Json/src/IndexedSurfacesJsonConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "Acts/Detector/detail/GridAxisGenerators.hpp"
#include "Acts/Navigation/NavigationStateUpdators.hpp"
#include "Acts/Plugins/Json/GridJsonConverter.hpp"
#include "Acts/Plugins/Json/UtilitiesJsonConverter.hpp"

#include <array>
#include <memory>
Expand Down
1 change: 1 addition & 0 deletions Plugins/Json/src/PortalJsonConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "Acts/Navigation/DetectorVolumeUpdators.hpp"
#include "Acts/Plugins/Json/DetrayJsonHelper.hpp"
#include "Acts/Plugins/Json/SurfaceJsonConverter.hpp"
#include "Acts/Plugins/Json/UtilitiesJsonConverter.hpp"
#include "Acts/Surfaces/CylinderBounds.hpp"
#include "Acts/Surfaces/CylinderSurface.hpp"
#include "Acts/Surfaces/DiscSurface.hpp"
Expand Down

0 comments on commit d85d3fd

Please sign in to comment.