File indexing completed on 2025-01-18 09:57:52
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041 #ifndef G4AdjointCrossSurfChecker_hh
0042 #define G4AdjointCrossSurfChecker_hh 1
0043
0044 #include "G4ThreeVector.hh"
0045 #include "globals.hh"
0046
0047 #include <vector>
0048
0049 class G4Step;
0050
0051 class G4AdjointCrossSurfChecker
0052 {
0053 public:
0054 static G4AdjointCrossSurfChecker* GetInstance();
0055
0056 G4bool CrossingASphere(const G4Step* aStep, G4double sphere_radius, G4ThreeVector sphere_center,
0057 G4ThreeVector& cross_pos, G4double& cos_to_surface, G4bool& GoingIn);
0058
0059 G4bool GoingInOrOutOfaVolume(
0060 const G4Step* aStep, const G4String& volume_name, G4double& cos_to_surface, G4bool& GoingIn);
0061
0062 G4bool GoingInOrOutOfaVolumeByExtSurface(const G4Step* aStep, const G4String& volume_name,
0063 const G4String& mother_lvol_name, G4double& cos_to_surface, G4bool& GoingIn);
0064
0065 G4bool CrossingAGivenRegisteredSurface(const G4Step* aStep, const G4String& surface_name,
0066 G4ThreeVector& cross_pos, G4double& cos_to_surface, G4bool& GoingIn);
0067
0068 G4bool CrossingAGivenRegisteredSurface(const G4Step* aStep, G4int ind, G4ThreeVector& cross_pos,
0069 G4double& cos_to_surface, G4bool& GoingIn);
0070
0071 G4bool CrossingOneOfTheRegisteredSurface(const G4Step* aStep, G4String& surface_name,
0072 G4ThreeVector& cross_pos, G4double& cos_to_surface, G4bool& GoingIn);
0073
0074 G4bool CrossingAnInterfaceBetweenTwoVolumes(const G4Step* aStep, const G4String& vol1_name,
0075 const G4String& vol2_name, G4ThreeVector& cross_pos, G4double& cos_to_surface, G4bool& GoingIn);
0076
0077 G4bool AddaSphericalSurface(
0078 const G4String& SurfaceName, G4double radius, G4ThreeVector pos, G4double& area);
0079 G4bool AddaSphericalSurfaceWithCenterAtTheCenterOfAVolume(const G4String& SurfaceName,
0080 G4double radius, const G4String& volume_name, G4ThreeVector& center, G4double& area);
0081 G4bool AddanExtSurfaceOfAvolume(
0082 const G4String& SurfaceName, const G4String& volume_name, G4double& area);
0083 G4bool AddanInterfaceBetweenTwoVolumes(const G4String& SurfaceName, const G4String& volume_name1,
0084 const G4String& volume_name2, G4double& area);
0085 void ClearListOfSelectedSurface();
0086
0087 private:
0088 G4AdjointCrossSurfChecker() = default;
0089 ~G4AdjointCrossSurfChecker();
0090
0091 G4int FindRegisteredSurface(const G4String& name);
0092
0093 private:
0094 static G4ThreadLocal G4AdjointCrossSurfChecker* instance;
0095
0096 std::vector<G4String> ListOfSurfaceName;
0097 std::vector<G4String> ListOfSurfaceType;
0098 std::vector<G4double> ListOfSphereRadius;
0099 std::vector<G4ThreeVector> ListOfSphereCenter;
0100 std::vector<G4String> ListOfVol1Name;
0101 std::vector<G4String> ListOfVol2Name;
0102 std::vector<G4double> AreaOfSurface;
0103 };
0104
0105 #endif