87 crossSectionHandler(0),
93 generatorName =
"tsai";
118 if(crossSectionHandler)
delete crossSectionHandler;
119 if(energySpectrum)
delete energySpectrum;
120 if(theMeanFreePath)
delete theMeanFreePath;
121 delete angularDistribution;
122 delete TsaiAngularDistribution;
130 G4cout <<
"G4LowEnergyBremsstrahlung::BuildPhysicsTable start"
134 cutForSecondaryPhotons.clear();
137 if( energySpectrum != 0 )
delete energySpectrum;
139 for(
size_t i=0; i<15; i++) {
142 if(i == 10) x = 0.95;
143 if(i == 11) x = 0.97;
144 if(i == 12) x = 0.99;
145 if(i == 13) x = 0.995;
147 energyBins.push_back(x);
149 const G4String dataName(
"/brem/br-sp.dat");
153 G4cout <<
"G4LowEnergyBremsstrahlungSpectrum is initialized"
159 if( crossSectionHandler != 0 )
delete crossSectionHandler;
165 crossSectionHandler->
Initialise(0,lowKineticEnergy, highKineticEnergy, totBin);
170 <<
" is created; Cross section data: "
180 BuildLossTable(aParticleType);
183 G4cout <<
"The loss table is built"
201 if( theMeanFreePath != 0 )
delete theMeanFreePath;
202 theMeanFreePath = crossSectionHandler->
203 BuildMeanFreePathForMaterials(&cutForSecondaryPhotons);
206 G4cout <<
"The MeanFreePath table is built"
215 G4cout <<
"G4LowEnergyBremsstrahlung::BuildPhysicsTable end"
243 cutForSecondaryPhotons.clear();
247 for (
size_t j=0; j<numOfCouples; j++) {
260 tCut =
std::min(highKineticEnergy, tCut);
261 cutForSecondaryPhotons.push_back(tCut);
265 const G4double* theAtomicNumDensityVector =
268 G4cout <<
"Energy loss for material # " << j
269 <<
" tCut(keV)= " << tCut/
keV
274 for (
size_t i = 0; i<totBin; i++) {
280 for (
size_t iel=0; iel<NumberOfElements; iel++ ) {
281 G4int Z = (
G4int)((*theElementVector)[iel]->GetZ());
284 ionloss += e * cs * theAtomicNumDensityVector[iel];
287 <<
"; tCut(keV)= " << tCut/
keV
288 <<
"; E(keV)= " << lowEdgeEnergy/
keV
289 <<
"; Eav(keV)= " << e/
keV
291 <<
"; loss= " << ionloss
310 G4double tCut = cutForSecondaryPhotons[index];
313 if(tCut >= kineticEnergy)
320 G4double finalEnergy = kineticEnergy - tGamma;
323 if((kineticEnergy < 1*MeV && kineticEnergy > 1*
keV && generatorName ==
"2bn")){
324 theta = angularDistribution->
PolarAngle(kineticEnergy,finalEnergy,Z);
326 theta = TsaiAngularDistribution->
PolarAngle(kineticEnergy,finalEnergy,Z);
331 G4double sinTheta = std::sqrt(1. - dirZ*dirZ);
332 G4double dirX = sinTheta*std::cos(phi);
333 G4double dirY = sinTheta*std::sin(phi);
341 gammaDirection.
rotateUz(electronDirection);
344 if (finalEnergy < 0.) {
345 tGamma += finalEnergy;
349 G4double momentum = std::sqrt((totalEnergy + electron_mass_c2)*kineticEnergy);
351 G4double finalX = momentum*electronDirection.
x() - tGamma*gammaDirection.
x();
352 G4double finalY = momentum*electronDirection.
y() - tGamma*gammaDirection.
y();
353 G4double finalZ = momentum*electronDirection.
z() - tGamma*gammaDirection.
z();
356 G4double norm = 1./std::sqrt(finalX*finalX + finalY*finalY + finalZ*finalZ);
362 gammaDirection, tGamma);
371 G4String comments =
"Total cross sections from EEDL database.";
372 comments +=
"\n Gamma energy sampled from a parameterised formula.";
373 comments +=
"\n Implementation of the continuous dE/dx part.";
374 comments +=
"\n At present it can be used for electrons ";
375 comments +=
"in the energy range [250eV,100GeV].";
376 comments +=
"\n The process must work with G4LowEnergyIonisation.";
405 angularDistribution = distribution;
413 delete angularDistribution;
415 generatorName =
name;
417 else if (name ==
"2bn")
419 delete angularDistribution;
421 generatorName =
name;
423 else if (name ==
"2bs")
425 delete angularDistribution;
427 generatorName =
name;
431 G4Exception(
"G4LowEnergyBremsstrahlung::SetAngularGenerator()",
const std::vector< G4double > * GetEnergyCutsVector(size_t pcIdx) const
std::vector< G4Element * > G4ElementVector
virtual G4double PolarAngle(const G4double initial_energy, const G4double final_energy, const G4int Z)=0
void insert(G4PhysicsVector *)
static G4int CounterOfElectronProcess
void Initialise(G4RDVDataSetAlgorithm *interpolation=0, G4double minE=250 *CLHEP::eV, G4double maxE=100 *CLHEP::GeV, G4int numberOfBins=200, G4double unitE=CLHEP::MeV, G4double unitData=CLHEP::barn, G4int minZ=1, G4int maxZ=99)
void PrintInfoDefinition()
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
void LoadShellData(const G4String &dataFile)
virtual const G4RDVEMDataSet * GetComponent(G4int componentId) const =0
static G4double GetLowerBoundEloss()
G4double FindValue(G4int Z, G4double e) const
G4double GetLowEdgeEnergy(size_t binNumber) const
const G4ElementVector * GetElementVector() const
~G4LowEnergyBremsstrahlung()
static constexpr double twopi
const XML_Char const XML_Char * data
G4double GetKineticEnergy() const
G4GLOB_DLL std::ostream G4cout
void SetCutForLowEnSecPhotons(G4double cut)
size_t GetTableSize() const
Hep3Vector & rotateUz(const Hep3Vector &)
void PutValue(size_t index, G4double theValue)
void BuildDEDXTable(const G4ParticleDefinition &aParticleType)
virtual G4double FindValue(G4double x, G4int componentId=0) const =0
virtual void PrintData() const =0
const G4String & GetProcessName() const
const G4double * GetAtomicNumDensityVector() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4PhysicsTable ** RecorderOfPositronProcess
virtual void Initialize(const G4Track &)
static G4ProductionCutsTable * GetProductionCutsTable()
static G4double GetUpperBoundEloss()
virtual G4double AverageEnergy(G4int Z, G4double minKineticEnergy, G4double maxKineticEnergy, G4double kineticEnergy, G4int shell=0, const G4ParticleDefinition *pd=0) const =0
static G4PhysicsTable ** RecorderOfElectronProcess
const G4ThreeVector & GetMomentumDirection() const
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
void SetNumberOfSecondaries(G4int totSecondaries)
static G4int GetNbinEloss()
void SetAngularGenerator(G4RDVBremAngularDistribution *distribution)
G4LowEnergyBremsstrahlung(const G4String &processName="LowEnBrem")
G4int SelectRandomAtom(const G4MaterialCutsCouple *couple, G4double e) const
void ProposeEnergy(G4double finalEnergy)
G4ParticleChange aParticleChange
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
void AddSecondary(G4Track *aSecondary)
void BuildPhysicsTable(const G4ParticleDefinition &particleType)
static G4Electron * Electron()
size_t GetNumberOfElements() const
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
G4PhysicsTable * theLossTable
static G4int CounterOfPositronProcess
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
G4double GetMeanFreePath(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
static constexpr double keV
G4VParticleChange * PostStepDoIt(const G4Track &track, const G4Step &step)
virtual G4double SampleEnergy(G4int Z, G4double minKineticEnergy, G4double maxKineticEnergy, G4double kineticEnergy, G4int shell=0, const G4ParticleDefinition *pd=0) const =0
const G4Material * GetMaterial() const
G4bool IsApplicable(const G4ParticleDefinition &)
virtual void PrintGeneratorInformation() const =0