Geant4  10.02.p03
G4MicroElecElasticModel Class Reference

#include <G4MicroElecElasticModel.hh>

Inheritance diagram for G4MicroElecElasticModel:
Collaboration diagram for G4MicroElecElasticModel:

Public Member Functions

 G4MicroElecElasticModel (const G4ParticleDefinition *p=0, const G4String &nam="MicroElecElasticModel")
 
virtual ~G4MicroElecElasticModel ()
 
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, const G4ParticleDefinition *, G4double)
 
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 *> *)
 
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 Attributes

G4ParticleChangeForGamma * fParticleChangeForGamma
 
- Protected Attributes inherited from G4VEmModel
G4ElementDatafElementData
 
G4VParticleChange * pParticleChange
 
G4PhysicsTablexSectionTable
 
const std::vector< G4double > * theDensityFactor
 
const std::vector< G4int > * theDensityIdx
 
size_t idxTable
 

Private Types

typedef std::map< G4String, G4String, std::less< G4String > > MapFile
 
typedef std::map< G4String, G4MicroElecCrossSectionDataSet *, std::less< G4String > > MapData
 
typedef std::map< double, std::map< double, double > > TriDimensionMap
 
typedef std::map< double, std::vector< double > > VecMap
 

Private Member Functions

G4double Theta (G4ParticleDefinition *aParticleDefinition, G4double k, G4double integrDiff)
 
G4double LinLinInterpolate (G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2)
 
G4double LogLogInterpolate (G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2)
 
G4double LinLogInterpolate (G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2)
 
G4double QuadInterpolator (G4double e11, G4double e12, G4double e21, G4double e22, G4double x11, G4double x12, G4double x21, G4double x22, G4double t1, G4double t2, G4double t, G4double e)
 
G4double RandomizeCosTheta (G4double k)
 
G4MicroElecElasticModeloperator= (const G4MicroElecElasticModel &right)
 
 G4MicroElecElasticModel (const G4MicroElecElasticModel &)
 

Private Attributes

G4MaterialnistSi
 
G4double killBelowEnergy
 
G4double lowEnergyLimit
 
G4double lowEnergyLimitOfModel
 
G4double highEnergyLimit
 
G4bool isInitialised
 
G4int verboseLevel
 
MapFile tableFile
 
MapData tableData
 
TriDimensionMap eDiffCrossSectionData
 
std::vector< double > eTdummyVec
 
VecMap eVecm
 

Additional Inherited Members

- Protected Member Functions inherited from G4VEmModel
G4ParticleChangeForLoss * GetParticleChangeForLoss ()
 
G4ParticleChangeForGamma * GetParticleChangeForGamma ()
 
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 G4MicroElecElasticModel.hh.

Member Typedef Documentation

◆ MapData

Definition at line 97 of file G4MicroElecElasticModel.hh.

◆ MapFile

typedef std::map<G4String,G4String,std::less<G4String> > G4MicroElecElasticModel::MapFile
private

Definition at line 94 of file G4MicroElecElasticModel.hh.

◆ TriDimensionMap

typedef std::map<double, std::map<double, double> > G4MicroElecElasticModel::TriDimensionMap
private

Definition at line 123 of file G4MicroElecElasticModel.hh.

◆ VecMap

typedef std::map<double, std::vector<double> > G4MicroElecElasticModel::VecMap
private

Definition at line 128 of file G4MicroElecElasticModel.hh.

Constructor & Destructor Documentation

◆ G4MicroElecElasticModel() [1/2]

G4MicroElecElasticModel::G4MicroElecElasticModel ( const G4ParticleDefinition p = 0,
const G4String nam = "MicroElecElasticModel" 
)

Definition at line 49 of file G4MicroElecElasticModel.cc.

51 :G4VEmModel(nam),isInitialised(false)
52 {
54 
55  killBelowEnergy = 16.7 * eV; // Minimum e- energy for energy loss by excitation
56  lowEnergyLimit = 0 * eV;
57  lowEnergyLimitOfModel = 5 * eV; // The model lower energy is 5 eV
58  highEnergyLimit = 100. * MeV;
61 
62  verboseLevel= 0;
63  // Verbosity scale:
64  // 0 = nothing
65  // 1 = warning for energy non-conservation
66  // 2 = details of energy budget
67  // 3 = calculation of cross sections, file openings, sampling of atoms
68  // 4 = entering in methods
69 
70  if( verboseLevel>0 )
71  {
72  G4cout << "MicroElec Elastic model is constructed " << G4endl
73  << "Energy range: "
74  << lowEnergyLimit / eV << " eV - "
75  << highEnergyLimit / MeV << " MeV"
76  << G4endl;
77  }
79 }
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
static const double MeV
Definition: G4SIunits.hh:211
static G4NistManager * Instance()
G4VEmModel(const G4String &nam)
Definition: G4VEmModel.cc:69
void SetHighEnergyLimit(G4double)
Definition: G4VEmModel.hh:725
G4GLOB_DLL std::ostream G4cout
static const double eV
Definition: G4SIunits.hh:212
G4ParticleChangeForGamma * fParticleChangeForGamma
#define G4endl
Definition: G4ios.hh:61
void SetLowEnergyLimit(G4double)
Definition: G4VEmModel.hh:732
Here is the call graph for this function:

◆ ~G4MicroElecElasticModel()

G4MicroElecElasticModel::~G4MicroElecElasticModel ( )
virtual

Definition at line 83 of file G4MicroElecElasticModel.cc.

84 {
85  // For total cross section
86 
87  std::map< G4String,G4MicroElecCrossSectionDataSet*,std::less<G4String> >::iterator pos;
88  for (pos = tableData.begin(); pos != tableData.end(); ++pos)
89  {
90  G4MicroElecCrossSectionDataSet* table = pos->second;
91  delete table;
92  }
93 
94  // For final state
95 
96  eVecm.clear();
97 
98 }
static const G4double pos

◆ G4MicroElecElasticModel() [2/2]

G4MicroElecElasticModel::G4MicroElecElasticModel ( const G4MicroElecElasticModel )
private

Member Function Documentation

◆ CrossSectionPerVolume()

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

Reimplemented from G4VEmModel.

Definition at line 216 of file G4MicroElecElasticModel.cc.

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

◆ GetKillBelowThreshold()

G4double G4MicroElecElasticModel::GetKillBelowThreshold ( )
inline

Definition at line 76 of file G4MicroElecElasticModel.hh.

◆ Initialise()

void G4MicroElecElasticModel::Initialise ( const G4ParticleDefinition ,
const G4DataVector  
)
virtual

Implements G4VEmModel.

Definition at line 102 of file G4MicroElecElasticModel.cc.

104 {
105 
106  if (verboseLevel > 3)
107  G4cout << "Calling G4MicroElecElasticModel::Initialise()" << G4endl;
108 
109  // Energy limits
110 
112  {
113  G4cout << "G4MicroElecElasticModel: low energy limit increased from " <<
114  LowEnergyLimit()/eV << " eV to " << lowEnergyLimit/eV << " eV" << G4endl;
116  }
117 
119  {
120  G4cout << "G4MicroElecElasticModel: high energy limit decreased from " <<
121  HighEnergyLimit()/MeV << " MeV to " << highEnergyLimit/MeV << " MeV" << G4endl;
123  }
124 
125  // Reading of data files
126 
127  G4double scaleFactor = 1e-18 * cm * cm;
128 
129  G4String fileElectron("microelec/sigma_elastic_e_Si");
130 
133 
134  // For total cross section
135 
136  electron = electronDef->GetParticleName();
137 
138  tableFile[electron] = fileElectron;
139 
141  tableE->LoadData(fileElectron);
142  tableData[electron] = tableE;
143 
144  // For final state
145 
146  char *path = getenv("G4LEDATA");
147 
148  if (!path)
149  {
150  G4Exception("G4MicroElecElasticModel::Initialise","em0006",FatalException,"G4LEDATA environment variable not set.");
151  return;
152  }
153 
154  std::ostringstream eFullFileName;
155  eFullFileName << path << "/microelec/sigmadiff_cumulated_elastic_e_Si.dat";
156  std::ifstream eDiffCrossSection(eFullFileName.str().c_str());
157 
158  if (!eDiffCrossSection)
159  G4Exception("G4MicroElecElasticModel::Initialise","em0003",FatalException,"Missing data file: /microelec/sigmadiff_cumulated_elastic_e_Si.dat");
160 
161 
162  // October 21th, 2014 - Melanie Raine
163  // Added clear for MT
164 
165  eTdummyVec.clear();
166  eVecm.clear();
167  eDiffCrossSectionData.clear();
168 
169  //
170 
171 
172  eTdummyVec.push_back(0.);
173 
174  while(!eDiffCrossSection.eof())
175  {
176  double tDummy;
177  double eDummy;
178  eDiffCrossSection>>tDummy>>eDummy;
179 
180  // SI : mandatory eVecm initialization
181 
182  if (tDummy != eTdummyVec.back())
183  {
184  eTdummyVec.push_back(tDummy);
185  eVecm[tDummy].push_back(0.);
186  }
187 
188  eDiffCrossSection>>eDiffCrossSectionData[tDummy][eDummy];
189 
190  if (eDummy != eVecm[tDummy].back()) eVecm[tDummy].push_back(eDummy);
191 
192  }
193 
194  // End final state
195 
196  if (verboseLevel > 2)
197  G4cout << "Loaded cross section files for MicroElec Elastic model" << G4endl;
198 
199  if( verboseLevel>0 )
200  {
201  G4cout << "MicroElec Elastic model is initialized " << G4endl
202  << "Energy range: "
203  << LowEnergyLimit() / eV << " eV - "
204  << HighEnergyLimit() / MeV << " MeV"
205  << G4endl;
206  }
207 
208  if (isInitialised) { return; }
210  isInitialised = true;
211 
212 }
G4double LowEnergyLimit() const
Definition: G4VEmModel.hh:641
static const double cm
Definition: G4SIunits.hh:118
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
static const double MeV
Definition: G4SIunits.hh:211
std::vector< double > eTdummyVec
void SetHighEnergyLimit(G4double)
Definition: G4VEmModel.hh:725
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
G4double HighEnergyLimit() const
Definition: G4VEmModel.hh:634
virtual G4bool LoadData(const G4String &argFileName)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
static const double eV
Definition: G4SIunits.hh:212
G4ParticleChangeForGamma * fParticleChangeForGamma
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
void SetLowEnergyLimit(G4double)
Definition: G4VEmModel.hh:732
G4ParticleChangeForGamma * GetParticleChangeForGamma()
Definition: G4VEmModel.cc:134
Here is the call graph for this function:

◆ LinLinInterpolate()

G4double G4MicroElecElasticModel::LinLinInterpolate ( G4double  e1,
G4double  e2,
G4double  e,
G4double  xs1,
G4double  xs2 
)
private

Definition at line 388 of file G4MicroElecElasticModel.cc.

393 {
394  G4double d1 = xs1;
395  G4double d2 = xs2;
396  G4double value = (d1 + (d2 - d1)*(e - e1)/ (e2 - e1));
397  return value;
398 }
static const G4double d1
static const G4double e2
static const G4double e1
double G4double
Definition: G4Types.hh:76
static const G4double d2
Here is the caller graph for this function:

◆ LinLogInterpolate()

G4double G4MicroElecElasticModel::LinLogInterpolate ( G4double  e1,
G4double  e2,
G4double  e,
G4double  xs1,
G4double  xs2 
)
private

Definition at line 374 of file G4MicroElecElasticModel.cc.

379 {
380  G4double d1 = std::log(xs1);
381  G4double d2 = std::log(xs2);
382  G4double value = G4Exp(d1 + (d2 - d1)*(e - e1)/ (e2 - e1));
383  return value;
384 }
static const G4double d1
static const G4double e2
static const G4double e1
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
double G4double
Definition: G4Types.hh:76
static const G4double d2
Here is the call graph for this function:

◆ LogLogInterpolate()

G4double G4MicroElecElasticModel::LogLogInterpolate ( G4double  e1,
G4double  e2,
G4double  e,
G4double  xs1,
G4double  xs2 
)
private

Definition at line 402 of file G4MicroElecElasticModel.cc.

407 {
408  G4double a = (std::log10(xs2)-std::log10(xs1)) / (std::log10(e2)-std::log10(e1));
409  G4double b = std::log10(xs2) - a*std::log10(e2);
410  G4double sigma = a*std::log10(e) + b;
411  G4double value = (std::pow(10.,sigma));
412  return value;
413 }
static const G4double e2
static const G4double e1
double G4double
Definition: G4Types.hh:76

◆ operator=()

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

◆ QuadInterpolator()

G4double G4MicroElecElasticModel::QuadInterpolator ( G4double  e11,
G4double  e12,
G4double  e21,
G4double  e22,
G4double  x11,
G4double  x12,
G4double  x21,
G4double  x22,
G4double  t1,
G4double  t2,
G4double  t,
G4double  e 
)
private

Definition at line 417 of file G4MicroElecElasticModel.cc.

423 {
424  // Log-Log
425 /*
426  G4double interpolatedvalue1 = LogLogInterpolate(e11, e12, e, xs11, xs12);
427  G4double interpolatedvalue2 = LogLogInterpolate(e21, e22, e, xs21, xs22);
428  G4double value = LogLogInterpolate(t1, t2, t, interpolatedvalue1, interpolatedvalue2);
429 
430 
431  // Lin-Log
432  G4double interpolatedvalue1 = LinLogInterpolate(e11, e12, e, xs11, xs12);
433  G4double interpolatedvalue2 = LinLogInterpolate(e21, e22, e, xs21, xs22);
434  G4double value = LinLogInterpolate(t1, t2, t, interpolatedvalue1, interpolatedvalue2);
435 */
436 
437  // Lin-Lin
438  G4double interpolatedvalue1 = LinLinInterpolate(e11, e12, e, xs11, xs12);
439  G4double interpolatedvalue2 = LinLinInterpolate(e21, e22, e, xs21, xs22);
440  G4double value = LinLinInterpolate(t1, t2, t, interpolatedvalue1, interpolatedvalue2);
441 
442  return value;
443 }
TTree * t1
Definition: plottest35.C:26
G4double LinLinInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2)
TTree * t2
Definition: plottest35.C:36
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RandomizeCosTheta()

G4double G4MicroElecElasticModel::RandomizeCosTheta ( G4double  k)
private

Definition at line 447 of file G4MicroElecElasticModel.cc.

448 {
449  G4double integrdiff=0;
450  G4double uniformRand=G4UniformRand();
451  integrdiff = uniformRand;
452 
453  G4double theta=0.;
454  G4double cosTheta=0.;
455  theta = Theta(G4Electron::ElectronDefinition(),k/eV,integrdiff);
456 
457  cosTheta= std::cos(theta*pi/180);
458 
459  return cosTheta;
460 }
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
G4double Theta(G4ParticleDefinition *aParticleDefinition, G4double k, G4double integrDiff)
#define G4UniformRand()
Definition: Randomize.hh:97
static const double eV
Definition: G4SIunits.hh:212
static const double pi
Definition: G4SIunits.hh:74
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SampleSecondaries()

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

Implements G4VEmModel.

Definition at line 272 of file G4MicroElecElasticModel.cc.

277 {
278 
279  if (verboseLevel > 3)
280  G4cout << "Calling SampleSecondaries() of G4MicroElecElasticModel" << G4endl;
281 
282  G4double electronEnergy0 = aDynamicElectron->GetKineticEnergy();
283 
284  if (electronEnergy0 < killBelowEnergy)
285  {
286  fParticleChangeForGamma->SetProposedKineticEnergy(0.);
287  fParticleChangeForGamma->ProposeTrackStatus(fStopAndKill);
288  fParticleChangeForGamma->ProposeLocalEnergyDeposit(electronEnergy0);
289  return ;
290  }
291 
292  if (electronEnergy0>= killBelowEnergy && electronEnergy0 < highEnergyLimit)
293  {
294  G4double cosTheta = RandomizeCosTheta(electronEnergy0);
295 
296  G4double phi = 2. * pi * G4UniformRand();
297 
298  G4ThreeVector zVers = aDynamicElectron->GetMomentumDirection();
299  G4ThreeVector xVers = zVers.orthogonal();
300  G4ThreeVector yVers = zVers.cross(xVers);
301 
302  G4double xDir = std::sqrt(1. - cosTheta*cosTheta);
303  G4double yDir = xDir;
304  xDir *= std::cos(phi);
305  yDir *= std::sin(phi);
306 
307  G4ThreeVector zPrimeVers((xDir*xVers + yDir*yVers + cosTheta*zVers));
308 
309  fParticleChangeForGamma->ProposeMomentumDirection(zPrimeVers.unit()) ;
310 
311  fParticleChangeForGamma->SetProposedKineticEnergy(electronEnergy0);
312  }
313 
314 }
G4double GetKineticEnergy() const
#define G4UniformRand()
Definition: Randomize.hh:97
G4GLOB_DLL std::ostream G4cout
Hep3Vector cross(const Hep3Vector &) const
Hep3Vector orthogonal() const
static const double pi
Definition: G4SIunits.hh:74
const G4ThreeVector & GetMomentumDirection() const
G4ParticleChangeForGamma * fParticleChangeForGamma
G4double RandomizeCosTheta(G4double k)
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

◆ SetKillBelowThreshold()

void G4MicroElecElasticModel::SetKillBelowThreshold ( G4double  threshold)
inline

Definition at line 140 of file G4MicroElecElasticModel.hh.

141 {
142  killBelowEnergy = threshold;
143 
144  if (threshold < 5*CLHEP::eV)
145  {
146  G4Exception ("*** WARNING : the G4MicroElecElasticModel class is not validated below 5 eV !","",JustWarning,"") ;
147  threshold = 5*CLHEP::eV;
148  }
149 
150 }
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
static const double eV
Here is the call graph for this function:

◆ Theta()

G4double G4MicroElecElasticModel::Theta ( G4ParticleDefinition aParticleDefinition,
G4double  k,
G4double  integrDiff 
)
private

Definition at line 319 of file G4MicroElecElasticModel.cc.

320 {
321 
322  G4double theta = 0.;
323  G4double valueT1 = 0;
324  G4double valueT2 = 0;
325  G4double valueE21 = 0;
326  G4double valueE22 = 0;
327  G4double valueE12 = 0;
328  G4double valueE11 = 0;
329  G4double xs11 = 0;
330  G4double xs12 = 0;
331  G4double xs21 = 0;
332  G4double xs22 = 0;
333 
334 
335  if (particleDefinition == G4Electron::ElectronDefinition())
336  {
337  std::vector<double>::iterator t2 = std::upper_bound(eTdummyVec.begin(),eTdummyVec.end(), k);
338  std::vector<double>::iterator t1 = t2-1;
339 
340  std::vector<double>::iterator e12 = std::upper_bound(eVecm[(*t1)].begin(),eVecm[(*t1)].end(), integrDiff);
341  std::vector<double>::iterator e11 = e12-1;
342 
343  std::vector<double>::iterator e22 = std::upper_bound(eVecm[(*t2)].begin(),eVecm[(*t2)].end(), integrDiff);
344  std::vector<double>::iterator e21 = e22-1;
345 
346  valueT1 =*t1;
347  valueT2 =*t2;
348  valueE21 =*e21;
349  valueE22 =*e22;
350  valueE12 =*e12;
351  valueE11 =*e11;
352 
353  xs11 = eDiffCrossSectionData[valueT1][valueE11];
354  xs12 = eDiffCrossSectionData[valueT1][valueE12];
355  xs21 = eDiffCrossSectionData[valueT2][valueE21];
356  xs22 = eDiffCrossSectionData[valueT2][valueE22];
357 
358 }
359 
360  if (xs11==0 || xs12==0 ||xs21==0 ||xs22==0) return (0.);
361 
362  theta = QuadInterpolator( valueE11, valueE12,
363  valueE21, valueE22,
364  xs11, xs12,
365  xs21, xs22,
366  valueT1, valueT2,
367  k, integrDiff );
368 
369  return theta;
370 }
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
G4double QuadInterpolator(G4double e11, G4double e12, G4double e21, G4double e22, G4double x11, G4double x12, G4double x21, G4double x22, G4double t1, G4double t2, G4double t, G4double e)
TTree * t1
Definition: plottest35.C:26
std::vector< double > eTdummyVec
TTree * t2
Definition: plottest35.C:36
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ eDiffCrossSectionData

TriDimensionMap G4MicroElecElasticModel::eDiffCrossSectionData
private

Definition at line 125 of file G4MicroElecElasticModel.hh.

◆ eTdummyVec

std::vector<double> G4MicroElecElasticModel::eTdummyVec
private

Definition at line 126 of file G4MicroElecElasticModel.hh.

◆ eVecm

VecMap G4MicroElecElasticModel::eVecm
private

Definition at line 129 of file G4MicroElecElasticModel.hh.

◆ fParticleChangeForGamma

G4ParticleChangeForGamma* G4MicroElecElasticModel::fParticleChangeForGamma
protected

Definition at line 80 of file G4MicroElecElasticModel.hh.

◆ highEnergyLimit

G4double G4MicroElecElasticModel::highEnergyLimit
private

Definition at line 88 of file G4MicroElecElasticModel.hh.

◆ isInitialised

G4bool G4MicroElecElasticModel::isInitialised
private

Definition at line 89 of file G4MicroElecElasticModel.hh.

◆ killBelowEnergy

G4double G4MicroElecElasticModel::killBelowEnergy
private

Definition at line 85 of file G4MicroElecElasticModel.hh.

◆ lowEnergyLimit

G4double G4MicroElecElasticModel::lowEnergyLimit
private

Definition at line 86 of file G4MicroElecElasticModel.hh.

◆ lowEnergyLimitOfModel

G4double G4MicroElecElasticModel::lowEnergyLimitOfModel
private

Definition at line 87 of file G4MicroElecElasticModel.hh.

◆ nistSi

G4Material* G4MicroElecElasticModel::nistSi
private

Definition at line 84 of file G4MicroElecElasticModel.hh.

◆ tableData

MapData G4MicroElecElasticModel::tableData
private

Definition at line 98 of file G4MicroElecElasticModel.hh.

◆ tableFile

MapFile G4MicroElecElasticModel::tableFile
private

Definition at line 95 of file G4MicroElecElasticModel.hh.

◆ verboseLevel

G4int G4MicroElecElasticModel::verboseLevel
private

Definition at line 90 of file G4MicroElecElasticModel.hh.


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