49 G4String FileExperimentalData,
G4String FileExperimentalDataOut):startCurve(0),
50 stopCurve(0),chi2Factor(0)
53 sprintf(a,
"%d", seed);
92 in.getline(a,1000,
'\n');
104 in.getline(a,1000,
'\n');
149 std::cout <<
"ERROR I can't find the experimental data file" <<
G4endl;
161 for (
int i=0; i<(
int)
voxels.size(); i++ )
168 G4double depEnergy, density, voxelVolume;
192 voxelVolume=
voxels[i].halfSize.getX()*
voxels[i].halfSize.getY()*
voxels[i].halfSize.getZ()*8.;
193 voxelMass=density*voxelVolume;
257 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]";
296 cs+=vox[i].depEnergy*vox[i].expDose;
297 cc+=vox[i].depEnergy*vox[i].depEnergy;
305 dd=vox[i].depEnergy*vox[i].depEnergy;
306 d2=vox[i].depEnergy2;
308 vox[i].depEnergyNorm=
chi2Factor[j]*vox[i].depEnergy;
311 if (n>1){vox[i].depEnergyNormError=
chi2Factor[j]*std::sqrt(v/(n-1));}
312 if (n==1){vox[i].depEnergyNormError=vox[i].depEnergyNorm;}
void set(double x, double y, double z)
G4int getMinNumberOfEvents()
std::vector< ExP01TrackerHit * > a
static const G4double pos
G4LogicalVolume * GetLogicalVolume() const
G4StepPoint * GetPreStepPoint() const
static constexpr double mm
G4VPhysicalVolume * GetPhysicalVolume() const
static constexpr double kg
G4ParticleDefinition * GetDefinition() const
G4Material * GetMaterial() const
const G4ThreeVector & GetPosition() const
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
G4Track * GetTrack() const
const G4ThreeVector & GetMomentumDirection() const
G4double GetTotalEnergyDeposit() const
G4double depEnergyNormError
void calculateNormalizedEd(std::vector< Svoxel > &voxels)
G4int saving_in_Selected_Voxels_every_events
G4int getMaxNumberOfEvents()
static constexpr double joule
G4int GetPDGEncoding() const
G4int primaryParticlePDGE
std::vector< Svoxel > voxels
G4bool bHasExperimentalData
void add(G4ThreeVector pos, G4double depEnergy, G4double density)
CML2ExpVoxels(G4bool bHasExperimentalData, G4int saving_in_Selected_Voxels_every_events, G4int seed, G4String FileExperimentalData, G4String FileExperimentalDataOut)
void resetNEventsInVoxels()
G4double GetDensity() const