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;
103 char *path = getenv(
"G4LEDATA");
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;
133 for(
size_t level = 0; level<fTableData->size(); ++level)
136 (*fTableData)(level)->SetSpline(
true);
139 size_t finalBin_i = 2000;
147 for(
size_t energy_i = 0; energy_i < finalBin_i; ++energy_i)
149 energy = fTotalXS->
Energy(energy_i);
152 for(
size_t level = 0; level<fTableData->size(); ++level)
154 finalXS += (*fTableData)(level)->
Value(energy);
156 fTotalXS->
PutValue(energy_i, finalXS);
168 G4cout <<
"Born excitation model is initialized " <<
G4endl
182 isInitialised =
true;
193 if (verboseLevel > 3)
195 G4cout <<
"Calling CrossSectionPerVolume() of G4DNABornExcitationModel2"
199 if(particleDefinition != fParticleDefinition)
return 0;
207 if (ekin >= fLowEnergy && ekin <= fHighEnergy)
209 sigma = fTotalXS->
Value(ekin, fLastBinCallForFinalXS);
220 if (verboseLevel > 2)
222 G4cout <<
"__________________________________" <<
G4endl;
223 G4cout <<
"G4DNABornExcitationModel2 - XS INFO START" <<
G4endl;
225 G4cout <<
"Cross section per water molecule (cm^2)=" << sigma/cm/cm <<
G4endl;
226 G4cout <<
"Cross section per water molecule (cm^-1)=" << sigma*waterDensity/(1./cm) <<
G4endl;
227 G4cout <<
"G4DNABornExcitationModel2 - XS INFO END" <<
G4endl;
230 return sigma*waterDensity;
242 if (verboseLevel > 3)
244 G4cout <<
"Calling SampleSecondaries() of G4DNABornExcitationModel2"
250 G4int level = RandomSelect(k);
252 G4double newEnergy = k - excitationEnergy;
277 if (fParticleDefinition != particle)
279 G4Exception(
"G4DNABornExcitationModel2::GetPartialCrossSection",
282 "Model initialized for another particle type.");
285 return (*fTableData)(level)->
Value(kineticEnergy);
292 const size_t n(fTableData->size());
306 partialXS = (*fTableData)(i)->
Value(k);
307 if (partialXS > value)
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)
const G4Track * GetCurrentTrack() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
const G4String & GetParticleName() const
G4bool RetrievePhysicsTable(const G4String &filename, G4bool ascii=false)
G4double Energy(std::size_t index) const
G4double Value(G4double theEnergy, std::size_t &lastidx) const
void PutValue(std::size_t index, G4double theValue)
void SetHighEnergyLimit(G4double)
G4ParticleChangeForGamma * GetParticleChangeForGamma()
G4double LowEnergyLimit() const
virtual G4double Value(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy)
G4double HighEnergyLimit() const
void SetLowEnergyLimit(G4double)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)