45G4VEmModel(nam), isInitialised(false), fTableData(0)
47 fpMolWaterDensity = 0;
50 fParticleDefinition = 0;
62 G4cout <<
"Born excitation model is constructed " <<
G4endl;
65 fLastBinCallForFinalXS = 0;
91 G4cout <<
"Calling G4DNABornExcitationModel2::Initialise()" <<
G4endl;
94 if(fParticleDefinition != 0 && fParticleDefinition != particle)
96 G4Exception(
"G4DNABornExcitationModel2::Initialise",
"em0001",
97 FatalException,
"Model already initialized for another particle type.");
100 fParticleDefinition = particle;
102 std::ostringstream fullFileName;
107 G4Exception(
"G4DNABornExcitationModel2::Initialise",
"G4LEDATA-CHECK",
111 fullFileName << path;
115 fullFileName <<
"/dna/bornExcitation-e.dat";
121 fullFileName <<
"/dna/bornExcitation-p.dat";
122 fLowEnergy = 500. * keV;
123 fHighEnergy = 100. * MeV;
139 std::size_t finalBin_i = 2000;
146 for(std::size_t energy_i = 0; energy_i < finalBin_i; ++energy_i)
148 energy = fTotalXS->
Energy(energy_i);
151 for(std::size_t level = 0; level<fTableData->size(); ++level)
153 finalXS += (*fTableData)(level)->
Value(energy);
155 fTotalXS->
PutValue(energy_i, finalXS);
167 G4cout <<
"Born excitation model is initialized " <<
G4endl
181 isInitialised =
true;
192 if (verboseLevel > 3)
194 G4cout <<
"Calling CrossSectionPerVolume() of G4DNABornExcitationModel2"
198 if(particleDefinition != fParticleDefinition)
return 0;
206 if (ekin >= fLowEnergy && ekin <= fHighEnergy)
208 sigma = fTotalXS->
Value(ekin, fLastBinCallForFinalXS);
219 if (verboseLevel > 2)
221 G4cout <<
"__________________________________" <<
G4endl;
222 G4cout <<
"G4DNABornExcitationModel2 - XS INFO START" <<
G4endl;
224 G4cout <<
"Cross section per water molecule (cm^2)=" << sigma/cm/cm <<
G4endl;
225 G4cout <<
"Cross section per water molecule (cm^-1)=" << sigma*waterDensity/(1./cm) <<
G4endl;
226 G4cout <<
"G4DNABornExcitationModel2 - XS INFO END" <<
G4endl;
229 return sigma*waterDensity;
241 if (verboseLevel > 3)
243 G4cout <<
"Calling SampleSecondaries() of G4DNABornExcitationModel2"
249 G4int level = RandomSelect(k);
251 G4double newEnergy = k - excitationEnergy;
276 if (fParticleDefinition != particle)
278 G4Exception(
"G4DNABornExcitationModel2::GetPartialCrossSection",
281 "Model initialized for another particle type.");
284 return (*fTableData)(level)->
Value(kineticEnergy);
291 const std::size_t n(fTableData->size());
305 partialXS = (*fTableData)(i)->
Value(k);
306 if (partialXS > value)
const char * G4FindDataDir(const char *)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
virtual G4double CrossSectionPerVolume(const G4Material *material, const G4ParticleDefinition *p, G4double ekin, G4double emin, G4double emax)
G4ParticleChangeForGamma * fParticleChangeForGamma
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
G4DNABornExcitationModel2(const G4ParticleDefinition *p=0, const G4String &nam="DNABornExcitationModel")
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &= *(new G4DataVector()))
virtual G4double GetPartialCrossSection(const G4Material *, G4int level, const G4ParticleDefinition *, G4double kineticEnergy)
virtual ~G4DNABornExcitationModel2()
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()
G4double ExcitationEnergy(G4int level)
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeMomentumDirection(const G4ThreeVector &Pfinal)
const G4String & GetParticleName() const
G4bool RetrievePhysicsTable(const G4String &filename, G4bool ascii=false, G4bool spline=false)
void PutValue(const std::size_t index, const G4double value)
G4double Energy(const std::size_t index) const
G4double Value(const G4double energy, std::size_t &lastidx) const
void SetHighEnergyLimit(G4double)
G4ParticleChangeForGamma * GetParticleChangeForGamma()
G4double LowEnergyLimit() const
virtual G4double Value(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy)
G4double HighEnergyLimit() const
void SetLowEnergyLimit(G4double)
const G4Track * GetCurrentTrack() const
void ProposeLocalEnergyDeposit(G4double anEnergyPart)