125 crossSectionHandler(0),
148 G4cout <<
"G4LowEnergyIonisation::BuildPhysicsTable start"
159 G4cout <<
"G4RDVEnergySpectrum is initialized"
179 <<
" is created; Cross section data: "
192 G4cout <<
"The loss table is built"
215 G4cout <<
"The MeanFreePath table is built"
225 G4cout <<
"G4LowEnergyIonisation::BuildPhysicsTable end"
255 size_t binForFluo = totBin/10;
268 for (
size_t m=0;
m<numOfCouples;
m++) {
281 if(tCut > highKineticEnergy) tCut = highKineticEnergy;
285 const G4double* theAtomicNumDensityVector =
288 G4cout <<
"Energy loss for material # " <<
m
289 <<
" tCut(keV)= " << tCut/
keV
294 for (
size_t i = 0; i<totBin; i++) {
300 for (
size_t iel=0; iel<NumberOfElements; iel++ ) {
302 G4int Z = (
G4int)((*theElementVector)[iel]->GetZ());
311 ionloss += e * cs * theAtomicNumDensityVector[iel];
313 if(
verboseLevel > 1 || (Z == 14 && lowEdgeEnergy>1. && lowEdgeEnergy<0.)) {
316 <<
" E(keV)= " << lowEdgeEnergy/
keV
317 <<
" Eav(keV)= " << e/
keV
319 <<
" loss= " << ionloss
320 <<
" rho= " << theAtomicNumDensityVector[iel]
325 ionloss += esp * theAtomicNumDensityVector[iel];
328 if(
verboseLevel > 1 || (
m == 0 && lowEdgeEnergy>=1. && lowEdgeEnergy<=0.)) {
330 <<
" E(keV)= " << lowEdgeEnergy/
keV
331 <<
" loss(MeV/mm)= " << ionloss*
mm/
MeV
342 for (
size_t iel=0; iel<NumberOfElements; iel++ ) {
344 G4int Z = (
G4int)((*theElementVector)[iel]->GetZ());
348 for (
size_t j = 0; j<binForFluo; j++) {
362 eAverage += e * cs * theAtomicNumDensityVector[iel];
363 cross += cs * pro * theAtomicNumDensityVector[iel];
367 <<
" E(keV)= " << lowEdgeEnergy/
keV
368 <<
" Eav(keV)= " << e/
keV
377 coeff = cross/eAverage;
382 G4cout <<
"Ksi Coefficient for Z= " << Z
383 <<
" E(keV)= " << lowEdgeEnergy/
keV
384 <<
" Eav(keV)= " << eAverage/
keV
385 <<
" coeff= " << coeff
389 energy->push_back(lowEdgeEnergy);
390 ksi->push_back(coeff);
432 kineticEnergy, shell);
446 / (deltaMom * primaryMom);
448 if (cost > 1.) cost = 1.;
449 G4double sint = std::sqrt(1. - cost*cost);
451 G4double dirx = sint * std::cos(phi);
452 G4double diry = sint * std::sin(phi);
458 deltaDir.
rotateUz(primaryDirection);
468 sint = std::sqrt(1. - cost*cost);
472 dirx += del* sint * std::cos(phi);
473 diry += del* sint * std::sin(phi);
477 G4double finalPx = primaryMom*primaryDirection.
x() - deltaMom*dirx;
478 G4double finalPy = primaryMom*primaryDirection.
y() - deltaMom*diry;
479 G4double finalPz = primaryMom*primaryDirection.
z() - deltaMom*dirz;
484 G4double norm = 1.0/std::sqrt(dirx*dirx + diry*diry + dirz*dirz);
496 G4double finalKinEnergy = kineticEnergy - tDelta - theEnergyDeposit;
497 if(finalKinEnergy < 0.0) {
498 theEnergyDeposit += finalKinEnergy;
499 finalKinEnergy = 0.0;
504 G4double norm = 1.0/std::sqrt(finalPx*finalPx+finalPy*finalPy+finalPz*finalPz);
514 size_t nSecondaries = 0;
515 size_t totalNumber = 1;
516 std::vector<G4DynamicParticle*>* secondaryVector = 0;
527 if (secondaryVector != 0) {
529 nSecondaries = secondaryVector->size();
530 for (
size_t i = 0; i<nSecondaries; i++) {
532 aSecondary = (*secondaryVector)[i];
537 if (e < theEnergyDeposit &&
541 theEnergyDeposit -=
e;
547 (*secondaryVector)[i] = 0;
561 if (secondaryVector) {
563 for (
size_t l = 0; l < nSecondaries; l++) {
565 aSecondary = (*secondaryVector)[l];
572 delete secondaryVector;
575 if(theEnergyDeposit < 0.) {
576 G4cout <<
"G4LowEnergyIonisation: Negative energy deposit: "
577 << theEnergyDeposit/
eV <<
" eV" <<
G4endl;
578 theEnergyDeposit = 0.0;
588 G4String comments =
"Total cross sections from EEDL database.";
589 comments +=
"\n Gamma energy sampled from a parametrised formula.";
590 comments +=
"\n Implementation of the continuous dE/dx part.";
591 comments +=
"\n At present it can be used for electrons ";
592 comments +=
"in the energy range [250eV,100GeV].";
593 comments +=
"\n The process must work with G4LowEnergyBremsstrahlung.";
603 std::vector<G4DynamicParticle*>*
611 std::vector<G4DynamicParticle*>* partVector =
612 new std::vector<G4DynamicParticle*>;
622 std::vector<G4DynamicParticle*>* secVector = 0;
627 G4int shell, shellId;
632 std::vector<G4int>
n =
634 incidentEnergy,eLoss);
635 for (
size_t i=0; i<nElements; i++) {
638 size_t nVacancies = n[i];
644 for (
size_t j=0; j<nVacancies; j++) {
647 shellId = transitionManager->
Shell(Z, shell)->
ShellId();
655 if (secVector != 0) {
657 for (
size_t l = 0; l<secVector->size(); l++) {
659 aSecondary = (*secVector)[l];
660 if (aSecondary != 0) {
664 if ( eTot + e <= eLoss &&
669 partVector->push_back(aSecondary);