#include <G4PreCompoundFragmentVector.hh>
Public Member Functions | |
G4PreCompoundFragmentVector (pcfvector *avector) | |
~G4PreCompoundFragmentVector () | |
void | SetVector (pcfvector *avector) |
void | SetOPTxs (G4int) |
void | UseSICB (G4bool) |
void | Initialize (const G4Fragment &aFragment) |
G4double | CalculateProbabilities (const G4Fragment &aFragment) |
G4VPreCompoundFragment * | ChooseFragment () |
Definition at line 52 of file G4PreCompoundFragmentVector.hh.
G4PreCompoundFragmentVector::G4PreCompoundFragmentVector | ( | pcfvector * | avector | ) |
Definition at line 38 of file G4PreCompoundFragmentVector.cc.
References SetVector().
00039 : theChannels(0), nChannels(0) 00040 { 00041 SetVector(avector); 00042 }
G4PreCompoundFragmentVector::~G4PreCompoundFragmentVector | ( | ) |
G4double G4PreCompoundFragmentVector::CalculateProbabilities | ( | const G4Fragment & | aFragment | ) | [inline] |
Definition at line 96 of file G4PreCompoundFragmentVector.hh.
Referenced by G4PreCompoundEmission::GetTotalProbability().
00097 { 00098 //G4cout << "## G4PreCompoundFragmentVector::CalculateProbabilities" << G4endl; 00099 G4double probtot = 0.0; 00100 for (G4int i=0; i< nChannels; ++i) { 00101 G4double prob = (*theChannels)[i]->CalcEmissionProbability(aFragment); 00102 probtot += prob; 00103 probabilities[i] = probtot; 00104 //G4cout<<" prob= "<<prob<<" for "<<(*theChannels)[i]->GetName()<<G4endl; 00105 } 00106 return probtot; 00107 }
G4VPreCompoundFragment * G4PreCompoundFragmentVector::ChooseFragment | ( | ) | [inline] |
Definition at line 109 of file G4PreCompoundFragmentVector.hh.
References G4UniformRand.
Referenced by G4PreCompoundEmission::PerformEmission().
00110 { 00111 G4double x = probabilities[nChannels-1]*G4UniformRand(); 00112 G4int i=0; 00113 for (; i<nChannels; ++i) { 00114 if(x <= probabilities[i]) { break; } 00115 } 00116 return (*theChannels)[i]; 00117 }
void G4PreCompoundFragmentVector::Initialize | ( | const G4Fragment & | aFragment | ) | [inline] |
Definition at line 88 of file G4PreCompoundFragmentVector.hh.
Referenced by G4PreCompoundEmission::Initialize().
00089 { 00090 for (G4int i=0; i< nChannels; ++i) { 00091 (*theChannels)[i]->Initialize(aFragment); 00092 } 00093 }
void G4PreCompoundFragmentVector::SetOPTxs | ( | G4int | ) |
Definition at line 57 of file G4PreCompoundFragmentVector.cc.
Referenced by G4PreCompoundEmission::SetOPTxs().
00058 { 00059 for (G4int i=0; i< nChannels; ++i) { 00060 (*theChannels)[i]->SetOPTxs(opt); 00061 } 00062 }
void G4PreCompoundFragmentVector::SetVector | ( | pcfvector * | avector | ) |
Definition at line 47 of file G4PreCompoundFragmentVector.cc.
Referenced by G4PreCompoundFragmentVector(), G4PreCompoundEmission::SetDefaultModel(), and G4PreCompoundEmission::SetHETCModel().
00048 { 00049 theChannels = avector; 00050 if(theChannels) { 00051 nChannels = theChannels->size(); 00052 probabilities.resize(nChannels); 00053 } 00054 }
void G4PreCompoundFragmentVector::UseSICB | ( | G4bool | ) |
Definition at line 65 of file G4PreCompoundFragmentVector.cc.
Referenced by G4PreCompoundEmission::UseSICB().
00066 { 00067 for (G4int i=0; i< nChannels; ++i) { 00068 (*theChannels)[i]->UseSICB(use); 00069 } 00070 }