File indexing completed on 2025-10-18 08:22:07
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Definitions/Common.hpp"
0013 #include "Acts/Surfaces/Surface.hpp"
0014
0015 #include <array>
0016 #include <memory>
0017 #include <tuple>
0018
0019 namespace CLHEP {
0020 class Hep3Vector;
0021 class HepRotation;
0022 }
0023
0024 namespace HepGeom {
0025 class Transform3D;
0026 }
0027
0028 namespace Acts {
0029 class AnnulusBounds;
0030 class CylinderBounds;
0031 class RadialBounds;
0032 class RectangleBounds;
0033 class TrapezoidBounds;
0034 class PlanarBounds;
0035 class LineBounds;
0036 class Material;
0037 class HomogeneousSurfaceMaterial;
0038 class HomogeneousVolumeMaterial;
0039 class CylinderVolumeBounds;
0040
0041 }
0042
0043 class G4Box;
0044 class G4Material;
0045 class G4Trd;
0046 class G4Trap;
0047 class G4Tubs;
0048 class G4VSolid;
0049 class G4VPhysicalVolume;
0050 using G4ThreeVector = CLHEP::Hep3Vector;
0051 using G4RotationMatrix = CLHEP::HepRotation;
0052 using G4Transform3D = HepGeom::Transform3D;
0053
0054 namespace ActsPlugins {
0055
0056 struct Geant4AlgebraConverter {
0057
0058 double scale = 1.;
0059
0060
0061
0062
0063
0064
0065 Acts::Transform3 transform(const G4ThreeVector& g4Trans);
0066
0067
0068
0069
0070
0071
0072
0073 Acts::Transform3 transform(const G4RotationMatrix& g4Rot,
0074 const G4ThreeVector& g4Trans);
0075
0076
0077
0078
0079
0080
0081 Acts::Transform3 transform(const G4Transform3D& g4Trf);
0082
0083
0084
0085
0086
0087
0088 Acts::Transform3 transform(const G4VPhysicalVolume& g4PhysVol);
0089 };
0090
0091
0092
0093
0094
0095
0096
0097 struct Geant4ShapeConverter {
0098
0099 double scale = 1.;
0100
0101
0102
0103 bool keepAxisOrder = false;
0104
0105
0106
0107
0108
0109
0110 std::tuple<std::shared_ptr<Acts::CylinderBounds>, double> cylinderBounds(
0111 const G4Tubs& g4Tubs);
0112
0113
0114
0115
0116
0117
0118 std::tuple<std::shared_ptr<Acts::RadialBounds>, double> radialBounds(
0119 const G4Tubs& g4Tubs);
0120
0121
0122
0123
0124
0125
0126 std::shared_ptr<Acts::LineBounds> lineBounds(const G4Tubs& g4Tubs);
0127
0128
0129
0130
0131
0132
0133 std::tuple<std::shared_ptr<Acts::RectangleBounds>, std::array<int, 2u>,
0134 double>
0135 rectangleBounds(const G4Box& g4Box);
0136
0137
0138
0139
0140
0141
0142 std::tuple<std::shared_ptr<Acts::TrapezoidBounds>, std::array<int, 2u>,
0143 double>
0144 trapezoidBounds(const G4Trd& g4Trd);
0145
0146
0147
0148
0149
0150
0151 std::tuple<std::shared_ptr<Acts::TrapezoidBounds>, std::array<int, 2u>,
0152 double>
0153 trapezoidBounds(const G4Trap& g4Trap);
0154
0155
0156
0157
0158
0159
0160
0161 std::tuple<std::shared_ptr<Acts::PlanarBounds>, std::array<int, 2u>, double>
0162 planarBounds(const G4VSolid& g4Solid);
0163 };
0164
0165 struct Geant4PhysicalVolumeConverter {
0166
0167 Acts::Surface::SurfaceType forcedType = Acts::Surface::SurfaceType::Other;
0168
0169
0170
0171
0172
0173
0174
0175
0176
0177 std::shared_ptr<Acts::Surface> surface(const G4VPhysicalVolume& g4PhysVol,
0178 const Acts::Transform3& toGlobal,
0179 bool convertMaterial = false,
0180 double compressed = 0.);
0181 };
0182
0183 struct Geant4MaterialConverter {
0184 Acts::Material material(const G4Material& g4Material, double compression = 1);
0185
0186
0187
0188
0189
0190
0191
0192 std::shared_ptr<Acts::HomogeneousSurfaceMaterial> surfaceMaterial(
0193 const G4Material& g4Material, double original, double compressed);
0194 };
0195
0196 struct Geant4VolumeConverter {
0197
0198
0199
0200
0201
0202 std::shared_ptr<Acts::CylinderVolumeBounds> cylinderBounds(
0203 const G4Tubs& g4Tubs);
0204 };
0205
0206 }