105 G4cout <<
"HadrontherapyMatrix: Memory space to store physical dose into " <<
107 " voxels has been allocated " <<
G4endl;
111 else G4Exception(
"HadrontherapyMatrix::HadrontherapyMatrix()",
"Hadrontherapy0005",
FatalException,
"Can't allocate memory to store physical dose!");
133 for (
size_t i=0; i<
ionStore.size(); i++)
161 for (
size_t i=0; i<
ionStore.size(); i++)
197 if ( (energyDeposit <=0. && !fluence) || !
secondary)
return false;
200 G4int PDGencoding = particleDef -> GetPDGEncoding();
201 PDGencoding -= PDGencoding%10;
204 for (
size_t l=0; l <
ionStore.size(); l++)
206 if (
ionStore[l].PDGencoding == PDGencoding )
209 if ( (trackID ==1 &&
ionStore[l].isPrimary) || (trackID !=1 && !
ionStore[l].isPrimary))
211 if (energyDeposit > 0.)
223 G4int Z = particleDef-> GetAtomicNumber();
224 G4int A = particleDef-> GetAtomicMass();
225 G4String fullName = particleDef -> GetParticleName();
226 G4String name = fullName.substr (0, fullName.find(
"[") );
233 (trackID == 1) ?
true:
false,
253 if (energyDeposit > 0.) newIon.
dose[
Index(i, j, k)] += energyDeposit;
279 ofs.open(file, std::ios::out);
288 if (psize ==
sizeof(
unsigned int))
290 unsigned int* pdata = (
unsigned int*)data;
294 ofs << i <<
'\t' << j <<
'\t' <<
k <<
'\t' << pdata[
n] <<
G4endl;
302 if (pdata[n])
ofs << i <<
'\t' << j <<
'\t' <<
k <<
'\t' << pdata[
n] <<
G4endl;
315 for (
size_t i=0; i <
ionStore.size(); i++){
325 for (
size_t i=0; i <
ionStore.size(); i++){
357 ofs << std::setw(
width) <<
"Dose(Gy)";
362 for (
size_t l=0; l <
ionStore.size(); l++)
383 ofs << i <<
'\t' << j <<
'\t' <<
k <<
'\t';
391 for (
size_t l=0; l <
ionStore.size(); l++)