Geant4  10.02.p03
G4WentzelVIModel Class Reference

#include <G4WentzelVIModel.hh>

Inheritance diagram for G4WentzelVIModel:
Collaboration diagram for G4WentzelVIModel:

Public Member Functions

 G4WentzelVIModel (G4bool comb=true, const G4String &nam="WentzelVIUni")
 
virtual ~G4WentzelVIModel ()
 
virtual void Initialise (const G4ParticleDefinition *, const G4DataVector &)
 
virtual void InitialiseLocal (const G4ParticleDefinition *, G4VEmModel *masterModel)
 
void StartTracking (G4Track *)
 
virtual G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, G4double KineticEnergy, G4double AtomicNumber, G4double AtomicWeight=0., G4double cut=DBL_MAX, G4double emax=DBL_MAX)
 
virtual G4ThreeVectorSampleScattering (const G4ThreeVector &, G4double safety)
 
virtual G4double ComputeTruePathLengthLimit (const G4Track &track, G4double &currentMinimalStep)
 
virtual G4double ComputeGeomPathLength (G4double truePathLength)
 
virtual G4double ComputeTrueStepLength (G4double geomStepLength)
 
void SetFixedCut (G4double)
 
G4double GetFixedCut () const
 
G4WentzelOKandVIxSectionGetWVICrossSection ()
 
void SetUseSecondMoment (G4bool)
 
G4bool UseSecondMoment () const
 
G4PhysicsTableGetSecondMomentTable ()
 
G4double SecondMoment (const G4ParticleDefinition *, const G4MaterialCutsCouple *, G4double kineticEnergy)
 
void SetSingleScatteringFactor (G4double)
 
- Public Member Functions inherited from G4VMscModel
 G4VMscModel (const G4String &nam)
 
virtual ~G4VMscModel ()
 
virtual void SampleSecondaries (std::vector< G4DynamicParticle *> *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double tmax)
 
void SetStepLimitType (G4MscStepLimitType)
 
void SetLateralDisplasmentFlag (G4bool val)
 
void SetRangeFactor (G4double)
 
void SetGeomFactor (G4double)
 
void SetSkin (G4double)
 
void SetSampleZ (G4bool)
 
G4VEnergyLossProcessGetIonisation () const
 
void SetIonisation (G4VEnergyLossProcess *, const G4ParticleDefinition *part)
 
G4double ComputeSafety (const G4ThreeVector &position, G4double limit=DBL_MAX)
 
G4double ComputeGeomLimit (const G4Track &, G4double &presafety, G4double limit)
 
G4double GetDEDX (const G4ParticleDefinition *part, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
 
G4double GetRange (const G4ParticleDefinition *part, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
 
G4double GetEnergy (const G4ParticleDefinition *part, G4double range, const G4MaterialCutsCouple *couple)
 
G4double GetTransportMeanFreePath (const G4ParticleDefinition *part, G4double kinEnergy)
 
- 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 ComputeDEDXPerVolume (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=DBL_MAX)
 
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 CorrectionsAlongStep (const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double &eloss, G4double &niel, G4double length)
 
virtual G4double Value (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy)
 
virtual G4double MinPrimaryEnergy (const G4Material *, const G4ParticleDefinition *, G4double cut=0.0)
 
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

void DefineMaterial (const G4MaterialCutsCouple *)
 
- Protected Member Functions inherited from G4VMscModel
G4ParticleChangeForMSC * GetParticleChangeForMSC (const G4ParticleDefinition *p=0)
 
G4double ConvertTrueToGeom (G4double &tLength, G4double &gLength)
 
- 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

G4WentzelOKandVIxSectionwokvi
 
G4double tlimitminfix
 
G4double ssFactor
 
G4double invssFactor
 
G4double preKinEnergy
 
G4double tPathLength
 
G4double zPathLength
 
G4double lambdaeff
 
G4double currentRange
 
G4double cosTetMaxNuc
 
G4int currentMaterialIndex
 
const G4MaterialCutsCouplecurrentCouple
 
const G4MaterialcurrentMaterial
 
const G4ParticleDefinitionparticle
 
G4bool singleScatteringMode
 
- Protected Attributes inherited from G4VMscModel
G4double facrange
 
G4double facgeom
 
G4double facsafety
 
G4double skin
 
G4double dtrl
 
G4double lambdalimit
 
G4double geomMin
 
G4double geomMax
 
G4ThreeVector fDisplacement
 
G4MscStepLimitType steppingAlgorithm
 
G4bool samplez
 
G4bool latDisplasment
 
- Protected Attributes inherited from G4VEmModel
G4ElementDatafElementData
 
G4VParticleChange * pParticleChange
 
G4PhysicsTablexSectionTable
 
const std::vector< G4double > * theDensityFactor
 
const std::vector< G4int > * theDensityIdx
 
size_t idxTable
 

Private Member Functions

G4double ComputeTransportXSectionPerVolume (G4double cosTheta)
 
G4double ComputeSecondMoment (const G4ParticleDefinition *, G4double kineticEnergy)
 
void SetupParticle (const G4ParticleDefinition *)
 
G4WentzelVIModeloperator= (const G4WentzelVIModel &right)
 
 G4WentzelVIModel (const G4WentzelVIModel &)
 

Private Attributes

G4ParticleChangeForMSC * fParticleChange
 
const G4DataVectorcurrentCuts
 
G4double invsqrt12
 
G4double fixedCut
 
G4double effKinEnergy
 
G4double cosThetaMin
 
G4double cosThetaMax
 
G4PhysicsTablefSecondMoments
 
size_t idx2
 
G4double xtsec
 
std::vector< G4doublexsecn
 
std::vector< G4doubleprob
 
G4int nelments
 
G4double numlimit
 
G4double lowEnergyLimit
 
G4bool isCombined
 
G4bool useSecondMoment
 

Additional Inherited Members

- Static Protected Attributes inherited from G4VEmModel
static const G4double inveplus = 1.0/CLHEP::eplus
 

Detailed Description

Definition at line 66 of file G4WentzelVIModel.hh.

Constructor & Destructor Documentation

◆ G4WentzelVIModel() [1/2]

G4WentzelVIModel::G4WentzelVIModel ( G4bool  comb = true,
const G4String nam = "WentzelVIUni" 
)

Definition at line 76 of file G4WentzelVIModel.cc.

76  :
77  G4VMscModel(nam),
78  ssFactor(1.05),
79  invssFactor(1.0),
80  currentCouple(0),
81  singleScatteringMode(false),
82  cosThetaMin(1.0),
83  cosThetaMax(-1.0),
84  fSecondMoments(0),
85  idx2(0),
86  numlimit(0.1),
87  isCombined(combined),
88  useSecondMoment(false)
89 {
91  invsqrt12 = 1./sqrt(12.);
92  tlimitminfix = 1.e-6*mm;
93  lowEnergyLimit = 1.0*eV;
94  particle = 0;
95  nelments = 5;
96  xsecn.resize(nelments);
97  prob.resize(nelments);
98  wokvi = new G4WentzelOKandVIxSection(combined);
99  fixedCut = -1.0;
100 
102  = currentRange = xtsec = cosTetMaxNuc = 0.0;
104 
105  fParticleChange = 0;
106  currentCuts = 0;
107  currentMaterial = 0;
108 }
void SetSingleScatteringFactor(G4double)
G4WentzelOKandVIxSection * wokvi
std::vector< G4double > prob
const G4MaterialCutsCouple * currentCouple
G4ParticleChangeForMSC * fParticleChange
const G4Material * currentMaterial
std::vector< G4double > xsecn
static const double eV
Definition: G4SIunits.hh:212
const G4DataVector * currentCuts
const G4ParticleDefinition * particle
G4PhysicsTable * fSecondMoments
G4VMscModel(const G4String &nam)
Definition: G4VMscModel.cc:58
static const double mm
Definition: G4SIunits.hh:114
Here is the call graph for this function:

◆ ~G4WentzelVIModel()

G4WentzelVIModel::~G4WentzelVIModel ( )
virtual

Definition at line 112 of file G4WentzelVIModel.cc.

113 {
114  delete wokvi;
115  if(fSecondMoments && IsMaster()) {
116  delete fSecondMoments;
117  fSecondMoments = 0;
118  }
119 }
G4WentzelOKandVIxSection * wokvi
G4bool IsMaster() const
Definition: G4VEmModel.hh:718
G4PhysicsTable * fSecondMoments
Here is the call graph for this function:

◆ G4WentzelVIModel() [2/2]

G4WentzelVIModel::G4WentzelVIModel ( const G4WentzelVIModel )
private

Member Function Documentation

◆ ComputeCrossSectionPerAtom()

G4double G4WentzelVIModel::ComputeCrossSectionPerAtom ( const G4ParticleDefinition p,
G4double  KineticEnergy,
G4double  AtomicNumber,
G4double  AtomicWeight = 0.,
G4double  cut = DBL_MAX,
G4double  emax = DBL_MAX 
)
virtual

Reimplemented from G4VEmModel.

Definition at line 210 of file G4WentzelVIModel.cc.

215 {
216  G4double cross = 0.0;
217  if(p != particle) { SetupParticle(p); }
218  if(kinEnergy < lowEnergyLimit) { return cross; }
219  if(!CurrentCouple()) {
220  G4Exception("G4WentzelVIModel::ComputeCrossSectionPerAtom", "em0011",
221  FatalException, " G4MaterialCutsCouple is not defined");
222  return 0.0;
223  }
226  if(cosTetMaxNuc < 1.0) {
227  G4double cut = cutEnergy;
228  if(fixedCut > 0.0) { cut = fixedCut; }
229  G4double cost = wokvi->SetupTarget(G4lrint(Z), cut);
231  /*
232  if(p->GetParticleName() == "e-")
233  G4cout << "G4WentzelVIModel::CS: Z= " << G4int(Z) << " e(MeV)= "<<kinEnergy
234  << " 1-cosN= " << 1 - cosTetMaxNuc << " cross(bn)= " << cross/barn
235  << " " << particle->GetParticleName() << G4endl;
236  */
237  }
238  return cross;
239 }
G4WentzelOKandVIxSection * wokvi
void DefineMaterial(const G4MaterialCutsCouple *)
const G4MaterialCutsCouple * CurrentCouple() const
Definition: G4VEmModel.hh:452
const G4Material * currentMaterial
G4double SetupTarget(G4int Z, G4double cut=DBL_MAX)
G4double ComputeTransportCrossSectionPerAtom(G4double CosThetaMax)
Float_t Z
G4double SetupKinematic(G4double kinEnergy, const G4Material *mat)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
int G4lrint(double ad)
Definition: templates.hh:163
void SetupParticle(const G4ParticleDefinition *)
const G4ParticleDefinition * particle
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

◆ ComputeGeomPathLength()

G4double G4WentzelVIModel::ComputeGeomPathLength ( G4double  truePathLength)
virtual

Reimplemented from G4VMscModel.

Definition at line 347 of file G4WentzelVIModel.cc.

348 {
349  zPathLength = tPathLength = truelength;
350 
351  // small step use only single scattering
352  cosThetaMin = 1.0;
354  //G4cout << "xtsec= " << xtsec << " Nav= "
355  // << zPathLength*xtsec << G4endl;
356  if(0.0 >= lambdaeff || G4int(zPathLength*xtsec) < minNCollisions) {
357  singleScatteringMode = true;
358  lambdaeff = DBL_MAX;
359 
360  } else {
361  //G4cout << "ComputeGeomPathLength: tLength= " << tPathLength
362  // << " Leff= " << lambdaeff << G4endl;
363  // small step
366  zPathLength *= (1.0 - 0.5*tau + tau*tau/6.0);
367 
368  // medium step
369  } else {
370  G4double e1 = 0.0;
371  if(currentRange > tPathLength) {
373  }
374  effKinEnergy = 0.5*(e1 + preKinEnergy);
377  //G4cout << " tLength= "<< tPathLength<< " Leff= " << lambdaeff << G4endl;
379  if(tPathLength*numlimit < lambdaeff) {
380  zPathLength *= (1.0 - G4Exp(-tPathLength/lambdaeff));
381  }
382  }
383  }
384  //G4cout << "Comp.geom: zLength= "<<zPathLength<<" tLength= "
385  // << tPathLength<< " Leff= " << lambdaeff << G4endl;
386  return zPathLength;
387 }
G4WentzelOKandVIxSection * wokvi
const G4MaterialCutsCouple * currentCouple
const G4Material * currentMaterial
int G4int
Definition: G4Types.hh:78
G4double GetEnergy(const G4ParticleDefinition *part, G4double range, const G4MaterialCutsCouple *couple)
Definition: G4VMscModel.hh:315
G4double SetupKinematic(G4double kinEnergy, const G4Material *mat)
G4double ComputeTransportXSectionPerVolume(G4double cosTheta)
G4double GetTransportMeanFreePath(const G4ParticleDefinition *part, G4double kinEnergy)
Definition: G4VMscModel.hh:352
static const G4double e1
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
const G4int minNCollisions
const G4ParticleDefinition * particle
double G4double
Definition: G4Types.hh:76
#define DBL_MAX
Definition: templates.hh:83
Here is the call graph for this function:

◆ ComputeSecondMoment()

G4double G4WentzelVIModel::ComputeSecondMoment ( const G4ParticleDefinition p,
G4double  kineticEnergy 
)
private

Definition at line 755 of file G4WentzelVIModel.cc.

757 {
758  G4double xs = 0.0;
759 
760  SetupParticle(p);
762 
763  if(cosTetMaxNuc >= 1.0) { return xs; }
764 
765  const G4ElementVector* theElementVector = currentMaterial->GetElementVector();
766  const G4double* theAtomNumDensityVector =
769 
770  G4double cut = (*currentCuts)[currentMaterialIndex];
771  if(fixedCut > 0.0) { cut = fixedCut; }
772 
773  // loop over elements
774  for (G4int i=0; i<nelm; ++i) {
775  G4double costm =
776  wokvi->SetupTarget(G4lrint((*theElementVector)[i]->GetZ()), cut);
777  xs += theAtomNumDensityVector[i]
779  }
780  return xs;
781 }
G4WentzelOKandVIxSection * wokvi
std::vector< G4Element * > G4ElementVector
G4double ComputeSecondTransportMoment(G4double CosThetaMax)
const G4Material * currentMaterial
int G4int
Definition: G4Types.hh:78
G4double SetupTarget(G4int Z, G4double cut=DBL_MAX)
G4double SetupKinematic(G4double kinEnergy, const G4Material *mat)
const G4double * GetVecNbOfAtomsPerVolume() const
Definition: G4Material.hh:206
int G4lrint(double ad)
Definition: templates.hh:163
void SetupParticle(const G4ParticleDefinition *)
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:
Here is the caller graph for this function:

◆ ComputeTransportXSectionPerVolume()

G4double G4WentzelVIModel::ComputeTransportXSectionPerVolume ( G4double  cosTheta)
private

Definition at line 700 of file G4WentzelVIModel.cc.

701 {
702  // prepare recomputation of x-sections
703  const G4ElementVector* theElementVector = currentMaterial->GetElementVector();
704  const G4double* theAtomNumDensityVector =
707  if(nelm > nelments) {
708  nelments = nelm;
709  xsecn.resize(nelm);
710  prob.resize(nelm);
711  }
712 
713  // check consistency
714  xtsec = 0.0;
715  if(cosTetMaxNuc >= cosTheta) { return 0.0; }
716 
717  G4double cut = (*currentCuts)[currentMaterialIndex];
718  if(fixedCut > 0.0) { cut = fixedCut; }
719 
720  // loop over elements
721  G4double xs = 0.0;
722  for (G4int i=0; i<nelm; ++i) {
723  G4double costm =
724  wokvi->SetupTarget(G4lrint((*theElementVector)[i]->GetZ()), cut);
725  G4double density = theAtomNumDensityVector[i];
726 
727  G4double esec = 0.0;
728  if(costm < cosTheta) {
729 
730  // recompute the transport x-section
731  if(1.0 > cosTheta) {
732  xs += density*wokvi->ComputeTransportCrossSectionPerAtom(cosTheta);
733  }
734  // recompute the total x-section
735  G4double nucsec = wokvi->ComputeNuclearCrossSection(cosTheta, costm);
736  esec = wokvi->ComputeElectronCrossSection(cosTheta, costm);
737  nucsec += esec;
738  if(nucsec > 0.0) { esec /= nucsec; }
739  xtsec += nucsec*density;
740  }
741  xsecn[i] = xtsec;
742  prob[i] = esec;
743  //G4cout << i << " xs= " << xs << " xtsec= " << xtsec
744  // << " 1-cosTheta= " << 1-cosTheta
745  // << " 1-cosTetMaxNuc2= " <<1-cosTetMaxNuc2<< G4endl;
746  }
747 
748  //G4cout << "ComputeXS result: xsec(1/mm)= " << xs
749  // << " txsec(1/mm)= " << xtsec <<G4endl;
750  return xs;
751 }
G4WentzelOKandVIxSection * wokvi
std::vector< G4double > prob
std::vector< G4Element * > G4ElementVector
const G4Material * currentMaterial
int G4int
Definition: G4Types.hh:78
G4double SetupTarget(G4int Z, G4double cut=DBL_MAX)
G4double density
Definition: TRTMaterials.hh:39
G4double ComputeTransportCrossSectionPerAtom(G4double CosThetaMax)
std::vector< G4double > xsecn
const G4double * GetVecNbOfAtomsPerVolume() const
Definition: G4Material.hh:206
G4double ComputeElectronCrossSection(G4double CosThetaMin, G4double CosThetaMax)
int G4lrint(double ad)
Definition: templates.hh:163
G4double ComputeNuclearCrossSection(G4double CosThetaMin, G4double CosThetaMax)
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:
Here is the caller graph for this function:

◆ ComputeTruePathLengthLimit()

G4double G4WentzelVIModel::ComputeTruePathLengthLimit ( const G4Track &  track,
G4double currentMinimalStep 
)
virtual

Reimplemented from G4VMscModel.

Reimplemented in G4LowEWentzelVIModel.

Definition at line 250 of file G4WentzelVIModel.cc.

253 {
254  G4double tlimit = currentMinimalStep;
255  const G4DynamicParticle* dp = track.GetDynamicParticle();
256  G4StepPoint* sp = track.GetStep()->GetPreStepPoint();
257  G4StepStatus stepStatus = sp->GetStepStatus();
258  singleScatteringMode = false;
259 
260  //G4cout << "G4WentzelVIModel::ComputeTruePathLengthLimit stepStatus= "
261  // << stepStatus << " " << track.GetDefinition()->GetParticleName()
262  // << G4endl;
263 
264  // initialisation for each step, lambda may be computed from scratch
267  DefineMaterial(track.GetMaterialCutsCouple());
271 
272  //G4cout << "lambdaeff= " << lambdaeff << " Range= " << currentRange
273  // << " tlimit= " << tlimit << " 1-cost= " << 1 - cosTetMaxNuc << G4endl;
274 
275  // extra check for abnormal situation
276  // this check needed to run MSC with eIoni and eBrem inactivated
277  if(tlimit > currentRange) { tlimit = currentRange; }
278 
279  // stop here if small range particle
280  if(tlimit < tlimitminfix) {
281  return ConvertTrueToGeom(tlimit, currentMinimalStep);
282  }
283 
284  // pre step
285  G4double presafety = sp->GetSafety();
286  // far from geometry boundary
287  if(currentRange < presafety) {
288  return ConvertTrueToGeom(tlimit, currentMinimalStep);
289  }
290 
291  // compute presafety again if presafety <= 0 and no boundary
292  // i.e. when it is needed for optimization purposes
293  if(stepStatus != fGeomBoundary && presafety < tlimitminfix) {
294  presafety = ComputeSafety(sp->GetPosition(), tlimit);
295  if(currentRange < presafety) {
296  return ConvertTrueToGeom(tlimit, currentMinimalStep);
297  }
298  }
299  /*
300  G4cout << "e(MeV)= " << preKinEnergy/MeV
301  << " " << particle->GetParticleName()
302  << " CurLimit(mm)= " << tlimit/mm <<" safety(mm)= " << presafety/mm
303  << " R(mm)= " <<currentRange/mm
304  << " L0(mm^-1)= " << lambdaeff*mm
305  << G4endl;
306  */
307  // natural limit for high energy
309  (1.0 - cosTetMaxNuc)*lambdaeff*invssFactor);
310 
311  // low-energy e-
312  if(cosThetaMax > cosTetMaxNuc) {
313  rlimit = std::min(rlimit, facsafety*presafety);
314  }
315 
316  // cut correction
318  //G4cout << "rcut= " << rcut << " rlimit= " << rlimit << " presafety= "
319  // << presafety << " 1-cosThetaMax= " <<1-cosThetaMax
320  //<< " 1-cosTetMaxNuc= " << 1-cosTetMaxNuc << G4endl;
321  if(rcut > rlimit) { rlimit = std::min(rlimit, rcut*sqrt(rlimit/rcut)); }
322 
323  tlimit = std::min(tlimit, rlimit);
324  tlimit = std::max(tlimit, tlimitminfix);
325 
326  // step limit in infinite media
327  tlimit = std::min(tlimit, 50*currentMaterial->GetRadlen()/facgeom);
328 
329  //compute geomlimit and force few steps within a volume
331  && stepStatus == fGeomBoundary) {
332 
333  G4double geomlimit = ComputeGeomLimit(track, presafety, currentRange);
334  tlimit = std::min(tlimit, geomlimit/facgeom);
335  }
336  /*
337  G4cout << particle->GetParticleName() << " e= " << preKinEnergy
338  << " L0= " << lambdaeff << " R= " << currentRange
339  << " tlimit= " << tlimit
340  << " currentMinimalStep= " << currentMinimalStep << G4endl;
341  */
342  return ConvertTrueToGeom(tlimit, currentMinimalStep);
343 }
G4double facgeom
Definition: G4VMscModel.hh:178
G4WentzelOKandVIxSection * wokvi
G4double facrange
Definition: G4VMscModel.hh:177
void DefineMaterial(const G4MaterialCutsCouple *)
G4double ConvertTrueToGeom(G4double &tLength, G4double &gLength)
Definition: G4VMscModel.hh:247
G4ProductionCuts * GetProductionCuts() const
const G4MaterialCutsCouple * currentCouple
const G4Material * currentMaterial
G4double ComputeSafety(const G4ThreeVector &position, G4double limit=DBL_MAX)
Definition: G4VMscModel.hh:239
G4double GetProductionCut(G4int index) const
G4double GetKineticEnergy() const
G4double GetRange(const G4ParticleDefinition *part, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
Definition: G4VMscModel.hh:295
G4double SetupKinematic(G4double kinEnergy, const G4Material *mat)
G4double ComputeGeomLimit(const G4Track &, G4double &presafety, G4double limit)
Definition: G4VMscModel.hh:257
G4double GetTransportMeanFreePath(const G4ParticleDefinition *part, G4double kinEnergy)
Definition: G4VMscModel.hh:352
G4double facsafety
Definition: G4VMscModel.hh:179
const G4ParticleDefinition * particle
G4MscStepLimitType steppingAlgorithm
Definition: G4VMscModel.hh:187
double G4double
Definition: G4Types.hh:76
G4double GetRadlen() const
Definition: G4Material.hh:220
Here is the call graph for this function:

◆ ComputeTrueStepLength()

G4double G4WentzelVIModel::ComputeTrueStepLength ( G4double  geomStepLength)
virtual

Reimplemented from G4VMscModel.

Definition at line 391 of file G4WentzelVIModel.cc.

392 {
393  // initialisation of single scattering x-section
394  /*
395  G4cout << "ComputeTrueStepLength: Step= " << geomStepLength
396  << " geomL= " << zPathLength
397  << " Lambda= " << lambdaeff
398  << " 1-cosThetaMaxNuc= " << 1 - cosTetMaxNuc << G4endl;
399  */
401  zPathLength = tPathLength = geomStepLength;
402 
403  } else {
404 
405  // step defined by transportation
406  // change both geom and true step lengths
407  if(geomStepLength < zPathLength) {
408 
409  // single scattering
410  if(G4int(geomStepLength*xtsec) < minNCollisions) {
411  zPathLength = tPathLength = geomStepLength;
412  lambdaeff = DBL_MAX;
413  singleScatteringMode = true;
414 
415  // multiple scattering
416  } else {
417  // small step
418  if(geomStepLength < numlimit*lambdaeff) {
419  G4double tau = geomStepLength/lambdaeff;
420  tPathLength = geomStepLength*(1.0 + 0.5*tau + tau*tau/3.0);
421 
422  // energy correction for a big step
423  } else {
424  tPathLength *= geomStepLength/zPathLength;
425  G4double e1 = 0.0;
426  if(currentRange > tPathLength) {
428  }
429  effKinEnergy = 0.5*(e1 + preKinEnergy);
432  G4double tau = geomStepLength/lambdaeff;
433 
434  if(tau < 0.999999) { tPathLength = -lambdaeff*G4Log(1.0 - tau); }
435  else { tPathLength = currentRange; }
436  }
437  zPathLength = geomStepLength;
438  }
439  }
440  }
441  // check of step length
442  // define threshold angle between single and multiple scattering
443  if(!singleScatteringMode) {
445  xtsec = 0.0;
446 
447  // recompute transport cross section - do not change energy
448  // anymore - cannot be applied for big steps
449  if(cosThetaMin > cosTetMaxNuc) {
450  // new computation
452  //G4cout << "%%%% cross= " << cross << " xtsec= " << xtsec
453  // << " 1-cosTMin= " << 1.0 - cosThetaMin << G4endl;
454  if(cross <= 0.0) {
455  singleScatteringMode = true;
457  lambdaeff = DBL_MAX;
458  cosThetaMin = 1.0;
459  } else if(xtsec > 0.0) {
460 
461  lambdaeff = 1./cross;
462  G4double tau = zPathLength*cross;
463  if(tau < numlimit) {
464  tPathLength = zPathLength*(1.0 + 0.5*tau + tau*tau/3.0);
465  } else if(tau < 0.999999) {
466  tPathLength = -lambdaeff*G4Log(1.0 - tau);
467  } else {
469  }
470  }
471  }
472  }
474  /*
475  G4cout <<"Comp.true: zLength= "<<zPathLength<<" tLength= "<<tPathLength
476  <<" Leff(mm)= "<<lambdaeff/mm<<" sig0(1/mm)= " << xtsec <<G4endl;
477  G4cout << particle->GetParticleName() << " 1-cosThetaMin= " << 1-cosThetaMin
478  << " 1-cosTetMaxNuc= " << 1-cosTetMaxNuc
479  << " e(MeV)= " << preKinEnergy/MeV << " "
480  << " SSmode= " << singleScatteringMode << G4endl;
481  */
482  return tPathLength;
483 }
G4WentzelOKandVIxSection * wokvi
const G4MaterialCutsCouple * currentCouple
const G4Material * currentMaterial
int G4int
Definition: G4Types.hh:78
G4double GetEnergy(const G4ParticleDefinition *part, G4double range, const G4MaterialCutsCouple *couple)
Definition: G4VMscModel.hh:315
G4double SetupKinematic(G4double kinEnergy, const G4Material *mat)
G4double ComputeTransportXSectionPerVolume(G4double cosTheta)
G4double GetTransportMeanFreePath(const G4ParticleDefinition *part, G4double kinEnergy)
Definition: G4VMscModel.hh:352
static const G4double e1
G4double G4Log(G4double x)
Definition: G4Log.hh:230
const G4int minNCollisions
const G4ParticleDefinition * particle
double G4double
Definition: G4Types.hh:76
#define DBL_MAX
Definition: templates.hh:83
Here is the call graph for this function:

◆ DefineMaterial()

void G4WentzelVIModel::DefineMaterial ( const G4MaterialCutsCouple cup)
inlineprotected

Definition at line 201 of file G4WentzelVIModel.hh.

202 {
203  if(cup != currentCouple) {
204  currentCouple = cup;
205  SetCurrentCouple(cup);
206  currentMaterial = cup->GetMaterial();
208  }
209 }
const G4Material * GetMaterial() const
const G4MaterialCutsCouple * currentCouple
const G4Material * currentMaterial
void SetCurrentCouple(const G4MaterialCutsCouple *)
Definition: G4VEmModel.hh:445
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetFixedCut()

G4double G4WentzelVIModel::GetFixedCut ( ) const
inline

Definition at line 231 of file G4WentzelVIModel.hh.

232 {
233  return fixedCut;
234 }

◆ GetSecondMomentTable()

G4PhysicsTable * G4WentzelVIModel::GetSecondMomentTable ( )
inline

Definition at line 259 of file G4WentzelVIModel.hh.

260 {
261  return fSecondMoments;
262 }
G4PhysicsTable * fSecondMoments
Here is the caller graph for this function:

◆ GetWVICrossSection()

G4WentzelOKandVIxSection * G4WentzelVIModel::GetWVICrossSection ( )
inline

Definition at line 238 of file G4WentzelVIModel.hh.

239 {
240  return wokvi;
241 }
G4WentzelOKandVIxSection * wokvi

◆ Initialise()

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

Implements G4VEmModel.

Definition at line 123 of file G4WentzelVIModel.cc.

125 {
126  // reset parameters
127  SetupParticle(p);
128  currentRange = 0.0;
129 
130  if(isCombined) {
132  if(tet <= 0.0) { cosThetaMax = 1.0; }
133  else if(tet < CLHEP::pi) { cosThetaMax = cos(tet); }
134  }
135 
136  //G4cout << "G4WentzelVIModel::Initialise " << p->GetParticleName() << G4endl;
138  /*
139  G4cout << "G4WentzelVIModel: " << particle->GetParticleName()
140  << " 1-cos(ThetaLimit)= " << 1 - cosThetaMax
141  << " SingScatFactor= " << ssFactor
142  << G4endl;
143  */
144  currentCuts = &cuts;
145 
146  // set values of some data members
148 
149  // build second moment table only if transport table is build
151  if(useSecondMoment && IsMaster() && table) {
152 
153  //G4cout << "### G4WentzelVIModel::Initialise: build 2nd moment table "
154  // << table << G4endl;
155  fSecondMoments =
157  // Access to materials
158  const G4ProductionCutsTable* theCoupleTable =
160  size_t numOfCouples = theCoupleTable->GetTableSize();
161 
162  G4bool splineFlag = true;
163  G4PhysicsVector* aVector = 0;
164  G4PhysicsVector* bVector = 0;
167  if(emin < emax) {
169  *G4lrint(std::log10(emax/emin));
170  if(n < 3) { n = 3; }
171 
172  for(size_t i=0; i<numOfCouples; ++i) {
173 
174  //G4cout<< "i= " << i << " Flag= " << fSecondMoments->GetFlag(i)
175  // << G4endl;
176  if(fSecondMoments->GetFlag(i)) {
177  DefineMaterial(theCoupleTable->GetMaterialCutsCouple(i));
178 
179  delete (*fSecondMoments)[i];
180  if(!aVector) {
181  aVector = new G4PhysicsLogVector(emin, emax, n);
182  bVector = aVector;
183  } else {
184  bVector = new G4PhysicsVector(*aVector);
185  }
186  for(size_t j=0; j<n; ++j) {
187  G4double e = bVector->Energy(j);
188  bVector->PutValue(j, ComputeSecondMoment(p, e)*e*e);
189  }
190  if(splineFlag) { bVector->FillSecondDerivatives(); }
191  (*fSecondMoments)[i] = bVector;
192  }
193  }
194  }
195  //G4cout << *fSecondMoments << G4endl;
196  }
197 }
G4double LowEnergyLimit() const
Definition: G4VEmModel.hh:641
G4WentzelOKandVIxSection * wokvi
void DefineMaterial(const G4MaterialCutsCouple *)
G4bool IsMaster() const
Definition: G4VEmModel.hh:718
G4PhysicsTable * GetCrossSectionTable()
Definition: G4VEmModel.hh:826
G4ParticleChangeForMSC * fParticleChange
G4int NumberOfBinsPerDecade() const
void FillSecondDerivatives()
static G4PhysicsTable * PreparePhysicsTable(G4PhysicsTable *physTable)
G4double PolarAngleLimit() const
Definition: G4VEmModel.hh:662
Char_t n[5]
static G4double tet[DIM]
G4double HighEnergyLimit() const
Definition: G4VEmModel.hh:634
G4ParticleChangeForMSC * GetParticleChangeForMSC(const G4ParticleDefinition *p=0)
Definition: G4VMscModel.cc:90
bool G4bool
Definition: G4Types.hh:79
static const double pi
Definition: SystemOfUnits.h:53
void PutValue(size_t index, G4double theValue)
G4double LowEnergyActivationLimit() const
Definition: G4VEmModel.hh:655
static const G4double emax
static G4ProductionCutsTable * GetProductionCutsTable()
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
int G4lrint(double ad)
Definition: templates.hh:163
void SetupParticle(const G4ParticleDefinition *)
const G4DataVector * currentCuts
static G4EmParameters * Instance()
G4double ComputeSecondMoment(const G4ParticleDefinition *, G4double kineticEnergy)
G4PhysicsTable * fSecondMoments
G4bool GetFlag(size_t i) const
G4double Energy(size_t index) const
double G4double
Definition: G4Types.hh:76
G4double HighEnergyActivationLimit() const
Definition: G4VEmModel.hh:648
void Initialise(const G4ParticleDefinition *, G4double CosThetaLim)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitialiseLocal()

void G4WentzelVIModel::InitialiseLocal ( const G4ParticleDefinition ,
G4VEmModel masterModel 
)
virtual

Reimplemented from G4VEmModel.

Definition at line 201 of file G4WentzelVIModel.cc.

203 {
204  fSecondMoments = static_cast<G4WentzelVIModel*>(masterModel)
206 }
G4PhysicsTable * GetSecondMomentTable()
G4PhysicsTable * fSecondMoments
Here is the call graph for this function:

◆ operator=()

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

◆ SampleScattering()

G4ThreeVector & G4WentzelVIModel::SampleScattering ( const G4ThreeVector oldDirection,
G4double  safety 
)
virtual

Reimplemented from G4VMscModel.

Definition at line 488 of file G4WentzelVIModel.cc.

490 {
491  fDisplacement.set(0.0,0.0,0.0);
492  //G4cout << "!##! G4WentzelVIModel::SampleScattering for "
493  // << particle->GetParticleName() << G4endl;
494 
495  // ignore scattering for zero step length and energy below the limit
496  if(preKinEnergy < lowEnergyLimit || tPathLength <= 0.0)
497  { return fDisplacement; }
498 
499  G4double invlambda = 0.0;
500  if(lambdaeff < DBL_MAX) { invlambda = 0.5/lambdaeff; }
501 
502  // use average kinetic energy over the step
503  G4double cut = (*currentCuts)[currentMaterialIndex];
504  if(fixedCut > 0.0) { cut = fixedCut; }
505  /*
506  G4cout <<"SampleScat: E0(MeV)= "<< preKinEnergy/MeV
507  << " Leff= " << lambdaeff <<" sig0(1/mm)= " << xtsec
508  << " xmsc= " << tPathLength*invlambda
509  << " safety= " << safety << G4endl;
510  */
511  // step limit due msc
512  G4int nMscSteps = 1;
513  G4double x0 = tPathLength;
514  G4double z0 = x0*invlambda;
515  //G4double zzz = 0.0;
516  G4double prob2 = 0.0;
517 
518  CLHEP::HepRandomEngine* rndmEngine = G4Random::getTheEngine();
519 
520  // large scattering angle case - two step approach
521  if(!singleScatteringMode) {
522  static const G4double zzmin = 0.05;
523  if(useSecondMoment) {
524  G4double z1 = invlambda*invlambda;
526  prob2 = (z2 - z1)/(1.5*z1 - z2);
527  }
528  // if(z0 > zzmin && safety > tlimitminfix) {
529  if(z0 > zzmin) {
530  x0 *= 0.5;
531  z0 *= 0.5;
532  nMscSteps = 2;
533  }
534  //if(z0 > zzmin) { zzz = G4Exp(-1.0/z0); }
535  G4double zzz = 0.0;
536  if(z0 > zzmin) {
537  zzz = G4Exp(-1.0/z0);
538  z0 += zzz;
539  prob2 *= (1 + zzz);
540  }
541  prob2 /= (1 + prob2);
542  }
543 
544  // step limit due to single scattering
545  G4double x1 = 2*tPathLength;
546  if(0.0 < xtsec) { x1 = -G4Log(rndmEngine->flat())/xtsec; }
547 
548  // no scattering case
549  if(singleScatteringMode && x1 > tPathLength)
550  { return fDisplacement; }
551 
552  const G4ElementVector* theElementVector =
555 
556  // geometry
557  G4double sint, cost, phi;
558  G4ThreeVector temp(0.0,0.0,1.0);
559 
560  // current position and direction relative to the end point
561  // because of magnetic field geometry is computed relatively to the
562  // end point of the step
563  G4ThreeVector dir(0.0,0.0,1.0);
564  fDisplacement.set(0.0,0.0,-zPathLength);
565 
567 
568  // start a loop
569  G4double x2 = x0;
570  G4double step, z;
571  G4bool singleScat;
572  /*
573  G4cout << "Start of the loop x1(mm)= " << x1 << " x2(mm)= " << x2
574  << " 1-cost1= " << 1 - cosThetaMin << " SSmode= " << singleScatteringMode
575  << " xtsec= " << xtsec << " Nst= " << nMscSteps << G4endl;
576  */
577  do {
578 
579  //G4cout << "# x1(mm)= "<< x1<< " x2(mm)= "<< x2 << G4endl;
580  // single scattering case
581  if(singleScatteringMode && x1 > x2) {
582  fDisplacement += x2*mscfac*dir;
583  break;
584  }
585 
586  // what is next single of multiple?
587  if(x1 <= x2) {
588  step = x1;
589  singleScat = true;
590  } else {
591  step = x2;
592  singleScat = false;
593  }
594 
595  //G4cout << "# step(mm)= "<< step<< " singlScat= "<< singleScat << G4endl;
596 
597  // new position
598  fDisplacement += step*mscfac*dir;
599 
600  if(singleScat) {
601 
602  // select element
603  G4int i = 0;
604  if(nelm > 1) {
605  G4double qsec = rndmEngine->flat()*xtsec;
606  for (; i<nelm; ++i) { if(xsecn[i] >= qsec) { break; } }
607  }
608  G4double cosTetM =
609  wokvi->SetupTarget(G4lrint((*theElementVector)[i]->GetZ()), cut);
610  //G4cout << "!!! " << cosThetaMin << " " << cosTetM << " "
611  // << prob[i] << G4endl;
612  temp = wokvi->SampleSingleScattering(cosThetaMin, cosTetM, prob[i]);
613 
614  // direction is changed
615  temp.rotateUz(dir);
616  dir = temp;
617  //G4cout << dir << G4endl;
618 
619  // new proposed step length
620  x2 -= step;
621  x1 = -G4Log(rndmEngine->flat())/xtsec;
622 
623  // multiple scattering
624  } else {
625  --nMscSteps;
626  x1 -= step;
627  x2 = x0;
628 
629  // sample z in interval 0 - 1
630  G4bool isFirst = true;
631  if(prob2 > 0.0 && rndmEngine->flat() < prob2) { isFirst = false; }
632  do {
633  //z = -z0*G4Log(1.0 - (1.0 - zzz)*rndmEngine->flat());
634  if(isFirst) { z = -G4Log(rndmEngine->flat()); }
635  else { z = G4RandGamma::shoot(rndmEngine, 2.0, 2.0); }
636  z *= z0;
637  // Loop checking, 03-Aug-2015, Vladimir Ivanchenko
638  } while(z > 1.0);
639 
640  cost = 1.0 - 2.0*z/*factCM*/;
641  if(cost > 1.0) { cost = 1.0; }
642  else if(cost < -1.0) { cost =-1.0; }
643  sint = sqrt((1.0 - cost)*(1.0 + cost));
644  phi = twopi*rndmEngine->flat();
645  G4double vx1 = sint*cos(phi);
646  G4double vy1 = sint*sin(phi);
647 
648  // lateral displacement
649  if (latDisplasment) {
650  G4double rms = invsqrt12*sqrt(2*z0);
651  G4double r = x0*mscfac;
652  G4double dx = r*(0.5*vx1 + rms*G4RandGauss::shoot(rndmEngine, 0.0, 1.0));
653  G4double dy = r*(0.5*vy1 + rms*G4RandGauss::shoot(rndmEngine, 0.0, 1.0));
654  G4double dz;
655  G4double d = r*r - dx*dx - dy*dy;
656 
657  // change position
658  if(d >= 0.0) {
659  dz = sqrt(d) - r;
660  temp.set(dx,dy,dz);
661  temp.rotateUz(dir);
662  fDisplacement += temp;
663  }
664  }
665  // change direction
666  temp.set(vx1,vy1,cost);
667  temp.rotateUz(dir);
668  dir = temp;
669  }
670  // Loop checking, 03-Aug-2015, Vladimir Ivanchenko
671  } while (0 < nMscSteps);
672 
673  dir.rotateUz(oldDirection);
674 
675  //G4cout<<"G4WentzelVIModel sampling is done 1-cost= "<< 1.-dir.z()<<G4endl;
676  // end of sampling -------------------------------
677 
678  fParticleChange->ProposeMomentumDirection(dir);
679 
680  // lateral displacement
681  fDisplacement.rotateUz(oldDirection);
682 
683  /*
684  G4cout << " r(mm)= " << fDisplacement.mag()
685  << " safety= " << safety
686  << " trueStep(mm)= " << tPathLength
687  << " geomStep(mm)= " << zPathLength
688  << " x= " << fDisplacement.x()
689  << " y= " << fDisplacement.y()
690  << " z= " << fDisplacement.z()
691  << G4endl;
692  */
693 
694  //G4cout<< "G4WentzelVIModel::SampleScattering end NewDir= " << dir<< G4endl;
695  return fDisplacement;
696 }
void set(double x, double y, double z)
ThreeVector shoot(const G4int Ap, const G4int Af)
G4WentzelOKandVIxSection * wokvi
std::vector< G4double > prob
std::vector< G4Element * > G4ElementVector
Double_t x2[nxs]
Float_t d
G4bool latDisplasment
Definition: G4VMscModel.hh:190
const G4MaterialCutsCouple * currentCouple
G4ParticleChangeForMSC * fParticleChange
virtual double flat()=0
TDirectory * dir
const G4Material * currentMaterial
int G4int
Definition: G4Types.hh:78
G4double SetupTarget(G4int Z, G4double cut=DBL_MAX)
std::vector< G4double > xsecn
bool G4bool
Definition: G4Types.hh:79
G4double SecondMoment(const G4ParticleDefinition *, const G4MaterialCutsCouple *, G4double kineticEnergy)
Hep3Vector & rotateUz(const Hep3Vector &)
Definition: ThreeVector.cc:38
static const double twopi
Definition: G4SIunits.hh:75
Double_t x1[nxs]
G4ThreeVector fDisplacement
Definition: G4VMscModel.hh:186
G4double G4Log(G4double x)
Definition: G4Log.hh:230
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
int G4lrint(double ad)
Definition: templates.hh:163
size_t GetNumberOfElements() const
Definition: G4Material.hh:186
const G4ParticleDefinition * particle
const G4ElementVector * GetElementVector() const
Definition: G4Material.hh:190
double G4double
Definition: G4Types.hh:76
#define DBL_MAX
Definition: templates.hh:83
G4ThreeVector & SampleSingleScattering(G4double CosThetaMin, G4double CosThetaMax, G4double elecRatio=0.0)
Here is the call graph for this function:

◆ SecondMoment()

G4double G4WentzelVIModel::SecondMoment ( const G4ParticleDefinition part,
const G4MaterialCutsCouple couple,
G4double  kineticEnergy 
)
inline

Definition at line 267 of file G4WentzelVIModel.hh.

270 {
271  G4double x = 0.0;
272  if(useSecondMoment) {
273  DefineMaterial(couple);
274  if(fSecondMoments) {
275  x = (*fSecondMoments)[(*theDensityIdx)[currentMaterialIndex]]
276  ->Value(ekin, idx2)
277  *(*theDensityFactor)[currentMaterialIndex]/(ekin*ekin);
278  } else {
279  x = ComputeSecondMoment(part, ekin);
280  }
281  }
282  return x;
283 }
void DefineMaterial(const G4MaterialCutsCouple *)
G4double ComputeSecondMoment(const G4ParticleDefinition *, G4double kineticEnergy)
G4PhysicsTable * fSecondMoments
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetFixedCut()

void G4WentzelVIModel::SetFixedCut ( G4double  val)
inline

Definition at line 224 of file G4WentzelVIModel.hh.

225 {
226  fixedCut = val;
227 }

◆ SetSingleScatteringFactor()

void G4WentzelVIModel::SetSingleScatteringFactor ( G4double  val)

Definition at line 785 of file G4WentzelVIModel.cc.

786 {
787  if(val > 0.05) {
788  ssFactor = val;
789  invssFactor = 1.0/(val - 0.05);
790  }
791 }
Here is the caller graph for this function:

◆ SetupParticle()

void G4WentzelVIModel::SetupParticle ( const G4ParticleDefinition p)
inlineprivate

Definition at line 213 of file G4WentzelVIModel.hh.

214 {
215  // Initialise mass and charge
216  if(p != particle) {
217  particle = p;
218  wokvi->SetupParticle(p);
219  }
220 }
void SetupParticle(const G4ParticleDefinition *)
G4WentzelOKandVIxSection * wokvi
const G4ParticleDefinition * particle
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetUseSecondMoment()

void G4WentzelVIModel::SetUseSecondMoment ( G4bool  val)
inline

Definition at line 245 of file G4WentzelVIModel.hh.

246 {
247  useSecondMoment = val;
248 }

◆ StartTracking()

void G4WentzelVIModel::StartTracking ( G4Track *  track)
virtual

Reimplemented from G4VEmModel.

Definition at line 243 of file G4WentzelVIModel.cc.

244 {
245  SetupParticle(track->GetDynamicParticle()->GetDefinition());
246 }
void SetupParticle(const G4ParticleDefinition *)
Here is the call graph for this function:

◆ UseSecondMoment()

G4bool G4WentzelVIModel::UseSecondMoment ( ) const
inline

Definition at line 252 of file G4WentzelVIModel.hh.

253 {
254  return useSecondMoment;
255 }

Member Data Documentation

◆ cosTetMaxNuc

G4double G4WentzelVIModel::cosTetMaxNuc
protected

Definition at line 151 of file G4WentzelVIModel.hh.

◆ cosThetaMax

G4double G4WentzelVIModel::cosThetaMax
private

Definition at line 176 of file G4WentzelVIModel.hh.

◆ cosThetaMin

G4double G4WentzelVIModel::cosThetaMin
private

Definition at line 175 of file G4WentzelVIModel.hh.

◆ currentCouple

const G4MaterialCutsCouple* G4WentzelVIModel::currentCouple
protected

Definition at line 155 of file G4WentzelVIModel.hh.

◆ currentCuts

const G4DataVector* G4WentzelVIModel::currentCuts
private

Definition at line 166 of file G4WentzelVIModel.hh.

◆ currentMaterial

const G4Material* G4WentzelVIModel::currentMaterial
protected

Definition at line 156 of file G4WentzelVIModel.hh.

◆ currentMaterialIndex

G4int G4WentzelVIModel::currentMaterialIndex
protected

Definition at line 154 of file G4WentzelVIModel.hh.

◆ currentRange

G4double G4WentzelVIModel::currentRange
protected

Definition at line 150 of file G4WentzelVIModel.hh.

◆ effKinEnergy

G4double G4WentzelVIModel::effKinEnergy
private

Definition at line 172 of file G4WentzelVIModel.hh.

◆ fixedCut

G4double G4WentzelVIModel::fixedCut
private

Definition at line 169 of file G4WentzelVIModel.hh.

◆ fParticleChange

G4ParticleChangeForMSC* G4WentzelVIModel::fParticleChange
private

Definition at line 165 of file G4WentzelVIModel.hh.

◆ fSecondMoments

G4PhysicsTable* G4WentzelVIModel::fSecondMoments
private

Definition at line 178 of file G4WentzelVIModel.hh.

◆ idx2

size_t G4WentzelVIModel::idx2
private

Definition at line 179 of file G4WentzelVIModel.hh.

◆ invsqrt12

G4double G4WentzelVIModel::invsqrt12
private

Definition at line 168 of file G4WentzelVIModel.hh.

◆ invssFactor

G4double G4WentzelVIModel::invssFactor
protected

Definition at line 143 of file G4WentzelVIModel.hh.

◆ isCombined

G4bool G4WentzelVIModel::isCombined
private

Definition at line 193 of file G4WentzelVIModel.hh.

◆ lambdaeff

G4double G4WentzelVIModel::lambdaeff
protected

Definition at line 149 of file G4WentzelVIModel.hh.

◆ lowEnergyLimit

G4double G4WentzelVIModel::lowEnergyLimit
private

Definition at line 190 of file G4WentzelVIModel.hh.

◆ nelments

G4int G4WentzelVIModel::nelments
private

Definition at line 185 of file G4WentzelVIModel.hh.

◆ numlimit

G4double G4WentzelVIModel::numlimit
private

Definition at line 187 of file G4WentzelVIModel.hh.

◆ particle

const G4ParticleDefinition* G4WentzelVIModel::particle
protected

Definition at line 158 of file G4WentzelVIModel.hh.

◆ preKinEnergy

G4double G4WentzelVIModel::preKinEnergy
protected

Definition at line 146 of file G4WentzelVIModel.hh.

◆ prob

std::vector<G4double> G4WentzelVIModel::prob
private

Definition at line 184 of file G4WentzelVIModel.hh.

◆ singleScatteringMode

G4bool G4WentzelVIModel::singleScatteringMode
protected

Definition at line 161 of file G4WentzelVIModel.hh.

◆ ssFactor

G4double G4WentzelVIModel::ssFactor
protected

Definition at line 142 of file G4WentzelVIModel.hh.

◆ tlimitminfix

G4double G4WentzelVIModel::tlimitminfix
protected

Definition at line 141 of file G4WentzelVIModel.hh.

◆ tPathLength

G4double G4WentzelVIModel::tPathLength
protected

Definition at line 147 of file G4WentzelVIModel.hh.

◆ useSecondMoment

G4bool G4WentzelVIModel::useSecondMoment
private

Definition at line 194 of file G4WentzelVIModel.hh.

◆ wokvi

G4WentzelOKandVIxSection* G4WentzelVIModel::wokvi
protected

Definition at line 139 of file G4WentzelVIModel.hh.

◆ xsecn

std::vector<G4double> G4WentzelVIModel::xsecn
private

Definition at line 183 of file G4WentzelVIModel.hh.

◆ xtsec

G4double G4WentzelVIModel::xtsec
private

Definition at line 182 of file G4WentzelVIModel.hh.

◆ zPathLength

G4double G4WentzelVIModel::zPathLength
protected

Definition at line 148 of file G4WentzelVIModel.hh.


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