Geant4  10.02.p03
G4ElementSelector Class Reference

#include <G4ElementSelector.hh>

Collaboration diagram for G4ElementSelector:

Public Member Functions

 G4ElementSelector ()
 
virtual ~G4ElementSelector ()
 
virtual G4ElementSelectZandA (const G4Track &track, G4Nucleus *)
 

Private Member Functions

G4ElementSelectoroperator= (const G4ElementSelector &right)
 
 G4ElementSelector (const G4ElementSelector &)
 

Private Attributes

std::vector< G4doubleprob
 

Detailed Description

Definition at line 61 of file G4ElementSelector.hh.

Constructor & Destructor Documentation

◆ G4ElementSelector() [1/2]

G4ElementSelector::G4ElementSelector ( )

Definition at line 49 of file G4ElementSelector.cc.

50 {}

◆ ~G4ElementSelector()

G4ElementSelector::~G4ElementSelector ( )
virtual

Definition at line 54 of file G4ElementSelector.cc.

55 {}

◆ G4ElementSelector() [2/2]

G4ElementSelector::G4ElementSelector ( const G4ElementSelector )
private

Member Function Documentation

◆ operator=()

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

◆ SelectZandA()

G4Element * G4ElementSelector::SelectZandA ( const G4Track &  track,
G4Nucleus target 
)
virtual

Definition at line 60 of file G4ElementSelector.cc.

61 {
62  // Fermi-Teller Z-low of mu- capture and exceptions
63  // for halogens and oxigen.
64  // N.C.Mukhopadhyay Phys. Rep. 30 (1977) 1.
65 
66  size_t i = 0;
67  const G4Material* mat = track.GetMaterial();
68  size_t numberOfElements = mat->GetNumberOfElements();
69  const G4ElementVector* theElementVector = mat->GetElementVector();
70 
71  if(1 < numberOfElements) {
72  if(numberOfElements > prob.size()) { prob.resize(numberOfElements, 0.0); }
73 
74  const G4double* theAtomNumDensity = mat->GetAtomicNumDensityVector();
75 
76  G4double sum = 0.0;
77  for (i=0; i < numberOfElements; ++i) {
78 
79  G4int Z = G4lrint((*theElementVector)[i]->GetZ());
80 
81  // Halogens
82  if( (9 == Z) || (17 == Z) || (35 == Z) || (53 == Z) || (85 == Z) ) {
83  sum += 0.66 * Z * theAtomNumDensity[i];
84 
85  // Oxigen
86  } else if( 8 == Z ) {
87  sum += 0.56 * Z * theAtomNumDensity[i];
88 
89  // Others
90  } else {
91  sum += Z * theAtomNumDensity[i];
92  }
93  prob[i] = sum;
94  }
95 
96  sum *= G4UniformRand();
97  for (i=0; i < numberOfElements; ++i) {
98  if(sum <= prob[i]) { break; }
99  }
100  }
101 
102  G4Element* elm = (*theElementVector)[i];
103  G4int Z = G4lrint(elm->GetZ());
104 
105  // select isotope
106  const G4IsotopeVector* isv = elm->GetIsotopeVector();
107  size_t ni = isv->size();
108  i = 0;
109 
110  if(1 < ni) {
111 
112  const G4double* ab = elm->GetRelativeAbundanceVector();
114  for(i=0; i<ni; ++i) {
115  y -= ab[i];
116  if(y <= 0.0) { break; }
117  }
118  }
119 
120  G4int A = elm->GetIsotope(i)->GetN();
121  target->SetParameters(A, Z);
122 
123  return elm;
124 }
std::vector< G4Isotope * > G4IsotopeVector
std::vector< G4Element * > G4ElementVector
const G4Isotope * GetIsotope(G4int iso) const
Definition: G4Element.hh:169
int G4int
Definition: G4Types.hh:78
G4double * GetRelativeAbundanceVector() const
Definition: G4Element.hh:166
Float_t mat
Double_t y
const G4double * GetAtomicNumDensityVector() const
Definition: G4Material.hh:216
#define G4UniformRand()
Definition: Randomize.hh:97
double A(double temperature)
Float_t Z
G4IsotopeVector * GetIsotopeVector() const
Definition: G4Element.hh:162
std::vector< G4double > prob
static const G4double ab
int G4lrint(double ad)
Definition: templates.hh:163
G4int GetN() const
Definition: G4Isotope.hh:94
size_t GetNumberOfElements() const
Definition: G4Material.hh:186
const G4ElementVector * GetElementVector() const
Definition: G4Material.hh:190
double G4double
Definition: G4Types.hh:76
void SetParameters(const G4double A, const G4double Z)
Definition: G4Nucleus.cc:212
G4double GetZ() const
Definition: G4Element.hh:131
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ prob

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

Definition at line 77 of file G4ElementSelector.hh.


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