81 for(iMat = 0; iMat < numOfCouples; ++iMat)
91 if(iMat == numOfCouples)
93 G4Exception(
"G4ForwardXrayTR::G4ForwardXrayTR",
"ForwardXrayTR01",
95 "Invalid first material name in G4ForwardXrayTR constructor!");
101 for(iMat = 0; iMat < numOfCouples; ++iMat)
111 if(iMat == numOfCouples)
114 "G4ForwardXrayTR::G4ForwardXrayTR",
"ForwardXrayTR02",
JustWarning,
115 "Invalid second material name in G4ForwardXrayTR constructor!");
154 out <<
"Simulation of forward X-ray transition radiation generated by\n"
155 "relativistic charged particles crossing the interface between\n"
170 G4int iMat, jMat, iTkin, iTR, iPlace;
180 for(iMat = 0; iMat < numOfCouples;
186 for(jMat = 0; jMat < numOfCouples; ++jMat)
222 for(iTkin = 0; iTkin <
fTotBin; ++iTkin)
251 for(iTR =
fBinTR - 2; iTR >= 0; --iTR)
261 energyVector->
PutValue(iTR, energySum);
262 angleVector->
PutValue(iTR, angleSum);
293 G4double formationLength1, formationLength2;
298 return (varAngle /
energy) * (formationLength1 - formationLength2) *
299 (formationLength1 - formationLength2);
306 G4double x, x2, c, d, f, a2, b2, a4, b4;
317 cof1 = c * c * (0.5 / (a2 * (x2 + a2)) + 0.5 * std::log(x2 / (x2 + a2)) / a4);
318 cof3 = d * d * (0.5 / (b2 * (x2 + b2)) + 0.5 * std::log(x2 / (x2 + b2)) / b4);
320 (std::log(x2 / (x2 + b2)) / b2 - std::log(x2 / (x2 + a2)) / a2) /
322 return -varAngle * (cof1 + cof2 + cof3);
340 G4double h, sumEven = 0.0, sumOdd = 0.0;
367 return ((a + b) * std::log((x + b) / (x + a)) / (a - b) + a / (x + a) +
388 G4double h, sumEven = 0.0, sumOdd = 0.0;
412 G4int iMat, jMat, iTkin, iPlace, numOfTR, iTR, iTransfer;
414 G4double energyPos, anglePos, energyTR, theta, phi, dirX, dirY, dirZ;
471 G4double chargeSq = charge * charge;
475 G4double TkinScaled = kinEnergy * massRatio;
476 for(iTkin = 0; iTkin <
fTotBin; ++iTkin)
478 if(TkinScaled < fProtonEnergyVector->GetLowEdgeEnergy(iTkin))
507 for(iTR = 0; iTR < numOfTR; ++iTR)
509 energyPos = (*(*fEnergyDistrTable)(iPlace))(0) *
G4UniformRand();
510 for(iTransfer = 0; iTransfer <
fBinTR - 1; ++iTransfer)
515 energyTR = (*fEnergyDistrTable)(iPlace)->GetLowEdgeEnergy(iTransfer);
517 kinEnergy -= energyTR;
520 anglePos = (*(*fAngleDistrTable)(iPlace))(0) *
G4UniformRand();
521 for(iTransfer = 0; iTransfer <
fBinTR - 1; ++iTransfer)
530 dirX = std::sin(theta) * std::cos(phi);
531 dirY = std::sin(theta) * std::sin(phi);
532 dirZ = std::cos(theta);
558 W1 = (E2 - TkinScaled) * W;
559 W2 = (TkinScaled - E1) * W;
575 for(iTR = 0; iTR < numOfTR; ++iTR)
577 energyPos = ((*(*fEnergyDistrTable)(iPlace))(0) * W1 +
580 for(iTransfer = 0; iTransfer <
fBinTR - 1; ++iTransfer)
588 ((*fEnergyDistrTable)(iPlace)->GetLowEdgeEnergy(iTransfer)) * W1 +
592 kinEnergy -= energyTR;
595 anglePos = ((*(*fAngleDistrTable)(iPlace))(0) * W1 +
598 for(iTransfer = 0; iTransfer <
fBinTR - 1; ++iTransfer)
611 dirX = std::sin(theta) * std::cos(phi);
612 dirY = std::sin(theta) * std::sin(phi);
613 dirZ = std::cos(theta);
637 G4int iPlace, numOfTR, iTR, iTransfer;
672 iPlace = (iMat * (numOfCouples - 1) + jMat) *
fTotBin + iTkin - 1;
676 iPlace = (iMat * (numOfCouples - 1) + jMat - 1) *
fTotBin + iTkin - 1;
683 numOfTR =
G4Poisson((*energyVector1)(0));
690 for(iTR = 0; iTR < numOfTR; ++iTR)
693 for(iTransfer = 0; iTransfer <
fBinTR - 1; ++iTransfer)
695 if(energyPos >= (*energyVector1)(iTransfer))
712 numOfTR =
G4Poisson((*energyVector1)(0) * W1 + (*energyVector2)(0) * W2);
719 G4cout <<
"It is still OK in GetEnergyTR(int,int,int)" <<
G4endl;
720 for(iTR = 0; iTR < numOfTR; ++iTR)
722 energyPos = ((*energyVector1)(0) * W1 + (*energyVector2)(0) * W2) *
724 for(iTransfer = 0; iTransfer <
fBinTR - 1; ++iTransfer)
726 if(energyPos >= ((*energyVector1)(iTransfer) *W1 +
727 (*energyVector2)(iTransfer) *W2))
731 (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)
static constexpr double twopi
G4GLOB_DLL std::ostream G4cout
Hep3Vector & rotateUz(const Hep3Vector &)
const G4ThreeVector & GetMomentumDirection() const
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
static constexpr G4double fPlasmaCof
G4double SpectralDensity(G4double energy, G4double x) const
static constexpr G4int fTotBin
G4ForwardXrayTR(const G4String &matName1, const G4String &matName2, const G4String &processName="XrayTR")
static G4double GetMinProtonTkin()
G4double EnergyInterval(G4double energy1, G4double energy2, G4double varAngle) const
static constexpr G4double fTheMaxEnergyTR
G4double EnergySum(G4double energy1, G4double energy2) const
static G4int GetSympsonNumber()
static constexpr G4int fBinTR
static constexpr G4double fCofTR
static G4double GetMaxProtonTkin()
static constexpr G4double fTheMinAngle
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
static constexpr G4double fTheMinEnergyTR
static constexpr G4int fSympsonNumber
G4double GetEnergyTR(G4int iMat, G4int jMat, G4int iTkin) const
static constexpr G4double fMaxProtonTkin
static constexpr G4double fTheMaxAngle
static constexpr G4double fMinProtonTkin
G4double AngleInterval(G4double energy, G4double varAngle1, G4double varAngle2) const
G4double GetThetaTR(G4int iMat, G4int jMat, G4int iTkin) const
G4PhysicsLogVector * fProtonEnergyVector
G4ParticleDefinition * fPtrGamma
G4double SpectralAngleTRdensity(G4double energy, G4double varAngle) const override
void ProcessDescription(std::ostream &) const override
G4double AngleSum(G4double varAngle1, G4double varAngle2) const
G4double GetMeanFreePath(const G4Track &, G4double, G4ForceCondition *condition) override
G4double GetSurfaceTolerance() const
static G4GeometryTolerance * GetInstance()
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
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
static G4int GetModelID(const G4int modelIndex)
void insertAt(std::size_t, G4PhysicsVector *)
G4double GetLowEdgeEnergy(const std::size_t index) const
void PutValue(const std::size_t index, const G4double value)
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
const G4TouchableHandle & GetTouchableHandle() const
G4VPhysicalVolume * GetPhysicalVolume() const
G4StepPoint * GetPreStepPoint() const
G4StepPoint * GetPostStepPoint() const
const G4ThreeVector & GetPosition() const
void SetTouchableHandle(const G4TouchableHandle &apValue)
G4double GetGlobalTime() const
const G4DynamicParticle * GetDynamicParticle() const
void SetCreatorModelID(const G4int id)
G4double GetStepLength() const
void SetParentID(const G4int aValue)
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
void SetNumberOfSecondaries(G4int totSecondaries)
G4LogicalVolume * GetLogicalVolume() const
G4ParticleChange aParticleChange
G4double energy(const ThreeVector &p, const G4double m)