File indexing completed on 2025-09-17 08:59:07
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 #ifndef G4PartialPhantomParameterisation_hh
0036 #define G4PartialPhantomParameterisation_hh 1
0037
0038 #include <map>
0039 #include <set>
0040 #include <utility>
0041 #include <vector>
0042
0043 #include "G4Types.hh"
0044 #include "G4PhantomParameterisation.hh"
0045 #include "G4AffineTransform.hh"
0046 #include "G4VTouchable.hh"
0047
0048 class G4VPhysicalVolume;
0049 class G4VSolid;
0050 class G4Material;
0051
0052 class G4PartialPhantomParameterisation : public G4PhantomParameterisation
0053 {
0054 public:
0055
0056 G4PartialPhantomParameterisation() = default;
0057 ~G4PartialPhantomParameterisation() override = default;
0058
0059 void ComputeTransformation(const G4int, G4VPhysicalVolume *) const override;
0060
0061 G4Material* ComputeMaterial(const G4int repNo,
0062 G4VPhysicalVolume *currentVol,
0063 const G4VTouchable *parentTouch = nullptr) override;
0064
0065 G4int GetReplicaNo( const G4ThreeVector& localPoint,
0066 const G4ThreeVector& localDir ) override;
0067
0068
0069
0070 G4ThreeVector GetTranslation(const G4int copyNo ) const;
0071
0072 std::size_t GetMaterialIndex( std::size_t nx, std::size_t ny, std::size_t nz) const;
0073 std::size_t GetMaterialIndex( std::size_t copyNo) const;
0074
0075 G4Material* GetMaterial( std::size_t nx, std::size_t ny, std::size_t nz) const;
0076 G4Material* GetMaterial( std::size_t copyNo ) const;
0077
0078 void SetFilledIDs( std::multimap<G4int,G4int> fid )
0079 {
0080 fFilledIDs = std::move(fid);
0081 }
0082
0083 void SetFilledMins( std::map< G4int, std::map<G4int,G4int> > fmins )
0084 {
0085 fFilledMins = std::move(fmins);
0086 }
0087
0088 void BuildContainerWalls();
0089
0090 private:
0091
0092 void ComputeVoxelIndices(const G4int copyNo, std::size_t& nx,
0093 std::size_t& ny, std::size_t& nz ) const;
0094
0095
0096 void CheckCopyNo( const G4long copyNo ) const;
0097
0098
0099 private:
0100
0101 std::multimap<G4int,G4int> fFilledIDs;
0102 std::map< G4int, std::map<G4int,G4int> > fFilledMins;
0103 };
0104
0105 #endif