Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4PartialPhantomParameterisation.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// G4PartialPhantomParameterisation
27//
28// Class description:
29//
30// Describes partial regular parameterisations, i.e. the voxels do not
31// completely fill the container in the three dimensions.
32
33// Author: Pedro Arce (CIEMAT), September 2010
34// --------------------------------------------------------------------
35#ifndef G4PartialPhantomParameterisation_hh
36#define G4PartialPhantomParameterisation_hh 1
37
38#include <map>
39#include <set>
40#include <utility>
41#include <vector>
42
43#include "G4Types.hh"
45#include "G4AffineTransform.hh"
46#include "G4VTouchable.hh"
47
49class G4VSolid;
50class G4Material;
51
52/**
53 * @brief G4PartialPhantomParameterisation describes partial regular
54 * parameterisations, i.e. the voxels do not completely fill the container
55 * in the three dimensions.
56 */
57
59{
60 public:
61
62 /**
63 * Default Constructor and Destructor.
64 */
67
68 void ComputeTransformation(const G4int, G4VPhysicalVolume *) const override;
69
70 G4Material* ComputeMaterial(const G4int repNo,
71 G4VPhysicalVolume *currentVol,
72 const G4VTouchable *parentTouch = nullptr) override;
73
74 /**
75 * Gets the voxel number corresponding to the point in the container
76 * frame. Use 'localDir' to avoid precision problems at the surfaces.
77 * @param[in] localPoint Point in local coordinates system.
78 * @param[in] localDir Local direction to overcome precision issues.
79 * @returns The voxel number for the specified point.
80 */
81 G4int GetReplicaNo( const G4ThreeVector& localPoint,
82 const G4ThreeVector& localDir ) override;
83
84 G4ThreeVector GetTranslation(const G4int copyNo ) const;
85
86 std::size_t GetMaterialIndex( std::size_t nx, std::size_t ny, std::size_t nz) const;
87 std::size_t GetMaterialIndex( std::size_t copyNo) const;
88
89 G4Material* GetMaterial( std::size_t nx, std::size_t ny, std::size_t nz) const;
90 G4Material* GetMaterial( std::size_t copyNo ) const;
91
92 inline void SetFilledIDs( std::multimap<G4int,G4int> fid )
93 {
94 fFilledIDs = std::move(fid);
95 }
96
97 inline void SetFilledMins( std::map< G4int, std::map<G4int,G4int> > fmins )
98 {
99 fFilledMins = std::move(fmins);
100 }
101
102 void BuildContainerWalls();
103
104 private:
105
106 /**
107 * Converts the copyNo to voxel numbers in x, y and z.
108 */
109 void ComputeVoxelIndices(const G4int copyNo, std::size_t& nx,
110 std::size_t& ny, std::size_t& nz ) const;
111
112 /**
113 * Checks that the copy number is within limits.
114 */
115 void CheckCopyNo( const G4long copyNo ) const;
116
117 private:
118
119 std::multimap<G4int,G4int> fFilledIDs;
120 std::map< G4int, std::map<G4int,G4int> > fFilledMins;
121};
122
123#endif
CLHEP::Hep3Vector G4ThreeVector
long G4long
Definition G4Types.hh:87
int G4int
Definition G4Types.hh:85
G4TouchableHistory G4VTouchable
G4VTouchable is a G4TouchableHistory object.
void SetFilledIDs(std::multimap< G4int, G4int > fid)
void SetFilledMins(std::map< G4int, std::map< G4int, G4int > > fmins)
std::size_t GetMaterialIndex(std::size_t nx, std::size_t ny, std::size_t nz) const
void ComputeTransformation(const G4int, G4VPhysicalVolume *) const override
~G4PartialPhantomParameterisation() override=default
G4Material * GetMaterial(std::size_t nx, std::size_t ny, std::size_t nz) const
G4int GetReplicaNo(const G4ThreeVector &localPoint, const G4ThreeVector &localDir) override
G4Material * ComputeMaterial(const G4int repNo, G4VPhysicalVolume *currentVol, const G4VTouchable *parentTouch=nullptr) override
G4ThreeVector GetTranslation(const G4int copyNo) const
G4VPhysicalVolume is an abstract base class for the representation of a positioned volume....
G4VSolid is an abstract base class for solids, physical shapes that can be tracked through....
Definition G4VSolid.hh:80