Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
RE02NestedPhantomParameterisation Class Reference

#include <RE02NestedPhantomParameterisation.hh>

Inheritance diagram for RE02NestedPhantomParameterisation:
G4VNestedParameterisation G4VPVParameterisation G4VVolumeMaterialScanner

Public Member Functions

 RE02NestedPhantomParameterisation (const G4ThreeVector &voxelSize, G4int nz, std::vector< G4Material * > &mat)
 
 ~RE02NestedPhantomParameterisation ()
 
G4MaterialComputeMaterial (G4VPhysicalVolume *currentVol, const G4int repNo, const G4VTouchable *parentTouch=0)
 
G4int GetNumberOfMaterials () const
 
G4MaterialGetMaterial (G4int idx) const
 
void ComputeTransformation (const G4int no, G4VPhysicalVolume *currentPV) const
 
void ComputeDimensions (G4Box &, const G4int, const G4VPhysicalVolume *) const
 
- Public Member Functions inherited from G4VNestedParameterisation
 G4VNestedParameterisation ()
 
virtual ~G4VNestedParameterisation ()
 
virtual G4VSolidComputeSolid (const G4int no, G4VPhysicalVolume *thisVol)
 
G4MaterialComputeMaterial (const G4int repNo, G4VPhysicalVolume *currentVol, const G4VTouchable *parentTouch=0)
 
virtual G4bool IsNested () const
 
virtual G4VVolumeMaterialScannerGetMaterialScanner ()
 
- Public Member Functions inherited from G4VPVParameterisation
 G4VPVParameterisation ()
 
virtual ~G4VPVParameterisation ()
 
- Public Member Functions inherited from G4VVolumeMaterialScanner
 G4VVolumeMaterialScanner ()
 
virtual ~G4VVolumeMaterialScanner ()
 

Detailed Description

A nested parameterisation class for a phantom

(Description) This parameterisation handles material and transfomation of voxles.

Definition at line 92 of file RE02NestedPhantomParameterisation.hh.

Constructor & Destructor Documentation

RE02NestedPhantomParameterisation::RE02NestedPhantomParameterisation ( const G4ThreeVector voxelSize,
G4int  nz,
std::vector< G4Material * > &  mat 
)

Definition at line 54 of file RE02NestedPhantomParameterisation.cc.

References iz.

56  :
58  fdX(voxelSize.x()),fdY(voxelSize.y()),fdZ(voxelSize.z()),
59  fNz(nz),fMat(mat)
60 {
61  // Position of voxels.
62  // x and y positions are already defined in DetectorConstruction
63  // by using replicated volume. Here only we need to define is z positions
64  // of voxles.
65  fpZ.clear();
66  G4double zp;
67  for ( G4int iz = 0; iz < fNz; iz++){
68  zp = (-fNz+1+2*iz)*fdZ;
69  fpZ.push_back(zp);
70  }
71 
72 }
double x() const
int G4int
Definition: G4Types.hh:78
double z() const
G4double iz
Definition: TRTMaterials.hh:39
double y() const
double G4double
Definition: G4Types.hh:76
RE02NestedPhantomParameterisation::~RE02NestedPhantomParameterisation ( )

Definition at line 75 of file RE02NestedPhantomParameterisation.cc.

75  {
76  fpZ.clear();
77 }

Member Function Documentation

void RE02NestedPhantomParameterisation::ComputeDimensions ( G4Box box,
const G4int  ,
const G4VPhysicalVolume  
) const
virtual

Reimplemented from G4VNestedParameterisation.

Definition at line 136 of file RE02NestedPhantomParameterisation.cc.

References G4Box::SetXHalfLength(), G4Box::SetYHalfLength(), and G4Box::SetZHalfLength().

136  {
137  box.SetXHalfLength(fdX);
138  box.SetYHalfLength(fdY);
139  box.SetZHalfLength(fdZ);
140 }
void SetZHalfLength(G4double dz)
Definition: G4Box.cc:172
void SetYHalfLength(G4double dy)
Definition: G4Box.cc:152
void SetXHalfLength(G4double dx)
Definition: G4Box.cc:132
G4Material * RE02NestedPhantomParameterisation::ComputeMaterial ( G4VPhysicalVolume currentVol,
const G4int  repNo,
const G4VTouchable parentTouch = 0 
)
virtual

Implements G4VNestedParameterisation.

Definition at line 84 of file RE02NestedPhantomParameterisation.cc.

References G4VTouchable::GetReplicaNumber(), and iz.

86 {
87  if(parentTouch==0) return fMat[0]; // protection for initialization and
88  // vis at idle state
89  // Copy number of voxels.
90  // Copy number of X and Y are obtained from replication number.
91  // Copy nymber of Z is the copy number of current voxel.
92  G4int ix = parentTouch->GetReplicaNumber(0);
93  G4int iy = parentTouch->GetReplicaNumber(1);
94  G4int iz = copyNo;
95  // For demonstration purpose,a couple of materials are chosen alternately.
96  G4Material* mat=0;
97  if ( ix%2 == 0 && iy%2 == 0 && iz%2 == 0 ) mat = fMat[0];
98  else mat = fMat[1];
99 
100  return mat;
101 }
int G4int
Definition: G4Types.hh:78
G4double iz
Definition: TRTMaterials.hh:39
virtual G4int GetReplicaNumber(G4int depth=0) const
Definition: G4VTouchable.cc:58
void RE02NestedPhantomParameterisation::ComputeTransformation ( const G4int  no,
G4VPhysicalVolume currentPV 
) const
virtual

Implements G4VNestedParameterisation.

Definition at line 126 of file RE02NestedPhantomParameterisation.cc.

References position, and G4VPhysicalVolume::SetTranslation().

126  {
127  G4ThreeVector position(0.,0.,fpZ[copyNo]);
128  physVol->SetTranslation(position);
129 }
int position
Definition: filter.cc:7
G4Material * RE02NestedPhantomParameterisation::GetMaterial ( G4int  idx) const
virtual

Implements G4VNestedParameterisation.

Definition at line 117 of file RE02NestedPhantomParameterisation.cc.

117  {
118  return fMat[i];
119 }
G4int RE02NestedPhantomParameterisation::GetNumberOfMaterials ( ) const
virtual

Implements G4VNestedParameterisation.

Definition at line 108 of file RE02NestedPhantomParameterisation.cc.

108  {
109  return fMat.size();
110 }

The documentation for this class was generated from the following files: