57static const G4double sqrte=sqrt(exp(1.));
64 Rc(
CLHEP::elm_coupling/Mmuon),
65 LimitEnergy (5.*Mmuon),
66 LowestEnergyLimit (2.*Mmuon),
67 HighestEnergyLimit(1e12*
CLHEP::GeV),
88 return (&part == theGamma);
97 if(Energy5DLimit > 0.0 &&
nullptr != f5Dmodel) {
130 if(GammaEnergy <= LowestEnergyLimit) {
return DBL_MAX; }
138 if(e < LimitEnergy) {
139 G4double y = (e - LowestEnergyLimit)/(LimitEnergy - LowestEnergyLimit);
146 SIGMA += NbOfAtomsPerVolume[i] * fact *
149 return (SIGMA > 0.0) ? 1./SIGMA :
DBL_MAX;
173 if(Egam <= LowestEnergyLimit) {
return 0.0; }
177 G4double PowThres,Ecor,
B,Dn,Zthird,Winfty,WMedAppr,
189 Winfty=
B*Zthird*Mmuon/(Dn*electron_mass_c2);
190 WMedAppr=1./(4.*Dn*sqrte*Mmuon);
191 Wsatur=Winfty/WMedAppr;
192 sigfac=4.*fine_structure_const*
Z*
Z*Rc*Rc;
193 PowThres=1.479+0.00799*Dn;
194 Ecor=-18.+4347./(
B*Zthird);
201 G4double CrossSection=7./9.*sigfac*
G4Log(1.+WMedAppr*CorFuc*Eg);
202 CrossSection *= CrossSecFactor;
211 if(fac < 0.0)
return;
213 G4cout <<
"The cross section for GammaConversionToMuons is artificially "
214 <<
"increased by the CrossSecFactor=" << CrossSecFactor <<
G4endl;
232 if (Egam <= LowestEnergyLimit) {
242 if (Egam <= Energy5DLimit) {
243 std::vector<G4DynamicParticle*> fvect;
254 const G4Element* anElement = SelectRandomAtom(aDynamicGamma, aMaterial);
270 G4double Winfty=
B*Zthird*Mmuon/(Dn*electron_mass_c2);
274 G4double C2Term2=electron_mass_c2/(183.*Zthird*Mmuon);
279 G4double xmin=(Egam < LimitEnergy) ? GammaMuonInv : .5-sqrt(.25-GammaMuonInv);
283 G4double sBZ=sqrte*
B*Zthird/electron_mass_c2;
285 /(1.+2.*sBZ*Mmuon*GammaMuonInv));
288 const G4int nmax = 1000;
293 G4double del=Mmuon*Mmuon/(2.*Egam*xPM);
294 W=Winfty*(1.+Ds2*del/Mmuon)/(1.+sBZ*del);
296 result=(xxp > 0.) ? xxp*
G4Log(
W)*LogWmaxInv : 0.0;
298 G4cout <<
"G4GammaConversionToMuons::PostStepDoIt WARNING:"
299 <<
" in dSigxPlusGen, result=" << result <<
" > 1" <<
G4endl;
302 if(nn >= nmax) {
break; }
312 G4double a3 = (GammaMuonInv/(2.*xPM));
319 G4double f1_max=-(1.-xPM)*(2.*b1+(a21+a33)*
G4Log(a33/a21))/(2*b3);
321 G4double thetaPlus,thetaMinus,phiHalf;
331 if(std::abs(b1)<0.0001*a34)
334 f1=(1.-2.*xPM+4.*xPM*t*(1.-t))/(12.*a34*a34*a34*a34);
338 f1=-(1.-2.*xPM+4.*xPM*t*(1.-t))*(2.*b1+(a22+a34)*
G4Log(a34/a22))/(2*b3);
340 if(f1<0.0 || f1> f1_max)
342 G4cout <<
"G4GammaConversionToMuons::PostStepDoIt WARNING:"
343 <<
"outside allowed range f1=" << f1
344 <<
" is set to zero, a34 = "<< a34 <<
" a22 = "<<a22<<
"."
348 if(nn > nmax) {
break; }
352 G4double f2_max=1.-2.*xPM*(1.-4.*t*(1.-t));
358 f2=1.-2.*xPM+4.*xPM*t*(1.-t)*(1.+cos(2.*psi));
359 if(f2<0 || f2> f2_max)
361 G4cout <<
"G4GammaConversionToMuons::PostStepDoIt WARNING:"
362 <<
"outside allowed range f2=" << f2 <<
" is set to zero"
366 if(nn >= nmax) {
break; }
371 G4double C2Term1=GammaMuonInv/(2.*xPM*t);
372 G4double C22 = C2Term1*C2Term1+C2Term2*C2Term2;
381 phiHalf=0.5*rho/u*sin(psi);
383 thetaPlus =GammaMuonInv*(u+xiHalf)/xPlus;
384 thetaMinus=GammaMuonInv*(u-xiHalf)/xMinus;
388 if(std::abs(thetaPlus)>pi) { thetaPlus = 0.0; }
389 if(std::abs(thetaMinus)>pi) { thetaMinus = 0.0; }
393 }
while ( std::abs(thetaPlus)>pi || std::abs(thetaMinus) >pi);
402 G4ThreeVector MuPlusDirection ( sin(thetaPlus) *cos(phi0+phiHalf),
403 sin(thetaPlus) *sin(phi0+phiHalf), cos(thetaPlus) );
404 G4ThreeVector MuMinusDirection (-sin(thetaMinus)*cos(phi0-phiHalf),
405 -sin(thetaMinus) *sin(phi0-phiHalf), cos(thetaMinus) );
407 MuPlusDirection.
rotateUz(GammaDirection);
408 MuMinusDirection.
rotateUz(GammaDirection);
424const G4Element* G4GammaConversionToMuons::SelectRandomAtom(
432 const G4Element* elm = (*theElementVector)[0];
434 if (NumberOfElements > 1) {
440 for (std::size_t i=0; i<NumberOfElements; ++i)
442 elm = (*theElementVector)[i];
443 PartialSumSigma += NbOfAtomsPerVolume[i]
445 if (rval <= PartialSumSigma) {
break; }
455 G4String comments =
"gamma->mu+mu- Bethe Heitler process, SubType= ";
458 G4cout <<
" good cross section parametrization from "
460 <<
" to " << HighestEnergyLimit/GeV <<
" GeV for all Z." <<
G4endl;
G4double B(G4double temperature)
std::vector< const G4Element * > G4ElementVector
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4double G4Log(G4double x)
G4GLOB_DLL std::ostream G4cout
Hep3Vector & rotateUz(const Hep3Vector &)
void Initialise(const G4ParticleDefinition *, const G4DataVector &) override
void SampleSecondaries(std::vector< G4DynamicParticle * > *fvect, const G4MaterialCutsCouple *couple, const G4DynamicParticle *aDynamicGamma, G4double, G4double) override
void SetLeptonPair(const G4ParticleDefinition *p1, const G4ParticleDefinition *p2)
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
static G4EmParameters * Instance()
G4double MaxEnergyFor5DMuPair() const
G4double ComputeMeanFreePath(G4double GammaEnergy, const G4Material *aMaterial)
G4double ComputeCrossSectionPerAtom(G4double GammaEnergy, G4int Z)
G4double GetMeanFreePath(const G4Track &aTrack, G4double previousStepSize, G4ForceCondition *condition) override
void PrintInfoDefinition()
void SetCrossSecFactor(G4double fac)
~G4GammaConversionToMuons() override
G4bool IsApplicable(const G4ParticleDefinition &) override
G4double GetCrossSectionPerAtom(const G4DynamicParticle *aDynamicGamma, const G4Element *anElement)
void BuildPhysicsTable(const G4ParticleDefinition &) override
G4VParticleChange * PostStepDoIt(const G4Track &aTrack, const G4Step &aStep) override
G4GammaConversionToMuons(const G4String &processName="GammaToMuPair", G4ProcessType type=fElectromagnetic)
static G4LossTableManager * Instance()
void DeRegister(G4VEnergyLossProcess *p)
void Register(G4VEnergyLossProcess *p)
const G4ElementVector * GetElementVector() const
size_t GetNumberOfElements() const
const G4double * GetVecNbOfAtomsPerVolume() const
G4double GetA27(G4int Z) const
G4double GetZ13(G4double Z) const
static G4NistManager * Instance()
void AddSecondary(G4Track *aSecondary)
void Initialize(const G4Track &) override
void ProposeEnergy(G4double finalEnergy)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
std::size_t GetTableSize() const
static G4ProductionCutsTable * GetProductionCutsTable()
G4Material * GetMaterial() const
const G4DynamicParticle * GetDynamicParticle() const
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
void ProposeTrackStatus(G4TrackStatus status)
void SetNumberOfSecondaries(G4int totSecondaries)
G4ParticleChange aParticleChange
void SetProcessSubType(G4int)
G4int GetProcessSubType() const
const G4String & GetProcessName() const