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

#include <G4PreCompoundFragmentVector.hh>

Public Member Functions

 G4PreCompoundFragmentVector (pcfvector *avector)
 
 ~G4PreCompoundFragmentVector ()=default
 
void SetVector (pcfvector *avector)
 
void SetOPTxs (G4int)
 
void UseSICB (G4bool)
 
G4double CalculateProbabilities (const G4Fragment &aFragment)
 
G4VPreCompoundFragmentChooseFragment ()
 

Detailed Description

Definition at line 51 of file G4PreCompoundFragmentVector.hh.

Constructor & Destructor Documentation

◆ G4PreCompoundFragmentVector()

G4PreCompoundFragmentVector::G4PreCompoundFragmentVector ( pcfvector avector)
explicit

Definition at line 37 of file G4PreCompoundFragmentVector.cc.

38 : theChannels(nullptr), nChannels(0)
39{
40 SetVector(avector);
41}

◆ ~G4PreCompoundFragmentVector()

G4PreCompoundFragmentVector::~G4PreCompoundFragmentVector ( )
default

Member Function Documentation

◆ CalculateProbabilities()

G4double G4PreCompoundFragmentVector::CalculateProbabilities ( const G4Fragment aFragment)

Definition at line 74 of file G4PreCompoundFragmentVector.cc.

76{
77 //G4cout << "## G4PreCompoundFragmentVector::CalculateProbabilities nCh= "
78 // << nChannels << G4endl;
79 G4double probtot = 0.0;
80 for (G4int i=0; i< nChannels; ++i) {
81 (*theChannels)[i]->Initialize(aFragment);
82 G4double prob = ((*theChannels)[i]->IsItPossible(aFragment))
83 ? (*theChannels)[i]->CalcEmissionProbability(aFragment)
84 : 0.0;
85 probtot += prob;
86 probabilities[i] = probtot;
87 //G4cout<<" prob= " << prob << " probtot= " << probtot
88 // << " for "<< i << "-th channel" <<G4endl;
89 }
90 return probtot;
91}
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85

Referenced by G4PreCompoundEmission::GetTotalProbability().

◆ ChooseFragment()

G4VPreCompoundFragment * G4PreCompoundFragmentVector::ChooseFragment ( )

Definition at line 93 of file G4PreCompoundFragmentVector.cc.

94{
95 //G4cout << "## G4PreCompoundFragmentVector::ChooseFragment nCh= "
96 // << nChannels << G4endl;
97 G4double x = probabilities[nChannels-1]*G4UniformRand();
98 G4int i=0;
99 for (; i<nChannels; ++i) {
100 if(x <= probabilities[i]) { break; }
101 }
102 return (*theChannels)[i];
103}
#define G4UniformRand()
Definition: Randomize.hh:52

Referenced by G4PreCompoundEmission::PerformEmission().

◆ SetOPTxs()

void G4PreCompoundFragmentVector::SetOPTxs ( G4int  opt)

Definition at line 59 of file G4PreCompoundFragmentVector.cc.

60{
61 for (G4int i=0; i<nChannels; ++i) {
62 (*theChannels)[i]->SetOPTxs(opt);
63 }
64}

Referenced by G4PreCompoundEmission::SetOPTxs().

◆ SetVector()

void G4PreCompoundFragmentVector::SetVector ( pcfvector avector)

Definition at line 43 of file G4PreCompoundFragmentVector.cc.

44{
45 if(avector != theChannels) {
46 delete theChannels;
47 theChannels = avector;
48 }
49 if(theChannels) {
50 nChannels = theChannels->size();
51 probabilities.resize(nChannels, 0.0);
52 } else {
53 nChannels = 0;
54 probabilities.clear();
55 }
56}

Referenced by G4PreCompoundFragmentVector(), G4PreCompoundEmission::SetDefaultModel(), and G4PreCompoundEmission::SetHETCModel().

◆ UseSICB()

void G4PreCompoundFragmentVector::UseSICB ( G4bool  use)

Definition at line 67 of file G4PreCompoundFragmentVector.cc.

68{
69 for (G4int i=0; i< nChannels; ++i) {
70 (*theChannels)[i]->UseSICB(use);
71 }
72}

Referenced by G4PreCompoundEmission::UseSICB().


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