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 * GetHitTrack(G4int i, G4int j, G4int k)
G4bool Fill(G4int, G4ParticleDefinition *particleDef, G4int i, G4int j, G4int k, G4double energyDeposit, G4bool fluence=false)
std::vector< ExP01TrackerHit * > a
static constexpr double MeV
G4int Index(G4int i, G4int j, G4int k)
static IORTMatrix * instance
void TotalEnergyDeposit()
static IORTMatrix * GetInstance()
const XML_Char const XML_Char * data
static constexpr double g
G4int numberOfVoxelAlongZ
double A(double temperature)
void StoreDoseFluenceAscii(G4String filename="")
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
IORTMatrix(G4int numberOfVoxelAlongX, G4int numberOfVoxelAlongY, G4int numberOfVoxelAlongZ, G4double massOfVoxel)
static IORTAnalysisManager * GetInstance()
void StoreDoseFluenceRoot()
G4int numberOfVoxelAlongY
G4GLOB_DLL std::ostream G4cout
std::vector< ion > ionStore
G4int numberOfVoxelAlongX
void StoreMatrix(G4String file, void *data, size_t psize)