Geant4  10.02.p03
G4MuPairProductionModel Class Reference

#include <G4MuPairProductionModel.hh>

Inheritance diagram for G4MuPairProductionModel:
Collaboration diagram for G4MuPairProductionModel:

Public Member Functions

 G4MuPairProductionModel (const G4ParticleDefinition *p=0, const G4String &nam="muPairProd")
 
virtual ~G4MuPairProductionModel ()
 
virtual void Initialise (const G4ParticleDefinition *, const G4DataVector &)
 
virtual void InitialiseLocal (const G4ParticleDefinition *, G4VEmModel *masterModel)
 
virtual G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, G4double kineticEnergy, G4double Z, G4double A, G4double cutEnergy, G4double maxEnergy)
 
virtual G4double ComputeDEDXPerVolume (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy)
 
virtual void SampleSecondaries (std::vector< G4DynamicParticle *> *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
 
virtual G4double MinPrimaryEnergy (const G4Material *, const G4ParticleDefinition *, G4double)
 
void SetLowestKineticEnergy (G4double e)
 
void SetParticle (const G4ParticleDefinition *)
 
- Public Member Functions inherited from G4VEmModel
 G4VEmModel (const G4String &nam)
 
virtual ~G4VEmModel ()
 
virtual void InitialiseForMaterial (const G4ParticleDefinition *, const G4Material *)
 
virtual void InitialiseForElement (const G4ParticleDefinition *, G4int Z)
 
virtual G4double CrossSectionPerVolume (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
virtual G4double GetPartialCrossSection (const G4Material *, G4int, const G4ParticleDefinition *, G4double)
 
virtual G4double ComputeCrossSectionPerShell (const G4ParticleDefinition *, G4int Z, G4int shellIdx, G4double kinEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
virtual G4double ChargeSquareRatio (const G4Track &)
 
virtual G4double GetChargeSquareRatio (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual G4double GetParticleCharge (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual void StartTracking (G4Track *)
 
virtual void CorrectionsAlongStep (const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double &eloss, G4double &niel, G4double length)
 
virtual G4double Value (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy)
 
virtual G4double MinEnergyCut (const G4ParticleDefinition *, const G4MaterialCutsCouple *)
 
virtual void SetupForMaterial (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual void DefineForRegion (const G4Region *)
 
virtual void ModelDescription (std::ostream &outFile) const
 
void InitialiseElementSelectors (const G4ParticleDefinition *, const G4DataVector &)
 
std::vector< G4EmElementSelector * > * GetElementSelectors ()
 
void SetElementSelectors (std::vector< G4EmElementSelector *> *)
 
G4double ComputeDEDX (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=DBL_MAX)
 
G4double CrossSection (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
G4double ComputeMeanFreePath (const G4ParticleDefinition *, G4double kineticEnergy, const G4Material *, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, const G4Element *, G4double kinEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
G4int SelectIsotopeNumber (const G4Element *)
 
const G4ElementSelectRandomAtom (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
const G4ElementSelectRandomAtom (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
G4int SelectRandomAtomNumber (const G4Material *)
 
void SetParticleChange (G4VParticleChange *, G4VEmFluctuationModel *f=0)
 
void SetCrossSectionTable (G4PhysicsTable *, G4bool isLocal)
 
G4ElementDataGetElementData ()
 
G4PhysicsTableGetCrossSectionTable ()
 
G4VEmFluctuationModelGetModelOfFluctuations ()
 
G4VEmAngularDistributionGetAngularDistribution ()
 
void SetAngularDistribution (G4VEmAngularDistribution *)
 
G4double HighEnergyLimit () const
 
G4double LowEnergyLimit () const
 
G4double HighEnergyActivationLimit () const
 
G4double LowEnergyActivationLimit () const
 
G4double PolarAngleLimit () const
 
G4double SecondaryThreshold () const
 
G4bool LPMFlag () const
 
G4bool DeexcitationFlag () const
 
G4bool ForceBuildTableFlag () const
 
G4bool UseAngularGeneratorFlag () const
 
void SetAngularGeneratorFlag (G4bool)
 
void SetHighEnergyLimit (G4double)
 
void SetLowEnergyLimit (G4double)
 
void SetActivationHighEnergyLimit (G4double)
 
void SetActivationLowEnergyLimit (G4double)
 
G4bool IsActive (G4double kinEnergy)
 
void SetPolarAngleLimit (G4double)
 
void SetSecondaryThreshold (G4double)
 
void SetLPMFlag (G4bool val)
 
void SetDeexcitationFlag (G4bool val)
 
void SetForceBuildTable (G4bool val)
 
void SetMasterThread (G4bool val)
 
G4bool IsMaster () const
 
G4double MaxSecondaryKinEnergy (const G4DynamicParticle *dynParticle)
 
const G4StringGetName () const
 
void SetCurrentCouple (const G4MaterialCutsCouple *)
 
const G4ElementGetCurrentElement () const
 
const G4IsotopeGetCurrentIsotope () const
 
G4bool IsLocked () const
 
void SetLocked (G4bool)
 

Protected Member Functions

G4double ComputMuPairLoss (G4double Z, G4double tkin, G4double cut, G4double tmax)
 
G4double ComputeMicroscopicCrossSection (G4double tkin, G4double Z, G4double cut)
 
virtual G4double ComputeDMicroscopicCrossSection (G4double tkin, G4double Z, G4double pairEnergy)
 
G4double MaxSecondaryEnergyForElement (G4double kineticEnergy, G4double Z)
 
- Protected Member Functions inherited from G4VEmModel
G4ParticleChangeForLoss * GetParticleChangeForLoss ()
 
G4ParticleChangeForGamma * GetParticleChangeForGamma ()
 
virtual G4double MaxSecondaryEnergy (const G4ParticleDefinition *, G4double kineticEnergy)
 
const G4MaterialCutsCoupleCurrentCouple () const
 
void SetCurrentElement (const G4Element *)
 

Protected Attributes

const G4ParticleDefinitionparticle
 
G4NistManagernist
 
G4double factorForCross
 
G4double sqrte
 
G4double particleMass
 
G4double z13
 
G4double z23
 
G4double lnZ
 
G4int currentZ
 
- Protected Attributes inherited from G4VEmModel
G4ElementDatafElementData
 
G4VParticleChange * pParticleChange
 
G4PhysicsTablexSectionTable
 
const std::vector< G4double > * theDensityFactor
 
const std::vector< G4int > * theDensityIdx
 
size_t idxTable
 

Static Protected Attributes

static const G4double xgi [8]
 
static const G4double wgi [8]
 
- Static Protected Attributes inherited from G4VEmModel
static const G4double inveplus = 1.0/CLHEP::eplus
 

Private Member Functions

void MakeSamplingTables ()
 
void DataCorrupted (G4int Z, G4double logTkin)
 
G4double FindScaledEnergy (G4int Z, G4double rand, G4double logTkin, G4double yymin, G4double yymax)
 
G4MuPairProductionModeloperator= (const G4MuPairProductionModel &right)
 
 G4MuPairProductionModel (const G4MuPairProductionModel &)
 

Private Attributes

G4ParticleDefinitiontheElectron
 
G4ParticleDefinitionthePositron
 
G4ParticleChangeForLoss * fParticleChange
 
G4double minPairEnergy
 
G4double lowestKinEnergy
 
G4int nzdat
 
G4int nYBinPerDecade
 
size_t nbiny
 
size_t nbine
 
G4double ymin
 
G4double dy
 
G4double emin
 
G4double emax
 

Static Private Attributes

static const G4int zdat [5] ={1, 4, 13, 29, 92}
 
static const G4double adat [5] ={1.01, 9.01,26.98, 63.55, 238.03}
 

Detailed Description

Definition at line 73 of file G4MuPairProductionModel.hh.

Constructor & Destructor Documentation

◆ G4MuPairProductionModel() [1/2]

G4MuPairProductionModel::G4MuPairProductionModel ( const G4ParticleDefinition p = 0,
const G4String nam = "muPairProd" 
)

Definition at line 104 of file G4MuPairProductionModel.cc.

106  : G4VEmModel(nam),
107  particle(0),
110  sqrte(sqrt(G4Exp(1.))),
111  currentZ(0),
112  fParticleChange(0),
114  lowestKinEnergy(1.0*GeV),
115  nzdat(5),
116  nYBinPerDecade(4),
117  nbiny(1000),
118  nbine(0),
119  ymin(-5.),
120  dy(0.005)
121 {
123 
126 
127  particleMass = lnZ = z13 = z23 = 0;
128 
129  // setup lowest limit dependent on particle mass
130  if(p) {
131  SetParticle(p);
132  G4double limit = p->GetPDGMass()*8;
133  if(limit > lowestKinEnergy) { lowestKinEnergy = limit; }
134  }
136  emax = 10*TeV;
137 }
G4ParticleDefinition * thePositron
const G4ParticleDefinition * particle
G4ParticleDefinition * theElectron
void SetParticle(const G4ParticleDefinition *)
static G4NistManager * Instance()
G4VEmModel(const G4String &nam)
Definition: G4VEmModel.cc:69
G4ParticleChangeForLoss * fParticleChange
int fine_structure_const
Definition: hepunit.py:287
static const double GeV
Definition: G4SIunits.hh:214
float electron_mass_c2
Definition: hepunit.py:274
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
static G4Positron * Positron()
Definition: G4Positron.cc:94
int classic_electr_radius
Definition: hepunit.py:288
static const double pi
Definition: G4SIunits.hh:74
static G4Electron * Electron()
Definition: G4Electron.cc:94
static const double TeV
Definition: G4SIunits.hh:215
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

◆ ~G4MuPairProductionModel()

G4MuPairProductionModel::~G4MuPairProductionModel ( )
virtual

Definition at line 141 of file G4MuPairProductionModel.cc.

142 {}

◆ G4MuPairProductionModel() [2/2]

G4MuPairProductionModel::G4MuPairProductionModel ( const G4MuPairProductionModel )
private

Member Function Documentation

◆ ComputeCrossSectionPerAtom()

G4double G4MuPairProductionModel::ComputeCrossSectionPerAtom ( const G4ParticleDefinition ,
G4double  kineticEnergy,
G4double  Z,
G4double  A,
G4double  cutEnergy,
G4double  maxEnergy 
)
virtual

Reimplemented from G4VEmModel.

Definition at line 417 of file G4MuPairProductionModel.cc.

423 {
424  G4double cross = 0.0;
425  if (kineticEnergy <= lowestKinEnergy) { return cross; }
426 
427  G4double maxPairEnergy = MaxSecondaryEnergyForElement(kineticEnergy, Z);
428  G4double tmax = std::min(maxEnergy, maxPairEnergy);
429  G4double cut = std::max(cutEnergy, minPairEnergy);
430  if (cut >= tmax) { return cross; }
431 
432  cross = ComputeMicroscopicCrossSection(kineticEnergy, Z, cut);
433  if(tmax < kineticEnergy) {
434  cross -= ComputeMicroscopicCrossSection(kineticEnergy, Z, tmax);
435  }
436  return cross;
437 }
G4double MaxSecondaryEnergyForElement(G4double kineticEnergy, G4double Z)
G4double ComputeMicroscopicCrossSection(G4double tkin, G4double Z, G4double cut)
Float_t Z
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

◆ ComputeDEDXPerVolume()

G4double G4MuPairProductionModel::ComputeDEDXPerVolume ( const G4Material material,
const G4ParticleDefinition ,
G4double  kineticEnergy,
G4double  cutEnergy 
)
virtual

Reimplemented from G4VEmModel.

Definition at line 198 of file G4MuPairProductionModel.cc.

203 {
204  G4double dedx = 0.0;
205  if (cutEnergy <= minPairEnergy || kineticEnergy <= lowestKinEnergy)
206  { return dedx; }
207 
208  const G4ElementVector* theElementVector = material->GetElementVector();
209  const G4double* theAtomicNumDensityVector =
210  material->GetAtomicNumDensityVector();
211 
212  // loop for elements in the material
213  for (size_t i=0; i<material->GetNumberOfElements(); ++i) {
214  G4double Z = (*theElementVector)[i]->GetZ();
215  G4double tmax = MaxSecondaryEnergyForElement(kineticEnergy, Z);
216  G4double loss = ComputMuPairLoss(Z, kineticEnergy, cutEnergy, tmax);
217  dedx += loss*theAtomicNumDensityVector[i];
218  }
219  if (dedx < 0.) { dedx = 0.; }
220  return dedx;
221 }
G4double MaxSecondaryEnergyForElement(G4double kineticEnergy, G4double Z)
std::vector< G4Element * > G4ElementVector
G4double ComputMuPairLoss(G4double Z, G4double tkin, G4double cut, G4double tmax)
const G4double * GetAtomicNumDensityVector() const
Definition: G4Material.hh:216
Float_t Z
size_t GetNumberOfElements() const
Definition: G4Material.hh:186
const G4ElementVector * GetElementVector() const
Definition: G4Material.hh:190
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

◆ ComputeDMicroscopicCrossSection()

G4double G4MuPairProductionModel::ComputeDMicroscopicCrossSection ( G4double  tkin,
G4double  Z,
G4double  pairEnergy 
)
protectedvirtual

Reimplemented in G4hPairProductionModel.

Definition at line 304 of file G4MuPairProductionModel.cc.

311 {
312  static const G4double bbbtf= 183. ;
313  static const G4double bbbh = 202.4 ;
314  static const G4double g1tf = 1.95e-5 ;
315  static const G4double g2tf = 5.3e-5 ;
316  static const G4double g1h = 4.4e-5 ;
317  static const G4double g2h = 4.8e-5 ;
318 
319  G4double totalEnergy = tkin + particleMass;
320  G4double residEnergy = totalEnergy - pairEnergy;
321  G4double massratio = particleMass/electron_mass_c2 ;
322  G4double massratio2 = massratio*massratio ;
323  G4double cross = 0.;
324 
325  G4double c3 = 0.75*sqrte*particleMass;
326  if (residEnergy <= c3*z13) { return cross; }
327 
329  G4double c8 = 6.*particleMass*particleMass;
330  G4double alf = c7/pairEnergy;
331  G4double a3 = 1. - alf;
332  if (a3 <= 0.) { return cross; }
333 
334  // zeta calculation
335  G4double bbb,g1,g2;
336  if( Z < 1.5 ) { bbb = bbbh ; g1 = g1h ; g2 = g2h ; }
337  else { bbb = bbbtf; g1 = g1tf; g2 = g2tf; }
338 
339  G4double zeta = 0;
340  G4double zeta1 =
341  0.073*G4Log(totalEnergy/(particleMass+g1*z23*totalEnergy))-0.26;
342  if ( zeta1 > 0.)
343  {
344  G4double zeta2 =
345  0.058*G4Log(totalEnergy/(particleMass+g2*z13*totalEnergy))-0.14;
346  zeta = zeta1/zeta2 ;
347  }
348 
349  G4double z2 = Z*(Z+zeta);
350  G4double screen0 = 2.*electron_mass_c2*sqrte*bbb/(z13*pairEnergy);
351  G4double a0 = totalEnergy*residEnergy;
352  G4double a1 = pairEnergy*pairEnergy/a0;
353  G4double bet = 0.5*a1;
354  G4double xi0 = 0.25*massratio2*a1;
355  G4double del = c8/a0;
356 
357  G4double rta3 = sqrt(a3);
358  G4double tmnexp = alf/(1. + rta3) + del*rta3;
359  if(tmnexp >= 1.0) { return cross; }
360 
361  G4double tmn = G4Log(tmnexp);
362  G4double sum = 0.;
363 
364  // Gaussian integration in ln(1-ro) ( with 8 points)
365  for (G4int i=0; i<8; ++i)
366  {
367  G4double a4 = G4Exp(tmn*xgi[i]); // a4 = (1.-asymmetry)
368  G4double a5 = a4*(2.-a4) ;
369  G4double a6 = 1.-a5 ;
370  G4double a7 = 1.+a6 ;
371  G4double a9 = 3.+a6 ;
372  G4double xi = xi0*a5 ;
373  G4double xii = 1./xi ;
374  G4double xi1 = 1.+xi ;
375  G4double screen = screen0*xi1/a5 ;
376  G4double yeu = 5.-a6+4.*bet*a7 ;
377  G4double yed = 2.*(1.+3.*bet)*G4Log(3.+xii)-a6-a1*(2.-a6) ;
378  G4double ye1 = 1.+yeu/yed ;
379  G4double ale = G4Log(bbb/z13*sqrt(xi1*ye1)/(1.+screen*ye1)) ;
380  G4double cre = 0.5*G4Log(1.+2.25*z23*xi1*ye1/massratio2) ;
381  G4double be;
382 
383  if (xi <= 1.e3) {
384  be = ((2.+a6)*(1.+bet)+xi*a9)*G4Log(1.+xii)+(a5-bet)/xi1-a9;
385  } else {
386  be = (3.-a6+a1*a7)/(2.*xi);
387  }
388  G4double fe = (ale-cre)*be;
389  if ( fe < 0.) fe = 0. ;
390 
391  G4double ymu = 4.+a6 +3.*bet*a7 ;
392  G4double ymd = a7*(1.5+a1)*G4Log(3.+xi)+1.-1.5*a6 ;
393  G4double ym1 = 1.+ymu/ymd ;
394  G4double alm_crm = G4Log(bbb*massratio/(1.5*z23*(1.+screen*ym1)));
395  G4double a10,bm;
396  if ( xi >= 1.e-3)
397  {
398  a10 = (1.+a1)*a5 ;
399  bm = (a7*(1.+1.5*bet)-a10*xii)*G4Log(xi1)+xi*(a5-bet)/xi1+a10;
400  } else {
401  bm = (5.-a6+bet*a9)*(xi/2.);
402  }
403 
404  G4double fm = alm_crm*bm;
405  if ( fm < 0.) { fm = 0.; }
406 
407  sum += wgi[i]*a4*(fe+fm/massratio2);
408  }
409 
410  cross = -tmn*sum*factorForCross*z2*residEnergy/(totalEnergy*pairEnergy);
411  if(cross < 0.0) { cross = 0.0; }
412  return cross;
413 }
const G4double a0
static const G4double xgi[8]
static const G4double a1
static const G4double a4
int G4int
Definition: G4Types.hh:78
Float_t Z
static const G4double c3
float electron_mass_c2
Definition: hepunit.py:274
static const G4double a3
G4double G4Log(G4double x)
Definition: G4Log.hh:230
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
static const G4double wgi[8]
static const G4double a5
double G4double
Definition: G4Types.hh:76
static const G4double e3
static const double electron_mass_c2
G4fissionEvent * fe
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeMicroscopicCrossSection()

G4double G4MuPairProductionModel::ComputeMicroscopicCrossSection ( G4double  tkin,
G4double  Z,
G4double  cut 
)
protected

Definition at line 266 of file G4MuPairProductionModel.cc.

270 {
271  G4double cross = 0.;
273  G4double cut = std::max(cutEnergy, minPairEnergy);
274  if (tmax <= cut) { return cross; }
275 
276  G4double ak1=6.9 ;
277  G4double ak2=1.0 ;
278  G4double aaa = G4Log(cut);
279  G4double bbb = G4Log(tmax);
280  G4int kkk = (G4int)((bbb-aaa)/ak1 + ak2);
281  if(kkk > 8) { kkk = 8; }
282  else if (kkk < 1) { kkk = 1; }
283 
284  G4double hhh = (bbb-aaa)/G4double(kkk);
285  G4double x = aaa;
286 
287  for(G4int l=0; l<kkk; ++l)
288  {
289  for(G4int i=0; i<8; ++i)
290  {
291  G4double ep = G4Exp(x + xgi[i]*hhh);
292  cross += ep*wgi[i]*ComputeDMicroscopicCrossSection(tkin, Z, ep);
293  }
294  x += hhh;
295  }
296 
297  cross *= hhh;
298  if(cross < 0.0) { cross = 0.0; }
299  return cross;
300 }
G4double MaxSecondaryEnergyForElement(G4double kineticEnergy, G4double Z)
static const G4double xgi[8]
int G4int
Definition: G4Types.hh:78
Float_t Z
G4double G4Log(G4double x)
Definition: G4Log.hh:230
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
virtual G4double ComputeDMicroscopicCrossSection(G4double tkin, G4double Z, G4double pairEnergy)
static const G4double wgi[8]
double G4double
Definition: G4Types.hh:76
TH1F * hhh
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputMuPairLoss()

G4double G4MuPairProductionModel::ComputMuPairLoss ( G4double  Z,
G4double  tkin,
G4double  cut,
G4double  tmax 
)
protected

Definition at line 225 of file G4MuPairProductionModel.cc.

229 {
230  G4double loss = 0.0;
231 
232  G4double cut = std::min(cutEnergy,tmax);
233  if(cut <= minPairEnergy) { return loss; }
234 
235  // calculate the rectricted loss
236  // numerical integration in log(PairEnergy)
237  G4double ak1=6.9;
238  G4double ak2=1.0;
240  G4double bbb = G4Log(cut);
241 
242  G4int kkk = (G4int)((bbb-aaa)/ak1+ak2);
243  if (kkk > 8) { kkk = 8; }
244  else if (kkk < 1) { kkk = 1; }
245 
246  G4double hhh = (bbb-aaa)/(G4double)kkk;
247  G4double x = aaa;
248 
249  for (G4int l=0 ; l<kkk; l++)
250  {
251 
252  for (G4int ll=0; ll<8; ll++)
253  {
254  G4double ep = G4Exp(x+xgi[ll]*hhh);
255  loss += wgi[ll]*ep*ep*ComputeDMicroscopicCrossSection(tkin, Z, ep);
256  }
257  x += hhh;
258  }
259  loss *= hhh;
260  if (loss < 0.) loss = 0.;
261  return loss;
262 }
static const G4double xgi[8]
int G4int
Definition: G4Types.hh:78
Float_t Z
G4double G4Log(G4double x)
Definition: G4Log.hh:230
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
virtual G4double ComputeDMicroscopicCrossSection(G4double tkin, G4double Z, G4double pairEnergy)
static const G4double wgi[8]
double G4double
Definition: G4Types.hh:76
TH1F * hhh
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DataCorrupted()

void G4MuPairProductionModel::DataCorrupted ( G4int  Z,
G4double  logTkin 
)
private

Definition at line 650 of file G4MuPairProductionModel.cc.

651 {
653  ed << "G4ElementData is not properly initialized Z= " << Z
654  << " Ekin(MeV)= " << G4Exp(logTkin)
655  << " IsMasterThread= " << IsMaster()
656  << " Model " << GetName();
657  G4Exception("G4MuPairProductionModel::()","em0033",FatalException,
658  ed,"");
659 }
const G4String & GetName() const
Definition: G4VEmModel.hh:795
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
G4bool IsMaster() const
Definition: G4VEmModel.hh:718
Float_t Z
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindScaledEnergy()

G4double G4MuPairProductionModel::FindScaledEnergy ( G4int  Z,
G4double  rand,
G4double  logTkin,
G4double  yymin,
G4double  yymax 
)
inlineprivate

Definition at line 218 of file G4MuPairProductionModel.hh.

221 {
222  G4double res = yymin;
224  if(!pv) {
225  DataCorrupted(Z, logTkin);
226  } else {
227  G4double pmin = pv->Value(yymin, logTkin);
228  G4double pmax = pv->Value(yymax, logTkin);
229  G4double p0 = pv->Value(0.0, logTkin);
230  if(p0 <= 0.0) { DataCorrupted(Z, logTkin); }
231  else { res = pv->FindLinearX((pmin + rand*(pmax - pmin))/p0, logTkin); }
232  }
233  return res;
234 }
void DataCorrupted(G4int Z, G4double logTkin)
G4double FindLinearX(G4double rand, G4double y, size_t &lastidy) const
Float_t Z
double G4double
Definition: G4Types.hh:76
G4double Value(G4double x, G4double y, size_t &lastidx, size_t &lastidy) const
G4Physics2DVector * GetElement2DData(G4int Z)
G4ElementData * fElementData
Definition: G4VEmModel.hh:421
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Initialise()

void G4MuPairProductionModel::Initialise ( const G4ParticleDefinition p,
const G4DataVector cuts 
)
virtual

Implements G4VEmModel.

Definition at line 155 of file G4MuPairProductionModel.cc.

157 {
158  SetParticle(p);
160 
161  // for low-energy application this process should not work
162  if(lowestKinEnergy >= HighEnergyLimit()) { return; }
163 
164  // define scale of internal table for each thread only once
165  if(0 == nbine) {
168  nbine = size_t(nYBinPerDecade*std::log10(emax/emin));
169  if(nbine < 3) { nbine = 3; }
170 
172  dy = -ymin/G4double(nbiny);
173  }
174 
175  if(IsMaster() && p == particle) {
176 
177  if(!fElementData) {
178  fElementData = new G4ElementData();
180  }
181  InitialiseElementSelectors(p, cuts);
182  }
183 }
G4double LowEnergyLimit() const
Definition: G4VEmModel.hh:641
G4ParticleChangeForLoss * GetParticleChangeForLoss()
Definition: G4VEmModel.cc:120
void InitialiseElementSelectors(const G4ParticleDefinition *, const G4DataVector &)
Definition: G4VEmModel.cc:148
const G4ParticleDefinition * particle
G4bool IsMaster() const
Definition: G4VEmModel.hh:718
void SetParticle(const G4ParticleDefinition *)
G4ParticleChangeForLoss * fParticleChange
G4double HighEnergyLimit() const
Definition: G4VEmModel.hh:634
G4double G4Log(G4double x)
Definition: G4Log.hh:230
double G4double
Definition: G4Types.hh:76
G4ElementData * fElementData
Definition: G4VEmModel.hh:421
Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitialiseLocal()

void G4MuPairProductionModel::InitialiseLocal ( const G4ParticleDefinition p,
G4VEmModel masterModel 
)
virtual

Reimplemented from G4VEmModel.

Definition at line 187 of file G4MuPairProductionModel.cc.

189 {
190  if(p == particle && lowestKinEnergy < HighEnergyLimit()) {
192  fElementData = masterModel->GetElementData();
193  }
194 }
const G4ParticleDefinition * particle
void SetElementSelectors(std::vector< G4EmElementSelector *> *)
Definition: G4VEmModel.hh:810
G4ElementData * GetElementData()
Definition: G4VEmModel.hh:819
G4double HighEnergyLimit() const
Definition: G4VEmModel.hh:634
std::vector< G4EmElementSelector * > * GetElementSelectors()
Definition: G4VEmModel.hh:802
G4ElementData * fElementData
Definition: G4VEmModel.hh:421
Here is the call graph for this function:

◆ MakeSamplingTables()

void G4MuPairProductionModel::MakeSamplingTables ( )
private

Definition at line 441 of file G4MuPairProductionModel.cc.

442 {
443  G4double factore = G4Exp(G4Log(emax/emin)/G4double(nbine));
444 
445  for (G4int iz=0; iz<nzdat; ++iz) {
446 
447  G4double Z = zdat[iz];
449  G4double kinEnergy = emin;
450 
451  for (size_t it=0; it<=nbine; ++it) {
452 
453  pv->PutY(it, G4Log(kinEnergy/MeV));
454  G4double maxPairEnergy = MaxSecondaryEnergyForElement(kinEnergy, Z);
455  /*
456  G4cout << "it= " << it << " E= " << kinEnergy
457  << " " << particle->GetParticleName()
458  << " maxE= " << maxPairEnergy << " minE= " << minPairEnergy
459  << " ymin= " << ymin << G4endl;
460  */
461  G4double coef = G4Log(minPairEnergy/kinEnergy)/ymin;
462  G4double ymax = G4Log(maxPairEnergy/kinEnergy)/coef;
463  G4double fac = (ymax - ymin)/dy;
464  size_t imax = (size_t)fac;
465  fac -= (G4double)imax;
466 
467  G4double xSec = 0.0;
468  G4double x = ymin;
469  /*
470  G4cout << "Z= " << currentZ << " z13= " << z13
471  << " mE= " << maxPairEnergy << " ymin= " << ymin
472  << " dy= " << dy << " c= " << coef << G4endl;
473  */
474  // start from zero
475  pv->PutValue(0, it, 0.0);
476  if(0 == it) { pv->PutX(nbiny, 0.0); }
477 
478  for (size_t i=0; i<nbiny; ++i) {
479 
480  if(0 == it) { pv->PutX(i, x); }
481 
482  if(i < imax) {
483  G4double ep = kinEnergy*G4Exp(coef*(x + dy*0.5));
484 
485  // not multiplied by interval, because table
486  // will be used only for sampling
487  //G4cout << "i= " << i << " x= " << x << "E= " << kinEnergy
488  // << " Egamma= " << ep << G4endl;
489  xSec += ep*ComputeDMicroscopicCrossSection(kinEnergy, Z, ep);
490 
491  // last bin before the kinematic limit
492  } else if(i == imax) {
493  G4double ep = kinEnergy*G4Exp(coef*(x + fac*dy*0.5));
494  xSec += ep*fac*ComputeDMicroscopicCrossSection(kinEnergy, Z, ep);
495  }
496  pv->PutValue(i + 1, it, xSec);
497  x += dy;
498  }
499  kinEnergy *= factore;
500 
501  // to avoid precision lost
502  if(it+1 == nbine) { kinEnergy = emax; }
503  }
505  }
506 }
G4double MaxSecondaryEnergyForElement(G4double kineticEnergy, G4double Z)
static const double MeV
Definition: G4SIunits.hh:211
int G4int
Definition: G4Types.hh:78
void PutValue(size_t idx, size_t idy, G4double value)
void InitialiseForElement(G4int Z, G4PhysicsVector *v)
Float_t Z
G4double iz
Definition: TRTMaterials.hh:39
G4double G4Log(G4double x)
Definition: G4Log.hh:230
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
void PutX(size_t idx, G4double value)
virtual G4double ComputeDMicroscopicCrossSection(G4double tkin, G4double Z, G4double pairEnergy)
static const G4double fac
static const G4int imax
double G4double
Definition: G4Types.hh:76
void PutY(size_t idy, G4double value)
G4ElementData * fElementData
Definition: G4VEmModel.hh:421
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MaxSecondaryEnergyForElement()

G4double G4MuPairProductionModel::MaxSecondaryEnergyForElement ( G4double  kineticEnergy,
G4double  Z 
)
inlineprotected

Definition at line 202 of file G4MuPairProductionModel.hh.

204 {
205  G4int Z = G4lrint(ZZ);
206  if(Z != currentZ) {
207  currentZ = Z;
208  z13 = nist->GetZ13(Z);
209  z23 = z13*z13;
210  lnZ = nist->GetLOGZ(Z);
211  }
212  return kineticEnergy + particleMass*(1.0 - 0.75*sqrte*z13);
213 }
G4double GetZ13(G4double Z)
int G4int
Definition: G4Types.hh:78
Float_t Z
int G4lrint(double ad)
Definition: templates.hh:163
G4double GetLOGZ(G4int Z)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MinPrimaryEnergy()

G4double G4MuPairProductionModel::MinPrimaryEnergy ( const G4Material ,
const G4ParticleDefinition ,
G4double  cut 
)
virtual

Reimplemented from G4VEmModel.

Definition at line 146 of file G4MuPairProductionModel.cc.

149 {
150  return std::max(lowestKinEnergy,cut);
151 }

◆ operator=()

G4MuPairProductionModel& G4MuPairProductionModel::operator= ( const G4MuPairProductionModel right)
private

◆ SampleSecondaries()

void G4MuPairProductionModel::SampleSecondaries ( std::vector< G4DynamicParticle *> *  vdp,
const G4MaterialCutsCouple couple,
const G4DynamicParticle aDynamicParticle,
G4double  tmin,
G4double  maxEnergy 
)
virtual

Implements G4VEmModel.

Definition at line 510 of file G4MuPairProductionModel.cc.

516 {
517  G4double kineticEnergy = aDynamicParticle->GetKineticEnergy();
518  //G4cout << "------- G4MuPairProductionModel::SampleSecondaries E(MeV)= "
519  // << kineticEnergy << " "
520  // << aDynamicParticle->GetDefinition()->GetParticleName() << G4endl;
521  G4double totalEnergy = kineticEnergy + particleMass;
522  G4double totalMomentum =
523  sqrt(kineticEnergy*(kineticEnergy + 2.0*particleMass));
524 
525  G4ThreeVector partDirection = aDynamicParticle->GetMomentumDirection();
526 
527  // select randomly one element constituing the material
528  const G4Element* anElement = SelectRandomAtom(couple,particle,kineticEnergy);
529 
530  // define interval of energy transfer
531  G4double maxPairEnergy = MaxSecondaryEnergyForElement(kineticEnergy,
532  anElement->GetZ());
533  G4double maxEnergy = std::min(tmax, maxPairEnergy);
534  G4double minEnergy = std::max(tmin, minPairEnergy);
535 
536  if(minEnergy >= maxEnergy) { return; }
537  //G4cout << "emin= " << minEnergy << " emax= " << maxEnergy
538  // << " minPair= " << minPairEnergy << " maxpair= " << maxPairEnergy
539  // << " ymin= " << ymin << " dy= " << dy << G4endl;
540 
541  G4double coeff = G4Log(minPairEnergy/kineticEnergy)/ymin;
542 
543  // compute limits
544  G4double yymin = G4Log(minEnergy/kineticEnergy)/coeff;
545  G4double yymax = G4Log(maxEnergy/kineticEnergy)/coeff;
546 
547  //G4cout << "yymin= " << yymin << " yymax= " << yymax << G4endl;
548 
549  // units should not be used, bacause table was built without
550  G4double logTkin = G4Log(kineticEnergy/MeV);
551 
552  // sample e-e+ energy, pair energy first
553 
554  // select sample table via Z
555  G4int iz1(0), iz2(0);
556  for(G4int iz=0; iz<nzdat; ++iz) {
557  if(currentZ == zdat[iz]) {
558  iz1 = iz2 = currentZ;
559  break;
560  } else if(currentZ < zdat[iz]) {
561  iz2 = zdat[iz];
562  if(iz > 0) { iz1 = zdat[iz-1]; }
563  else { iz1 = iz2; }
564  break;
565  }
566  }
567  if(0 == iz1) { iz1 = iz2 = zdat[nzdat-1]; }
568 
569  G4double PairEnergy = 0.0;
570  G4int count = 0;
571  //G4cout << "start loop Z1= " << iz1 << " Z2= " << iz2 << G4endl;
572  do {
573  ++count;
574  // sampling using only one random number
575  G4double rand = G4UniformRand();
576 
577  G4double x = FindScaledEnergy(iz1, rand, logTkin, yymin, yymax);
578  if(iz1 != iz2) {
579  G4double x2 = FindScaledEnergy(iz2, rand, logTkin, yymin, yymax);
580  G4double lz1= nist->GetLOGZ(iz1);
581  G4double lz2= nist->GetLOGZ(iz2);
582  //G4cout << count << ". x= " << x << " x2= " << x2
583  // << " Z1= " << iz1 << " Z2= " << iz2 << G4endl;
584  x += (x2 - x)*(lnZ - lz1)/(lz2 - lz1);
585  }
586  //G4cout << "x= " << x << " coeff= " << coeff << G4endl;
587  PairEnergy = kineticEnergy*G4Exp(x*coeff);
588 
589  // Loop checking, 03-Aug-2015, Vladimir Ivanchenko
590  } while((PairEnergy < minEnergy || PairEnergy > maxEnergy) && 10 > count);
591 
592  //G4cout << "## PairEnergy(GeV)= " << PairEnergy/GeV
593  // << " Etot(GeV)= " << totalEnergy/GeV << G4endl;
594 
595  // sample r=(E+-E-)/PairEnergy ( uniformly .....)
596  G4double rmax =
597  (1.-6.*particleMass*particleMass/(totalEnergy*(totalEnergy-PairEnergy)))
598  *sqrt(1.-minPairEnergy/PairEnergy);
599  G4double r = rmax * (-1.+2.*G4UniformRand()) ;
600 
601  // compute energies from PairEnergy,r
602  G4double ElectronEnergy = (1.-r)*PairEnergy*0.5;
603  G4double PositronEnergy = PairEnergy - ElectronEnergy;
604 
605  // The angle of the emitted virtual photon is sampled
606  // according to the muon bremsstrahlung model
607 
608  G4double gam = totalEnergy/particleMass;
609  G4double gmax = gam*std::min(1.0, totalEnergy/PairEnergy - 1.0);
610  G4double gmax2= gmax*gmax;
611  G4double x = G4UniformRand()*gmax2/(1.0 + gmax2);
612 
613  G4double theta = sqrt(x/(1.0 - x))/gam;
614  G4double sint = sin(theta);
615  G4double phi = twopi * G4UniformRand() ;
616  G4double dirx = sint*cos(phi), diry = sint*sin(phi), dirz = cos(theta) ;
617 
618  G4ThreeVector gDirection(dirx, diry, dirz);
619  gDirection.rotateUz(partDirection);
620 
621  // the angles of e- and e+ assumed to be the same as virtual gamma
622 
623  // create G4DynamicParticle object for the particle1
624  G4DynamicParticle* aParticle1 =
625  new G4DynamicParticle(theElectron, gDirection,
626  ElectronEnergy - electron_mass_c2);
627 
628  // create G4DynamicParticle object for the particle2
629  G4DynamicParticle* aParticle2 =
630  new G4DynamicParticle(thePositron, gDirection,
631  PositronEnergy - electron_mass_c2);
632 
633  // primary change
634  kineticEnergy -= (ElectronEnergy + PositronEnergy);
635  fParticleChange->SetProposedKineticEnergy(kineticEnergy);
636 
637  partDirection *= totalMomentum;
638  partDirection -= (aParticle1->GetMomentum() + aParticle2->GetMomentum());
639  partDirection = partDirection.unit();
640  fParticleChange->SetProposedMomentumDirection(partDirection);
641 
642  // add secondary
643  vdp->push_back(aParticle1);
644  vdp->push_back(aParticle2);
645  //G4cout << "-- G4MuPairProductionModel::SampleSecondaries done" << G4endl;
646 }
G4double MaxSecondaryEnergyForElement(G4double kineticEnergy, G4double Z)
static const double MeV
Definition: G4SIunits.hh:211
G4ParticleDefinition * thePositron
Double_t x2[nxs]
const G4ParticleDefinition * particle
G4ParticleDefinition * theElectron
int G4int
Definition: G4Types.hh:78
G4ParticleChangeForLoss * fParticleChange
G4double FindScaledEnergy(G4int Z, G4double rand, G4double logTkin, G4double yymin, G4double yymax)
G4double GetKineticEnergy() const
G4ThreeVector GetMomentum() const
#define G4UniformRand()
Definition: Randomize.hh:97
G4double iz
Definition: TRTMaterials.hh:39
Hep3Vector unit() const
static const double twopi
Definition: G4SIunits.hh:75
float electron_mass_c2
Definition: hepunit.py:274
G4double G4Log(G4double x)
Definition: G4Log.hh:230
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
const G4ThreeVector & GetMomentumDirection() const
G4double GetLOGZ(G4int Z)
double G4double
Definition: G4Types.hh:76
G4double GetZ() const
Definition: G4Element.hh:131
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.hh:544
Here is the call graph for this function:

◆ SetLowestKineticEnergy()

void G4MuPairProductionModel::SetLowestKineticEnergy ( G4double  e)
inline

Definition at line 183 of file G4MuPairProductionModel.hh.

184 {
185  lowestKinEnergy = e;
186 }

◆ SetParticle()

void G4MuPairProductionModel::SetParticle ( const G4ParticleDefinition p)
inline

Definition at line 191 of file G4MuPairProductionModel.hh.

192 {
193  if(!particle) {
194  particle = p;
196  }
197 }
const G4ParticleDefinition * particle
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ adat

const G4double G4MuPairProductionModel::adat ={1.01, 9.01,26.98, 63.55, 238.03}
staticprivate

Definition at line 178 of file G4MuPairProductionModel.hh.

◆ currentZ

G4int G4MuPairProductionModel::currentZ
protected

Definition at line 153 of file G4MuPairProductionModel.hh.

◆ dy

G4double G4MuPairProductionModel::dy
private

Definition at line 173 of file G4MuPairProductionModel.hh.

◆ emax

G4double G4MuPairProductionModel::emax
private

Definition at line 175 of file G4MuPairProductionModel.hh.

◆ emin

G4double G4MuPairProductionModel::emin
private

Definition at line 174 of file G4MuPairProductionModel.hh.

◆ factorForCross

G4double G4MuPairProductionModel::factorForCross
protected

Definition at line 147 of file G4MuPairProductionModel.hh.

◆ fParticleChange

G4ParticleChangeForLoss* G4MuPairProductionModel::fParticleChange
private

Definition at line 161 of file G4MuPairProductionModel.hh.

◆ lnZ

G4double G4MuPairProductionModel::lnZ
protected

Definition at line 152 of file G4MuPairProductionModel.hh.

◆ lowestKinEnergy

G4double G4MuPairProductionModel::lowestKinEnergy
private

Definition at line 164 of file G4MuPairProductionModel.hh.

◆ minPairEnergy

G4double G4MuPairProductionModel::minPairEnergy
private

Definition at line 163 of file G4MuPairProductionModel.hh.

◆ nbine

size_t G4MuPairProductionModel::nbine
private

Definition at line 171 of file G4MuPairProductionModel.hh.

◆ nbiny

size_t G4MuPairProductionModel::nbiny
private

Definition at line 170 of file G4MuPairProductionModel.hh.

◆ nist

G4NistManager* G4MuPairProductionModel::nist
protected

Definition at line 145 of file G4MuPairProductionModel.hh.

◆ nYBinPerDecade

G4int G4MuPairProductionModel::nYBinPerDecade
private

Definition at line 169 of file G4MuPairProductionModel.hh.

◆ nzdat

G4int G4MuPairProductionModel::nzdat
private

Definition at line 166 of file G4MuPairProductionModel.hh.

◆ particle

const G4ParticleDefinition* G4MuPairProductionModel::particle
protected

Definition at line 144 of file G4MuPairProductionModel.hh.

◆ particleMass

G4double G4MuPairProductionModel::particleMass
protected

Definition at line 149 of file G4MuPairProductionModel.hh.

◆ sqrte

G4double G4MuPairProductionModel::sqrte
protected

Definition at line 148 of file G4MuPairProductionModel.hh.

◆ theElectron

G4ParticleDefinition* G4MuPairProductionModel::theElectron
private

Definition at line 159 of file G4MuPairProductionModel.hh.

◆ thePositron

G4ParticleDefinition* G4MuPairProductionModel::thePositron
private

Definition at line 160 of file G4MuPairProductionModel.hh.

◆ wgi

const G4double G4MuPairProductionModel::wgi
staticprotected
Initial value:
={ 0.0506, 0.1112, 0.1569, 0.1813,
0.1813, 0.1569, 0.1112, 0.0506 }

Definition at line 155 of file G4MuPairProductionModel.hh.

◆ xgi

const G4double G4MuPairProductionModel::xgi
staticprotected
Initial value:
={ 0.0199, 0.1017, 0.2372, 0.4083,
0.5917, 0.7628, 0.8983, 0.9801 }

Definition at line 155 of file G4MuPairProductionModel.hh.

◆ ymin

G4double G4MuPairProductionModel::ymin
private

Definition at line 172 of file G4MuPairProductionModel.hh.

◆ z13

G4double G4MuPairProductionModel::z13
protected

Definition at line 150 of file G4MuPairProductionModel.hh.

◆ z23

G4double G4MuPairProductionModel::z23
protected

Definition at line 151 of file G4MuPairProductionModel.hh.

◆ zdat

const G4int G4MuPairProductionModel::zdat ={1, 4, 13, 29, 92}
staticprivate

Definition at line 177 of file G4MuPairProductionModel.hh.


The documentation for this class was generated from the following files: