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

#include <G4StatMF.hh>

+ Inheritance diagram for G4StatMF:

Public Member Functions

 G4StatMF ()
 
 ~G4StatMF ()
 
G4FragmentVectorBreakItUp (const G4Fragment &theNucleus)
 
- Public Member Functions inherited from G4VMultiFragmentation
 G4VMultiFragmentation ()
 
virtual ~G4VMultiFragmentation ()
 
virtual G4FragmentVectorBreakItUp (const G4Fragment &theNucleus)=0
 

Detailed Description

Definition at line 47 of file G4StatMF.hh.

Constructor & Destructor Documentation

◆ G4StatMF()

G4StatMF::G4StatMF ( )

Definition at line 39 of file G4StatMF.cc.

39: _theEnsemble(0) {}

◆ ~G4StatMF()

G4StatMF::~G4StatMF ( )

Definition at line 43 of file G4StatMF.cc.

43{} //{if (_theEnsemble != 0) delete _theEnsemble;}

Member Function Documentation

◆ BreakItUp()

G4FragmentVector * G4StatMF::BreakItUp ( const G4Fragment theNucleus)
virtual

Implements G4VMultiFragmentation.

Definition at line 46 of file G4StatMF.cc.

47{
48 // G4FragmentVector * theResult = new G4FragmentVector;
49
50 if (theFragment.GetExcitationEnergy() <= 0.0) {
51 //G4FragmentVector * theResult = new G4FragmentVector;
52 //theResult->push_back(new G4Fragment(theFragment));
53 return 0;
54 }
55
56
57 // Maximun average multiplicity: M_0 = 2.6 for A ~ 200
58 // and M_0 = 3.3 for A <= 110
59 G4double MaxAverageMultiplicity =
60 G4StatMFParameters::GetMaxAverageMultiplicity(static_cast<G4int>(theFragment.GetA()));
61
62
63 // We'll use two kinds of ensembles
64 G4StatMFMicroCanonical * theMicrocanonicalEnsemble = 0;
65 G4StatMFMacroCanonical * theMacrocanonicalEnsemble = 0;
66
67
68 //-------------------------------------------------------
69 // Direct simulation part (Microcanonical ensemble)
70 //-------------------------------------------------------
71
72 // Microcanonical ensemble initialization
73 theMicrocanonicalEnsemble = new G4StatMFMicroCanonical(theFragment);
74
75 G4int Iterations = 0;
76 G4int IterationsLimit = 100000;
78
79 G4bool FirstTime = true;
80 G4StatMFChannel * theChannel = 0;
81
82 G4bool ChannelOk;
83 do { // Try to de-excite as much as IterationLimit permits
84 do {
85
86 G4double theMeanMult = theMicrocanonicalEnsemble->GetMeanMultiplicity();
87 if (theMeanMult <= MaxAverageMultiplicity) {
88 // G4cout << "MICROCANONICAL" << G4endl;
89 // Choose fragments atomic numbers and charges from direct simulation
90 theChannel = theMicrocanonicalEnsemble->ChooseAandZ(theFragment);
91 _theEnsemble = theMicrocanonicalEnsemble;
92 } else {
93 //-----------------------------------------------------
94 // Non direct simulation part (Macrocanonical Ensemble)
95 //-----------------------------------------------------
96 if (FirstTime) {
97 // Macrocanonical ensemble initialization
98 theMacrocanonicalEnsemble = new G4StatMFMacroCanonical(theFragment);
99 _theEnsemble = theMacrocanonicalEnsemble;
100 FirstTime = false;
101 }
102 // G4cout << "MACROCANONICAL" << G4endl;
103 // Select calculated fragment total multiplicity,
104 // fragment atomic numbers and fragment charges.
105 theChannel = theMacrocanonicalEnsemble->ChooseAandZ(theFragment);
106 }
107
108 ChannelOk = theChannel->CheckFragments();
109 if (!ChannelOk) delete theChannel;
110
111 } while (!ChannelOk);
112
113
114 if (theChannel->GetMultiplicity() <= 1) {
115 G4FragmentVector * theResult = new G4FragmentVector;
116 theResult->push_back(new G4Fragment(theFragment));
117 delete theMicrocanonicalEnsemble;
118 if (theMacrocanonicalEnsemble != 0) delete theMacrocanonicalEnsemble;
119 delete theChannel;
120 return theResult;
121 }
122
123 //--------------------------------------
124 // Second part of simulation procedure.
125 //--------------------------------------
126
127 // Find temperature of breaking channel.
128 Temperature = _theEnsemble->GetMeanTemperature(); // Initial guess for Temperature
129
130 if (FindTemperatureOfBreakingChannel(theFragment,theChannel,Temperature)) break;
131
132 // Do not forget to delete this unusable channel, for which we failed to find the temperature,
133 // otherwise for very proton-reach nuclei it would lead to memory leak due to large
134 // number of iterations. N.B. "theChannel" is created in G4StatMFMacroCanonical::ChooseZ()
135
136 // G4cout << " Iteration # " << Iterations << " Mean Temperature = " << Temperature << G4endl;
137
138 delete theChannel;
139
140 } while (Iterations++ < IterationsLimit );
141
142
143
144 // If Iterations >= IterationsLimit means that we couldn't solve for temperature
145 if (Iterations >= IterationsLimit)
146 throw G4HadronicException(__FILE__, __LINE__, "G4StatMF::BreakItUp: Was not possible to solve for temperature of breaking channel");
147
148
149 G4FragmentVector * theResult = theChannel->
150 GetFragments(theFragment.GetA_asInt(),theFragment.GetZ_asInt(),Temperature);
151
152
153
154 // ~~~~~~ Energy conservation Patch !!!!!!!!!!!!!!!!!!!!!!
155 // Original nucleus 4-momentum in CM system
156 G4LorentzVector InitialMomentum(theFragment.GetMomentum());
157 InitialMomentum.boost(-InitialMomentum.boostVector());
158 G4double ScaleFactor = 0.0;
159 G4double SavedScaleFactor = 0.0;
160 do {
161 G4double FragmentsEnergy = 0.0;
162 G4FragmentVector::iterator j;
163 for (j = theResult->begin(); j != theResult->end(); j++)
164 FragmentsEnergy += (*j)->GetMomentum().e();
165 SavedScaleFactor = ScaleFactor;
166 ScaleFactor = InitialMomentum.e()/FragmentsEnergy;
167 G4ThreeVector ScaledMomentum(0.0,0.0,0.0);
168 for (j = theResult->begin(); j != theResult->end(); j++) {
169 ScaledMomentum = ScaleFactor * (*j)->GetMomentum().vect();
170 G4double Mass = (*j)->GetMomentum().m();
171 G4LorentzVector NewMomentum;
172 NewMomentum.setVect(ScaledMomentum);
173 NewMomentum.setE(std::sqrt(ScaledMomentum.mag2()+Mass*Mass));
174 (*j)->SetMomentum(NewMomentum);
175 }
176 } while (ScaleFactor > 1.0+1.e-5 && std::abs(ScaleFactor-SavedScaleFactor)/ScaleFactor > 1.e-10);
177 // ~~~~~~ End of patch !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
178
179 // Perform Lorentz boost
180 G4FragmentVector::iterator i;
181 for (i = theResult->begin(); i != theResult->end(); i++) {
182 G4LorentzVector FourMom = (*i)->GetMomentum();
183 FourMom.boost(theFragment.GetMomentum().boostVector());
184 (*i)->SetMomentum(FourMom);
185#ifdef PRECOMPOUND_TEST
186 (*i)->SetCreatorModel(G4String("G4StatMF"));
187#endif
188 }
189
190 // garbage collection
191 delete theMicrocanonicalEnsemble;
192 if (theMacrocanonicalEnsemble != 0) delete theMacrocanonicalEnsemble;
193 delete theChannel;
194
195 return theResult;
196}
const double &G4Chips::Temperature Temperature
Definition: G4Chips.hh:48
std::vector< G4Fragment * > G4FragmentVector
Definition: G4Fragment.hh:65
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
HepLorentzVector & boost(double, double, double)
void setVect(const Hep3Vector &)
G4bool CheckFragments(void)
size_t GetMultiplicity(void)
G4StatMFChannel * ChooseAandZ(const G4Fragment &theFragment)
G4StatMFChannel * ChooseAandZ(const G4Fragment &theFragment)
static G4double GetMaxAverageMultiplicity(const G4int A)
G4double GetMeanTemperature(void) const
G4double GetMeanMultiplicity(void) const

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