45{
46
47
48 if (theFragment.GetExcitationEnergy() <= 0.0) {
49
50
51 return 0;
52 }
53
54
55
56
59
60
61
64
65
66
67
68
69
71
73 G4int IterationsLimit = 100000;
75
78
80 do {
81 do {
82
84 if (theMeanMult <= MaxAverageMultiplicity) {
85
86
87 theChannel = theMicrocanonicalEnsemble->
ChooseAandZ(theFragment);
88 _theEnsemble = theMicrocanonicalEnsemble;
89 } else {
90
91
92
93 if (FirstTime) {
94
96 _theEnsemble = theMacrocanonicalEnsemble;
97 FirstTime = false;
98 }
99
100
101
102 theChannel = theMacrocanonicalEnsemble->
ChooseAandZ(theFragment);
103 }
104
106 if (!ChannelOk) delete theChannel;
107
108
109 } while (!ChannelOk);
110
111
114 theResult->push_back(
new G4Fragment(theFragment));
115 delete theMicrocanonicalEnsemble;
116 if (theMacrocanonicalEnsemble != 0) delete theMacrocanonicalEnsemble;
117 delete theChannel;
118 return theResult;
119 }
120
121
122
123
124
125
127
128 if (FindTemperatureOfBreakingChannel(theFragment,theChannel,Temperature)) break;
129
130
131
132
133
134
135
136 delete theChannel;
137
138
139 } while (Iterations++ < IterationsLimit );
140
141
142
143
144 if (Iterations >= IterationsLimit)
145 throw G4HadronicException(__FILE__, __LINE__,
"G4StatMF::BreakItUp: Was not possible to solve for temperature of breaking channel");
146
147
149 GetFragments(theFragment.GetA_asInt(),theFragment.GetZ_asInt(),Temperature);
150
151
152
153
154
156 InitialMomentum.boost(-InitialMomentum.boostVector());
159 do {
161 G4FragmentVector::iterator j;
162 for (j = theResult->begin(); j != theResult->end(); j++)
163 FragmentsEnergy += (*j)->GetMomentum().e();
164 SavedScaleFactor = ScaleFactor;
165 ScaleFactor = InitialMomentum.e()/FragmentsEnergy;
167 for (j = theResult->begin(); j != theResult->end(); j++) {
168 ScaledMomentum = ScaleFactor * (*j)->GetMomentum().vect();
169 G4double Mass = (*j)->GetMomentum().m();
171 NewMomentum.
setVect(ScaledMomentum);
172 NewMomentum.
setE(std::sqrt(ScaledMomentum.mag2()+Mass*Mass));
173 (*j)->SetMomentum(NewMomentum);
174 }
175
176 } while (ScaleFactor > 1.0+1.e-5 && std::abs(ScaleFactor-SavedScaleFactor)/ScaleFactor > 1.e-10);
177
178
179
180 G4FragmentVector::iterator i;
181 for (i = theResult->begin(); i != theResult->end(); i++) {
183 FourMom.
boost(theFragment.GetMomentum().boostVector());
184 (*i)->SetMomentum(FourMom);
185 }
186
187
188 delete theMicrocanonicalEnsemble;
189 if (theMacrocanonicalEnsemble != 0) delete theMacrocanonicalEnsemble;
190 delete theChannel;
191
192 return theResult;
193}
std::vector< G4Fragment * > G4FragmentVector
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)
G4double GetMeanTemperature(void) const
G4double GetMeanMultiplicity(void) const