49 G4String FileExperimentalData,
G4String FileExperimentalDataOut):startCurve(0),
50 stopCurve(0),chi2Factor(0)
53 sprintf(a,
"%d", seed);
92 in.getline(a,1000,
'\n');
94 in.getline(a,1000,
'\n');
99 for (
int i = 0; i <
nCurves; i++)
106 in.getline(a,1000,
'\n');
107 in.getline(a,1000,
'\n');
153 G4cout <<
"ERROR I can't find the experimental data file" <<
G4endl;
172 G4double depEnergy, density, voxelVolume;
197 voxelMass = density*voxelVolume;
207 particle ->
dir = aStep -> GetPreStepPoint() -> GetMomentumDirection();
208 particle -> pos = aStep -> GetPreStepPoint() -> GetPosition();
209 particle -> kinEnergy =
dose;
210 particle -> nPrimaryPart = -1;
211 particle -> partPDGE = aStep -> GetTrack() -> GetDefinition() -> GetPDGEncoding();
212 particle -> primaryParticlePDGE = -1;
213 particle -> volumeId = i;
214 particle -> volumeName =
"-1";
256 for (
int i = 0; i<
nCurves; i++)
263 out <<
"% x [mm], y [mm], z [mm], Dx [mm], Dy [mm], Dz [mm], expDose [Gy], Calculated dose [Gy], Calculated dose2 [Gy^2], nEvents, normDose [Gy], normDoseError [Gy]";
302 cs += vox[i].depEnergy*vox[i].expDose;
303 cc += vox[i].depEnergy*vox[i].depEnergy;
309 for (i =
startCurve[j]-1; i < stopCurve[j]; i++)
311 dd = vox[i].depEnergy*vox[i].depEnergy;
312 d2 = vox[i].depEnergy2;
314 vox[i].depEnergyNorm =
chi2Factor[j]*vox[i].depEnergy;
317 if (n > 1) { vox[i].depEnergyNormError =
chi2Factor[j]*std::sqrt(v/(n-1)); }
318 if (n == 1) { vox[i].depEnergyNormError = vox[i].depEnergyNorm; }