Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4FissionStore Class Reference

#include <G4FissionStore.hh>

Public Member Functions

 G4FissionStore ()
 
void setVerboseLevel (G4int verbose=1)
 
void addConfig (G4double a, G4double z, G4double ez, G4double ek, G4double ev)
 
void clear ()
 
size_t size () const
 
G4FissionConfiguration generateConfiguration (G4double amax, G4double rand) const
 

Detailed Description

Definition at line 37 of file G4FissionStore.hh.

Constructor & Destructor Documentation

◆ G4FissionStore()

G4FissionStore::G4FissionStore ( )

Definition at line 36 of file G4FissionStore.cc.

36 : verboseLevel(0) {
37 if (verboseLevel > 1)
38 G4cout << " >>> G4FissionStore::G4FissionStore" << G4endl;
39}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout

Member Function Documentation

◆ addConfig()

void G4FissionStore::addConfig ( G4double  a,
G4double  z,
G4double  ez,
G4double  ek,
G4double  ev 
)

Definition at line 41 of file G4FissionStore.cc.

42 {
43 G4FissionConfiguration config(a, z, ez, ek, ev);
44 configurations.push_back(config);
45 if (verboseLevel > 2) G4cout << config << G4endl;
46}
struct config_s config

Referenced by G4Fissioner::collide().

◆ clear()

void G4FissionStore::clear ( )
inline

Definition at line 45 of file G4FissionStore.hh.

45{ configurations.clear(); }

Referenced by G4Fissioner::collide().

◆ generateConfiguration()

G4FissionConfiguration G4FissionStore::generateConfiguration ( G4double  amax,
G4double  rand 
) const

Definition at line 48 of file G4FissionStore.cc.

49 {
50 if (verboseLevel > 1)
51 G4cout << " >>> G4FissionStore::generateConfiguration" << G4endl;
52
53 const G4double small = -30.0;
54
55 G4double totProb = 0.0;
56 configProbs.resize(size(),0.);
57
58 if (verboseLevel > 3)
59 G4cout << " amax " << amax << " ic " << size() << G4endl;
60
61 for (size_t i = 0; i < size(); i++) {
62 G4double ez = configurations[i].ezet;
63 G4double pr = ez - amax;
64
65 if (pr < small) pr = small;
66 pr = std::exp(pr);
67 if (verboseLevel > 2) {
68 G4cout << configurations[i] << "\n probability " << pr << G4endl;
69 }
70 totProb += pr;
71 configProbs[i] = totProb;
72 };
73
74 G4double st = totProb * rand;
75
76 size_t igen = 0;
77 while (configProbs[igen] <= st && igen < size()) igen++;
78
79 if (verboseLevel > 3) G4cout << " igen " << igen << G4endl;
80
81 return configurations[igen];
82}
double G4double
Definition: G4Types.hh:64
size_t size() const

Referenced by G4Fissioner::collide().

◆ setVerboseLevel()

void G4FissionStore::setVerboseLevel ( G4int  verbose = 1)
inline

Definition at line 41 of file G4FissionStore.hh.

41{ verboseLevel = verbose; }

Referenced by G4Fissioner::collide().

◆ size()

size_t G4FissionStore::size ( ) const
inline

Definition at line 47 of file G4FissionStore.hh.

47{ return configurations.size(); }

Referenced by G4Fissioner::collide(), and generateConfiguration().


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