File indexing completed on 2025-06-30 08:06:59
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 class G4Box;
0029 class G4Material;
0030 class G4Trd;
0031 class G4Trap;
0032 class G4Tubs;
0033 class G4VSolid;
0034 class G4VPhysicalVolume;
0035 using G4ThreeVector = CLHEP::Hep3Vector;
0036 using G4RotationMatrix = CLHEP::HepRotation;
0037 using G4Transform3D = HepGeom::Transform3D;
0038
0039 namespace Acts {
0040 struct Geant4AlgebraConverter {
0041
0042 ActsScalar scale = 1.;
0043
0044
0045
0046
0047
0048
0049 Transform3 transform(const G4ThreeVector& g4Trans);
0050
0051
0052
0053
0054
0055
0056
0057 Transform3 transform(const G4RotationMatrix& g4Rot,
0058 const G4ThreeVector& g4Trans);
0059
0060
0061
0062
0063
0064
0065 Transform3 transform(const G4Transform3D& g4Trf);
0066
0067
0068
0069
0070
0071
0072 Transform3 transform(const G4VPhysicalVolume& g4PhysVol);
0073 };
0074
0075 class AnnulusBounds;
0076 class CylinderBounds;
0077 class RadialBounds;
0078 class RectangleBounds;
0079 class TrapezoidBounds;
0080 class PlanarBounds;
0081 class LineBounds;
0082
0083
0084
0085
0086
0087
0088
0089 struct Geant4ShapeConverter {
0090
0091 ActsScalar scale = 1.;
0092
0093
0094
0095 bool keepAxisOrder = false;
0096
0097
0098
0099
0100
0101
0102 std::tuple<std::shared_ptr<CylinderBounds>, ActsScalar> cylinderBounds(
0103 const G4Tubs& g4Tubs);
0104
0105
0106
0107
0108
0109
0110 std::tuple<std::shared_ptr<RadialBounds>, ActsScalar> radialBounds(
0111 const G4Tubs& g4Tubs);
0112
0113
0114
0115
0116
0117
0118 std::shared_ptr<LineBounds> lineBounds(const G4Tubs& g4Tubs);
0119
0120
0121
0122
0123
0124
0125 std::tuple<std::shared_ptr<RectangleBounds>, std::array<int, 2u>, ActsScalar>
0126 rectangleBounds(const G4Box& g4Box);
0127
0128
0129
0130
0131
0132
0133 std::tuple<std::shared_ptr<TrapezoidBounds>, std::array<int, 2u>, ActsScalar>
0134 trapezoidBounds(const G4Trd& g4Trd);
0135
0136
0137
0138
0139
0140
0141
0142 std::tuple<std::shared_ptr<PlanarBounds>, std::array<int, 2u>, ActsScalar>
0143 planarBounds(const G4VSolid& g4Solid);
0144 };
0145
0146 struct Geant4PhysicalVolumeConverter {
0147
0148 Surface::SurfaceType forcedType = Surface::SurfaceType::Other;
0149
0150
0151
0152
0153
0154
0155
0156
0157
0158 std::shared_ptr<Surface> surface(const G4VPhysicalVolume& g4PhysVol,
0159 const Transform3& toGlobal,
0160 bool convertMaterial = false,
0161 ActsScalar compressed = 0.);
0162 };
0163
0164 class Material;
0165 class HomogeneousSurfaceMaterial;
0166 class HomogeneousVolumeMaterial;
0167
0168 struct Geant4MaterialConverter {
0169 Material material(const G4Material& g4Material, ActsScalar compression = 1);
0170
0171
0172
0173
0174
0175
0176
0177 std::shared_ptr<HomogeneousSurfaceMaterial> surfaceMaterial(
0178 const G4Material& g4Material, ActsScalar original, ActsScalar compressed);
0179 };
0180
0181 class CylinderVolumeBounds;
0182
0183 struct Geant4VolumeConverter {
0184
0185
0186
0187
0188
0189 std::shared_ptr<CylinderVolumeBounds> cylinderBounds(const G4Tubs& g4Tubs);
0190 };
0191
0192 }