66 hbarc*hbarc*hbarc/electron_mass_c2;
106 for(iMat=0;iMat<numOfCouples;iMat++)
115 if(iMat == numOfCouples)
117 G4Exception(
"G4ForwardXrayTR::G4ForwardXrayTR",
"ForwardXrayTR01",
JustWarning,
"Invalid first material name in G4ForwardXrayTR constructor!");
122 for(iMat=0;iMat<numOfCouples;iMat++)
131 if(iMat == numOfCouples)
133 G4Exception(
"G4ForwardXrayTR::G4ForwardXrayTR",
"ForwardXrayTR02",
JustWarning,
"Invalid second material name in G4ForwardXrayTR constructor!");
190 G4int iMat, jMat, iTkin, iTR, iPlace;
201 for(iMat=0;iMat<numOfCouples;iMat++)
205 for(jMat=0;jMat<numOfCouples;jMat++)
241 for(iTkin=0;iTkin<
fTotBin;iTkin++)
249 GetLowEdgeEnergy(iTkin)/proton_mass_c2);
275 for(iTR=
fBinTR-2;iTR>=0;iTR--)
283 energyVector->
PutValue(iTR,energySum);
284 angleVector ->
PutValue(iTR,angleSum);
319 G4double formationLength1, formationLength2;
320 formationLength1 = 1.0/
324 formationLength2 = 1.0/
328 return (varAngle/energy)*(formationLength1 - formationLength2)
329 *(formationLength1 - formationLength2);
342 G4double x, x2, c, d, f, a2, b2, a4, b4;
355 cof1 = c*c*(0.5/(a2*(x2 +a2)) +0.5*std::log(x2/(x2 +a2))/a4);
356 cof3 = d*d*(0.5/(b2*(x2 +b2)) +0.5*std::log(x2/(x2 +b2))/b4);
357 cof2 = -c*d*(std::log(x2/(x2 +b2))/b2 - std::log(x2/(x2 +a2))/a2)/(a2 - b2) ;
358 return -varAngle*(cof1 + cof2 + cof3);
385 G4double h , sumEven = 0.0 , sumOdd = 0.0;
391 varAngle1 + (2*i - 1)*h );
398 + 4.0*sumOdd + 2.0*sumEven )/3.0;
415 return ( (a + b)*std::log((x + b)/(x + a))/(a - b)
416 + a/(x + a) + b/(x + b) )/energy;
444 G4double h , sumEven = 0.0 , sumOdd = 0.0;
456 + 4.0*sumOdd + 2.0*sumEven )/3.0;
470 G4int iMat, jMat, iTkin, iPlace, numOfTR, iTR, iTransfer;
472 G4double energyPos, anglePos, energyTR, theta, phi, dirX, dirY, dirZ;
490 GetLogicalVolume()->GetMaterialCutsCouple();
492 GetLogicalVolume()->GetMaterialCutsCouple();
527 G4double TkinScaled = kinEnergy*massRatio;
528 for(iTkin=0;iTkin<
fTotBin;iTkin++)
530 if(TkinScaled < fProtonEnergyVector->GetLowEdgeEnergy(iTkin))
570 for(iTR=0;iTR<numOfTR;iTR++)
572 energyPos = (*(*fEnergyDistrTable)(iPlace))(0)*
G4UniformRand();
573 for(iTransfer=0;iTransfer<
fBinTR-1;iTransfer++)
577 energyTR = (*fEnergyDistrTable)(iPlace)->GetLowEdgeEnergy(iTransfer);
581 kinEnergy -= energyTR;
584 anglePos = (*(*fAngleDistrTable)(iPlace))(0)*
G4UniformRand();
585 for(iTransfer=0;iTransfer<
fBinTR-1;iTransfer++)
589 theta = std::sqrt((*
fAngleDistrTable)(iPlace)->GetLowEdgeEnergy(iTransfer-1));
594 dirX = std::sin(theta)*std::cos(phi) ;
595 dirY = std::sin(theta)*std::sin(phi) ;
596 dirZ = std::cos(theta) ;
617 W1 = (E2 - TkinScaled)*W;
618 W2 = (TkinScaled - E1)*W;
640 for(iTR=0;iTR<numOfTR;iTR++)
642 energyPos = ((*(*fEnergyDistrTable)(iPlace))(0)*W1+
644 for(iTransfer=0;iTransfer<
fBinTR-1;iTransfer++)
649 energyTR = ((*fEnergyDistrTable)(iPlace)->GetLowEdgeEnergy(iTransfer))*W1+
654 kinEnergy -= energyTR;
657 anglePos = ((*(*fAngleDistrTable)(iPlace))(0)*W1+
659 for(iTransfer=0;iTransfer<
fBinTR-1;iTransfer++)
665 GetLowEdgeEnergy(iTransfer-1))*W1+
667 GetLowEdgeEnergy(iTransfer-1))*W2);
672 dirX = std::sin(theta)*std::cos(phi) ;
673 dirY = std::sin(theta)*std::sin(phi) ;
674 dirZ = std::cos(theta) ;
697 G4int iPlace, numOfTR, iTR, iTransfer;
728 iPlace = (iMat*(numOfCouples - 1) + jMat)*
fTotBin + iTkin - 1;
732 iPlace = (iMat*(numOfCouples - 1) + jMat - 1)*
fTotBin + iTkin - 1;
739 numOfTR =
G4Poisson( (*energyVector1)(0) );
746 for(iTR=0;iTR<numOfTR;iTR++)
749 for(iTransfer=0;iTransfer<
fBinTR-1;iTransfer++)
751 if(energyPos >= (*energyVector1)(iTransfer))
break;
767 numOfTR =
G4Poisson( (*energyVector1)(0)*W1 +
768 (*energyVector2)(0)*W2 );
775 G4cout<<
"It is still OK in GetEnergyTR(int,int,int)"<<
G4endl;
776 for(iTR=0;iTR<numOfTR;iTR++)
778 energyPos = ((*energyVector1)(0)*W1+
780 for(iTransfer=0;iTransfer<
fBinTR-1;iTransfer++)
782 if(energyPos >= ((*energyVector1)(iTransfer)*W1+
783 (*energyVector2)(iTransfer)*W2))
break;
786 (energyVector2->GetLowEdgeEnergy(iTransfer))*W2;
G4double condition(const G4ErrorSymMatrix &m)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4long G4Poisson(G4double mean)
G4GLOB_DLL std::ostream G4cout
Hep3Vector & rotateUz(const Hep3Vector &)
const G4ThreeVector & GetMomentumDirection() const
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
static G4int fSympsonNumber
G4double SpectralDensity(G4double energy, G4double x) const
G4ForwardXrayTR(const G4String &matName1, const G4String &matName2, const G4String &processName="XrayTR")
static G4double GetMinProtonTkin()
G4double EnergyInterval(G4double energy1, G4double energy2, G4double varAngle) const
static G4double fPlasmaCof
G4double EnergySum(G4double energy1, G4double energy2) const
static G4int GetSympsonNumber()
static G4double fTheMaxAngle
static G4double fTheMinEnergyTR
static G4double GetMaxProtonTkin()
const std::vector< G4double > * fGammaCutInKineticEnergy
G4PhysicsTable * fEnergyDistrTable
G4VParticleChange * PostStepDoIt(const G4Track &aTrack, const G4Step &aStep) override
G4PhysicsTable * fAngleDistrTable
G4double AngleDensity(G4double energy, G4double varAngle) const
G4double GetEnergyTR(G4int iMat, G4int jMat, G4int iTkin) const
static G4double fMinProtonTkin
G4double AngleInterval(G4double energy, G4double varAngle1, G4double varAngle2) const
G4double GetThetaTR(G4int iMat, G4int jMat, G4int iTkin) const
G4PhysicsLogVector * fProtonEnergyVector
G4ParticleDefinition * fPtrGamma
static G4double fTheMinAngle
G4double SpectralAngleTRdensity(G4double energy, G4double varAngle) const override
G4double AngleSum(G4double varAngle1, G4double varAngle2) const
static G4double fTheMaxEnergyTR
static G4double fMaxProtonTkin
virtual ~G4ForwardXrayTR()
G4double GetMeanFreePath(const G4Track &, G4double, G4ForceCondition *condition) override
G4double GetSurfaceTolerance() const
static G4GeometryTolerance * GetInstance()
const G4Material * GetMaterial() const
G4double GetElectronDensity() const
const G4String & GetName() const
void AddSecondary(G4Track *aSecondary)
void ProposeEnergy(G4double finalEnergy)
virtual void Initialize(const G4Track &)
G4double GetPDGMass() const
G4double GetPDGCharge() const
void insertAt(std::size_t, G4PhysicsVector *)
G4double GetLowEdgeEnergy(std::size_t binNumber) const
void PutValue(std::size_t index, G4double theValue)
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::size_t GetTableSize() const
const std::vector< G4double > * GetEnergyCutsVector(std::size_t pcIdx) const
static G4ProductionCutsTable * GetProductionCutsTable()
G4StepStatus GetStepStatus() const
G4VPhysicalVolume * GetPhysicalVolume() const
G4StepPoint * GetPreStepPoint() const
G4StepPoint * GetPostStepPoint() const
const G4DynamicParticle * GetDynamicParticle() const
G4double GetStepLength() const
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
void SetNumberOfSecondaries(G4int totSecondaries)
G4ParticleChange aParticleChange