67 hbarc*hbarc*hbarc/electron_mass_c2;
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++)
250 GetLowEdgeEnergy(iTkin)/proton_mass_c2);
276 for(iTR=
fBinTR-2;iTR>=0;iTR--)
284 energyVector->
PutValue(iTR,energySum);
285 angleVector ->
PutValue(iTR,angleSum);
320 G4double formationLength1, formationLength2;
321 formationLength1 = 1.0/
325 formationLength2 = 1.0/
329 return (varAngle/energy)*(formationLength1 - formationLength2)
330 *(formationLength1 - formationLength2);
343 G4double x, x2, c, d, f, a2, b2, a4, b4;
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 );
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))
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 condition(const G4ErrorSymMatrix &m)
G4long G4Poisson(G4double mean)
G4DLLIMPORT 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")
G4double EnergyInterval(G4double energy1, G4double energy2, G4double varAngle) const
static G4double fPlasmaCof
G4double EnergySum(G4double energy1, G4double energy2) const
static G4double fTheMaxAngle
static G4double fTheMinEnergyTR
G4VParticleChange * PostStepDoIt(const G4Track &aTrack, const G4Step &aStep)
const std::vector< G4double > * fGammaCutInKineticEnergy
G4PhysicsTable * fEnergyDistrTable
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
G4double SpectralAngleTRdensity(G4double energy, G4double varAngle) const
G4double GetMeanFreePath(const G4Track &, G4double, G4ForceCondition *condition)
static G4double fTheMinAngle
G4double AngleSum(G4double varAngle1, G4double varAngle2) const
static G4double fTheMaxEnergyTR
static G4double fMaxProtonTkin
virtual ~G4ForwardXrayTR()
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(size_t, G4PhysicsVector *)
virtual G4double GetLowEdgeEnergy(size_t binNumber) const
void PutValue(size_t index, G4double theValue)
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
size_t GetTableSize() const
const std::vector< G4double > * GetEnergyCutsVector(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
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)