51 fNucleusMaterial1 = nucleus1;
52 fCytoplasmMaterial1 = cytoplasm1;
53 fNucleusMaterial2 = nucleus2;
54 fCytoplasmMaterial2 = cytoplasm2;
55 fNucleusMaterial3 = nucleus3;
56 fCytoplasmMaterial3 = cytoplasm3;
59 G4int shiftX, shiftY, shiftZ;
61 G4double denCyto1, denCyto2, denCyto3, denNucl1, denNucl2, denNucl3;
79 fMap = fopen(
"phantom.dat",
"r");
85 ncols = fscanf(fMap,
"%i %i %i",&fPhantomTotalPixels,&fNucleusTotalPixels,&fCytoplasmTotalPixels);
87 fMaterial =
new G4double[fPhantomTotalPixels];
88 fMass =
new G4double[fPhantomTotalPixels];
89 fTissueType =
new G4int[fPhantomTotalPixels];
94 ncols = fscanf(fMap,
"%lf %lf %lf",&fDimCellBoxX,&fDimCellBoxY,&fDimCellBoxZ);
101 if (nlines == 2) ncols = fscanf(fMap,
"%i %i %i",&shiftX,&shiftY,&shiftZ);
103 if (nlines == 3) ncols = fscanf(fMap,
"%lf %lf %lf",&denCyto1, &denCyto2, &denCyto3);
105 if (nlines == 4) ncols = fscanf(fMap,
"%lf %lf %lf",&denNucl1, &denNucl2, &denNucl3);
107 if (nlines > 4) ncols = fscanf(fMap,
"%lf %lf %lf %lf %lf %lf",&x,&y,&z,&mat,&den,&tmp);
109 if (ncols < 0)
break;
116 fMapCell[nlines-5]=
v;
117 fMaterial[nlines-5]=mat;
122 if( fMaterial[nlines-5] == 2 )
124 if( fMass[nlines-5] == 1 )
126 fTissueType[nlines-5]=2;
128 if( fMass[nlines-5] == 2 )
130 fTissueType[nlines-5]=2;
132 if( fMass[nlines-5] == 3 )
134 fTissueType[nlines-5]=2;
138 else if( fMaterial[nlines-5] == 1 )
140 if( fMass[nlines-5] == 1 )
142 fTissueType[nlines-5]=1;
144 if( fMass[nlines-5] == 2 )
146 fTissueType[nlines-5]=2;
148 if( fMass[nlines-5] == 3 )
150 fTissueType[nlines-5]=1;
157 if (std::abs(mat-2)<1.e-30)
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);
162 fNucleusMass = fNucleusMass + density * fDimCellBoxX * fDimCellBoxY * fDimCellBoxZ ;
165 if (std::abs(mat-1)<1.e-30)
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);
170 fCytoplasmMass = fCytoplasmMass + density * fDimCellBoxX * fDimCellBoxY * fDimCellBoxZ ;
183 fNucleusAttributes1->SetForceSolid(
false);
187 fNucleusAttributes2->SetForceSolid(
false);
191 fNucleusAttributes3->SetForceSolid(
false);
197 fCytoplasmAttributes1->SetForceSolid(
false);
201 fCytoplasmAttributes2->SetForceSolid(
false);
205 fCytoplasmAttributes3->SetForceSolid(
false);
220 delete[] fTissueType;
230 fMapCell[copyNo].
x()*fDimCellBoxX,
231 fMapCell[copyNo].y()*fDimCellBoxY,
232 fMapCell[copyNo].
z()*fDimCellBoxZ);
250 if( fMaterial[copyNo] == 2 )
252 if( fMass[copyNo] == 1 )
255 return fNucleusMaterial1;
257 if( fMass[copyNo] == 2 )
260 return fNucleusMaterial2;
262 if( fMass[copyNo] == 3 )
265 return fNucleusMaterial3;
269 else if( fMaterial[copyNo] == 1 )
271 if( fMass[copyNo] == 1 )
274 return fCytoplasmMaterial1;
276 if( fMass[copyNo] == 2 )
280 return fCytoplasmMaterial2;
282 if( fMass[copyNo] == 3 )
285 return fCytoplasmMaterial3;
void SetColour(const G4Colour &)
G4Material * GetMaterial() const
G4Material * ComputeMaterial(const G4int copyNo, G4VPhysicalVolume *physVol, const G4VTouchable *)
CellParameterisation(G4Material *nucleus1, G4Material *cytoplasm1, G4Material *nucleus2, G4Material *cytoplasm2, G4Material *nucleus3, G4Material *cytoplasm3)
void ComputeTransformation(const G4int copyNo, G4VPhysicalVolume *physVol) const
void ComputeDimensions(G4Box &, const G4int, const G4VPhysicalVolume *) const
void SetTranslation(const G4ThreeVector &v)
static constexpr double cm3
G4LogicalVolume * GetLogicalVolume() const
virtual ~CellParameterisation()
static constexpr double micrometer
void SetVisAttributes(const G4VisAttributes *pVA)