Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes
G4hCoulombScatteringModel Class Reference

#include <G4hCoulombScatteringModel.hh>

Inheritance diagram for G4hCoulombScatteringModel:
G4VEmModel

Public Member Functions

 G4hCoulombScatteringModel (const G4String &nam="eCoulombScattering")
 
virtual ~G4hCoulombScatteringModel ()
 
virtual void Initialise (const G4ParticleDefinition *, const G4DataVector &)
 
virtual G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A, G4double cut, G4double emax)
 
virtual void SampleSecondaries (std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
 
void SetLowEnergyThreshold (G4double val)
 
void SetRecoilThreshold (G4double eth)
 
- Public Member Functions inherited from G4VEmModel
 G4VEmModel (const G4String &nam)
 
virtual ~G4VEmModel ()
 
virtual void InitialiseLocal (const G4ParticleDefinition *, G4VEmModel *masterModel)
 
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 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 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 *)
 
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
 

Protected Member Functions

void DefineMaterial (const G4MaterialCutsCouple *)
 
void SetupParticle (const G4ParticleDefinition *)
 
- Protected Member Functions inherited from G4VEmModel
G4ParticleChangeForLossGetParticleChangeForLoss ()
 
G4ParticleChangeForGammaGetParticleChangeForGamma ()
 
virtual G4double MaxSecondaryEnergy (const G4ParticleDefinition *, G4double kineticEnergy)
 
const G4MaterialCutsCoupleCurrentCouple () const
 
void SetCurrentElement (const G4Element *)
 

Protected Attributes

G4IonTabletheIonTable
 
G4ParticleChangeForGammafParticleChange
 
G4WentzelVIRelXSectionwokvi
 
G4NistManagerfNistManager
 
const std::vector< G4double > * pCuts
 
const G4MaterialCutsCouplecurrentCouple
 
const G4MaterialcurrentMaterial
 
G4int currentMaterialIndex
 
G4double cosThetaMin
 
G4double cosThetaMax
 
G4double cosTetMinNuc
 
G4double cosTetMaxNuc
 
G4double recoilThreshold
 
G4double elecRatio
 
G4double mass
 
const G4ParticleDefinitionparticle
 
const G4ParticleDefinitiontheProton
 
G4double lowEnergyThreshold
 
- Protected Attributes inherited from G4VEmModel
G4ElementDatafElementData
 
G4VParticleChangepParticleChange
 
G4PhysicsTablexSectionTable
 
const std::vector< G4double > * theDensityFactor
 
const std::vector< G4int > * theDensityIdx
 
size_t idxTable
 

Detailed Description

Definition at line 67 of file G4hCoulombScatteringModel.hh.

Constructor & Destructor Documentation

G4hCoulombScatteringModel::G4hCoulombScatteringModel ( const G4String nam = "eCoulombScattering")

Definition at line 70 of file G4hCoulombScatteringModel.cc.

References cosTetMaxNuc, cosTetMinNuc, currentCouple, currentMaterial, currentMaterialIndex, elecRatio, fNistManager, fParticleChange, G4ParticleTable::GetIonTable(), G4ParticleTable::GetParticleTable(), G4NistManager::Instance(), python.hepunit::keV, lowEnergyThreshold, mass, particle, pCuts, G4Proton::Proton(), python.hepunit::proton_mass_c2, recoilThreshold, theIonTable, theProton, and wokvi.

71  : G4VEmModel(nam),
72  cosThetaMin(1.0),
73  cosThetaMax(-1.0),
74  isInitialised(false)
75 {
76  fParticleChange = 0;
80  currentMaterial = 0;
81 
82  pCuts = 0;
83 
84  lowEnergyThreshold = 1*keV; // particle will be killed for lower energy
85  recoilThreshold = 0.*keV; // by default does not work
86 
87  particle = 0;
88  currentCouple = 0;
90 
92 
93  cosTetMinNuc = 1.0;
94  cosTetMaxNuc = -1.0;
95  elecRatio = 0.0;
97 }
const G4ParticleDefinition * theProton
const std::vector< G4double > * pCuts
static G4NistManager * Instance()
G4VEmModel(const G4String &nam)
Definition: G4VEmModel.cc:65
const G4MaterialCutsCouple * currentCouple
G4IonTable * GetIonTable() const
const G4ParticleDefinition * particle
static G4Proton * Proton()
Definition: G4Proton.cc:93
float proton_mass_c2
Definition: hepunit.py:275
G4ParticleChangeForGamma * fParticleChange
static G4ParticleTable * GetParticleTable()
G4hCoulombScatteringModel::~G4hCoulombScatteringModel ( )
virtual

Definition at line 101 of file G4hCoulombScatteringModel.cc.

References wokvi.

102 {
103  delete wokvi;
104 }

Member Function Documentation

G4double G4hCoulombScatteringModel::ComputeCrossSectionPerAtom ( const G4ParticleDefinition p,
G4double  kinEnergy,
G4double  Z,
G4double  A,
G4double  cut,
G4double  emax 
)
virtual

Reimplemented from G4VEmModel.

Definition at line 137 of file G4hCoulombScatteringModel.cc.

References G4WentzelVIRelXSection::ComputeElectronCrossSection(), G4WentzelVIRelXSection::ComputeNuclearCrossSection(), cosTetMaxNuc, cosTetMinNuc, cosThetaMax, G4VEmModel::CurrentCouple(), currentMaterial, DefineMaterial(), elecRatio, iz, particle, G4WentzelVIRelXSection::SetupKinematic(), SetupParticle(), G4WentzelVIRelXSection::SetupTarget(), theProton, and wokvi.

Referenced by SampleSecondaries().

142 {
143  //G4cout << "### G4hCoulombScatteringModel::ComputeCrossSectionPerAtom for "
144  // << p->GetParticleName()<<" Z= "<<Z<<" e(MeV)= "<< kinEnergy/MeV << G4endl;
145  G4double cross = 0.0;
146  if(p != particle) { SetupParticle(p); }
147 
148  // cross section is set to zero to avoid problems in sample secondary
149  if(kinEnergy <= 0.0) { return cross; }
152  if(cosThetaMax < cosTetMinNuc) {
153  G4int iz = G4int(Z);
154  cosTetMinNuc = wokvi->SetupTarget(iz, cutEnergy);
156  if(iz == 1 && cosTetMaxNuc < 0.0 && particle == theProton) {
157  cosTetMaxNuc = 0.0;
158  }
161  cross += elecRatio;
162  if(cross > 0.0) { elecRatio /= cross; }
163  }
164  /*
165  if(p->GetParticleName() == "e-")
166  G4cout << "e(MeV)= " << kinEnergy/MeV << " cross(b)= " << cross/barn
167  << " 1-cosTetMinNuc= " << 1-cosTetMinNuc
168  << " 1-cosTetMaxNuc= " << 1-cosTetMaxNuc
169  << G4endl;
170  */
171  return cross;
172 }
const G4ParticleDefinition * theProton
G4double ComputeNuclearCrossSection(G4double CosThetaMin, G4double CosThetaMax)
void DefineMaterial(const G4MaterialCutsCouple *)
void SetupParticle(const G4ParticleDefinition *)
int G4int
Definition: G4Types.hh:78
G4double SetupKinematic(G4double kinEnergy, const G4Material *mat)
G4double SetupTarget(G4int Z, G4double cut=DBL_MAX)
const G4MaterialCutsCouple * CurrentCouple() const
Definition: G4VEmModel.hh:426
const G4ParticleDefinition * particle
G4double iz
Definition: TRTMaterials.hh:39
G4double ComputeElectronCrossSection(G4double CosThetaMin, G4double CosThetaMax)
double G4double
Definition: G4Types.hh:76
void G4hCoulombScatteringModel::DefineMaterial ( const G4MaterialCutsCouple cup)
inlineprotected
void G4hCoulombScatteringModel::Initialise ( const G4ParticleDefinition p,
const G4DataVector cuts 
)
virtual

Implements G4VEmModel.

Definition at line 108 of file G4hCoulombScatteringModel.cc.

References cosThetaMin, currentCouple, fParticleChange, G4ProductionCutsTable::GetEnergyCutsVector(), G4VEmModel::GetParticleChangeForGamma(), G4ProductionCutsTable::GetProductionCutsTable(), python.hepunit::GeV, G4WentzelVIRelXSection::Initialise(), G4VEmModel::InitialiseElementSelectors(), mass, pCuts, G4VEmModel::PolarAngleLimit(), SetupParticle(), and wokvi.

110 {
111  SetupParticle(p);
112  currentCouple = 0;
113  cosThetaMin = cos(PolarAngleLimit());
115  /*
116  G4cout << "G4hCoulombScatteringModel: " << particle->GetParticleName()
117  << " 1-cos(ThetaLimit)= " << 1 - cosThetaMin
118  << " cos(thetaMax)= " << cosThetaMax
119  << G4endl;
120  */
122  //G4cout << "!!! G4hCoulombScatteringModel::Initialise for "
123  // << p->GetParticleName() << " cos(TetMin)= " << cosThetaMin
124  // << " cos(TetMax)= " << cosThetaMax <<G4endl;
125  // G4cout << "cut0= " << cuts[0] << " cut1= " << cuts[1] << G4endl;
126  if(!isInitialised) {
127  isInitialised = true;
129  }
130  if(mass < GeV) {
132  }
133 }
const std::vector< G4double > * GetEnergyCutsVector(size_t pcIdx) const
void InitialiseElementSelectors(const G4ParticleDefinition *, const G4DataVector &)
Definition: G4VEmModel.cc:135
const std::vector< G4double > * pCuts
void SetupParticle(const G4ParticleDefinition *)
const G4MaterialCutsCouple * currentCouple
G4ParticleChangeForGamma * fParticleChange
static G4ProductionCutsTable * GetProductionCutsTable()
G4double PolarAngleLimit() const
Definition: G4VEmModel.hh:620
void Initialise(const G4ParticleDefinition *, G4double CosThetaLim)
G4ParticleChangeForGamma * GetParticleChangeForGamma()
Definition: G4VEmModel.cc:121
void G4hCoulombScatteringModel::SampleSecondaries ( std::vector< G4DynamicParticle * > *  fvect,
const G4MaterialCutsCouple couple,
const G4DynamicParticle dp,
G4double  tmin,
G4double  maxEnergy 
)
virtual

Implements G4VEmModel.

Definition at line 176 of file G4hCoulombScatteringModel.cc.

References ComputeCrossSectionPerAtom(), cosTetMinNuc, cosThetaMax, currentMaterialIndex, DefineMaterial(), elecRatio, fParticleChange, G4DynamicParticle::GetDefinition(), G4IonTable::GetIon(), G4DynamicParticle::GetKineticEnergy(), G4DynamicParticle::GetMomentumDirection(), G4WentzelVIRelXSection::GetMomentumSquare(), G4NucleiProperties::GetNuclearMass(), G4Element::GetZ(), iz, lowEnergyThreshold, mass, G4INCL::Math::max(), particle, pCuts, G4VParticleChange::ProposeLocalEnergyDeposit(), G4ParticleChangeForGamma::ProposeMomentumDirection(), G4VParticleChange::ProposeNonIonizingEnergyDeposit(), recoilThreshold, CLHEP::Hep3Vector::rotateUz(), G4WentzelVIRelXSection::SampleSingleScattering(), G4VEmModel::SelectIsotopeNumber(), G4VEmModel::SelectRandomAtom(), G4ParticleChangeForGamma::SetProposedKineticEnergy(), G4WentzelVIRelXSection::SetTargetMass(), SetupParticle(), theIonTable, wokvi, and CLHEP::Hep3Vector::z().

182 {
183  G4double kinEnergy = dp->GetKineticEnergy();
184 
185  // absorb particle below low-energy limit to avoid situation
186  // when a particle has no energy loss
187  if(kinEnergy < lowEnergyThreshold) {
191  return;
192  }
194  DefineMaterial(couple);
195 
196  //G4cout << "G4hCoulombScatteringModel::SampleSecondaries e(MeV)= "
197  // << kinEnergy << " " << particle->GetParticleName()
198  // << " cut= " << cutEnergy<< G4endl;
199 
200  // Choose nucleus
201  const G4Element* currentElement =
202  SelectRandomAtom(couple,particle,kinEnergy,cutEnergy,kinEnergy);
203 
204  G4double Z = currentElement->GetZ();
205 
206  if(ComputeCrossSectionPerAtom(particle,kinEnergy, Z,
207  kinEnergy, cutEnergy, kinEnergy) == 0.0)
208  { return; }
209 
210  G4int iz = G4int(Z);
211  G4int ia = SelectIsotopeNumber(currentElement);
212  G4double targetMass = G4NucleiProperties::GetNuclearMass(ia, iz);
213  wokvi->SetTargetMass(targetMass);
214 
215  G4ThreeVector newDirection =
217  G4double cost = newDirection.z();
218 
219  G4ThreeVector direction = dp->GetMomentumDirection();
220  newDirection.rotateUz(direction);
221 
223 
224  // recoil sampling assuming a small recoil
225  // and first order correction to primary 4-momentum
226  G4double mom2 = wokvi->GetMomentumSquare();
227  G4double trec = mom2*(1.0 - cost)
228  /(targetMass + (mass + kinEnergy)*(1.0 - cost));
229 
230  // the check likely not needed
231  if(trec > kinEnergy) { trec = kinEnergy; }
232  G4double finalT = kinEnergy - trec;
233  G4double edep = 0.0;
234  //G4cout<<"G4eCoulombScatteringModel: finalT= "<<finalT<<" Trec= "
235  // <<trec << " Z= " << iz << " A= " << ia<<G4endl;
236 
237  G4double tcut = recoilThreshold;
238  if(pCuts) { tcut= std::max(tcut,(*pCuts)[currentMaterialIndex]); }
239 
240  if(trec > tcut) {
242  G4ThreeVector dir = (direction*sqrt(mom2) -
243  newDirection*sqrt(finalT*(2*mass + finalT))).unit();
244  G4DynamicParticle* newdp = new G4DynamicParticle(ion, dir, trec);
245  fvect->push_back(newdp);
246  } else {
247  edep = trec;
249  }
250 
251  // finelize primary energy and energy balance
252  // this threshold may be applied only because for low-enegry
253  // e+e- msc model is applied
254  if(finalT <= lowEnergyThreshold) {
255  edep += finalT;
256  finalT = 0.0;
257  }
260 }
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4ThreeVector SampleSingleScattering(G4double CosThetaMin, G4double CosThetaMax, G4double elecRatio=0.0)
G4double GetKineticEnergy() const
void DefineMaterial(const G4MaterialCutsCouple *)
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
Definition: G4IonTable.cc:449
G4double GetZ() const
Definition: G4Element.hh:131
const std::vector< G4double > * pCuts
G4ParticleDefinition * GetDefinition() const
void SetupParticle(const G4ParticleDefinition *)
int G4int
Definition: G4Types.hh:78
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
double z() const
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
G4double GetMomentumSquare() const
const G4ParticleDefinition * particle
void ProposeNonIonizingEnergyDeposit(G4double anEnergyPart)
const G4ThreeVector & GetMomentumDirection() const
G4double iz
Definition: TRTMaterials.hh:39
Hep3Vector & rotateUz(const Hep3Vector &)
Definition: ThreeVector.cc:72
G4int SelectIsotopeNumber(const G4Element *)
Definition: G4VEmModel.hh:548
G4ParticleChangeForGamma * fParticleChange
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A, G4double cut, G4double emax)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
void SetProposedKineticEnergy(G4double proposedKinEnergy)
double G4double
Definition: G4Types.hh:76
void SetTargetMass(G4double value)
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.hh:510
void G4hCoulombScatteringModel::SetLowEnergyThreshold ( G4double  val)
inline

Definition at line 169 of file G4hCoulombScatteringModel.hh.

References lowEnergyThreshold.

170 {
171  lowEnergyThreshold = val;
172 }
void G4hCoulombScatteringModel::SetRecoilThreshold ( G4double  eth)
inline

Definition at line 176 of file G4hCoulombScatteringModel.hh.

References recoilThreshold.

177 {
178  recoilThreshold = eth;
179 }
void G4hCoulombScatteringModel::SetupParticle ( const G4ParticleDefinition p)
inlineprotected

Definition at line 157 of file G4hCoulombScatteringModel.hh.

References G4ParticleDefinition::GetPDGMass(), mass, particle, G4WentzelVIRelXSection::SetupParticle(), and wokvi.

Referenced by ComputeCrossSectionPerAtom(), Initialise(), and SampleSecondaries().

158 {
159  // Initialise mass and charge
160  if(p != particle) {
161  particle = p;
162  mass = particle->GetPDGMass();
163  wokvi->SetupParticle(p);
164  }
165 }
const char * p
Definition: xmltok.h:285
void SetupParticle(const G4ParticleDefinition *)
const G4ParticleDefinition * particle
G4double GetPDGMass() const

Field Documentation

G4double G4hCoulombScatteringModel::cosTetMaxNuc
protected
G4double G4hCoulombScatteringModel::cosTetMinNuc
protected
G4double G4hCoulombScatteringModel::cosThetaMax
protected

Definition at line 124 of file G4hCoulombScatteringModel.hh.

Referenced by ComputeCrossSectionPerAtom(), and SampleSecondaries().

G4double G4hCoulombScatteringModel::cosThetaMin
protected

Definition at line 123 of file G4hCoulombScatteringModel.hh.

Referenced by Initialise().

const G4MaterialCutsCouple* G4hCoulombScatteringModel::currentCouple
protected
const G4Material* G4hCoulombScatteringModel::currentMaterial
protected
G4int G4hCoulombScatteringModel::currentMaterialIndex
protected
G4double G4hCoulombScatteringModel::elecRatio
protected
G4NistManager* G4hCoulombScatteringModel::fNistManager
protected

Definition at line 115 of file G4hCoulombScatteringModel.hh.

Referenced by G4hCoulombScatteringModel().

G4ParticleChangeForGamma* G4hCoulombScatteringModel::fParticleChange
protected
G4double G4hCoulombScatteringModel::lowEnergyThreshold
protected
G4double G4hCoulombScatteringModel::mass
protected
const G4ParticleDefinition* G4hCoulombScatteringModel::particle
protected
const std::vector<G4double>* G4hCoulombScatteringModel::pCuts
protected
G4double G4hCoulombScatteringModel::recoilThreshold
protected
G4IonTable* G4hCoulombScatteringModel::theIonTable
protected

Definition at line 112 of file G4hCoulombScatteringModel.hh.

Referenced by G4hCoulombScatteringModel(), and SampleSecondaries().

const G4ParticleDefinition* G4hCoulombScatteringModel::theProton
protected
G4WentzelVIRelXSection* G4hCoulombScatteringModel::wokvi
protected

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