107 for(iMat=0;iMat<numOfCouples;iMat++)
116 if(iMat == numOfCouples)
118 G4Exception(
"G4ForwardXrayTR::G4ForwardXrayTR",
"ForwardXrayTR01",
JustWarning,
"Invalid first material name in G4ForwardXrayTR constructor!");
123 for(iMat=0;iMat<numOfCouples;iMat++)
132 if(iMat == numOfCouples)
134 G4Exception(
"G4ForwardXrayTR::G4ForwardXrayTR",
"ForwardXrayTR02",
JustWarning,
"Invalid second material name in G4ForwardXrayTR constructor!");
191 G4int iMat, jMat, iTkin, iTR, iPlace;
202 for(iMat=0;iMat<numOfCouples;iMat++)
206 for(jMat=0;jMat<numOfCouples;jMat++)
242 for(iTkin=0;iTkin<
fTotBin;iTkin++)
276 for(iTR=
fBinTR-2;iTR>=0;iTR--)
284 energyVector->
PutValue(iTR,energySum);
285 angleVector ->
PutValue(iTR,angleSum);
291 iPlace = fTotBin+iTkin;
320 G4double formationLength1, formationLength2;
321 formationLength1 = 1.0/
325 formationLength2 = 1.0/
329 return (varAngle/energy)*(formationLength1 - formationLength2)
330 *(formationLength1 - formationLength2);
356 cof1 = c*c*(0.5/(a2*(x2 +a2)) +0.5*std::log(x2/(x2 +a2))/a4);
357 cof3 = d*d*(0.5/(b2*(x2 +b2)) +0.5*std::log(x2/(x2 +b2))/b4);
358 cof2 = -c*d*(std::log(x2/(x2 +b2))/b2 - std::log(x2/(x2 +a2))/a2)/(a2 - b2) ;
359 return -varAngle*(cof1 + cof2 + cof3);
386 G4double h , sumEven = 0.0 , sumOdd = 0.0;
392 varAngle1 + (2*i - 1)*h );
395 varAngle1 + (2*fSympsonNumber - 1)*h );
399 + 4.0*sumOdd + 2.0*sumEven )/3.0;
416 return ( (a + b)*std::log((x + b)/(x + a))/(a - b)
417 + a/(x + a) + b/(x + b) )/
energy;
445 G4double h , sumEven = 0.0 , sumOdd = 0.0;
457 + 4.0*sumOdd + 2.0*sumEven )/3.0;
471 G4int iMat, jMat, iTkin, iPlace, numOfTR, iTR, iTransfer;
473 G4double energyPos, anglePos, energyTR, theta, phi, dirX, dirY, dirZ;
491 GetLogicalVolume()->GetMaterialCutsCouple();
493 GetLogicalVolume()->GetMaterialCutsCouple();
528 G4double TkinScaled = kinEnergy*massRatio;
529 for(iTkin=0;iTkin<
fTotBin;iTkin++)
531 if(TkinScaled < fProtonEnergyVector->GetLowEdgeEnergy(iTkin))
538 iPlace = fTotBin + iTkin - 1;
571 for(iTR=0;iTR<numOfTR;iTR++)
573 energyPos = (*(*fEnergyDistrTable)(iPlace))(0)*
G4UniformRand();
574 for(iTransfer=0;iTransfer<
fBinTR-1;iTransfer++)
578 energyTR = (*fEnergyDistrTable)(iPlace)->GetLowEdgeEnergy(iTransfer);
582 kinEnergy -= energyTR;
585 anglePos = (*(*fAngleDistrTable)(iPlace))(0)*
G4UniformRand();
586 for(iTransfer=0;iTransfer<fBinTR-1;iTransfer++)
590 theta = std::sqrt((*
fAngleDistrTable)(iPlace)->GetLowEdgeEnergy(iTransfer-1));
595 dirX = std::sin(theta)*std::cos(phi) ;
596 dirY = std::sin(theta)*std::sin(phi) ;
597 dirZ = std::cos(theta) ;
618 W1 = (E2 - TkinScaled)*W;
619 W2 = (TkinScaled - E1)*W;
641 for(iTR=0;iTR<numOfTR;iTR++)
643 energyPos = ((*(*fEnergyDistrTable)(iPlace))(0)*W1+
645 for(iTransfer=0;iTransfer<
fBinTR-1;iTransfer++)
650 energyTR = ((*fEnergyDistrTable)(iPlace)->GetLowEdgeEnergy(iTransfer))*W1+
655 kinEnergy -= energyTR;
658 anglePos = ((*(*fAngleDistrTable)(iPlace))(0)*W1+
660 for(iTransfer=0;iTransfer<fBinTR-1;iTransfer++)
666 GetLowEdgeEnergy(iTransfer-1))*W1+
668 GetLowEdgeEnergy(iTransfer-1))*W2);
673 dirX = std::sin(theta)*std::cos(phi) ;
674 dirY = std::sin(theta)*std::sin(phi) ;
675 dirZ = std::cos(theta) ;
698 G4int iPlace, numOfTR, iTR, iTransfer;
729 iPlace = (iMat*(numOfCouples - 1) + jMat)*
fTotBin + iTkin - 1;
733 iPlace = (iMat*(numOfCouples - 1) + jMat - 1)*
fTotBin + iTkin - 1;
740 numOfTR =
G4Poisson( (*energyVector1)(0) );
747 for(iTR=0;iTR<numOfTR;iTR++)
750 for(iTransfer=0;iTransfer<
fBinTR-1;iTransfer++)
752 if(energyPos >= (*energyVector1)(iTransfer))
break;
768 numOfTR =
G4Poisson( (*energyVector1)(0)*W1 +
769 (*energyVector2)(0)*W2 );
776 G4cout<<
"It is still OK in GetEnergyTR(int,int,int)"<<
G4endl;
777 for(iTR=0;iTR<numOfTR;iTR++)
779 energyPos = ((*energyVector1)(0)*W1+
781 for(iTransfer=0;iTransfer<
fBinTR-1;iTransfer++)
783 if(energyPos >= ((*energyVector1)(iTransfer)*W1+
784 (*energyVector2)(iTransfer)*W2))
break;
787 (energyVector2->GetLowEdgeEnergy(iTransfer))*W2;
G4double SpectralAngleTRdensity(G4double energy, G4double varAngle) const override
static G4double fTheMaxAngle
G4double SpectralDensity(G4double energy, G4double x) const
std::vector< ExP01TrackerHit * > a
static G4double fTheMaxEnergyTR
G4double GetLowEdgeEnergy(size_t binNumber) const
G4StepPoint * GetPreStepPoint() const
static constexpr double keV
G4double GetStepLength() const
const G4ThreeVector & GetMomentumDirection() const
static constexpr double hbarc
G4double GetPDGCharge() const
Hep3Vector & rotateUz(const Hep3Vector &)
G4VPhysicalVolume * GetPhysicalVolume() const
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
G4double AngleSum(G4double varAngle1, G4double varAngle2) const
static G4double fTheMinEnergyTR
void insertAt(size_t, G4PhysicsVector *)
G4double condition(const G4ErrorSymMatrix &m)
G4double EnergyInterval(G4double energy1, G4double energy2, G4double varAngle) const
static G4int GetSympsonNumber()
G4double GetPDGMass() const
const std::vector< G4double > * GetEnergyCutsVector(size_t pcIdx) const
void AddSecondary(G4Track *aSecondary)
static G4double fTheMinAngle
G4ParticleChange aParticleChange
static G4int fSympsonNumber
static constexpr double proton_mass_c2
G4double GetMeanFreePath(const G4Track &, G4double, G4ForceCondition *condition) override
const G4String & GetName() const
static constexpr double TeV
G4double GetEnergyTR(G4int iMat, G4int jMat, G4int iTkin) const
G4StepStatus GetStepStatus() const
G4ParticleDefinition * GetDefinition() const
virtual void Initialize(const G4Track &)
static constexpr double electron_mass_c2
static G4double GetMaxProtonTkin()
const std::vector< G4double > * fGammaCutInKineticEnergy
static G4double fMaxProtonTkin
static constexpr double twopi
G4double AngleDensity(G4double energy, G4double varAngle) const
G4StepPoint * GetPostStepPoint() const
void ProposeEnergy(G4double finalEnergy)
virtual ~G4ForwardXrayTR()
size_t GetTableSize() const
G4ParticleDefinition * fPtrGamma
static G4double fMinProtonTkin
static G4double fPlasmaCof
static G4ProductionCutsTable * GetProductionCutsTable()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4PhysicsTable * fEnergyDistrTable
G4PhysicsTable * fAngleDistrTable
G4double AngleInterval(G4double energy, G4double varAngle1, G4double varAngle2) const
G4double GetThetaTR(G4int iMat, G4int jMat, G4int iTkin) const
G4double GetKineticEnergy() const
G4GLOB_DLL std::ostream G4cout
static G4double GetMinProtonTkin()
G4ForwardXrayTR(const G4String &matName1, const G4String &matName2, const G4String &processName="XrayTR")
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
G4long G4Poisson(G4double mean)
static G4GeometryTolerance * GetInstance()
const G4Material * GetMaterial() const
static constexpr double pi
static constexpr double fine_structure_const
Float_t x2[n_points_geant4]
G4double EnergySum(G4double energy1, G4double energy2) const
G4VParticleChange * PostStepDoIt(const G4Track &aTrack, const G4Step &aStep) override
static constexpr double GeV
const G4DynamicParticle * GetDynamicParticle() const
G4double GetElectronDensity() const
G4double GetSurfaceTolerance() const
void PutValue(size_t index, G4double theValue)
G4PhysicsLogVector * fProtonEnergyVector
void SetNumberOfSecondaries(G4int totSecondaries)