47 _NumOfNeutralFragments(0),
48 _NumOfChargedFragments(0)
57 if (!_theFragments.empty()) {
58 std::for_each(_theFragments.begin(),_theFragments.end(),
65 std::deque<G4StatMFFragment*>::iterator i;
66 for (i = _theFragments.begin();
67 i != _theFragments.end(); ++i)
70 G4int Z = (*i)->GetZ();
71 if ( (
A > 1 && (Z >
A || Z <= 0)) || (
A==1 && Z >
A) ||
A <= 0 )
return false;
83 _NumOfNeutralFragments++;
86 _NumOfChargedFragments++;
95 std::accumulate(_theFragments.begin(),_theFragments.end(),
100 return running_total + fragment->GetCoulombEnergy();
112 G4double TranslationalEnergy = 1.5*T*_theFragments.size();
114 std::deque<G4StatMFFragment*>::const_iterator i;
115 for (i = _theFragments.begin(); i != _theFragments.end(); ++i)
117 Energy += (*i)->GetEnergy(T);
119 return Energy + TranslationalEnergy;
127 CoulombImpulse(anA,anZ,T);
130 FragmentsMomenta(_NumOfNeutralFragments, _NumOfChargedFragments, T);
133 std::deque<G4StatMFFragment*>::iterator i;
134 for (i = _theFragments.begin(); i != _theFragments.end(); ++i)
135 theResult->push_back((*i)->GetFragment(T));
150 FragmentsMomenta(_NumOfChargedFragments, 0, T);
154 SolveEqOfMotion(anA,anZ,T);
159void G4StatMFChannel::PlaceFragments(
G4int anA)
170 TooMuchIterations =
false;
173 G4double R = (Rsys - R0*g4calc->
Z13(_theFragments[0]->GetA()))*
179 G4bool ThereAreOverlaps =
false;
180 std::deque<G4StatMFFragment*>::iterator i;
181 for (i = _theFragments.begin()+1; i != _theFragments.end(); ++i)
190 std::deque<G4StatMFFragment*>::iterator j;
191 for (j = _theFragments.begin(); j != i; ++j)
194 (*i)->GetPosition() - (*j)->GetPosition();
196 g4calc->
Z13((*j)->GetA()));
197 if ( (ThereAreOverlaps = (FragToFragVector.
mag2() < Rmin*Rmin)))
202 }
while (ThereAreOverlaps && counter < 1000);
206 TooMuchIterations =
true;
211 }
while (TooMuchIterations);
215void G4StatMFChannel::FragmentsMomenta(
G4int NF,
G4int idx,
230 p = std::sqrt(2.0*_theFragments[idx]->GetNuclearMass()*KinE)
232 _theFragments[idx]->SetMomentum(p);
237 G4double M1 = _theFragments[idx]->GetNuclearMass();
238 G4double M2 = _theFragments[idx+1]->GetNuclearMass();
240 _theFragments[idx]->SetMomentum(p);
241 _theFragments[idx+1]->SetMomentum(-p);
256 SummedP.setX(0.0);SummedP.setY(0.0);SummedP.setZ(0.0);
257 for (
G4int i = idx; i < idx+NF-2; ++i)
269 p = std::sqrt(2.0*E*_theFragments[i]->GetNuclearMass())
271 _theFragments[i]->SetMomentum(p);
280 AvailableE = KinE - SummedE;
284 while (AvailableE <= p.mag2()/(2.0*(_theFragments[i1]->GetNuclearMass()+
285 _theFragments[i2]->GetNuclearMass())));
286 G4double H = 1.0 + _theFragments[i2]->GetNuclearMass()
287 /_theFragments[i1]->GetNuclearMass();
288 G4double CTM12 = H*(1.0 - 2.0*_theFragments[i2]->GetNuclearMass()
289 *AvailableE/p.mag2());
293 if (CTM12 > 1.) {CosTheta1 = 1.;}
302 while (CosTheta1*CosTheta1 < CTM12);
305 while (CTM12 >= 0.0 && CosTheta1 < 0.0);
308 if (CTM12 < 0.0) Sign = 1.0;
312 G4double P1 = (p.mag()*CosTheta1+Sign*std::sqrt(p.mag2()
313 *(CosTheta1*CosTheta1-CTM12)))/H;
314 G4double P2 = std::sqrt(P1*P1+p.mag2() - 2.0*P1*p.mag()*CosTheta1);
316 G4double SinTheta1 = std::sqrt(1.0 - CosTheta1*CosTheta1);
321 G4double CosTheta2 = (p.mag2() + P2*P2 - P1*P1)/(2.0*p.mag()*P2);
323 if (CosTheta2 > -1.0 && CosTheta2 < 1.0) {
324 SinTheta2 = std::sqrt(1.0 - CosTheta2*CosTheta2);
326 G4ThreeVector p1(P1*SinTheta1*CosPhi1,P1*SinTheta1*SinPhi1,P1*CosTheta1);
327 G4ThreeVector p2(P2*SinTheta2*CosPhi2,P2*SinTheta2*SinPhi2,P2*CosTheta2);
330 p1 = RotateMomentum(p,b,p1);
331 p2 = RotateMomentum(p,b,p2);
334 SummedE += p1.mag2()/(2.0*_theFragments[i1]->GetNuclearMass()) +
335 p2.mag2()/(2.0*_theFragments[i2]->GetNuclearMass());
337 _theFragments[i1]->SetMomentum(p1);
338 _theFragments[i2]->SetMomentum(p2);
349 G4double CoulombEnergy = 0.6*CLHEP::elm_coupling*anZ*anZ*
352 if (CoulombEnergy <= 0.0)
return;
354 G4int Iterations = 0;
358 if (_NumOfChargedFragments > (
G4int)
Pos.size()) {
359 Pos.resize(_NumOfChargedFragments);
360 Vel.resize(_NumOfChargedFragments);
361 Accel.resize(_NumOfChargedFragments);
365 for (i = 0; i < _NumOfChargedFragments; ++i)
367 Vel[i] = (1.0/(_theFragments[i]->GetNuclearMass()))*
368 _theFragments[i]->GetMomentum();
369 Pos[i] = _theFragments[i]->GetPosition();
376 for (i = 0; i < _NumOfChargedFragments; ++i)
379 for (
G4int j = 0; j < _NumOfChargedFragments; ++j)
383 distance =
Pos[i] -
Pos[j];
384 force += (_theFragments[i]->GetZ()*_theFragments[j]->GetZ()/
385 (distance.mag2()*distance.mag()))*distance;
388 Accel[i] = CLHEP::elm_coupling*CLHEP::fermi*force/_theFragments[i]->GetNuclearMass();
391 TimeN = TimeS + DeltaTime;
393 for ( i = 0; i < _NumOfChargedFragments; ++i)
396 Vel[i] += Accel[i]*(TimeN-TimeS);
397 Pos[i] += (SavedVel+Vel[i])*(TimeN-TimeS)*0.5;
402 }
while (Iterations++ < 100);
406 for (i = 0; i < _NumOfChargedFragments; ++i)
408 TotalKineticEnergy += _theFragments[i]->GetNuclearMass()*
413 G4double Eta = std::pow(( CoulombEnergy + KineticEnergy ) / TotalKineticEnergy, 2);
416 for (i = 0; i < _NumOfChargedFragments; ++i)
418 _theFragments[i]->SetMomentum((_theFragments[i]->GetNuclearMass()*Eta)*Vel[i]);
431 G4double Alpha2 = std::sqrt(V.mag2() - Alpha1*Alpha1);
436 ( (V.x() - Alpha1*U.
x())/Alpha2 ) * P.
x() +
N.x() * P.
y() + U.
x() * P.
z(),
437 ( (V.y() - Alpha1*U.
y())/Alpha2 ) * P.
x() +
N.y() * P.
y() + U.
y() * P.
z(),
438 ( (V.z() - Alpha1*U.
z())/Alpha2 ) * P.
x() +
N.z() * P.
y() + U.
z() * P.
z()
440 return RotatedMomentum;
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
std::vector< G4Fragment * > G4FragmentVector
G4ThreeVector G4RandomDirection()
Hep3Vector cross(const Hep3Vector &) const
static G4Pow * GetInstance()
G4double A13(G4double A) const
G4double Z13(G4int Z) const
G4double GetFragmentsCoulombEnergy(void)
G4bool CheckFragments(void)
G4double GetFragmentsEnergy(G4double T) const
void CreateFragment(G4int A, G4int Z)
G4FragmentVector * GetFragments(G4int anA, G4int anZ, G4double T)
static G4double GetKappaCoulomb()