Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4MuElecElasticModel Class Reference

#include <G4MuElecElasticModel.hh>

Inheritance diagram for G4MuElecElasticModel:
Collaboration diagram for G4MuElecElasticModel:

Public Member Functions

 G4MuElecElasticModel (const G4ParticleDefinition *p=0, const G4String &nam="MuElecElasticModel")
 
virtual ~G4MuElecElasticModel ()
 
virtual void Initialise (const G4ParticleDefinition *, const G4DataVector &)
 
virtual G4double CrossSectionPerVolume (const G4Material *material, const G4ParticleDefinition *p, G4double ekin, G4double emin, G4double emax)
 
virtual void SampleSecondaries (std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
 
void SetKillBelowThreshold (G4double threshold)
 
G4double GetKillBelowThreshold ()
 
- 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 GetPartialCrossSection (const G4Material *, G4int level, const G4ParticleDefinition *, G4double kineticEnergy)
 
virtual G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
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 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 * > *)
 
virtual 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=nullptr)
 
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 Attributes

G4ParticleChangeForGammafParticleChangeForGamma
 
- Protected Attributes inherited from G4VEmModel
G4ElementDatafElementData
 
G4VParticleChangepParticleChange
 
G4PhysicsTablexSectionTable
 
const std::vector< G4double > * theDensityFactor
 
const std::vector< G4int > * theDensityIdx
 
size_t idxTable
 

Additional Inherited Members

- Protected Member Functions inherited from G4VEmModel
G4ParticleChangeForLossGetParticleChangeForLoss ()
 
G4ParticleChangeForGammaGetParticleChangeForGamma ()
 
virtual G4double MaxSecondaryEnergy (const G4ParticleDefinition *, G4double kineticEnergy)
 
const G4MaterialCutsCoupleCurrentCouple () const
 
void SetCurrentElement (const G4Element *)
 
- Static Protected Attributes inherited from G4VEmModel
static const G4double inveplus = 1.0/CLHEP::eplus
 

Detailed Description

Definition at line 51 of file G4MuElecElasticModel.hh.

Constructor & Destructor Documentation

G4MuElecElasticModel::G4MuElecElasticModel ( const G4ParticleDefinition p = 0,
const G4String nam = "MuElecElasticModel" 
)

Definition at line 49 of file G4MuElecElasticModel.cc.

51 :G4VEmModel(nam),isInitialised(false)
52 {
53 
54  G4cout << G4endl;
55  G4cout << "*******************************************************************************" << G4endl;
56  G4cout << "*******************************************************************************" << G4endl;
57  G4cout << " The name of the class G4MuElecElasticModel is changed to G4MicroElecElasticModel. " << G4endl;
58  G4cout << " The obsolete class will be REMOVED with the next release of Geant4. " << G4endl;
59  G4cout << "*******************************************************************************" << G4endl;
60  G4cout << "*******************************************************************************" << G4endl;
61  G4cout << G4endl;
62 
63  nistSi = G4NistManager::Instance()->FindOrBuildMaterial("G4_Si");
64 
65  killBelowEnergy = 16.7 * eV; // Minimum e- energy for energy loss by excitation
66  lowEnergyLimit = 0 * eV;
67  lowEnergyLimitOfModel = 5 * eV; // The model lower energy is 5 eV
68  highEnergyLimit = 100. * MeV;
69  SetLowEnergyLimit(lowEnergyLimit);
70  SetHighEnergyLimit(highEnergyLimit);
71 
72  verboseLevel= 0;
73  // Verbosity scale:
74  // 0 = nothing
75  // 1 = warning for energy non-conservation
76  // 2 = details of energy budget
77  // 3 = calculation of cross sections, file openings, sampling of atoms
78  // 4 = entering in methods
79 
80  if( verboseLevel>0 )
81  {
82  G4cout << "MuElec Elastic model is constructed " << G4endl
83  << "Energy range: "
84  << lowEnergyLimit / eV << " eV - "
85  << highEnergyLimit / keV << " keV"
86  << G4endl;
87  }
89 }
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
static G4NistManager * Instance()
G4VEmModel(const G4String &nam)
Definition: G4VEmModel.cc:68
void SetHighEnergyLimit(G4double)
Definition: G4VEmModel.hh:724
G4GLOB_DLL std::ostream G4cout
static constexpr double eV
Definition: G4SIunits.hh:215
G4ParticleChangeForGamma * fParticleChangeForGamma
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
void SetLowEnergyLimit(G4double)
Definition: G4VEmModel.hh:731
static constexpr double keV
Definition: G4SIunits.hh:216

Here is the call graph for this function:

G4MuElecElasticModel::~G4MuElecElasticModel ( )
virtual

Definition at line 93 of file G4MuElecElasticModel.cc.

94 {
95  // For total cross section
96 
97  std::map< G4String,G4MuElecCrossSectionDataSet*,std::less<G4String> >::iterator pos;
98  for (pos = tableData.begin(); pos != tableData.end(); ++pos)
99  {
100  G4MuElecCrossSectionDataSet* table = pos->second;
101  delete table;
102  }
103 
104  // For final state
105 
106  eVecm.clear();
107 
108 }
static const G4double pos

Member Function Documentation

G4double G4MuElecElasticModel::CrossSectionPerVolume ( const G4Material material,
const G4ParticleDefinition p,
G4double  ekin,
G4double  emin,
G4double  emax 
)
virtual

Reimplemented from G4VEmModel.

Definition at line 218 of file G4MuElecElasticModel.cc.

223 {
224  if (verboseLevel > 3)
225  G4cout << "Calling CrossSectionPerVolume() of G4MuElecElasticModel" << G4endl;
226 
227  // Calculate total cross section for model
228 
229  G4double sigma=0;
230 
231  G4double density = material->GetTotNbOfAtomsPerVolume();
232 
233  if (material == nistSi || material->GetBaseMaterial() == nistSi)
234  {
235  const G4String& particleName = p->GetParticleName();
236 
237  if (ekin < highEnergyLimit)
238  {
239  //SI : XS must not be zero otherwise sampling of secondaries method ignored
240  if (ekin < lowEnergyLimitOfModel) ekin = lowEnergyLimitOfModel;
241  //
242 
243  std::map< G4String,G4MuElecCrossSectionDataSet*,std::less<G4String> >::iterator pos;
244  pos = tableData.find(particleName);
245 
246  if (pos != tableData.end())
247  {
248  G4MuElecCrossSectionDataSet* table = pos->second;
249  if (table != 0)
250  {
251  sigma = table->FindValue(ekin);
252  }
253  }
254  else
255  {
256  G4Exception("G4MuElecElasticModel::ComputeCrossSectionPerVolume","em0002",FatalException,"Model not applicable to particle type.");
257  }
258  }
259 
260  if (verboseLevel > 3)
261  {
262  G4cout << "---> Kinetic energy(eV)=" << ekin/eV << G4endl;
263  G4cout << " - Cross section per Si atom (cm^2)=" << sigma/cm/cm << G4endl;
264  G4cout << " - Cross section per Si atom (cm^-1)=" << sigma*density/(1./cm) << G4endl;
265  }
266 
267  }
268 
269  return sigma*density;
270 }
virtual G4double FindValue(G4double e, G4int componentId=0) const
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
static constexpr double cm
Definition: G4SIunits.hh:119
static constexpr double eV
Definition: G4SIunits.hh:215
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4double GetTotNbOfAtomsPerVolume() const
Definition: G4Material.hh:209
const G4Material * GetBaseMaterial() const
Definition: G4Material.hh:233
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
static const G4double pos

Here is the call graph for this function:

G4double G4MuElecElasticModel::GetKillBelowThreshold ( )
inline

Definition at line 76 of file G4MuElecElasticModel.hh.

76 { return killBelowEnergy; }
void G4MuElecElasticModel::Initialise ( const G4ParticleDefinition ,
const G4DataVector  
)
virtual

Implements G4VEmModel.

Definition at line 112 of file G4MuElecElasticModel.cc.

114 {
115 
116  if (verboseLevel > 3)
117  G4cout << "Calling G4MuElecElasticModel::Initialise()" << G4endl;
118 
119  // Energy limits
120 
121  if (LowEnergyLimit() < lowEnergyLimit)
122  {
123  G4cout << "G4MuElecElasticModel: low energy limit increased from " <<
124  LowEnergyLimit()/eV << " eV to " << lowEnergyLimit/eV << " eV" << G4endl;
125  SetLowEnergyLimit(lowEnergyLimit);
126  }
127 
128  if (HighEnergyLimit() > highEnergyLimit)
129  {
130  G4cout << "G4MuElecElasticModel: high energy limit decreased from " <<
131  HighEnergyLimit()/MeV << " MeV to " << highEnergyLimit/MeV << " MeV" << G4endl;
132  SetHighEnergyLimit(highEnergyLimit);
133  }
134 
135  // Reading of data files
136 
137  G4double scaleFactor = 1e-18 * cm * cm;
138 
139  G4String fileElectron("microelec/sigma_elastic_e_Si");
140 
143 
144  // For total cross section
145 
146  electron = electronDef->GetParticleName();
147 
148  tableFile[electron] = fileElectron;
149 
151  tableE->LoadData(fileElectron);
152  tableData[electron] = tableE;
153 
154  // For final state
155 
156  char *path = getenv("G4LEDATA");
157 
158  if (!path)
159  {
160  G4Exception("G4MuElecElasticModel::Initialise","em0006",FatalException,"G4LEDATA environment variable not set.");
161  return;
162  }
163 
164  std::ostringstream eFullFileName;
165  eFullFileName << path << "/microelec/sigmadiff_elastic_e_Si.dat";
166  std::ifstream eDiffCrossSection(eFullFileName.str().c_str());
167 
168  if (!eDiffCrossSection)
169  G4Exception("G4MuElecElasticModel::Initialise","em0003",FatalException,"Missing data file: /microelec/sigmadiff_elastic_e_Si.dat");
170 
171  eTdummyVec.push_back(0.);
172 
173  while(!eDiffCrossSection.eof())
174  {
175  double tDummy;
176  double eDummy;
177  eDiffCrossSection>>tDummy>>eDummy;
178 
179  // SI : mandatory eVecm initialization
180  if (tDummy != eTdummyVec.back())
181  {
182  eTdummyVec.push_back(tDummy);
183  eVecm[tDummy].push_back(0.);
184  }
185 
186  eDiffCrossSection>>eDiffCrossSectionData[tDummy][eDummy];
187 
188  // SI : only if not end of file reached !
189  if (!eDiffCrossSection.eof()) eDiffCrossSectionData[tDummy][eDummy]*=scaleFactor;
190 
191  if (eDummy != eVecm[tDummy].back()) eVecm[tDummy].push_back(eDummy);
192 
193  }
194 
195  // End final state
196 
197  if (verboseLevel > 2)
198  G4cout << "Loaded cross section files for MuElec Elastic model" << G4endl;
199 
200  if( verboseLevel>0 )
201  {
202  G4cout << "MuElec Elastic model is initialized " << G4endl
203  << "Energy range: "
204  << LowEnergyLimit() / eV << " eV - "
205  << HighEnergyLimit() / keV << " keV"
206  << G4endl;
207  }
208 
209  if (isInitialised) { return; }
211  isInitialised = true;
212 
213  // InitialiseElementSelectors(particle,cuts);
214 }
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
G4double LowEnergyLimit() const
Definition: G4VEmModel.hh:640
G4double HighEnergyLimit() const
Definition: G4VEmModel.hh:633
virtual G4bool LoadData(const G4String &argFileName)
const G4String & GetParticleName() const
void SetHighEnergyLimit(G4double)
Definition: G4VEmModel.hh:724
G4GLOB_DLL std::ostream G4cout
static constexpr double cm
Definition: G4SIunits.hh:119
static constexpr double eV
Definition: G4SIunits.hh:215
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4ParticleChangeForGamma * fParticleChangeForGamma
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
double G4double
Definition: G4Types.hh:76
void SetLowEnergyLimit(G4double)
Definition: G4VEmModel.hh:731
static constexpr double keV
Definition: G4SIunits.hh:216
G4ParticleChangeForGamma * GetParticleChangeForGamma()
Definition: G4VEmModel.cc:132

Here is the call graph for this function:

void G4MuElecElasticModel::SampleSecondaries ( std::vector< G4DynamicParticle * > *  ,
const G4MaterialCutsCouple ,
const G4DynamicParticle aDynamicElectron,
G4double  tmin,
G4double  maxEnergy 
)
virtual

Implements G4VEmModel.

Definition at line 274 of file G4MuElecElasticModel.cc.

279 {
280 
281  if (verboseLevel > 3)
282  G4cout << "Calling SampleSecondaries() of G4MuElecElasticModel" << G4endl;
283 
284  G4double electronEnergy0 = aDynamicElectron->GetKineticEnergy();
285 
286  if (electronEnergy0 < killBelowEnergy)
287  {
290  return ;
291  }
292 
293  if (electronEnergy0>= killBelowEnergy && electronEnergy0 < highEnergyLimit)
294  {
295  G4double cosTheta = RandomizeCosTheta(electronEnergy0);
296 
297  G4double phi = 2. * pi * G4UniformRand();
298 
299  G4ThreeVector zVers = aDynamicElectron->GetMomentumDirection();
300  G4ThreeVector xVers = zVers.orthogonal();
301  G4ThreeVector yVers = zVers.cross(xVers);
302 
303  G4double xDir = std::sqrt(1. - cosTheta*cosTheta);
304  G4double yDir = xDir;
305  xDir *= std::cos(phi);
306  yDir *= std::sin(phi);
307 
308  G4ThreeVector zPrimeVers((xDir*xVers + yDir*yVers + cosTheta*zVers));
309 
311 
313  }
314 
315 }
G4double GetKineticEnergy() const
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
#define G4UniformRand()
Definition: Randomize.hh:97
G4GLOB_DLL std::ostream G4cout
const G4ThreeVector & GetMomentumDirection() const
Hep3Vector orthogonal() const
G4ParticleChangeForGamma * fParticleChangeForGamma
void SetProposedKineticEnergy(G4double proposedKinEnergy)
#define G4endl
Definition: G4ios.hh:61
static constexpr double pi
Definition: G4SIunits.hh:75
Hep3Vector cross(const Hep3Vector &) const
double G4double
Definition: G4Types.hh:76
void ProposeTrackStatus(G4TrackStatus status)

Here is the call graph for this function:

void G4MuElecElasticModel::SetKillBelowThreshold ( G4double  threshold)
inline

Definition at line 138 of file G4MuElecElasticModel.hh.

139 {
140  killBelowEnergy = threshold;
141 
142  if (threshold < 5*CLHEP::eV)
143  {
144  G4Exception ("*** WARNING : the G4MuElecElasticModel class is not validated below 5 eV !","",JustWarning,"") ;
145  threshold = 0.025*CLHEP::eV;
146  }
147 
148 }
static constexpr double eV
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

Here is the call graph for this function:

Member Data Documentation

G4ParticleChangeForGamma* G4MuElecElasticModel::fParticleChangeForGamma
protected

Definition at line 80 of file G4MuElecElasticModel.hh.


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