89 G4cout <<
"IORTMatrix: Memory space to store physical dose into " <<
91 " voxels has been allocated " <<
G4endl;
93 else G4Exception(
"IORTMatrix::IORTMatrix()",
"IORT0005",
FatalException,
"Error: can't allocate memory to store physical dose!");
113 for (
size_t i=0; i<
ionStore.size(); i++)
138 for (
size_t i=0; i<
ionStore.size(); i++)
167 if ( (energyDeposit <=0. && !fluence) || !
secondary)
return false;
169 G4int PDGencoding = particleDef -> GetPDGEncoding();
170 PDGencoding -= PDGencoding%10;
173 for (
size_t l=0; l <
ionStore.size(); l++)
175 if (
ionStore[l].PDGencoding == PDGencoding )
177 if ( ((trackID == 1) && (
ionStore[l].isPrimary)) || ((trackID !=1) && (!
ionStore[l].isPrimary)))
188 G4int Z = particleDef-> GetAtomicNumber();
189 G4int A = particleDef-> GetAtomicMass();
191 G4String fullName = particleDef -> GetParticleName();
192 G4String name = fullName.substr (0, fullName.find(
"[") );
196 (trackID == 1) ?
true:
false,
245 ofs.open(file, std::ios::out);
254 if (psize ==
sizeof(
unsigned int))
256 unsigned int* pdata = (
unsigned int*)data;
257 if (pdata[n])
ofs << i <<
'\t' << j <<
'\t' <<
258 k <<
'\t' << pdata[
n] <<
G4endl;
263 if (pdata[n])
ofs << i <<
'\t' << j <<
'\t' <<
264 k <<
'\t' << pdata[
n] <<
G4endl;
275 for (
size_t i=0; i <
ionStore.size(); i++){
283 for (
size_t i=0; i <
ionStore.size(); i++){
305 ofs << std::setw(
width) <<
"Dose(MeV/g)";
308 for (
size_t l=0; l <
ionStore.size(); l++)
343 ofs << i <<
'\t' << j <<
'\t' << k <<
'\t';
348 for (
size_t l=0; l <
ionStore.size(); l++)
370 for (
size_t l=0; l <
ionStore.size(); l++)
374 analysis -> FillVoxelFragmentTuple( i, j, k,
G4int numberOfVoxelAlongY
void StoreMatrix(G4String file, void *data, size_t psize)
G4int * GetHitTrack(G4int i, G4int j, G4int k)
A class for connecting the simulation to an analysis package.
void TotalEnergyDeposit()
G4GLOB_DLL std::ostream G4cout
double A(double temperature)
G4int numberOfVoxelAlongX
static IORTAnalysisManager * GetInstance()
Get the pointer to the analysis manager.
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4bool Fill(G4int, G4ParticleDefinition *particleDef, G4int i, G4int j, G4int k, G4double energyDeposit, G4bool fluence=false)
static IORTMatrix * instance
IORTMatrix(G4int numberOfVoxelAlongX, G4int numberOfVoxelAlongY, G4int numberOfVoxelAlongZ, G4double massOfVoxel)
static IORTMatrix * GetInstance()
std::vector< ion > ionStore
G4int numberOfVoxelAlongZ
void StoreDoseFluenceRoot()
void StoreDoseFluenceAscii(G4String filename="")
G4int Index(G4int i, G4int j, G4int k)