66 c0sw = std::sqrt( c0w );
67 clw = 2.0 / std::sqrt ( 4.0 * pi * wl );
70 c0g = - c0 / ( 2.0 * wl );
71 c3g = - c3 / ( 4.0 * wl ) * gamm;
72 csg = - cs / ( 2.0 * wl );
109 for (
int i = 0 ; i < n ; i++ )
159 for (
G4int i = 0 ; i < j ; i++ )
169 G4double gammaij = ( p4i + p4j ).gamma();
178 rbrb = irelcr * rbrb;
179 G4double gamma2_ij = gammaij*gammaij;
182 rr2[i][j] = rij2 + gamma2_ij * rbrb*rbrb;
183 rr2[j][i] = rr2[i][j];
185 rbij[i][j] = gamma2_ij * rbrb;
186 rbij[j][i] = - rbij[i][j];
189 + irelcr * ( - std::pow ( p4i.
e() - p4j.e() , 2 )
190 + gamma2_ij * std::pow ( ( ( p4i.
m2() - p4j.m2() ) / eij ) , 2 ) );
193 pp2[j][i] = pp2[i][j];
202 rh1 = std::exp( expa1 );
213 rha[i][j] = ibry*jbry*rh1;
214 rha[j][i] = rha[i][j];
226 if ( rrs*c0sw < 5.8 )
234 rhe[i][j] = icharge*jcharge * erfij;
236 rhe[j][i] = rhe[i][j];
238 rhc[i][j] = icharge*jcharge * ( - erfij + clw * rh1 ) / rrs2;
240 rhc[j][i] = rhc[i][j];
259 if ( j == i )
continue;
268 G4double gammaij = ( p4i + p4j ).gamma();
277 rbrb = irelcr * rbrb;
278 G4double gamma2_ij = gammaij*gammaij;
306 rr2[i][j] = rij2 + gamma2_ij * rbrb*rbrb;
307 rr2[j][i] = rr2[i][j];
309 rbij[i][j] = gamma2_ij * rbrb;
310 rbij[j][i] = - rbij[i][j];
313 + irelcr * ( - std::pow ( p4i.
e() - p4j.
e() , 2 )
314 + gamma2_ij * std::pow ( ( ( p4i.
m2() - p4j.
m2() ) / eij ) , 2 ) );
316 pp2[j][i] = pp2[i][j];
325 rh1 = std::exp( expa1 );
336 rha[i][j] = ibry*jbry*rh1;
337 rha[j][i] = rha[i][j];
349 if ( rrs*c0sw < 5.8 )
357 rhe[i][j] = icharge*jcharge * erfij;
359 rhe[j][i] = rhe[i][j];
363 rhc[i][j] = icharge*jcharge * ( - erfij + clw * rh1 ) / rrs2;
365 rhc[j][i] = rhc[i][j];
387 rh3d[i] = std::pow ( rho3 , pag );
401 G4double p_zero = std::sqrt( p4i.
e()*p4i.
e() + 2*p4i.
m()*Vi);
429 + c3g * rha[j][i] * ( rh3d[j] + rh3d[i] )
430 + csg * rha[j][i] * jnuc * inuc
431 * ( 1. - 2. * std::abs( jcharge - icharge ) )
457 ffr[i] = ffr[i] + 2*ccrr* ( rij + grbb*cij );
459 ffp[i] = ffp[i] - 2*ccpp* ( rij + grbb*betaij );
484 for (
G4int j = 0 ; j < n ; j ++ )
491 rhos += rha[j][i] * jnuc * inuc
492 * ( 1 - 2 * std::abs ( jcharge - icharge ) );
495 rho3 = std::pow ( rhoa , gamm );
512 std::vector < G4double > rhoa ( n , 0.0 );
513 std::vector < G4double > rho3 ( n , 0.0 );
514 std::vector < G4double > rhos ( n , 0.0 );
515 std::vector < G4double > rhoc ( n , 0.0 );
518 for (
G4int i = 0 ; i < n ; i ++ )
523 for (
G4int j = 0 ; j < n ; j ++ )
528 rhoa[i] += rha[j][i];
529 rhoc[i] += rhe[j][i];
530 rhos[i] += rha[j][i] * jnuc * inuc
531 * ( 1 - 2 * std::abs ( jcharge - icharge ) );
534 rho3[i] = std::pow ( rhoa[i] , gamm );
537 G4double potential = c0 * std::accumulate( rhoa.begin() , rhoa.end() , 0.0 )
538 + c3 * std::accumulate( rho3.begin() , rho3.end() , 0.0 )
539 + cs * std::accumulate( rhos.begin() , rhos.end() , 0.0 )
540 + cl * std::accumulate( rhoc.begin() , rhoc.end() , 0.0 );
561 if ( jcharge == icharge && jnuc == 1 )
574 expa = expa - pp2[i][j]*cph;
584 pf = pf + std::exp ( expa );
592 pf = ( pf - 1.0 ) * cpc;
608 G4double pf = calPauliBlockingFactor( i );
610 if ( pf > rand ) result =
true;
635 std::vector< G4ThreeVector > f0r, f0p;
639 for (
G4int i = 0 ; i < n ; i++ )
660 for (
G4int i = 0 ; i < n ; i++ )
665 ri += dt1* f0r[i] + dt2* ffr[i];
666 p3i += dt1* f0p[i] + dt2* ffp[i];
687 G4double cpf2 = std::pow ( 1.5 * pi*pi * std::pow ( 4.0 * pi * wl , -1.5 )
694 std::vector < G4double > rhoa;
697 for (
G4int i = 0 ; i < n ; i++ )
703 for (
G4int j = 0 ; j < n ; j++ )
706 rhoa[i] += rha[i][j];
710 rhoa[i] = std::pow ( rhoa[i] + 1 , 1.0/3.0 );
716 std::map < G4int , std::vector < G4int > > cluster_map;
717 std::vector < G4bool > is_already_belong_some_cluster;
720 std::multimap < G4int , G4int > comb_map;
721 std::multimap < G4int , G4int > assign_map;
724 std::vector < G4int > mascl;
725 std::vector < G4int > num;
728 is_already_belong_some_cluster.resize ( n );
730 std::vector < G4int > is_assigned_to ( n , -1 );
731 std::multimap < G4int , G4int > clusters;
733 for (
G4int i = 0 ; i < n ; i++ )
738 is_already_belong_some_cluster[i] =
false;
747 G4int cluster_id = -1;
748 for (
G4int i = 0 ; i < n-1 ; i++ )
751 G4bool hasThisCompany =
false;
762 for (
G4int j = j1 ; j < n ; j++ )
765 std::vector < G4int > cluster_participants;
773 * ( rhoa[ i ] + rhoa[ j ] )
774 * ( rhoa[ i ] + rhoa[ j ] );
777 if ( rdist2 < rcc2 && pdist2 < pcc2 )
787 if ( is_assigned_to [ j ] == -1 )
789 if ( is_assigned_to [ i ] == -1 )
791 if ( clusters.size() != 0 )
793 id = clusters.rbegin()->first + 1;
800 clusters.insert ( std::multimap<G4int,G4int>::value_type (
id , i ) );
801 is_assigned_to [ i ] = id;
802 clusters.insert ( std::multimap<G4int,G4int>::value_type (
id , j ) );
803 is_assigned_to [ j ] = id;
807 clusters.insert ( std::multimap<G4int,G4int>::value_type ( is_assigned_to [ i ] , j ) );
808 is_assigned_to [ j ] = is_assigned_to [ i ];
814 if ( is_assigned_to [ i ] == -1 )
816 clusters.insert ( std::multimap<G4int,G4int>::value_type ( is_assigned_to [ j ] , i ) );
817 is_assigned_to [ i ] = is_assigned_to [ j ];
822 if ( is_assigned_to [ i ] != is_assigned_to [ j ] )
827 std::multimap< G4int , G4int > clusters_tmp;
828 G4int target_cluster_id;
829 if ( is_assigned_to [ i ] > is_assigned_to [ j ] )
830 target_cluster_id = is_assigned_to [ i ];
832 target_cluster_id = is_assigned_to [ j ];
834 for ( std::multimap< G4int , G4int >::iterator it
835 = clusters.begin() ; it != clusters.end() ; it++ )
839 if ( it->first == target_cluster_id )
842 is_assigned_to [ it->second ] = is_assigned_to [ j ];
843 clusters_tmp.insert ( std::multimap<G4int,G4int>::value_type ( is_assigned_to [ j ] , it->second ) );
847 clusters_tmp.insert ( std::multimap<G4int,G4int>::value_type ( it->first , it->second ) );
851 clusters = clusters_tmp;
860 comb_map.insert( std::multimap<G4int,G4int>::value_type ( i , j ) );
861 cluster_participants.push_back ( j );
865 if ( assign_map.find( cluster_id ) == assign_map.end() )
867 is_already_belong_some_cluster[i] =
true;
868 assign_map.insert ( std::multimap<G4int,G4int>::value_type ( cluster_id , i ) );
869 hasThisCompany =
true;
871 assign_map.insert ( std::multimap<G4int,G4int>::value_type ( cluster_id , j ) );
872 is_already_belong_some_cluster[j] =
true;
883 if ( cluster_participants.size() > 0 )
886 cluster_map.insert ( std::pair <
G4int , std::vector < G4int > > ( i , cluster_participants ) );
891 if ( hasThisCompany ==
true ) cluster_id++;
899 std::multimap< G4int , G4int > sorted_cluster_map;
900 for (
G4int i = 0 ; i <= id ; i++ )
904 sorted_cluster_map.insert ( std::multimap<G4int,G4int>::value_type ( (
G4int) clusters.count( i ) , i ) );
910 std::vector < G4QMDNucleus* > result;
911 for ( std::multimap < G4int , G4int >::reverse_iterator it
912 = sorted_cluster_map.rbegin() ; it != sorted_cluster_map.rend() ; it ++)
917 if ( it->first != 0 )
920 for ( std::multimap < G4int , G4int >::iterator itt
921 = clusters.begin() ; itt != clusters.end() ; itt ++)
924 if ( it->second == itt->first )
931 result.push_back( nucleus );
938 for ( std::vector < G4QMDNucleus* > ::iterator it
939 = result.begin() ; it != result.end() ; it++ )
CLHEP::Hep3Vector G4ThreeVector
static double erf(double x)
G4double GetTotalPotential()
void SetNucleus(G4QMDNucleus *aSystem)
void DoPropagation(G4double)
void Cal2BodyQuantities()
G4double GetPotential(G4int)
std::vector< G4QMDNucleus * > DoClusterJudgment()
void SetSystem(G4QMDSystem *aSystem)
G4bool IsPauliBlocked(G4int)
void SetTotalPotential(G4double x)
void CalEnergyAndAngularMomentumInCM()
static G4QMDParameters * GetInstance()
G4ThreeVector GetPosition()
void SetPosition(G4ThreeVector r)
G4LorentzVector Get4Momentum()
G4int GetChargeInUnitOfEplus()
G4ThreeVector GetMomentum()
void SetMomentum(G4ThreeVector p)
G4QMDParticipant * GetParticipant(G4int i)
void SubtractSystem(G4QMDSystem *)
G4int GetTotalNumberOfParticipant()
void SetParticipant(G4QMDParticipant *particle)