Geant4-11
Public Member Functions | Private Member Functions | Private Attributes
G4StatMF Class Reference

#include <G4StatMF.hh>

Inheritance diagram for G4StatMF:
G4VMultiFragmentation

Public Member Functions

G4FragmentVectorBreakItUp (const G4Fragment &theNucleus)
 
 G4StatMF ()
 
 ~G4StatMF ()
 

Private Member Functions

G4double CalcEnergy (G4int A, G4int Z, const G4StatMFChannel *aChannel, G4double T)
 
G4bool FindTemperatureOfBreakingChannel (const G4Fragment &theFragment, const G4StatMFChannel *aChannel, G4double &Temperature)
 
 G4StatMF (const G4StatMF &right)
 
G4bool operator!= (const G4StatMF &right)
 
G4StatMFoperator= (const G4StatMF &right)
 
G4bool operator== (const G4StatMF &right)
 

Private Attributes

G4int _secID
 
G4VStatMFEnsemble_theEnsemble
 

Detailed Description

Definition at line 46 of file G4StatMF.hh.

Constructor & Destructor Documentation

◆ G4StatMF() [1/2]

G4StatMF::G4StatMF ( )

Definition at line 38 of file G4StatMF.cc.

38 : _theEnsemble(0), _secID(-1) {
39 _secID = G4PhysicsModelCatalog::GetModelID("model_G4StatMF");
40}
static G4int GetModelID(const G4int modelIndex)
G4int _secID
Definition: G4StatMF.hh:84
G4VStatMFEnsemble * _theEnsemble
Definition: G4StatMF.hh:82

References _secID, and G4PhysicsModelCatalog::GetModelID().

◆ ~G4StatMF()

G4StatMF::~G4StatMF ( )

Definition at line 44 of file G4StatMF.cc.

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

◆ G4StatMF() [2/2]

G4StatMF::G4StatMF ( const G4StatMF right)
private

Member Function Documentation

◆ BreakItUp()

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

Implements G4VMultiFragmentation.

Definition at line 47 of file G4StatMF.cc.

48{
49 // G4FragmentVector * theResult = new G4FragmentVector;
50
51 if (theFragment.GetExcitationEnergy() <= 0.0) {
52 //G4FragmentVector * theResult = new G4FragmentVector;
53 //theResult->push_back(new G4Fragment(theFragment));
54 return 0;
55 }
56
57
58 // Maximun average multiplicity: M_0 = 2.6 for A ~ 200
59 // and M_0 = 3.3 for A <= 110
60 G4double MaxAverageMultiplicity =
61 G4StatMFParameters::GetMaxAverageMultiplicity(theFragment.GetA_asInt());
62
63
64 // We'll use two kinds of ensembles
65 G4StatMFMicroCanonical * theMicrocanonicalEnsemble = 0;
66 G4StatMFMacroCanonical * theMacrocanonicalEnsemble = 0;
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;
77 G4double Temperature = 0.0;
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 // Loop checking, 05-Aug-2015, Vladimir Ivanchenko
112 } while (!ChannelOk);
113
114
115 if (theChannel->GetMultiplicity() <= 1) {
116 G4FragmentVector * theResult = new G4FragmentVector;
117 theResult->push_back(new G4Fragment(theFragment));
118 delete theMicrocanonicalEnsemble;
119 if (theMacrocanonicalEnsemble != 0) delete theMacrocanonicalEnsemble;
120 delete theChannel;
121 return theResult;
122 }
123
124 //--------------------------------------
125 // Second part of simulation procedure.
126 //--------------------------------------
127
128 // Find temperature of breaking channel.
129 Temperature = _theEnsemble->GetMeanTemperature(); // Initial guess for Temperature
130
131 if (FindTemperatureOfBreakingChannel(theFragment,theChannel,Temperature)) break;
132
133 // Do not forget to delete this unusable channel, for which we failed to find the temperature,
134 // otherwise for very proton-reach nuclei it would lead to memory leak due to large
135 // number of iterations. N.B. "theChannel" is created in G4StatMFMacroCanonical::ChooseZ()
136
137 // G4cout << " Iteration # " << Iterations << " Mean Temperature = " << Temperature << G4endl;
138
139 delete theChannel;
140
141 // Loop checking, 05-Aug-2015, Vladimir Ivanchenko
142 } while (Iterations++ < IterationsLimit );
143
144
145
146 // If Iterations >= IterationsLimit means that we couldn't solve for temperature
147 if (Iterations >= IterationsLimit)
148 throw G4HadronicException(__FILE__, __LINE__, "G4StatMF::BreakItUp: Was not possible to solve for temperature of breaking channel");
149
150
151 G4FragmentVector * theResult = theChannel->
152 GetFragments(theFragment.GetA_asInt(),theFragment.GetZ_asInt(),Temperature);
153
154
155
156 // ~~~~~~ Energy conservation Patch !!!!!!!!!!!!!!!!!!!!!!
157 // Original nucleus 4-momentum in CM system
158 G4LorentzVector InitialMomentum(theFragment.GetMomentum());
159 InitialMomentum.boost(-InitialMomentum.boostVector());
160 G4double ScaleFactor = 0.0;
161 G4double SavedScaleFactor = 0.0;
162 do {
163 G4double FragmentsEnergy = 0.0;
164 G4FragmentVector::iterator j;
165 for (j = theResult->begin(); j != theResult->end(); j++)
166 FragmentsEnergy += (*j)->GetMomentum().e();
167 SavedScaleFactor = ScaleFactor;
168 ScaleFactor = InitialMomentum.e()/FragmentsEnergy;
169 G4ThreeVector ScaledMomentum(0.0,0.0,0.0);
170 for (j = theResult->begin(); j != theResult->end(); j++) {
171 ScaledMomentum = ScaleFactor * (*j)->GetMomentum().vect();
172 G4double Mass = (*j)->GetMomentum().m();
173 G4LorentzVector NewMomentum;
174 NewMomentum.setVect(ScaledMomentum);
175 NewMomentum.setE(std::sqrt(ScaledMomentum.mag2()+Mass*Mass));
176 (*j)->SetMomentum(NewMomentum);
177 }
178 // Loop checking, 05-Aug-2015, Vladimir Ivanchenko
179 } while (ScaleFactor > 1.0+1.e-5 && std::abs(ScaleFactor-SavedScaleFactor)/ScaleFactor > 1.e-10);
180 // ~~~~~~ End of patch !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
181
182 // Perform Lorentz boost
183 G4FragmentVector::iterator i;
184 for (i = theResult->begin(); i != theResult->end(); i++) {
185 G4LorentzVector FourMom = (*i)->GetMomentum();
186 FourMom.boost(theFragment.GetMomentum().boostVector());
187 (*i)->SetMomentum(FourMom);
188 (*i)->SetCreatorModelID(_secID);
189 }
190
191 // garbage collection
192 delete theMicrocanonicalEnsemble;
193 if (theMacrocanonicalEnsemble != 0) delete theMacrocanonicalEnsemble;
194 delete theChannel;
195
196 return theResult;
197}
std::vector< G4Fragment * > G4FragmentVector
Definition: G4Fragment.hh:64
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
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(G4int A)
G4bool FindTemperatureOfBreakingChannel(const G4Fragment &theFragment, const G4StatMFChannel *aChannel, G4double &Temperature)
Definition: G4StatMF.cc:200
G4double GetMeanTemperature(void) const
G4double GetMeanMultiplicity(void) const

References _secID, _theEnsemble, CLHEP::HepLorentzVector::boost(), CLHEP::HepLorentzVector::boostVector(), G4StatMFChannel::CheckFragments(), G4StatMFMacroCanonical::ChooseAandZ(), G4StatMFMicroCanonical::ChooseAandZ(), CLHEP::HepLorentzVector::e(), FindTemperatureOfBreakingChannel(), G4Fragment::GetA_asInt(), G4Fragment::GetExcitationEnergy(), G4StatMFParameters::GetMaxAverageMultiplicity(), G4VStatMFEnsemble::GetMeanMultiplicity(), G4VStatMFEnsemble::GetMeanTemperature(), G4Fragment::GetMomentum(), G4StatMFChannel::GetMultiplicity(), G4Fragment::GetZ_asInt(), CLHEP::Hep3Vector::mag2(), CLHEP::HepLorentzVector::setE(), and CLHEP::HepLorentzVector::setVect().

◆ CalcEnergy()

G4double G4StatMF::CalcEnergy ( G4int  A,
G4int  Z,
const G4StatMFChannel aChannel,
G4double  T 
)
private

Definition at line 277 of file G4StatMF.cc.

279{
281 G4double ChannelEnergy = aChannel->GetFragmentsEnergy(T);
282 return -MassExcess0 + G4StatMFParameters::GetCoulomb() + ChannelEnergy;
283}
const G4int Z[17]
const G4double A[17]
static G4double GetMassExcess(const G4int A, const G4int Z)
G4double GetFragmentsEnergy(G4double T) const
static G4double GetCoulomb()

References A, G4StatMFParameters::GetCoulomb(), G4StatMFChannel::GetFragmentsEnergy(), G4NucleiProperties::GetMassExcess(), and Z.

Referenced by FindTemperatureOfBreakingChannel().

◆ FindTemperatureOfBreakingChannel()

G4bool G4StatMF::FindTemperatureOfBreakingChannel ( const G4Fragment theFragment,
const G4StatMFChannel aChannel,
G4double Temperature 
)
private

Definition at line 200 of file G4StatMF.cc.

204{
205 G4int A = theFragment.GetA_asInt();
206 G4int Z = theFragment.GetZ_asInt();
207 G4double U = theFragment.GetExcitationEnergy();
208
209 G4double T = std::max(Temperature,0.0012*MeV);
210 G4double Ta = T;
211 G4double TotalEnergy = CalcEnergy(A,Z,aChannel,T);
212
213 G4double Da = (U - TotalEnergy)/U;
214 G4double Db = 0.0;
215
216 // bracketing the solution
217 if (Da == 0.0) {
218 Temperature = T;
219 return true;
220 } else if (Da < 0.0) {
221 do {
222 T *= 0.5;
223 if (T < 0.001*MeV) return false;
224
225 TotalEnergy = CalcEnergy(A,Z,aChannel,T);
226
227 Db = (U - TotalEnergy)/U;
228 // Loop checking, 05-Aug-2015, Vladimir Ivanchenko
229 } while (Db < 0.0);
230
231 } else {
232 do {
233 T *= 1.5;
234
235 TotalEnergy = CalcEnergy(A,Z,aChannel,T);
236
237 Db = (U - TotalEnergy)/U;
238 // Loop checking, 05-Aug-2015, Vladimir Ivanchenko
239 } while (Db > 0.0);
240 }
241
242 G4double eps = 1.0e-14 * std::abs(T-Ta);
243 //G4double eps = 1.0e-3 ;
244
245 // Start the bisection method
246 for (G4int j = 0; j < 1000; j++) {
247 G4double Tc = (Ta+T)*0.5;
248 if (std::abs(Ta-Tc) <= eps) {
249 Temperature = Tc;
250 return true;
251 }
252
253 T = Tc;
254
255 TotalEnergy = CalcEnergy(A,Z,aChannel,T);
256
257 G4double Dc = (U - TotalEnergy)/U;
258
259 if (Dc == 0.0) {
260 Temperature = Tc;
261 return true;
262 }
263
264 if (Da*Dc < 0.0) {
265 T = Tc;
266 Db = Dc;
267 } else {
268 Ta = Tc;
269 Da = Dc;
270 }
271 }
272
273 Temperature = (Ta+T)*0.5;
274 return false;
275}
static const G4double eps
static constexpr double MeV
Definition: G4SIunits.hh:200
G4double GetExcitationEnergy() const
Definition: G4Fragment.hh:299
G4int GetZ_asInt() const
Definition: G4Fragment.hh:276
G4int GetA_asInt() const
Definition: G4Fragment.hh:271
G4double CalcEnergy(G4int A, G4int Z, const G4StatMFChannel *aChannel, G4double T)
Definition: G4StatMF.cc:277
T max(const T t1, const T t2)
brief Return the largest of the two arguments

References A, CalcEnergy(), eps, G4Fragment::GetA_asInt(), G4Fragment::GetExcitationEnergy(), G4Fragment::GetZ_asInt(), G4INCL::Math::max(), MeV, and Z.

Referenced by BreakItUp().

◆ operator!=()

G4bool G4StatMF::operator!= ( const G4StatMF right)
private

◆ operator=()

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

◆ operator==()

G4bool G4StatMF::operator== ( const G4StatMF right)
private

Field Documentation

◆ _secID

G4int G4StatMF::_secID
private

Definition at line 84 of file G4StatMF.hh.

Referenced by BreakItUp(), and G4StatMF().

◆ _theEnsemble

G4VStatMFEnsemble* G4StatMF::_theEnsemble
private

Definition at line 82 of file G4StatMF.hh.

Referenced by BreakItUp().


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