Changeset 962 for trunk/source/processes/hadronic/models/qmd
- Timestamp:
- Apr 6, 2009, 12:30:29 PM (15 years ago)
- Location:
- trunk/source/processes/hadronic/models/qmd
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/models/qmd/History
r819 r962 13 13 * Please list in reverse chronological order (last date on top) 14 14 --------------------------------------------------------------- 15 16 20-November-2008 Tatsumi Koi (hadr-qmd-V09-01-08) 17 - Add Update 18 include/G4QMDMeanField.hh 19 src/G4QMDMeanField.cc 20 - Add "hit" flag and related methods 21 include/G4QMDParticipant.hh 22 - Add Erase and Insert Participant methods 23 include/G4QMDSystem.hh 24 src/G4QMDSystem.cc 25 - Add deltaT in signature of CalKinematicsOfBinaryCollisions 26 Add several required updating of Mean Filed 27 Modify handling of absorption case 28 include/G4QMDCollision.hh 29 src/G4QMDCollision.cc 30 - Add deltaT in signature of CalKinematicsOfBinaryCollisions 31 src/G4QMDReaction.cc 32 33 07-November-2008 Tatsumi Koi (hadr-qmd-V09-01-07) 34 - Add UnUseGEM and UseFRAG 35 Fix bug in neucleon projectile 36 include/G4QMDReaction.hh 37 src/G4QMDReaction.cc 38 - Migrate to particles-V09-01-09 39 src/G4QMDNucleus.cc 40 41 27-Oct-2008 Tatsumi Koi (hadr-qmd-V09-01-06) 42 - Migrate to particles-V09-01-09 by T. Koi 43 Z,A to A,Z for functions of NucleiProperties 44 src/G4QMDGroundStateNucleus.cc 45 src/G4QMDNucleus.cc 46 47 24-Oct-2008 Tatsumi Koi (hadr-qmd-V09-01-05) 48 - Migrate to particles-V09-01-09 by T. Koi 49 src/G4QMDGroundStateNucleus.cc 50 src/G4QMDNucleus.cc 51 52 12-Jun-2008 Tatsumi Koi (hadr-qmd-V09-01-04) 53 - Delete unnecessary dependency and unused functions 54 Change criterion of reaction by T. Koi 55 include/G4QMDReaction.hh 56 src/G4QMDReaction.cc 57 58 06-Jun-2008 Tatsumi Koi (hadr-qmd-V09-01-03) 59 - Fix memory leaks by T. Koi 60 include/G4QMDSystem.hh 61 src/G4QMDReaction.cc 62 63 03-Jun-2008 Tatsumi Koi (hadr-qmd-V09-01-02) 64 - Fix memory leaks by T. Koi 65 src/G4QMDReaction.cc 66 src/G4QMDCollision.cc 67 68 05-May-2008 Tatsumi Koi (hadr-qmd-V09-01-01) 69 - Fixed and changed sampling method of impact parameter 70 src/G4QMDReaction.cc 71 15 72 26-Nov-2007 Tatsumi Koi (hadr-qmd-V09-00-05) 16 73 - Fix of typo which introduced at (hadr-qmd-V09-00-04) -
trunk/source/processes/hadronic/models/qmd/include/G4QMDCollision.hh
r819 r962 34 34 // Creation date: 9 April 2007 35 35 // ----------------------------------------------------------------------------- 36 // 37 // 081120 Add deltaT in signature of CalKinematicsOfBinaryCollisions 36 38 37 39 #ifndef G4QMDCollision_hh … … 49 51 ~G4QMDCollision(); 50 52 51 void CalKinematicsOfBinaryCollisions( );53 void CalKinematicsOfBinaryCollisions( G4double ); 52 54 G4bool CalFinalStateOfTheBinaryCollision( G4int , G4int ); 53 55 G4bool CalFinalStateOfTheBinaryCollisionJQMD( G4double , G4double , G4ThreeVector , G4double , G4double , G4ThreeVector , G4double , G4int , G4int ); … … 55 57 56 58 void SetMeanField ( G4QMDMeanField* meanfield ){ theMeanField = meanfield; theSystem = meanfield->GetSystem(); } 57 58 59 59 60 private: -
trunk/source/processes/hadronic/models/qmd/include/G4QMDMeanField.hh
r819 r962 34 34 // Creation date: 29 March 2007 35 35 // ----------------------------------------------------------------------------- 36 // 081120 Add Update 36 37 37 38 #ifndef G4QMDMeanField_hh … … 74 75 std::vector< G4double > GetDepthOfPotential(); 75 76 77 void Update(); 78 76 79 private: 77 80 G4double calPauliBlockingFactor( G4int ); -
trunk/source/processes/hadronic/models/qmd/include/G4QMDParticipant.hh
r819 r962 34 34 // Creation date: 29 March 2007 35 35 // ----------------------------------------------------------------------------- 36 // 37 // 081120 Add hit flag and related methods 36 38 37 39 #ifndef G4QMDParticipant_hh … … 70 72 71 73 void UnsetInitialMark() { projectile = false; target = false; } 74 void UnsetHitMark() { hit = false; } 75 G4bool IsThisHit() { return hit; } 76 void SetHitMark() { hit = true; } 77 72 78 void SetProjectile() { projectile = true; } 73 79 void SetTarget() { target = true; } … … 82 88 G4bool projectile; 83 89 G4bool target; 90 G4bool hit; 84 91 }; 85 92 -
trunk/source/processes/hadronic/models/qmd/include/G4QMDReaction.hh
r819 r962 34 34 // Creation date: 02 April 2007 35 35 // ----------------------------------------------------------------------------- 36 // 37 // 081107 Add UnUseGEM (then use the default channel of G4Evaporation) 38 // UseFrag (chage criterion of a inelastic reaction) 39 // 36 40 37 41 #ifndef G4QMDReaction_hh … … 63 67 G4HadFinalState *ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus & targetNucleus ); 64 68 69 void UnUseGEM(){ gem = false; setEvaporationCh(); }; 70 void UseFRAG(){ frag = true; }; 71 65 72 private: 66 void setInitialCondition( G4QMDSystem* , G4QMDSystem* ); 73 74 void setEvaporationCh(); 67 75 68 76 G4QMDMeanField* meanField; … … 70 78 G4QMDCollision* collision; 71 79 72 void doPropagation();73 80 void doCollision(); 74 81 std::vector< G4QMDSystem* > doClusterJudgment(); … … 80 87 G4Evaporation* evaporation; 81 88 G4ExcitationHandler* excitationHandler; 89 82 90 // G4VPreCompoundModel* preco; 83 91 … … 102 110 G4IonsShenCrossSection genspaXS; 103 111 112 G4bool gem; 113 G4bool frag; 114 104 115 }; 105 116 -
trunk/source/processes/hadronic/models/qmd/include/G4QMDSystem.hh
r819 r962 34 34 // Creation date: 29 March 2007 35 35 // ----------------------------------------------------------------------------- 36 // 37 // 080602 Fix memory leaks by T. Koi 38 // 081120 Add EraseParticipant and InsertParticipant Methods by T. Koi 36 39 37 40 #ifndef G4QMDSystem_hh … … 51 54 void SubtractSystem ( G4QMDSystem* ); 52 55 53 void DeleteParticipant( G4int i ) { participants.erase( std::find ( participants.begin() , participants.end() , participants[ i ] ) ); }; 56 G4QMDParticipant* EraseParticipant( G4int i ) { G4QMDParticipant* particle = participants[ i ]; participants.erase( std::find ( participants.begin() , participants.end() , participants[ i ] ) ) ; return particle; }; 57 void DeleteParticipant( G4int i ) { delete participants[ i ] ; participants.erase( std::find ( participants.begin() , participants.end() , participants[ i ] ) ); }; 58 void InsertParticipant( G4QMDParticipant* particle , G4int j ); 54 59 55 60 G4int GetTotalNumberOfParticipant() { return participants.size(); }; -
trunk/source/processes/hadronic/models/qmd/src/G4QMDCollision.cc
r819 r962 24 24 // ******************************************************************** 25 25 // 26 // 080602 Fix memory leaks by T. Koi 27 // 081120 Add deltaT in signature of CalKinematicsOfBinaryCollisions 28 // Add several required updating of Mean Filed 29 // Modified handling of absorption case by T. Koi 30 // 26 31 #include "G4QMDCollision.hh" 27 32 #include "G4ParticleDefinition.hh" 28 33 #include "G4Scatterer.hh" 29 34 #include "Randomize.hh" 30 #include "G4PionZero.hh"31 35 32 36 G4QMDCollision::G4QMDCollision() … … 49 53 50 54 51 void G4QMDCollision::CalKinematicsOfBinaryCollisions( )55 void G4QMDCollision::CalKinematicsOfBinaryCollisions( G4double dt ) 52 56 { 53 57 G4double deltaT = dt; 54 58 55 59 G4int n = theSystem->GetTotalNumberOfParticipant(); 60 //081118 61 //G4int nb = 0; 62 for ( G4int i = 0 ; i < n ; i++ ) 63 { 64 theSystem->GetParticipant( i )->UnsetHitMark(); 65 theSystem->GetParticipant( i )->UnsetHitMark(); 66 //nb += theSystem->GetParticipant( i )->GetBaryonNumber(); 67 } 68 //G4cout << "nb = " << nb << " n = " << n << G4endl; 69 56 70 57 71 //071101 58 72 for ( G4int i = 0 ; i < n ; i++ ) 59 73 { 74 60 75 //std::cout << i << " " << theSystem->GetParticipant( i )->GetDefinition()->GetParticleName() << " " << theSystem->GetParticipant( i )->GetPosition() << std::endl; 76 61 77 if ( theSystem->GetParticipant( i )->GetDefinition()->IsShortLived() ) 62 78 { 79 80 G4bool decayed = false; 81 63 82 G4ParticleDefinition* pd0 = theSystem->GetParticipant( i )->GetDefinition(); 64 83 G4ThreeVector p0 = theSystem->GetParticipant( i )->GetMomentum(); … … 67 86 G4LorentzVector p40 = theSystem->GetParticipant( i )->Get4Momentum(); 68 87 69 G4double epot = theMeanField->GetTotalPotential(); 70 G4double eini = epot + p40.e(); 88 G4double eini = theMeanField->GetTotalPotential() + p40.e(); 71 89 72 90 G4int n0 = theSystem->GetTotalNumberOfParticipant(); 73 91 G4int i0 = 0; 74 G4bool isThisEnergyOK = false; 92 93 G4bool isThisEnergyOK = false; 94 75 95 for ( G4int ii = 0 ; ii < 4 ; ii++ ) 76 { 77 78 //G4LorentzVector p4 = theSystem->GetParticipant( i )->Get4Momentum(); 79 G4LorentzVector p400 = p40; 80 81 p400 *= GeV; 82 //G4KineticTrack kt( theSystem->GetParticipant( i )->GetDefinition() , 0.0 , (theSystem->GetParticipant( i )->GetPosition())*fermi , p4 ); 83 G4KineticTrack kt( pd0 , 0.0 , r0*fermi , p400 ); 84 // std::cout << "G4KineticTrack " << i << " " << kt.GetDefinition()->GetParticleName() << kt.GetPosition() << std::endl; 85 G4KineticTrackVector* secs = NULL; 86 secs = kt.Decay(); 87 G4int id = 0; 88 G4double et = 0; 89 if ( secs ) 90 { 91 for ( G4KineticTrackVector::iterator it 92 = secs->begin() ; it != secs->end() ; it++ ) 96 { 97 98 //G4LorentzVector p4 = theSystem->GetParticipant( i )->Get4Momentum(); 99 G4LorentzVector p400 = p40; 100 101 p400 *= GeV; 102 //G4KineticTrack kt( theSystem->GetParticipant( i )->GetDefinition() , 0.0 , (theSystem->GetParticipant( i )->GetPosition())*fermi , p4 ); 103 G4KineticTrack kt( pd0 , 0.0 , r0*fermi , p400 ); 104 //std::cout << "G4KineticTrack " << i << " " << kt.GetDefinition()->GetParticleName() << kt.GetPosition() << std::endl; 105 G4KineticTrackVector* secs = NULL; 106 secs = kt.Decay(); 107 G4int id = 0; 108 G4double et = 0; 109 if ( secs ) 93 110 { 94 // std::cout << "G4KineticTrack" 95 // << " " << (*it)->GetDefinition()->GetParticleName() 96 // << " " << (*it)->Get4Momentum() 97 // << " " << (*it)->GetPosition()/fermi 98 // << std::endl; 99 if ( id == 0 ) 100 { 101 theSystem->GetParticipant( i )->SetDefinition( (*it)->GetDefinition() ); 102 theSystem->GetParticipant( i )->SetMomentum( (*it)->Get4Momentum().v()/GeV ); 103 theSystem->GetParticipant( i )->SetPosition( (*it)->GetPosition()/fermi ); 104 //theMeanField->Cal2BodyQuantities( i ); 105 et += (*it)->Get4Momentum().e()/GeV; 106 } 107 if ( id > 0 ) 108 { 109 // Append end; 110 theSystem->SetParticipant ( new G4QMDParticipant ( (*it)->GetDefinition() , (*it)->Get4Momentum().v()/GeV , (*it)->GetPosition()/fermi ) ); 111 et += (*it)->Get4Momentum().e()/GeV; 112 if ( id > 1 ) 111 for ( G4KineticTrackVector::iterator it 112 = secs->begin() ; it != secs->end() ; it++ ) 113 { 114 /* 115 G4cout << "G4KineticTrack" 116 << " " << (*it)->GetDefinition()->GetParticleName() 117 << " " << (*it)->Get4Momentum() 118 << " " << (*it)->GetPosition()/fermi 119 << G4endl; 120 */ 121 if ( id == 0 ) 113 122 { 114 // std::cout << "NAGISA id >2; id= " << id << std::endl; 123 theSystem->GetParticipant( i )->SetDefinition( (*it)->GetDefinition() ); 124 theSystem->GetParticipant( i )->SetMomentum( (*it)->Get4Momentum().v()/GeV ); 125 theSystem->GetParticipant( i )->SetPosition( (*it)->GetPosition()/fermi ); 126 //theMeanField->Cal2BodyQuantities( i ); 127 et += (*it)->Get4Momentum().e()/GeV; 115 128 } 116 } 117 id++; 118 119 delete *it; 129 if ( id > 0 ) 130 { 131 // Append end; 132 theSystem->SetParticipant ( new G4QMDParticipant ( (*it)->GetDefinition() , (*it)->Get4Momentum().v()/GeV , (*it)->GetPosition()/fermi ) ); 133 et += (*it)->Get4Momentum().e()/GeV; 134 if ( id > 1 ) 135 { 136 //081118 137 //G4cout << "G4QMDCollision id >2; id= " << id << G4endl; 138 } 139 } 140 id++; // number of daughter particles 141 142 delete *it; 143 } 144 145 theMeanField->Update(); 146 i0 = id-1; // 0 enter to i 147 148 delete secs; 120 149 } 121 theMeanField->SetSystem ( theSystem ); 122 i0 = id-1; // 0 enter to i 123 } 124 125 // EnergyCheck 126 127 G4double epot = theMeanField->GetTotalPotential(); 128 G4double efin = epot + et; 129 //std::cout << std::abs ( eini - efin ) - epse << std::endl; 130 // std::cout << std::abs ( eini - efin ) - epse*10 << std::endl; 131 //071031 132 // *10 TK 133 if ( std::abs ( eini - efin ) < epse*10 ) 134 { 135 // Energy OK 136 // std::cout << "Decay Succeeded Energy OK" << std::endl; 137 isThisEnergyOK = true; 138 break; 139 } 140 else 141 { 142 for ( G4int i0i = 0 ; i0i < id-1 ; i0i++ ) 150 151 // EnergyCheck 152 153 G4double efin = theMeanField->GetTotalPotential() + et; 154 //std::cout << std::abs ( eini - efin ) - epse << std::endl; 155 // std::cout << std::abs ( eini - efin ) - epse*10 << std::endl; 156 // *10 TK 157 if ( std::abs ( eini - efin ) < epse*10 ) 143 158 { 144 // std::cout << "Decay Energitically Blocked deleteing " << i0i+n0 << std::endl; 145 theSystem->DeleteParticipant( i0i+n0 ); 159 // Energy OK 160 isThisEnergyOK = true; 161 break; 146 162 } 147 } 148 } 163 else 164 { 165 166 theSystem->GetParticipant( i )->SetDefinition( pd0 ); 167 theSystem->GetParticipant( i )->SetPosition( r0 ); 168 theSystem->GetParticipant( i )->SetMomentum( p0 ); 169 170 for ( G4int i0i = 0 ; i0i < id-1 ; i0i++ ) 171 { 172 //081118 173 //std::cout << "Decay Energitically Blocked deleteing " << i0i+n0 << std::endl; 174 theSystem->DeleteParticipant( i0i+n0 ); 175 } 176 //081103 177 theMeanField->Update(); 178 } 179 180 } 181 149 182 150 183 // Pauli Check 151 184 if ( isThisEnergyOK == true ) 152 185 { 153 //if ( theMeanField->IsPauliBlocked ( i ) != true )186 if ( theMeanField->IsPauliBlocked ( i ) != true ) 154 187 { 155 bool allOK = true; 188 189 G4bool allOK = true; 156 190 for ( G4int i0i = 0 ; i0i < i0 ; i0i++ ) 157 191 { … … 163 197 } 164 198 165 // if ( allOK ) std::cout << "Decay Succeeded" << std::endl; 166 if ( allOK ) continue; //Do not Pauli Blocked 199 if ( allOK ) 200 { 201 decayed = true; //Decay Succeeded 202 } 167 203 } 204 168 205 } 169 206 // 170 207 171 // std::cout << "Decay Blocked" << std::endl; 172 theSystem->GetParticipant( i )->SetDefinition( pd0 ); 173 theSystem->GetParticipant( i )->SetPosition( r0 ); 174 theSystem->GetParticipant( i )->SetMomentum( p0 ); 175 176 if ( isThisEnergyOK == true ) 177 { 178 for ( G4int i0i = 0 ; i0i < i0 ; i0i++ ) 179 { 180 // std::cout << "Decay Blocked deleteing " << i0i+n0 << std::endl; 181 theSystem->DeleteParticipant( i0i+n0 ); 182 } 183 } 184 185 } 186 } 208 if ( decayed ) 209 { 210 //081119 211 //G4cout << "Decay Suceeded! " << std::endl; 212 theSystem->GetParticipant( i )->SetHitMark(); 213 for ( G4int i0i = 0 ; i0i < i0 ; i0i++ ) 214 { 215 theSystem->GetParticipant( i0i+n0 )->SetHitMark(); 216 } 217 218 } 219 else 220 { 221 222 // Decay Blocked and re-enter orginal participant; 223 224 if ( isThisEnergyOK == true ) // for false case already done 225 { 226 227 theSystem->GetParticipant( i )->SetDefinition( pd0 ); 228 theSystem->GetParticipant( i )->SetPosition( r0 ); 229 theSystem->GetParticipant( i )->SetMomentum( p0 ); 230 231 for ( G4int i0i = 0 ; i0i < i0 ; i0i++ ) 232 { 233 //081118 234 //std::cout << "Decay Blocked deleteing " << i0i+n0 << std::endl; 235 theSystem->DeleteParticipant( i0i+n0 ); 236 } 237 //081103 238 theMeanField->Update(); 239 } 240 241 } 242 243 } //shortlive 244 } // go next participant 187 245 //071101 188 246 189 247 190 248 n = theSystem->GetTotalNumberOfParticipant(); 191 //std::cout << "Collision n " << n << std::endl; 192 193 std::vector< G4bool > isCollided ( n , false ); 194 195 for ( G4int i = 1 ; i < n ; i++ ) 249 250 //081118 251 //for ( G4int i = 1 ; i < n ; i++ ) 252 for ( G4int i = 1 ; i < theSystem->GetTotalNumberOfParticipant() ; i++ ) 196 253 { 197 254 198 255 //std::cout << "Collision i " << i << std::endl; 256 if ( theSystem->GetParticipant( i )->IsThisHit() ) continue; 199 257 200 258 G4ThreeVector ri = theSystem->GetParticipant( i )->GetPosition(); … … 206 264 for ( G4int j = 0 ; j < i ; j++ ) 207 265 { 208 // std::cout << "Collision " << i << " " << j << std::endl; 266 209 267 210 268 /* … … 216 274 217 275 // Only 1 Collision allowed for each particle in a time step. 218 if ( isCollided[ i ] == true ) continue; 219 if ( isCollided[ j ] == true ) continue; 276 //081119 277 if ( theSystem->GetParticipant( i )->IsThisHit() ) continue; 278 if ( theSystem->GetParticipant( j )->IsThisHit() ) continue; 279 280 //std::cout << "Collision " << i << " " << j << std::endl; 220 281 221 282 // Do not allow collision between nucleons in target/projectile til its first collision. … … 285 346 G4double tj = (-pjdr/rmj - bji / aij ) * p4j.e() / rmj; 286 347 287 G4double deltaT = 0.0;288 deltaT = 1.0; // TK289 348 290 349 /* … … 319 378 //G4bool energetically_forbidden = !( CalFinalStateOfTheBinaryCollisionJQMD ( sig , cutoff , pcm , prcm , srt, beta , gamma , i , j ) ); // JQMD Elastic 320 379 380 /* 321 381 G4bool pauli_blocked = false; 322 if ( energetically_forbidden != true )382 if ( energetically_forbidden == false ) // result true 323 383 { 324 384 if ( theMeanField->IsPauliBlocked ( i ) == true || theMeanField->IsPauliBlocked ( j ) == true ) … … 330 390 else 331 391 { 392 if ( theMeanField->IsPauliBlocked ( i ) == true || theMeanField->IsPauliBlocked ( j ) == true ) 393 pauli_blocked = false; 332 394 //std::cout << "G4QMDRESULT Collsion Blocked " << std::endl; 333 395 } 396 */ 334 397 335 398 /* … … 338 401 << std::endl; 339 402 */ 340 341 342 if ( energetically_forbidden == true || pauli_blocked == true ) 343 { 344 // Collsion not allowed then re enter orginal participants 345 // Now only momentum, becasuse we only consider elastic scattering of nucleons 403 // 081118 404 //if ( energetically_forbidden == true || pauli_blocked == true ) 405 if ( energetically_forbidden == true ) 406 { 407 408 //G4cout << " energetically_forbidden " << G4endl; 409 // Collsion not allowed then re enter orginal participants 410 // Now only momentum, becasuse we only consider elastic scattering of nucleons 346 411 347 412 theSystem->GetParticipant( i )->SetMomentum( p4i.vect() ); 348 413 theSystem->GetParticipant( i )->SetDefinition( pdi ); 349 414 theSystem->GetParticipant( i )->SetPosition( ri ); 415 350 416 theSystem->GetParticipant( j )->SetMomentum( p4j.vect() ); 351 417 theSystem->GetParticipant( j )->SetDefinition( pdj ); 352 418 theSystem->GetParticipant( j )->SetPosition( rj ); 353 419 420 theMeanField->Cal2BodyQuantities( i ); 421 theMeanField->Cal2BodyQuantities( j ); 422 354 423 } 355 424 else 356 425 { 357 // Collsion allowed (really happened) 426 427 428 G4bool absorption = false; 429 if ( n == theSystem->GetTotalNumberOfParticipant()+1 ) absorption = true; 430 if ( absorption ) 431 { 432 //G4cout << "Absorption happend " << G4endl; 433 i = i-1; 434 n = n-1; 435 } 436 437 // Collsion allowed (really happened) 358 438 359 439 // Unset Projectile/Target flag 360 440 theSystem->GetParticipant( i )->UnsetInitialMark(); 361 theSystem->GetParticipant( j )->UnsetInitialMark();362 363 isCollided[ i ] = true;364 i sCollided[ j ] = true;441 if ( !absorption ) theSystem->GetParticipant( j )->UnsetInitialMark(); 442 443 theSystem->GetParticipant( i )->SetHitMark(); 444 if ( !absorption ) theSystem->GetParticipant( j )->SetHitMark(); 365 445 366 446 theSystem->IncrementCollisionCounter(); … … 390 470 << std::endl; 391 471 */ 392 393 } 394 395 // theMeanField 396 397 } 472 473 474 } 475 476 } 477 398 478 } 399 479 400 //071106401 n = theSystem->GetTotalNumberOfParticipant();402 G4bool isThisModefied = false;403 for ( G4int i = 0 ; i < n ; i++ )404 {405 if ( theSystem->GetParticipant( i )->GetDefinition() == G4PionZero::PionZero() )406 {407 if ( theSystem->GetParticipant( i )->GetPosition().mag() > 1.0e9 )408 {409 // std::cout << "Deleting " << i << " " << theSystem->GetParticipant( i )->GetPosition().mag() << std::endl;410 theSystem->DeleteParticipant( i );411 isThisModefied = true;412 }413 }414 }415 if ( isThisModefied == true ) theMeanField->SetSystem ( theSystem );416 //071106417 480 418 481 } … … 423 486 { 424 487 425 //G4cout << "CalFinalStateOfTheBinaryCollision " << G4endl; 426 427 G4bool result = true; 428 429 G4LorentzVector p4i = theSystem->GetParticipant( i )->Get4Momentum(); 430 G4LorentzVector p4j = theSystem->GetParticipant( j )->Get4Momentum(); 488 //081103 489 //G4cout << "CalFinalStateOfTheBinaryCollision " << i << " " << j << " " << theSystem->GetTotalNumberOfParticipant() << G4endl; 490 491 G4bool result = false; 492 G4bool energyOK = false; 493 G4bool pauliOK = false; 494 G4bool abs = false; 495 G4QMDParticipant* absorbed = NULL; 496 497 G4LorentzVector p4i = theSystem->GetParticipant( i )->Get4Momentum(); 498 G4LorentzVector p4j = theSystem->GetParticipant( j )->Get4Momentum(); 499 500 //071031 501 502 G4double epot = theMeanField->GetTotalPotential(); 503 504 G4double eini = epot + p4i.e() + p4j.e(); 431 505 432 506 //071031 433 507 // will use KineticTrack 434 G4LorentzVector p4ix = p4i*GeV;435 G4LorentzVector p4jx = p4j*GeV;436 G4ThreeVector rix = (theSystem->GetParticipant( i )->GetPosition())*fermi;437 G4ThreeVector rjx = (theSystem->GetParticipant( j )->GetPosition())*fermi;438 //071031439 440 G4double epot = theMeanField->GetTotalPotential();441 442 G4double eini = epot + p4i.e() + p4j.e();443 444 445 //071031446 508 G4ParticleDefinition* pdi0 =theSystem->GetParticipant( i )->GetDefinition(); 447 509 G4ParticleDefinition* pdj0 =theSystem->GetParticipant( j )->GetDefinition(); 448 G4ThreeVector ri0 =(theSystem->GetParticipant( i )->GetPosition())*fermi; 449 G4ThreeVector rj0 =(theSystem->GetParticipant( j )->GetPosition())*fermi; 510 G4LorentzVector p4i0 = p4i*GeV; 511 G4LorentzVector p4j0 = p4j*GeV; 512 G4ThreeVector ri0 = ( theSystem->GetParticipant( i )->GetPosition() )*fermi; 513 G4ThreeVector rj0 = ( theSystem->GetParticipant( j )->GetPosition() )*fermi; 450 514 451 515 for ( G4int iitry = 0 ; iitry < 4 ; iitry++ ) 452 516 { 453 517 454 G4KineticTrack kt1( pdi0 , 0.0 , ri0 , p4ix ); 455 G4KineticTrack kt2( pdj0 , 0.0 , rj0 , p4jx ); 518 abs = false; 519 520 G4KineticTrack kt1( pdi0 , 0.0 , ri0 , p4i0 ); 521 G4KineticTrack kt2( pdj0 , 0.0 , rj0 , p4j0 ); 522 456 523 G4LorentzVector p4ix_new; 457 524 G4LorentzVector p4jx_new; … … 462 529 //std::cout << "G4QMDSCATTERER BEFORE " << kt2.GetDefinition()->GetParticleName() << " " << kt2.Get4Momentum()/GeV << " " << kt2.GetPosition()/fermi << std::endl; 463 530 //std::cout << "THESCATTERER " << theScatterer->GetCrossSection ( kt1 , kt2 )/millibarn << " " << elastic << " " << sig << std::endl; 531 532 464 533 if ( secs ) 465 534 { … … 488 557 } 489 558 } 490 else 491 { 492 //std::cout << "NAGISA pion absrorption " << secs->front()->GetDefinition()->GetParticleName() << std::endl; 559 else if ( secs->size() == 1 ) 560 { 561 //081118 562 abs = true; 563 //G4cout << "G4QMDCollision pion absrorption " << secs->front()->GetDefinition()->GetParticleName() << G4endl; 493 564 //secs->front()->Decay(); 494 565 theSystem->GetParticipant( i )->SetDefinition( secs->front()->GetDefinition() ); 495 566 p4ix_new = secs->front()->Get4Momentum()/GeV; 496 567 theSystem->GetParticipant( i )->SetMomentum( p4ix_new.v() ); 497 498 //std::cout << "THESCATTERER " << (*it)->GetDefinition()->GetParticleName() << std::endl;499 p4jx_new( 0 );500 //theSystem->GetParticipant( j )->SetDefinition( G4Gamma::Gamma() );501 //theSystem->GetParticipant( j )->SetDefinition( G4Neutron::Neutron() );502 theSystem->GetParticipant( j )->SetDefinition( G4PionZero::PionZero() );503 theSystem->GetParticipant( j )->SetMomentum( G4ThreeVector( G4UniformRand() )*eV );504 theSystem->GetParticipant( j )->SetPosition( G4ThreeVector( 1000, 1000, 1000 )*km );505 568 506 569 } 507 570 508 if ( secs->size() > 2 ) std::cout << "NAGISA secs size > 2; " << secs->size() << std::endl; 571 //081118 572 if ( secs->size() > 2 ) 573 { 574 575 G4cout << "G4QMDCollision secs size > 2; " << secs->size() << G4endl; 576 577 for ( G4KineticTrackVector::iterator it 578 = secs->begin() ; it != secs->end() ; it++ ) 579 { 580 G4cout << "G4QMDSCATTERER AFTER " << (*it)->GetDefinition()->GetParticleName() << " " << (*it)->Get4Momentum()/GeV << G4endl; 581 } 582 583 } 509 584 510 585 // deleteing KineticTrack … … 514 589 delete *it; 515 590 } 591 592 delete secs; 516 593 } 517 594 //071031 518 595 519 theMeanField->Cal2BodyQuantities( i ); 520 theMeanField->Cal2BodyQuantities( j ); 596 if ( !abs ) 597 { 598 theMeanField->Cal2BodyQuantities( i ); 599 theMeanField->Cal2BodyQuantities( j ); 600 } 601 else 602 { 603 absorbed = theSystem->EraseParticipant( j ); 604 theMeanField->Update(); 605 } 521 606 522 607 epot = theMeanField->GetTotalPotential(); … … 540 625 //std::cout << "collisions after " << theSystem->GetParticipant( i )->Get4Momentum() << " " << theSystem->GetParticipant( j )->Get4Momentum() << std::endl; 541 626 //std::cout << "collisions dif " << ( p4i + p4j ) - ( theSystem->GetParticipant( i )->Get4Momentum() + theSystem->GetParticipant( j )->Get4Momentum() ) << std::endl; 542 //std::cout << "collisions before " << ri x/fermi << " " << rjx/fermi << std::endl;627 //std::cout << "collisions before " << ri0/fermi << " " << rj0/fermi << std::endl; 543 628 //std::cout << "collisions after " << theSystem->GetParticipant( i )->GetPosition() << " " << theSystem->GetParticipant( j )->GetPosition() << std::endl; 629 energyOK = true; 630 break; 631 } 632 else 633 { 634 //G4cout << "Energy Not OK " << G4endl; 635 if ( abs ) 636 { 637 //G4cout << "TKDB reinsert j " << G4endl; 638 theSystem->InsertParticipant( absorbed , j ); 639 theMeanField->Update(); 640 } 641 // do not need reinsert in no absroption case 544 642 } 545 643 //071031 546 547 if ( std::abs ( eini - efin ) < epse ) return result; // Collison OK548 549 644 } 550 645 551 // Energetically forbidden collision 552 result = false; 553 554 return result; 646 // Energetically forbidden collision 647 648 if ( energyOK ) 649 { 650 // Pauli Check 651 //G4cout << "Pauli Checking " << theSystem->GetTotalNumberOfParticipant() << G4endl; 652 if ( !abs ) 653 { 654 if ( !( theMeanField->IsPauliBlocked ( i ) == true || theMeanField->IsPauliBlocked ( j ) == true ) ) 655 { 656 //G4cout << "Binary Collision Happen " << theSystem->GetTotalNumberOfParticipant() << G4endl; 657 pauliOK = true; 658 } 659 } 660 else 661 { 662 if ( theMeanField->IsPauliBlocked ( i ) == false ) 663 { 664 //G4cout << "Absorption Happen " << theSystem->GetTotalNumberOfParticipant() << G4endl; 665 delete absorbed; 666 pauliOK = true; 667 } 668 } 669 670 671 if ( pauliOK ) 672 { 673 result = true; 674 } 675 else 676 { 677 //G4cout << "Pauli Blocked" << G4endl; 678 if ( abs ) 679 { 680 //G4cout << "TKDB reinsert j pauli block" << G4endl; 681 theSystem->InsertParticipant( absorbed , j ); 682 theMeanField->Update(); 683 } 684 } 685 } 686 687 return result; 555 688 556 689 } -
trunk/source/processes/hadronic/models/qmd/src/G4QMDGroundStateNucleus.cc
r819 r962 24 24 // ******************************************************************** 25 25 // 26 // 081024 G4NucleiPropertiesTable:: to G4NucleiProperties:: 27 // 26 28 #include "G4QMDGroundStateNucleus.hh" 27 29 … … 119 121 //std::cout << "G4QMDGroundStateNucleus::packNucleons" << std::endl; 120 122 121 ebini = - ( G4NucleiPropertiesTable::GetBindingEnergy( GetAtomicNumber() , GetMassNumber()) ) / GetMassNumber();123 ebini = - G4NucleiProperties::GetBindingEnergy( GetMassNumber() , GetAtomicNumber() ) / GetMassNumber(); 122 124 123 125 G4double ebin00 = ebini * 0.001; -
trunk/source/processes/hadronic/models/qmd/src/G4QMDMeanField.cc
r819 r962 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // 26 // 081120 Add Update by T. Koi 25 27 // 26 28 #include "G4QMDMeanField.hh" … … 861 863 { 862 864 863 // std::cout << "Add Participants to cluseter " << it->second << std::endl;865 //G4cout << "Add Participants to cluseter " << it->second << G4endl; 864 866 865 867 if ( it->first != 0 ) … … 873 875 { 874 876 nucleus->SetParticipant( system->GetParticipant ( itt->second ) ); 875 // std::cout << "Add Participants " << itt->second << " " << system->GetParticipant ( itt->second )->GetPosition() << std::endl;877 //G4cout << "Add Participants " << itt->second << " " << system->GetParticipant ( itt->second )->GetPosition() << G4endl; 876 878 } 877 879 … … 893 895 894 896 } 897 898 899 900 void G4QMDMeanField::Update() 901 { 902 SetSystem( system ); 903 } -
trunk/source/processes/hadronic/models/qmd/src/G4QMDNucleus.cc
r819 r962 24 24 // ******************************************************************** 25 25 // 26 // 081024 G4NucleiPropertiesTable:: to G4NucleiProperties:: 27 // 26 28 #include "G4QMDNucleus.hh" 27 29 #include "G4Proton.hh" … … 91 93 { 92 94 93 G4double mass = G4NucleiProperties Table::GetNuclearMass( GetAtomicNumber() , GetMassNumber() );95 G4double mass = G4NucleiProperties::GetNuclearMass( GetMassNumber() , GetAtomicNumber() ); 94 96 95 97 if ( mass == 0.0 ) … … 214 216 //G4cout << "PotentialEnergy in GeV " << potentialEnergy << G4endl; 215 217 //G4cout << "BindingEnergy in GeV " << bindingEnergy << G4endl; 216 //G4cout << "G4BindingEnergy in GeV " << G4NucleiProperties Table::GetBindingEnergy( GetAtomicNumber() , GetMassNumber() )/GeV << G4endl;217 218 excitationEnergy = bindingEnergy + G4NucleiProperties Table::GetBindingEnergy( GetAtomicNumber() , GetMassNumber() )/GeV;218 //G4cout << "G4BindingEnergy in GeV " << G4NucleiProperties::GetBindingEnergy( GetAtomicNumber() , GetMassNumber() )/GeV << G4endl; 219 220 excitationEnergy = bindingEnergy + G4NucleiProperties::GetBindingEnergy( GetMassNumber() , GetAtomicNumber() )/GeV; 219 221 //G4cout << "excitationEnergy in GeV " << excitationEnergy << G4endl; 220 222 if ( excitationEnergy < 0 ) excitationEnergy = 0.0; -
trunk/source/processes/hadronic/models/qmd/src/G4QMDReaction.cc
r819 r962 24 24 // ******************************************************************** 25 25 // 26 // 080505 Fixed and changed sampling method of impact parameter by T. Koi 27 // 080602 Fix memory leaks by T. Koi 28 // 080612 Delete unnecessary dependency and unused functions 29 // Change criterion of reaction by T. Koi 30 // 081107 Add UnUseGEM (then use the default channel of G4Evaporation) 31 // UseFrag (chage criterion of a inelastic reaction) 32 // Fix bug in nucleon projectiles by T. Koi 33 // 26 34 #include "G4QMDReaction.hh" 27 35 #include "G4QMDNucleus.hh" 28 29 36 #include "G4QMDGroundStateNucleus.hh" 30 #include "G4Fancy3DNucleus.hh"31 37 32 38 #include "G4NistManager.hh" 33 39 34 40 G4QMDReaction::G4QMDReaction() 35 : system ( 0)41 : system ( NULL ) 36 42 , deltaT ( 1 ) // in fsec 37 43 , maxTime ( 100 ) // will have maxTime-th time step 44 , gem ( true ) 45 , frag ( false ) 38 46 { 39 47 meanField = new G4QMDMeanField(); 40 48 collision = new G4QMDCollision(); 41 49 50 excitationHandler = new G4ExcitationHandler; 42 51 evaporation = new G4Evaporation; 43 evaporation->SetGEMChannel();44 excitationHandler = new G4ExcitationHandler;45 52 excitationHandler->SetEvaporation( evaporation ); 46 // preco = new G4PreCompoundModel( excitationHandler ); 47 53 setEvaporationCh(); 48 54 } 49 55 … … 53 59 { 54 60 delete evaporation; 61 delete excitationHandler; 55 62 delete collision; 56 63 delete meanField; 57 }58 59 60 61 void G4QMDReaction::setInitialCondition( G4QMDSystem* , G4QMDSystem* )62 {63 ;64 }65 66 67 68 void G4QMDReaction::doPropagation()69 {70 ;71 64 } 72 65 … … 108 101 //G4double xs_0 = shenXS.GetCrossSection ( proj_dp , targ_ele , aTemp ); 109 102 G4double xs_0 = genspaXS.GetCrossSection ( proj_dp , targ_ele , aTemp ); 110 G4double bmax_0 = std::sqrt( xs_0 )/pi*2;103 G4double bmax_0 = std::sqrt( xs_0 / pi ); 111 104 //std::cout << "bmax_0 in fm (fermi) " << bmax_0/fermi << std::endl; 112 105 … … 148 141 // impact parameter 149 142 G4double bmax = 1.05*(bmax_0/fermi); // 10% for Peripheral reactions 150 G4double b = bmax * G4UniformRand();143 G4double b = bmax * std::sqrt ( G4UniformRand() ); 151 144 //071112 152 145 //G4double b = 0; … … 164 157 G4LorentzVector proj4pLAB = projectile.Get4Momentum()/GeV; 165 158 166 G4QMDNucleus* proj(NULL); 167 if ( projectile.GetDefinition()->GetParticleType() == "nucleus" ) 168 { 169 proj = new G4QMDNucleus; 159 G4QMDGroundStateNucleus* proj(NULL); 160 if ( projectile.GetDefinition()->GetParticleType() == "nucleus" 161 || projectile.GetDefinition()->GetParticleName() == "proton" 162 || projectile.GetDefinition()->GetParticleName() == "neutron" ) 163 { 170 164 171 165 proj_Z = proj_pd->GetAtomicNumber(); … … 185 179 G4int ia = int ( target.GetN() ); 186 180 187 //G4QMDNucleus* targ = new G4QMDNucleus; 188 G4QMDNucleus* targ = new G4QMDGroundStateNucleus( iz , ia ); 181 G4QMDGroundStateNucleus* targ = new G4QMDGroundStateNucleus( iz , ia ); 189 182 190 183 meanField->SetSystem (targ ); … … 283 276 meanField->DoPropagation( deltaT ); 284 277 //system->ShowParticipants(); 285 collision->CalKinematicsOfBinaryCollisions( );278 collision->CalKinematicsOfBinaryCollisions( deltaT ); 286 279 287 280 if ( i / 10 * 10 == i ) … … 385 378 //if ( elasticLike_energy == true && withCollision == true ) elastic = true; // ielst = 1 386 379 // InelasticLike without Collision 387 if ( elasticLike_energy == false ) elastic = false; // ielst = 2 380 //if ( elasticLike_energy == false ) elastic = false; // ielst = 2 381 if ( frag == true ) 382 if ( elasticLike_energy == false ) elastic = false; 388 383 // InelasticLike with Collision 389 //if ( elasticLike_energy == false && withCollision == true ) elastic = false; // ielst = 3384 if ( elasticLike_energy == false && withCollision == true ) elastic = false; // ielst = 3 390 385 391 386 } … … 403 398 //G4cout << elastic << G4endl; 404 399 // if elastic is true try again from sampling of impact parameter 400 401 if ( elastic == true ) 402 { 403 // delete this nucleues 404 for ( std::vector< G4QMDNucleus* >::iterator 405 it = nucleuses.begin() ; it != nucleuses.end() ; it++ ) 406 { 407 delete *it; 408 } 409 nucleuses.clear(); 410 } 405 411 } 406 412 … … 436 442 for ( G4int i = 0 ; i < (*it)->GetTotalNumberOfParticipant() ; i++ ) 437 443 { 438 system->SetParticipant ( (*it)->GetParticipant( i ) ); 444 G4QMDParticipant* aP = new G4QMDParticipant( ( (*it)->GetParticipant( i ) )->GetDefinition() , ( (*it)->GetParticipant( i ) )->GetMomentum() , ( (*it)->GetParticipant( i ) )->GetPosition() ); 445 system->SetParticipant ( aP ); 439 446 } 440 447 continue; … … 508 515 } 509 516 517 for ( G4ReactionProductVector::iterator itt 518 = rv->begin() ; itt != rv->end() ; itt++ ) 519 { 520 delete *itt; 521 } 522 delete rv; 523 510 524 delete aFragment; 511 525 512 delete *it; // delete nulceuse513 514 526 } 527 515 528 516 529 … … 534 547 535 548 } 549 550 for ( std::vector< G4QMDNucleus* >::iterator it 551 = nucleuses.begin() ; it != nucleuses.end() ; it++ ) 552 { 553 delete *it; // delete nulceuse 554 } 555 nucleuses.clear(); 536 556 537 557 system->Clear(); … … 666 686 667 687 } 688 689 690 691 void G4QMDReaction::setEvaporationCh() 692 { 693 694 if ( gem == true ) 695 evaporation->SetGEMChannel(); 696 else 697 evaporation->SetDefaultChannel(); 698 699 } 700 -
trunk/source/processes/hadronic/models/qmd/src/G4QMDSystem.cc
r819 r962 24 24 // ******************************************************************** 25 25 // 26 // 081120 Add InsertParticipant Method by T. Koi 27 26 28 #include "G4QMDSystem.hh" 27 29 #include <iomanip> … … 97 99 G4cout << "Sum upped Momentum and mag " << p_sum << " " << p_sum.mag() << G4endl; 98 100 } 101 102 103 104 void G4QMDSystem::InsertParticipant ( G4QMDParticipant* particle , G4int n ) 105 { 106 107 if ( (size_t) n > participants.size()+1 ) 108 G4cout << "G4QMDSystem::InsertParticipant size error" << G4endl; 109 110 std::vector< G4QMDParticipant* >::iterator it; 111 it = participants.begin(); 112 113 for ( G4int i = 0; i < n ; i++ ) 114 it++; 115 116 participants.insert( it, particle ); 117 }
Note: See TracChangeset
for help on using the changeset viewer.