Geant4  10.02.p03
CellParameterisation Class Reference

#include <CellParameterisation.hh>

Inheritance diagram for CellParameterisation:
Collaboration diagram for CellParameterisation:

Public Member Functions

 CellParameterisation (G4Material *nucleus1, G4Material *cytoplasm1, G4Material *nucleus2, G4Material *cytoplasm2, G4Material *nucleus3, G4Material *cytoplasm3)
 
virtual ~CellParameterisation ()
 
void ComputeTransformation (const G4int copyNo, G4VPhysicalVolume *physVol) const
 
void ComputeDimensions (G4Box &, const G4int, const G4VPhysicalVolume *) const
 
void ComputeDimensions (G4Tubs &, const G4int, const G4VPhysicalVolume *) const
 
void ComputeDimensions (G4Trd &, const G4int, const G4VPhysicalVolume *) const
 
void ComputeDimensions (G4Trap &, const G4int, const G4VPhysicalVolume *) const
 
void ComputeDimensions (G4Cons &, const G4int, const G4VPhysicalVolume *) const
 
void ComputeDimensions (G4Sphere &, const G4int, const G4VPhysicalVolume *) const
 
void ComputeDimensions (G4Ellipsoid &, const G4int, const G4VPhysicalVolume *) const
 
void ComputeDimensions (G4Orb &, const G4int, const G4VPhysicalVolume *) const
 
void ComputeDimensions (G4Torus &, const G4int, const G4VPhysicalVolume *) const
 
void ComputeDimensions (G4Para &, const G4int, const G4VPhysicalVolume *) const
 
void ComputeDimensions (G4Polycone &, const G4int, const G4VPhysicalVolume *) const
 
void ComputeDimensions (G4Polyhedra &, const G4int, const G4VPhysicalVolume *) const
 
void ComputeDimensions (G4Hype &, const G4int, const G4VPhysicalVolume *) const
 
G4int GetNoBoxes ()
 
G4MaterialComputeMaterial (const G4int copyNo, G4VPhysicalVolume *physVol, const G4VTouchable *)
 
G4int GetPhantomTotalPixels ()
 
G4int GetNucleusTotalPixels ()
 
G4int GetCytoplasmTotalPixels ()
 
G4double GetPixelSizeX ()
 
G4double GetPixelSizeY ()
 
G4double GetPixelSizeZ ()
 
G4double GetCytoplasmMass ()
 
G4double GetNucleusMass ()
 
G4ThreeVector GetVoxelThreeVector (G4int i)
 
G4double GetMaterialVector (G4int i)
 
G4double GetMassVector (G4int i)
 
G4int GetTissueType (G4int i)
 
- Public Member Functions inherited from G4VPVParameterisation
 G4VPVParameterisation ()
 
virtual ~G4VPVParameterisation ()
 
virtual G4VSolidComputeSolid (const G4int, G4VPhysicalVolume *)
 
virtual G4bool IsNested () const
 
virtual G4VVolumeMaterialScannerGetMaterialScanner ()
 

Static Public Member Functions

static CellParameterisationInstance ()
 

Private Attributes

G4MaterialfNucleusMaterial1
 
G4MaterialfCytoplasmMaterial1
 
G4MaterialfNucleusMaterial2
 
G4MaterialfCytoplasmMaterial2
 
G4MaterialfNucleusMaterial3
 
G4MaterialfCytoplasmMaterial3
 
G4VisAttributesfNucleusAttributes1
 
G4VisAttributesfCytoplasmAttributes1
 
G4VisAttributesfNucleusAttributes2
 
G4VisAttributesfCytoplasmAttributes2
 
G4VisAttributesfNucleusAttributes3
 
G4VisAttributesfCytoplasmAttributes3
 
G4ThreeVectorfMapCell
 
G4doublefMaterial
 
G4doublefMass
 
G4intfTissueType
 
G4int fPhantomTotalPixels
 
G4int fNucleusTotalPixels
 
G4int fCytoplasmTotalPixels
 
G4double fDimCellBoxX
 
G4double fDimCellBoxY
 
G4double fDimCellBoxZ
 
G4double fNucleusMass
 
G4double fCytoplasmMass
 

Static Private Attributes

static CellParameterisationgInstance = 0
 

Detailed Description

Definition at line 43 of file CellParameterisation.hh.

Constructor & Destructor Documentation

◆ CellParameterisation()

CellParameterisation::CellParameterisation ( G4Material nucleus1,
G4Material cytoplasm1,
G4Material nucleus2,
G4Material cytoplasm2,
G4Material nucleus3,
G4Material cytoplasm3 
)

Definition at line 46 of file CellParameterisation.cc.

50 {
51  fNucleusMaterial1 = nucleus1;
52  fCytoplasmMaterial1 = cytoplasm1;
53  fNucleusMaterial2 = nucleus2;
54  fCytoplasmMaterial2 = cytoplasm2;
55  fNucleusMaterial3 = nucleus3;
56  fCytoplasmMaterial3 = cytoplasm3;
57 
59  G4int shiftX, shiftY, shiftZ;
61  G4double denCyto1, denCyto2, denCyto3, denNucl1, denNucl2, denNucl3;
62 
63  density=0;
64  denCyto1=0;
65  denCyto2=0;
66  denCyto3=0;
67  denNucl1=0;
68  denNucl2=0;
69  denNucl3=0;
70 
71  ncols=0; nlines=0;
72 
73  // READ PHANTOM
74 
75  fNucleusMass = 0;
76  fCytoplasmMass = 0;
77 
78  FILE *fMap;
79  fMap = fopen("phantom.dat","r");
80 
81  while (1)
82  {
83  if (nlines == 0)
84  {
85  ncols = fscanf(fMap,"%i %i %i",&fPhantomTotalPixels,&fNucleusTotalPixels,&fCytoplasmTotalPixels);
90  }
91 
92  if (nlines == 1)
93  {
94  ncols = fscanf(fMap,"%lf %lf %lf",&fDimCellBoxX,&fDimCellBoxY,&fDimCellBoxZ);
95 
99  }
100 
101  if (nlines == 2) ncols = fscanf(fMap,"%i %i %i",&shiftX,&shiftY,&shiftZ); // VOXEL SHIFT IN Z ASSUMED TO BE NEGATIVE
102 
103  if (nlines == 3) ncols = fscanf(fMap,"%lf %lf %lf",&denCyto1, &denCyto2, &denCyto3);
104 
105  if (nlines == 4) ncols = fscanf(fMap,"%lf %lf %lf",&denNucl1, &denNucl2, &denNucl3);
106 
107  if (nlines > 4) ncols = fscanf(fMap,"%lf %lf %lf %lf %lf %lf",&x,&y,&z,&mat,&den,&tmp);
108 
109  if (ncols < 0) break;
110 
111  G4ThreeVector v(x+shiftX,y+shiftY,z-1500/(fDimCellBoxZ/micrometer)-shiftZ); // VOXEL SHIFT IN ORDER TO CENTER PHANTOM
112 
113  if (nlines>4)
114  {
115 
116  fMapCell[nlines-5]=v;
117  fMaterial[nlines-5]=mat;
118  fMass[nlines-5]=den;
119 
120  // fTissueType: 1 is Cytoplasm - 2 is Nucleus
121 
122  if( fMaterial[nlines-5] == 2 ) // fMaterial 2 is nucleus
123  {
124  if( fMass[nlines-5] == 1 )
125  {
126  fTissueType[nlines-5]=2;
127  }
128  if( fMass[nlines-5] == 2 )
129  {
130  fTissueType[nlines-5]=2;
131  }
132  if( fMass[nlines-5] == 3 )
133  {
134  fTissueType[nlines-5]=2;
135  }
136  }
137 
138  else if( fMaterial[nlines-5] == 1 ) // fMaterial 1 is cytoplasm
139  {
140  if( fMass[nlines-5] == 1 )
141  {
142  fTissueType[nlines-5]=1;
143  }
144  if( fMass[nlines-5] == 2 )
145  {
146  fTissueType[nlines-5]=2;
147  }
148  if( fMass[nlines-5] == 3 )
149  {
150  fTissueType[nlines-5]=1;
151  }
152  }
153 
154  //
155 
156 
157  if (std::abs(mat-2)<1.e-30) // NUCLEUS
158  {
159  if (std::abs(den-1)<1.e-30) density = denNucl1*(g/cm3);
160  if (std::abs(den-2)<1.e-30) density = denNucl2*(g/cm3);
161  if (std::abs(den-3)<1.e-30) density = denNucl3*(g/cm3);
163  }
164 
165  if (std::abs(mat-1)<1.e-30) // CYTOPLASM
166  {
167  if (std::abs(den-1)<1e-30) density = denCyto1*(g/cm3);
168  if (std::abs(den-2)<1e-30) density = denCyto2*(g/cm3);
169  if (std::abs(den-3)<1e-30) density = denCyto3*(g/cm3);
171  }
172 
173  }
174 
175  nlines++;
176  }
177  fclose(fMap);
178 
179  // NUCLEUS IN GREEN
180 
184 
188 
192 
193  // CYTOPLASM IN RED
194 
198 
199  fCytoplasmAttributes2 = new G4VisAttributes; // nucleoli in yellow
202 
206 
207  //
208 
209  gInstance = this;
210 
211  }
Float_t den
void SetColour(const G4Colour &)
Float_t tmp
void SetForceSolid(G4bool)
int G4int
Definition: G4Types.hh:78
G4VisAttributes * fCytoplasmAttributes3
Float_t mat
Double_t y
G4double density
Definition: TRTMaterials.hh:39
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5206
static const double cm3
Definition: G4SIunits.hh:120
G4VisAttributes * fNucleusAttributes2
G4VisAttributes * fCytoplasmAttributes1
G4VisAttributes * fNucleusAttributes3
static const double micrometer
Definition: G4SIunits.hh:99
static CellParameterisation * gInstance
G4VisAttributes * fNucleusAttributes1
fclose(fp)
double G4double
Definition: G4Types.hh:76
nlines
G4VisAttributes * fCytoplasmAttributes2
Here is the call graph for this function:

◆ ~CellParameterisation()

CellParameterisation::~CellParameterisation ( )
virtual

Definition at line 215 of file CellParameterisation.cc.

216 {
217  delete[] fMapCell;
218  delete[] fMaterial;
219  delete[] fMass;
220  delete[] fTissueType;
221 }
Here is the call graph for this function:

Member Function Documentation

◆ ComputeDimensions() [1/13]

void CellParameterisation::ComputeDimensions ( G4Box ,
const G4int  ,
const G4VPhysicalVolume  
) const
virtual

Reimplemented from G4VPVParameterisation.

Definition at line 240 of file CellParameterisation.cc.

241 {}
Here is the caller graph for this function:

◆ ComputeDimensions() [2/13]

void CellParameterisation::ComputeDimensions ( G4Tubs ,
const G4int  ,
const G4VPhysicalVolume  
) const
inlinevirtual

Reimplemented from G4VPVParameterisation.

Definition at line 61 of file CellParameterisation.hh.

63  {}

◆ ComputeDimensions() [3/13]

void CellParameterisation::ComputeDimensions ( G4Trd ,
const G4int  ,
const G4VPhysicalVolume  
) const
inlinevirtual

Reimplemented from G4VPVParameterisation.

Definition at line 65 of file CellParameterisation.hh.

67  {}

◆ ComputeDimensions() [4/13]

void CellParameterisation::ComputeDimensions ( G4Trap ,
const G4int  ,
const G4VPhysicalVolume  
) const
inlinevirtual

Reimplemented from G4VPVParameterisation.

Definition at line 69 of file CellParameterisation.hh.

71  {}

◆ ComputeDimensions() [5/13]

void CellParameterisation::ComputeDimensions ( G4Cons ,
const G4int  ,
const G4VPhysicalVolume  
) const
inlinevirtual

Reimplemented from G4VPVParameterisation.

Definition at line 73 of file CellParameterisation.hh.

75  {}

◆ ComputeDimensions() [6/13]

void CellParameterisation::ComputeDimensions ( G4Sphere ,
const G4int  ,
const G4VPhysicalVolume  
) const
inlinevirtual

Reimplemented from G4VPVParameterisation.

Definition at line 77 of file CellParameterisation.hh.

79  {}

◆ ComputeDimensions() [7/13]

void CellParameterisation::ComputeDimensions ( G4Ellipsoid ,
const G4int  ,
const G4VPhysicalVolume  
) const
inlinevirtual

Reimplemented from G4VPVParameterisation.

Definition at line 81 of file CellParameterisation.hh.

83  {}

◆ ComputeDimensions() [8/13]

void CellParameterisation::ComputeDimensions ( G4Orb ,
const G4int  ,
const G4VPhysicalVolume  
) const
inlinevirtual

Reimplemented from G4VPVParameterisation.

Definition at line 85 of file CellParameterisation.hh.

87  {}

◆ ComputeDimensions() [9/13]

void CellParameterisation::ComputeDimensions ( G4Torus ,
const G4int  ,
const G4VPhysicalVolume  
) const
inlinevirtual

Reimplemented from G4VPVParameterisation.

Definition at line 89 of file CellParameterisation.hh.

91  {}

◆ ComputeDimensions() [10/13]

void CellParameterisation::ComputeDimensions ( G4Para ,
const G4int  ,
const G4VPhysicalVolume  
) const
inlinevirtual

Reimplemented from G4VPVParameterisation.

Definition at line 93 of file CellParameterisation.hh.

95  {}

◆ ComputeDimensions() [11/13]

void CellParameterisation::ComputeDimensions ( G4Polycone ,
const G4int  ,
const G4VPhysicalVolume  
) const
inlinevirtual

Reimplemented from G4VPVParameterisation.

Definition at line 97 of file CellParameterisation.hh.

99  {}

◆ ComputeDimensions() [12/13]

void CellParameterisation::ComputeDimensions ( G4Polyhedra ,
const G4int  ,
const G4VPhysicalVolume  
) const
inlinevirtual

Reimplemented from G4VPVParameterisation.

Definition at line 101 of file CellParameterisation.hh.

103  {}

◆ ComputeDimensions() [13/13]

void CellParameterisation::ComputeDimensions ( G4Hype ,
const G4int  ,
const G4VPhysicalVolume  
) const
inlinevirtual

Reimplemented from G4VPVParameterisation.

Definition at line 105 of file CellParameterisation.hh.

107  {}

◆ ComputeMaterial()

G4Material * CellParameterisation::ComputeMaterial ( const G4int  copyNo,
G4VPhysicalVolume physVol,
const G4VTouchable  
)
virtual

Reimplemented from G4VPVParameterisation.

Definition at line 246 of file CellParameterisation.cc.

249 {
250  if( fMaterial[copyNo] == 2 ) // fMaterial 2 is nucleus
251  {
252  if( fMass[copyNo] == 1 )
253  {
255  return fNucleusMaterial1;
256  }
257  if( fMass[copyNo] == 2 )
258  {
260  return fNucleusMaterial2;
261  }
262  if( fMass[copyNo] == 3 )
263  {
265  return fNucleusMaterial3;
266  }
267  }
268 
269  else if( fMaterial[copyNo] == 1 ) // fMaterial 1 is cytoplasm
270  {
271  if( fMass[copyNo] == 1 )
272  {
274  return fCytoplasmMaterial1;
275  }
276  if( fMass[copyNo] == 2 )
277  {
278  // nucleoli so taken as nucleus !
280  return fCytoplasmMaterial2;
281  }
282  if( fMass[copyNo] == 3 )
283  {
285  return fCytoplasmMaterial3;
286  }
287  }
288 
289  return physVol->GetLogicalVolume()->GetMaterial();
290 }
G4Material * GetMaterial() const
G4VisAttributes * fCytoplasmAttributes3
G4VisAttributes * fNucleusAttributes2
G4VisAttributes * fCytoplasmAttributes1
G4VisAttributes * fNucleusAttributes3
G4VisAttributes * fNucleusAttributes1
G4LogicalVolume * GetLogicalVolume() const
void SetVisAttributes(const G4VisAttributes *pVA)
G4VisAttributes * fCytoplasmAttributes2
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeTransformation()

void CellParameterisation::ComputeTransformation ( const G4int  copyNo,
G4VPhysicalVolume physVol 
) const
virtual

Implements G4VPVParameterisation.

Definition at line 226 of file CellParameterisation.cc.

227 {
229  origin(
230  fMapCell[copyNo].x()*fDimCellBoxX,
231  fMapCell[copyNo].y()*fDimCellBoxY,
232  fMapCell[copyNo].z()*fDimCellBoxZ);
233 
234  physVol->SetTranslation(origin);
235 }
Double_t y
void SetTranslation(const G4ThreeVector &v)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCytoplasmMass()

G4double CellParameterisation::GetCytoplasmMass ( )
inline

Definition at line 123 of file CellParameterisation.hh.

123 {return fCytoplasmMass;}
Here is the caller graph for this function:

◆ GetCytoplasmTotalPixels()

G4int CellParameterisation::GetCytoplasmTotalPixels ( )
inline

Definition at line 119 of file CellParameterisation.hh.

◆ GetMassVector()

G4double CellParameterisation::GetMassVector ( G4int  i)
inline

Definition at line 128 of file CellParameterisation.hh.

128 {return fMass[i];}

◆ GetMaterialVector()

G4double CellParameterisation::GetMaterialVector ( G4int  i)
inline

Definition at line 127 of file CellParameterisation.hh.

127 {return fMaterial[i];}

◆ GetNoBoxes()

G4int CellParameterisation::GetNoBoxes ( )
inline

Definition at line 109 of file CellParameterisation.hh.

Here is the call graph for this function:

◆ GetNucleusMass()

G4double CellParameterisation::GetNucleusMass ( )
inline

Definition at line 124 of file CellParameterisation.hh.

124 {return fNucleusMass;}
Here is the caller graph for this function:

◆ GetNucleusTotalPixels()

G4int CellParameterisation::GetNucleusTotalPixels ( )
inline

Definition at line 118 of file CellParameterisation.hh.

◆ GetPhantomTotalPixels()

G4int CellParameterisation::GetPhantomTotalPixels ( )
inline

Definition at line 117 of file CellParameterisation.hh.

Here is the caller graph for this function:

◆ GetPixelSizeX()

G4double CellParameterisation::GetPixelSizeX ( )
inline

Definition at line 120 of file CellParameterisation.hh.

120 {return fDimCellBoxX;}
Here is the caller graph for this function:

◆ GetPixelSizeY()

G4double CellParameterisation::GetPixelSizeY ( )
inline

Definition at line 121 of file CellParameterisation.hh.

121 {return fDimCellBoxY;}
Here is the caller graph for this function:

◆ GetPixelSizeZ()

G4double CellParameterisation::GetPixelSizeZ ( )
inline

Definition at line 122 of file CellParameterisation.hh.

122 {return fDimCellBoxZ;}
Here is the caller graph for this function:

◆ GetTissueType()

G4int CellParameterisation::GetTissueType ( G4int  i)
inline

Definition at line 129 of file CellParameterisation.hh.

129 {return fTissueType[i];}
Here is the caller graph for this function:

◆ GetVoxelThreeVector()

G4ThreeVector CellParameterisation::GetVoxelThreeVector ( G4int  i)
inline

Definition at line 126 of file CellParameterisation.hh.

126 {return fMapCell[i];}
Here is the caller graph for this function:

◆ Instance()

static CellParameterisation* CellParameterisation::Instance ( void  )
inlinestatic

Definition at line 133 of file CellParameterisation.hh.

134  {
135  return gInstance;
136  }
static CellParameterisation * gInstance
Here is the caller graph for this function:

Member Data Documentation

◆ fCytoplasmAttributes1

G4VisAttributes* CellParameterisation::fCytoplasmAttributes1
private

Definition at line 149 of file CellParameterisation.hh.

◆ fCytoplasmAttributes2

G4VisAttributes* CellParameterisation::fCytoplasmAttributes2
private

Definition at line 151 of file CellParameterisation.hh.

◆ fCytoplasmAttributes3

G4VisAttributes* CellParameterisation::fCytoplasmAttributes3
private

Definition at line 153 of file CellParameterisation.hh.

◆ fCytoplasmMass

G4double CellParameterisation::fCytoplasmMass
private

Definition at line 168 of file CellParameterisation.hh.

◆ fCytoplasmMaterial1

G4Material* CellParameterisation::fCytoplasmMaterial1
private

Definition at line 142 of file CellParameterisation.hh.

◆ fCytoplasmMaterial2

G4Material* CellParameterisation::fCytoplasmMaterial2
private

Definition at line 144 of file CellParameterisation.hh.

◆ fCytoplasmMaterial3

G4Material* CellParameterisation::fCytoplasmMaterial3
private

Definition at line 146 of file CellParameterisation.hh.

◆ fCytoplasmTotalPixels

G4int CellParameterisation::fCytoplasmTotalPixels
private

Definition at line 162 of file CellParameterisation.hh.

◆ fDimCellBoxX

G4double CellParameterisation::fDimCellBoxX
private

Definition at line 164 of file CellParameterisation.hh.

◆ fDimCellBoxY

G4double CellParameterisation::fDimCellBoxY
private

Definition at line 165 of file CellParameterisation.hh.

◆ fDimCellBoxZ

G4double CellParameterisation::fDimCellBoxZ
private

Definition at line 166 of file CellParameterisation.hh.

◆ fMapCell

G4ThreeVector* CellParameterisation::fMapCell
private

Definition at line 155 of file CellParameterisation.hh.

◆ fMass

G4double* CellParameterisation::fMass
private

Definition at line 157 of file CellParameterisation.hh.

◆ fMaterial

G4double* CellParameterisation::fMaterial
private

Definition at line 156 of file CellParameterisation.hh.

◆ fNucleusAttributes1

G4VisAttributes* CellParameterisation::fNucleusAttributes1
private

Definition at line 148 of file CellParameterisation.hh.

◆ fNucleusAttributes2

G4VisAttributes* CellParameterisation::fNucleusAttributes2
private

Definition at line 150 of file CellParameterisation.hh.

◆ fNucleusAttributes3

G4VisAttributes* CellParameterisation::fNucleusAttributes3
private

Definition at line 152 of file CellParameterisation.hh.

◆ fNucleusMass

G4double CellParameterisation::fNucleusMass
private

Definition at line 167 of file CellParameterisation.hh.

◆ fNucleusMaterial1

G4Material* CellParameterisation::fNucleusMaterial1
private

Definition at line 141 of file CellParameterisation.hh.

◆ fNucleusMaterial2

G4Material* CellParameterisation::fNucleusMaterial2
private

Definition at line 143 of file CellParameterisation.hh.

◆ fNucleusMaterial3

G4Material* CellParameterisation::fNucleusMaterial3
private

Definition at line 145 of file CellParameterisation.hh.

◆ fNucleusTotalPixels

G4int CellParameterisation::fNucleusTotalPixels
private

Definition at line 161 of file CellParameterisation.hh.

◆ fPhantomTotalPixels

G4int CellParameterisation::fPhantomTotalPixels
private

Definition at line 160 of file CellParameterisation.hh.

◆ fTissueType

G4int* CellParameterisation::fTissueType
private

Definition at line 158 of file CellParameterisation.hh.

◆ gInstance

CellParameterisation * CellParameterisation::gInstance = 0
staticprivate

Definition at line 170 of file CellParameterisation.hh.


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