LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
G4EzVoxelParameterization Class Reference

#include "G4EzVoxelParameterization.hh"

Inheritance diagram for G4EzVoxelParameterization:

Public Member Functions

 G4EzVoxelParameterization (G4double ddx, G4double ddy, G4double ddz, G4int nx, G4int ny, G4int nz)
 
 ~G4EzVoxelParameterization ()
 
virtual void ComputeTransformation (const G4int copyNo, G4VPhysicalVolume *physVol) const
 
virtual void ComputeDimensions (G4Box &aBox, const G4int copyNo, const G4VPhysicalVolume *physVol) const
 

Protected Attributes

G4ThreeVector voxelSize
 
G4ThreeVector motherSize
 
G4int nvoxels [3]
 

Detailed Description

Definition at line 43 of file G4EzVoxelParameterization.hh.

Constructor & Destructor Documentation

G4EzVoxelParameterization::G4EzVoxelParameterization ( G4double  ddx,
G4double  ddy,
G4double  ddz,
G4int  nx,
G4int  ny,
G4int  nz 
)

Definition at line 43 of file G4EzVoxelParameterization.cc.

44  : voxelSize(ddx, ddy, ddz), motherSize(ddx*nx, ddy*ny, ddz*nz)
46 {
47  nvoxels[0]= nx;
48  nvoxels[1]= ny;
49  nvoxels[2]= nz;
50 }
G4EzVoxelParameterization::~G4EzVoxelParameterization ( )

Definition at line 54 of file G4EzVoxelParameterization.cc.

References ComputeTransformation().

56 {
57 }

Member Function Documentation

void G4EzVoxelParameterization::ComputeDimensions ( G4Box &  aBox,
const G4int  copyNo,
const G4VPhysicalVolume *  physVol 
) const
virtual

Definition at line 84 of file G4EzVoxelParameterization.cc.

Referenced by ComputeTransformation().

86 {
87  return;
88 }
void G4EzVoxelParameterization::ComputeTransformation ( const G4int  copyNo,
G4VPhysicalVolume *  physVol 
) const
virtual

Definition at line 62 of file G4EzVoxelParameterization.cc.

References ComputeDimensions(), motherSize, nvoxels, and voxelSize.

Referenced by ~G4EzVoxelParameterization().

64 {
65  // copyNo-> index
66  G4int nxy= nvoxels[0]*nvoxels[1];
67  G4int iz= copyNo/nxy;
68  G4int ixy= copyNo - iz*nxy;
69  G4int iy= ixy/nvoxels[0];
70  G4int ix= ixy-iy*nvoxels[0];
71 
72  // voxel position
73  G4double px= voxelSize[0]*(ix+0.5) - motherSize[0]/2.;
74  G4double py= voxelSize[1]*(iy+0.5) - motherSize[1]/2.;
75  G4double pz= voxelSize[2]*(iz+0.5) - motherSize[2]/2.;
76 
77  physVol-> SetTranslation(G4ThreeVector(px, py, pz));
78 
79 }

Member Data Documentation

G4ThreeVector G4EzVoxelParameterization::motherSize
protected

Definition at line 46 of file G4EzVoxelParameterization.hh.

Referenced by ComputeTransformation().

G4int G4EzVoxelParameterization::nvoxels[3]
protected

Definition at line 47 of file G4EzVoxelParameterization.hh.

Referenced by ComputeTransformation().

G4ThreeVector G4EzVoxelParameterization::voxelSize
protected

Definition at line 45 of file G4EzVoxelParameterization.hh.

Referenced by ComputeTransformation().


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