Skip to content

Commit 44b5b1f

Browse files
paulgessingerMikkel Moller Modekjaer
authored andcommitted
revert: feat: move ROOT surface material map I/O to plugins [originally acts-project#4400] (acts-project#4424)
This reverts commit d036765.
1 parent 235542f commit 44b5b1f

31 files changed

+1059
-1712
lines changed

Core/include/Acts/Material/MaterialMapper.hpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "Acts/MagneticField/MagneticFieldContext.hpp"
1313
#include "Acts/Material/MaterialInteraction.hpp"
1414
#include "Acts/Material/MaterialInteractionAssignment.hpp"
15-
#include "Acts/Material/TrackingGeometryMaterial.hpp"
1615
#include "Acts/Material/interface/IAssignmentFinder.hpp"
1716
#include "Acts/Material/interface/ISurfaceMaterialAccumulater.hpp"
1817
#include "Acts/Utilities/Logger.hpp"
@@ -25,6 +24,14 @@ namespace Acts {
2524
/// @brief material mapping procedure
2625
class MaterialMapper {
2726
public:
27+
/// @brief The material maps
28+
using SurfaceMaterialMaps =
29+
std::map<GeometryIdentifier, std::shared_ptr<const ISurfaceMaterial>>;
30+
using VolumeMaterialMaps =
31+
std::map<GeometryIdentifier, std::shared_ptr<const IVolumeMaterial>>;
32+
using DetectorMaterialMaps =
33+
std::pair<SurfaceMaterialMaps, VolumeMaterialMaps>;
34+
2835
/// @brief nested configuration struct
2936
struct Config {
3037
// The assignment finder
@@ -76,7 +83,7 @@ class MaterialMapper {
7683
const Options& options = Options{}) const;
7784

7885
/// Finalize the maps
79-
TrackingGeometryMaterial finalizeMaps(const State& state) const;
86+
DetectorMaterialMaps finalizeMaps(const State& state) const;
8087

8188
private:
8289
/// Access method to the logger

Core/include/Acts/Material/TrackingGeometryMaterial.hpp

Lines changed: 0 additions & 28 deletions
This file was deleted.

Core/src/Material/MaterialMapper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ Acts::MaterialMapper::mapMaterial(State& state, const GeometryContext& gctx,
7979
return {mappedMaterial, unmappedMaterial};
8080
}
8181

82-
Acts::TrackingGeometryMaterial Acts::MaterialMapper::finalizeMaps(
82+
Acts::MaterialMapper::DetectorMaterialMaps Acts::MaterialMapper::finalizeMaps(
8383
const State& state) const {
8484
// The final maps
85-
TrackingGeometryMaterial detectorMaterialMaps;
85+
DetectorMaterialMaps detectorMaterialMaps;
8686
// The surface maps
8787
detectorMaterialMaps.first =
8888
m_cfg.surfaceMaterialAccumulater->finalizeMaterial(

Examples/Algorithms/MaterialMapping/include/ActsExamples/MaterialMapping/IMaterialWriter.hpp

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,23 @@
99
#pragma once
1010

1111
#include "Acts/Geometry/GeometryIdentifier.hpp"
12-
#include "Acts/Material/TrackingGeometryMaterial.hpp"
12+
13+
#include <map>
14+
#include <memory>
15+
16+
namespace Acts {
17+
18+
class ISurfaceMaterial;
19+
class IVolumeMaterial;
20+
21+
using SurfaceMaterialMap =
22+
std::map<GeometryIdentifier, std::shared_ptr<const ISurfaceMaterial>>;
23+
24+
using VolumeMaterialMap =
25+
std::map<GeometryIdentifier, std::shared_ptr<const IVolumeMaterial>>;
26+
27+
using DetectorMaterialMaps = std::pair<SurfaceMaterialMap, VolumeMaterialMap>;
28+
} // namespace Acts
1329

1430
namespace ActsExamples {
1531

@@ -24,8 +40,7 @@ class IMaterialWriter {
2440
/// The single writer class
2541
///
2642
/// @param detMaterial the detector material maps
27-
virtual void writeMaterial(
28-
const Acts::TrackingGeometryMaterial& detMaterial) = 0;
43+
virtual void writeMaterial(const Acts::DetectorMaterialMaps& detMaterial) = 0;
2944
};
3045

3146
} // namespace ActsExamples

Examples/Algorithms/MaterialMapping/include/ActsExamples/MaterialMapping/MappingMaterialDecorator.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ class MappingMaterialDecorator : public IMaterialDecorator {
4141
public:
4242
using BinningMap = std::map<std::uint64_t, std::pair<int, int>>;
4343

44+
using VolumeMaterialMap =
45+
std::map<GeometryIdentifier, std::shared_ptr<const IVolumeMaterial>>;
46+
4447
MappingMaterialDecorator(const Acts::TrackingGeometry& tGeometry,
4548
Acts::Logging::Level level,
4649
bool clearSurfaceMaterial = true,
@@ -273,7 +276,7 @@ class MappingMaterialDecorator : public IMaterialDecorator {
273276
private:
274277
BinningMap m_binningMap;
275278

276-
VolumeMaterialMaps m_volumeMaterialMap;
279+
VolumeMaterialMap m_volumeMaterialMap;
277280

278281
bool m_clearSurfaceMaterial{true};
279282
bool m_clearVolumeMaterial{true};

Examples/Algorithms/MaterialMapping/include/ActsExamples/MaterialMapping/MaterialMapping.hpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include "Acts/MagneticField/MagneticFieldContext.hpp"
1414
#include "Acts/Material/MaterialInteraction.hpp"
1515
#include "Acts/Material/SurfaceMaterialMapper.hpp"
16-
#include "Acts/Material/TrackingGeometryMaterial.hpp"
1716
#include "Acts/Material/VolumeMaterialMapper.hpp"
1817
#include "Acts/Utilities/Logger.hpp"
1918
#include "ActsExamples/Framework/DataHandle.hpp"
@@ -33,7 +32,18 @@
3332
#include <vector>
3433

3534
namespace Acts {
35+
3636
class TrackingGeometry;
37+
class ISurfaceMaterial;
38+
class IVolumeMaterial;
39+
40+
using SurfaceMaterialMap =
41+
std::map<GeometryIdentifier, std::shared_ptr<const ISurfaceMaterial>>;
42+
43+
using VolumeMaterialMap =
44+
std::map<GeometryIdentifier, std::shared_ptr<const IVolumeMaterial>>;
45+
46+
using DetectorMaterialMaps = std::pair<SurfaceMaterialMap, VolumeMaterialMap>;
3747
} // namespace Acts
3848

3949
namespace ActsExamples {

Examples/Algorithms/MaterialMapping/src/CoreMaterialMapping.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ CoreMaterialMapping::CoreMaterialMapping(const CoreMaterialMapping::Config& cfg,
3636
}
3737

3838
CoreMaterialMapping::~CoreMaterialMapping() {
39-
Acts::TrackingGeometryMaterial detectorMaterial =
39+
Acts::DetectorMaterialMaps detectorMaterial =
4040
m_cfg.materialMapper->finalizeMaps(*m_mappingState);
4141
// Loop over the available writers and write the maps
4242
for (auto& imw : m_cfg.materiaMaplWriters) {

Examples/Algorithms/MaterialMapping/src/MaterialMapping.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ MaterialMapping::MaterialMapping(const MaterialMapping::Config& cfg,
4949

5050
ProcessCode MaterialMapping::finalize() {
5151
ACTS_INFO("Finalizing material mappig output");
52-
Acts::TrackingGeometryMaterial detectorMaterial;
52+
Acts::DetectorMaterialMaps detectorMaterial;
5353

5454
if (m_cfg.materialSurfaceMapper && m_cfg.materialVolumeMapper) {
5555
// Finalize all the maps using the cached state

Examples/Io/Json/include/ActsExamples/Io/Json/JsonMaterialWriter.hpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "Acts/Geometry/GeometryIdentifier.hpp"
1313
#include "Acts/Material/ISurfaceMaterial.hpp"
1414
#include "Acts/Material/IVolumeMaterial.hpp"
15-
#include "Acts/Material/TrackingGeometryMaterial.hpp"
1615
#include "Acts/Plugins/Json/MaterialMapJsonConverter.hpp"
1716
#include "Acts/Utilities/EnumBitwiseOperators.hpp"
1817
#include "Acts/Utilities/Logger.hpp"
@@ -28,7 +27,18 @@
2827
#include <utility>
2928

3029
namespace Acts {
30+
3131
class TrackingGeometry;
32+
class ISurfaceMaterial;
33+
class IVolumeMaterial;
34+
35+
using SurfaceMaterialMap =
36+
std::map<GeometryIdentifier, std::shared_ptr<const ISurfaceMaterial>>;
37+
38+
using VolumeMaterialMap =
39+
std::map<GeometryIdentifier, std::shared_ptr<const IVolumeMaterial>>;
40+
41+
using DetectorMaterialMaps = std::pair<SurfaceMaterialMap, VolumeMaterialMap>;
3242
} // namespace Acts
3343

3444
namespace ActsExamples {
@@ -69,8 +79,7 @@ class JsonMaterialWriter : public IMaterialWriter {
6979
/// Write out the material map
7080
///
7181
/// @param detMaterial is the SurfaceMaterial and VolumeMaterial maps
72-
void writeMaterial(
73-
const Acts::TrackingGeometryMaterial& detMaterial) override;
82+
void writeMaterial(const Acts::DetectorMaterialMaps& detMaterial) override;
7483

7584
/// Write out the material map from Geometry
7685
///

Examples/Io/Json/src/JsonMaterialWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ ActsExamples::JsonMaterialWriter::JsonMaterialWriter(
2828
ActsExamples::JsonMaterialWriter::~JsonMaterialWriter() = default;
2929

3030
void ActsExamples::JsonMaterialWriter::writeMaterial(
31-
const Acts::TrackingGeometryMaterial& detMaterial) {
31+
const Acts::DetectorMaterialMaps& detMaterial) {
3232
// Evoke the converter
3333
auto jOut = m_converter->materialMapsToJson(detMaterial);
3434
// And write the file(s)

0 commit comments

Comments
 (0)