60 G4cout <<
"RPWBA excitation model is constructed " <<
G4endl;
79 G4cout <<
"Calling G4DNARPWBAExcitationModel::Initialise()" <<
G4endl;
82 if(fParticleDefinition !=
nullptr && fParticleDefinition != particle)
84 G4Exception(
"G4DNARPWBAExcitationModel::Initialise",
"em0001",
86 "Model already initialized for another particle type.");
89 fTableFile =
"dna/sigma_excitation_p_RPWBA";
90 fLowEnergy = 100. * MeV;
91 fHighEnergy = 300. * MeV;
96 ed <<
"Model is applicable from "<<fLowEnergy<<
" to "<<fHighEnergy;
97 G4Exception(
"G4DNARPWBAExcitationModel::Initialise",
"em0004",
104 fTableData->LoadData(fTableFile);
108 G4cout <<
"RPWBA excitation model is initialized " <<
G4endl
121 exceptionDescription <<
"G4_WATER does not exist :";
122 G4Exception(
"G4DNARPWBAIonisationModel::Initialise",
"em00020",
126 isInitialised =
true;
137 G4cout <<
"Calling CrossSectionPerVolume() of G4DNARPWBAExcitationModel"
141 if(fTableData ==
nullptr)
144 exceptionDescription <<
"No cross section data ";
145 G4Exception(
"G4DNARPWBAIonisationModel::CrossSectionPerVolume",
"em00120",
149 if(particleDefinition != fParticleDefinition)
158 if(ekin >= fLowEnergy && ekin <= fHighEnergy)
160 sigma = fTableData->FindValue(ekin);
165 G4cout <<
"__________________________________" <<
G4endl;
166 G4cout <<
"G4DNARPWBAExcitationModel - XS INFO START" <<
G4endl;
167 G4cout <<
"Kinetic energy(eV)=" << ekin / eV
169 G4cout <<
"Cross section per water molecule (cm^2)=" << sigma / cm / cm
171 G4cout <<
"Cross section per water molecule (cm^-1)="
172 << sigma * waterDensity / (1. / cm) <<
G4endl;
173 G4cout <<
"G4DNARPWBAExcitationModel - XS INFO END" <<
G4endl;
176 return sigma * waterDensity;
182 std::vector<G4DynamicParticle*>* ,
188 G4cout <<
"Calling SampleSecondaries() of G4DNARPWBAExcitationModel"
194 G4int level = RandomSelect(k);
196 G4double newEnergy = k - excitationEnergy;
223 if(fParticleDefinition != particle)
225 G4Exception(
"G4DNARPWBAExcitationModel::GetPartialCrossSection",
227 "Model initialized for another particle type.");
230 return fTableData->GetComponent(level)->FindValue(kineticEnergy);
239 auto valuesBuffer =
new G4double[fTableData->NumberOfComponents()];
240 const auto n = (
G4int)fTableData->NumberOfComponents();
247 valuesBuffer[i] = fTableData->GetComponent(i)->FindValue(k);
248 value += valuesBuffer[i];
258 if(valuesBuffer[i] > value)
260 delete[] valuesBuffer;
263 value -= valuesBuffer[i];
265 delete[] valuesBuffer;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4GLOB_DLL std::ostream G4cout
static G4DNAChemistryManager * Instance()
void CreateWaterMolecule(ElectronicModification, G4int, const G4Track *)
const std::vector< G4double > * GetNumMolPerVolTableFor(const G4Material *) const
Retrieve a table of molecular densities (number of molecules per unit volume) in the G4 unit system f...
static G4DNAMolecularMaterial * Instance()
G4DNARPWBAExcitationModel(const G4ParticleDefinition *p=nullptr, const G4String &nam="DNARPWBAExcitationModel")
void Initialise(const G4ParticleDefinition *, const G4DataVector &= *(new G4DataVector())) override
~G4DNARPWBAExcitationModel() override
G4double CrossSectionPerVolume(const G4Material *material, const G4ParticleDefinition *p, G4double ekin, G4double emin, G4double emax) override
G4ParticleChangeForGamma * fParticleChangeForGamma
G4double GetPartialCrossSection(const G4Material *, G4int level, const G4ParticleDefinition *, G4double kineticEnergy) override
void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) override
G4double ExcitationEnergy(G4int level)
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
std::size_t GetIndex() const
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeMomentumDirection(const G4ThreeVector &Pfinal)
const G4String & GetParticleName() const
G4ParticleChangeForGamma * GetParticleChangeForGamma()
G4double LowEnergyLimit() const
G4double HighEnergyLimit() const
const G4Track * GetCurrentTrack() const
void ProposeLocalEnergyDeposit(G4double anEnergyPart)