67 c0sw = std::sqrt( c0w );
68 clw = 2.0 / std::sqrt ( 4.0 *
pi * wl );
71 c0g = - c0 / ( 2.0 * wl );
72 c3g = - c3 / ( 4.0 * wl ) * gamm;
73 csg = - cs / ( 2.0 * wl );
111 for (
int i = 0 ; i <
n ; i++ )
161 for (
G4int i = 0 ; i < j ; i++ )
171 G4double gammaij = ( p4i + p4j ).gamma();
180 rbrb = irelcr * rbrb;
181 G4double gamma2_ij = gammaij*gammaij;
184 rr2[i][j] = rij2 + gamma2_ij * rbrb*rbrb;
185 rr2[j][i] = rr2[i][j];
187 rbij[i][j] = gamma2_ij * rbrb;
188 rbij[j][i] = - rbij[i][j];
191 + irelcr * ( - std::pow ( p4i.
e() - p4j.e() , 2 )
192 + gamma2_ij * std::pow ( ( ( p4i.
m2() - p4j.m2() ) / eij ) , 2 ) );
195 pp2[j][i] = pp2[i][j];
204 rh1 = std::exp( expa1 );
215 rha[i][j] = ibry*jbry*rh1;
216 rha[j][i] = rha[i][j];
228 if ( rrs*c0sw < 5.8 ) {
236 xerf = erf ( rrs*c0sw );
245 rhe[i][j] = icharge*jcharge * erfij;
247 rhe[j][i] = rhe[i][j];
249 rhc[i][j] = icharge*jcharge * ( - erfij + clw * rh1 ) / rrs2;
251 rhc[j][i] = rhc[i][j];
270 if ( j == i )
continue;
279 G4double gammaij = ( p4i + p4j ).gamma();
288 rbrb = irelcr * rbrb;
289 G4double gamma2_ij = gammaij*gammaij;
317 rr2[i][j] = rij2 + gamma2_ij * rbrb*rbrb;
318 rr2[j][i] = rr2[i][j];
320 rbij[i][j] = gamma2_ij * rbrb;
321 rbij[j][i] = - rbij[i][j];
324 + irelcr * ( - std::pow ( p4i.
e() - p4j.e() , 2 )
325 + gamma2_ij * std::pow ( ( ( p4i.
m2() - p4j.m2() ) / eij ) , 2 ) );
327 pp2[j][i] = pp2[i][j];
336 rh1 = std::exp( expa1 );
347 rha[i][j] = ibry*jbry*rh1;
348 rha[j][i] = rha[i][j];
360 if ( rrs*c0sw < 5.8 ) {
366 xerf = erf ( rrs*c0sw );
375 rhe[i][j] = icharge*jcharge * erfij;
377 rhe[j][i] = rhe[i][j];
381 rhc[i][j] = icharge*jcharge * ( - erfij + clw * rh1 ) / rrs2;
383 rhc[j][i] = rhc[i][j];
405 rh3d[i] = std::pow ( rho3 , pag );
419 G4double p_zero = std::sqrt( p4i.
e()*p4i.
e() + 2*p4i.
m()*Vi);
447 + c3g * rha[j][i] * ( rh3d[j] + rh3d[i] )
448 + csg * rha[j][i] * jnuc * inuc
449 * ( 1. - 2. * std::abs( jcharge - icharge ) )
475 ffr[i] = ffr[i] + 2*ccrr* ( rij + grbb*cij );
477 ffp[i] = ffp[i] - 2*ccpp* ( rij + grbb*betaij );
502 for (
G4int j = 0 ; j <
n ; j ++ )
509 rhos += rha[j][i] * jnuc * inuc
510 * ( 1 - 2 * std::abs ( jcharge - icharge ) );
513 rho3 = std::pow ( rhoa , gamm );
530 std::vector < G4double > rhoa ( n , 0.0 );
531 std::vector < G4double > rho3 ( n , 0.0 );
532 std::vector < G4double > rhos ( n , 0.0 );
533 std::vector < G4double > rhoc ( n , 0.0 );
536 for (
G4int i = 0 ; i <
n ; i ++ )
541 for (
G4int j = 0 ; j <
n ; j ++ )
546 rhoa[i] += rha[j][i];
547 rhoc[i] += rhe[j][i];
548 rhos[i] += rha[j][i] * jnuc * inuc
549 * ( 1 - 2 * std::abs ( jcharge - icharge ) );
552 rho3[i] = std::pow ( rhoa[i] , gamm );
555 G4double potential = c0 * std::accumulate( rhoa.begin() , rhoa.end() , 0.0 )
556 + c3 * std::accumulate( rho3.begin() , rho3.end() , 0.0 )
557 + cs * std::accumulate( rhos.begin() , rhos.end() , 0.0 )
558 + cl * std::accumulate( rhoc.begin() , rhoc.end() , 0.0 );
579 if ( jcharge == icharge && jnuc == 1 )
592 expa = expa - pp2[i][j]*cph;
602 pf = pf + std::exp ( expa );
610 pf = ( pf - 1.0 ) * cpc;
626 G4double pf = calPauliBlockingFactor( i );
628 if ( pf > rand ) result =
true;
653 std::vector< G4ThreeVector > f0r, f0p;
657 for (
G4int i = 0 ; i <
n ; i++ )
678 for (
G4int i = 0 ; i <
n ; i++ )
683 ri += dt1* f0r[i] + dt2* ffr[i];
684 p3i += dt1* f0p[i] + dt2* ffp[i];
705 G4double cpf2 = std::pow ( 1.5 *
pi*
pi * std::pow ( 4.0 *
pi * wl , -1.5 )
712 std::vector < G4double > rhoa;
715 for (
G4int i = 0 ; i <
n ; i++ )
721 for (
G4int j = 0 ; j <
n ; j++ )
724 rhoa[i] += rha[i][j];
728 rhoa[i] = std::pow ( rhoa[i] + 1 , 1.0/3.0 );
734 std::map < G4int , std::vector < G4int > > cluster_map;
735 std::vector < G4bool > is_already_belong_some_cluster;
738 std::multimap < G4int , G4int > comb_map;
739 std::multimap < G4int , G4int > assign_map;
742 std::vector < G4int > mascl;
743 std::vector < G4int > num;
746 is_already_belong_some_cluster.resize ( n );
748 std::vector < G4int > is_assigned_to ( n , -1 );
749 std::multimap < G4int , G4int > clusters;
751 for (
G4int i = 0 ; i <
n ; i++ )
756 is_already_belong_some_cluster[i] =
false;
765 G4int cluster_id = -1;
766 for (
G4int i = 0 ; i < n-1 ; i++ )
769 G4bool hasThisCompany =
false;
780 for (
G4int j = j1 ; j <
n ; j++ )
783 std::vector < G4int > cluster_participants;
791 * ( rhoa[ i ] + rhoa[ j ] )
792 * ( rhoa[ i ] + rhoa[ j ] );
795 if ( rdist2 < rcc2 && pdist2 < pcc2 )
805 if ( is_assigned_to [ j ] == -1 )
807 if ( is_assigned_to [ i ] == -1 )
809 if ( clusters.size() != 0 )
811 id = clusters.rbegin()->first + 1;
818 clusters.insert ( std::multimap<G4int,G4int>::value_type (
id , i ) );
819 is_assigned_to [ i ] = id;
820 clusters.insert ( std::multimap<G4int,G4int>::value_type (
id , j ) );
821 is_assigned_to [ j ] = id;
825 clusters.insert ( std::multimap<G4int,G4int>::value_type ( is_assigned_to [ i ] , j ) );
826 is_assigned_to [ j ] = is_assigned_to [ i ];
832 if ( is_assigned_to [ i ] == -1 )
834 clusters.insert ( std::multimap<G4int,G4int>::value_type ( is_assigned_to [ j ] , i ) );
835 is_assigned_to [ i ] = is_assigned_to [ j ];
840 if ( is_assigned_to [ i ] != is_assigned_to [ j ] )
845 std::multimap< G4int , G4int > clusters_tmp;
846 G4int target_cluster_id;
847 if ( is_assigned_to [ i ] > is_assigned_to [ j ] )
848 target_cluster_id = is_assigned_to [ i ];
850 target_cluster_id = is_assigned_to [ j ];
852 for ( std::multimap< G4int , G4int >::iterator it
853 = clusters.begin() ; it != clusters.end() ; it++ )
857 if ( it->first == target_cluster_id )
860 is_assigned_to [ it->second ] = is_assigned_to [ j ];
861 clusters_tmp.insert ( std::multimap<G4int,G4int>::value_type ( is_assigned_to [ j ] , it->second ) );
865 clusters_tmp.insert ( std::multimap<G4int,G4int>::value_type ( it->first , it->second ) );
869 clusters = clusters_tmp;
878 comb_map.insert( std::multimap<G4int,G4int>::value_type ( i , j ) );
879 cluster_participants.push_back ( j );
883 if ( assign_map.find( cluster_id ) == assign_map.end() )
885 is_already_belong_some_cluster[i] =
true;
886 assign_map.insert ( std::multimap<G4int,G4int>::value_type ( cluster_id , i ) );
887 hasThisCompany =
true;
889 assign_map.insert ( std::multimap<G4int,G4int>::value_type ( cluster_id , j ) );
890 is_already_belong_some_cluster[j] =
true;
901 if ( cluster_participants.size() > 0 )
904 cluster_map.insert ( std::pair <
G4int , std::vector < G4int > > ( i , cluster_participants ) );
909 if ( hasThisCompany ==
true ) cluster_id++;
917 std::multimap< G4int , G4int > sorted_cluster_map;
918 for (
G4int i = 0 ; i <= id ; i++ )
922 sorted_cluster_map.insert ( std::multimap<G4int,G4int>::value_type ( (
G4int) clusters.count( i ) , i ) );
928 std::vector < G4QMDNucleus* >
result;
929 for ( std::multimap < G4int , G4int >::reverse_iterator it
930 = sorted_cluster_map.rbegin() ; it != sorted_cluster_map.rend() ; it ++)
935 if ( it->first != 0 )
938 for ( std::multimap < G4int , G4int >::iterator itt
939 = clusters.begin() ; itt != clusters.end() ; itt ++)
942 if ( it->second == itt->first )
949 result.push_back( nucleus );
956 for ( std::vector < G4QMDNucleus* > ::iterator it
957 = result.begin() ; it != result.end() ; it++ )
G4ThreeVector GetPosition()
void SetParticipant(G4QMDParticipant *particle)
CLHEP::Hep3Vector G4ThreeVector
void SetPosition(G4ThreeVector r)
void SubtractSystem(G4QMDSystem *)
G4int GetChargeInUnitOfEplus()
G4double G4NeutronHPJENDLHEData::G4double result
void SetNucleus(G4QMDNucleus *aSystem)
void Cal2BodyQuantities()
G4bool IsPauliBlocked(G4int)
G4ThreeVector GetMomentum()
static G4QMDParameters * GetInstance()
G4double GetPotential(G4int)
G4int GetTotalNumberOfParticipant()
void SetMomentum(G4ThreeVector p)
G4double GetTotalPotential()
std::vector< G4QMDNucleus * > DoClusterJudgment()
G4QMDParticipant * GetParticipant(G4int i)
G4LorentzVector Get4Momentum()
void DoPropagation(G4double)
void SetSystem(G4QMDSystem *aSystem)
void SetTotalPotential(G4double x)
static double erf(double x)
void CalEnergyAndAngularMomentumInCM()