- Timestamp:
- Nov 25, 2009, 5:13:58 PM (15 years ago)
- Location:
- trunk/source/processes/hadronic/models/binary_cascade/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/models/binary_cascade/src/G4Absorber.cc
r819 r1196 56 56 if (kt.Get4Momentum().e() - kt.GetActualMass() < theCutOnP) 57 57 { 58 if(kt.GetDefinition() == G4PionPlus::PionPlus() ||59 kt.GetDefinition() == G4PionZero::PionZero() ||58 if(kt.GetDefinition() == G4PionPlus::PionPlus() || 59 kt.GetDefinition() == G4PionZero::PionZero() || 60 60 kt.GetDefinition() == G4PionMinus::PionMinus()) 61 61 { -
trunk/source/processes/hadronic/models/binary_cascade/src/G4BinaryCascade.cc
r962 r1196 97 97 theLateParticle= new G4BCLateParticle; 98 98 theImR.push_back(theDecay); 99 G4MesonAbsorption * aAb=new G4MesonAbsorption; 100 theImR.push_back(aAb); 99 101 G4Scatterer * aSc=new G4Scatterer; 100 102 theH1Scatterer = new G4Scatterer; 101 103 theImR.push_back(aSc); 102 G4MesonAbsorption * aAb=new G4MesonAbsorption;103 theImR.push_back(aAb);104 104 105 105 thePropagator = new G4RKPropagation; … … 107 107 theBCminP = 45*MeV; 108 108 theCutOnP = 90*MeV; 109 theCutOnPAbsorb= 0*MeV; 109 theCutOnPAbsorb= 0*MeV; // No Absorption of slow Mesons, other than above G4MesonAbsorption 110 110 111 111 theExcitationHandler = new G4ExcitationHandler; … … 155 155 eventcounter++; 156 156 if(getenv("BCDEBUG") ) G4cerr << " ######### Binary Cascade Reaction number starts ######### "<<eventcounter<<G4endl; 157 157 158 G4LorentzVector initial4Momentum = aTrack.Get4Momentum(); 158 159 G4ParticleDefinition * definition = const_cast<G4ParticleDefinition *>(aTrack.GetDefinition()); … … 238 239 theParticleChange.SetStatusChange(stopAndKill); 239 240 G4ReactionProductVector::iterator iter; 240 G4double Efinal=0;241 if (std::abs(theParticleChange.GetWeightChange() -1 ) > 1e-5 )242 {243 G4cout <<" BIC-weight change " << theParticleChange.GetWeightChange()<< G4endl;244 }245 241 246 242 for(iter = products->begin(); iter != products->end(); ++iter) … … 253 249 theParticleChange.AddSecondary(aNew); 254 250 255 // G4cout << " Secondary E - Ekin / p " << 256 // (*iter)->GetDefinition()->GetParticleName() << " " << 257 // (*iter)->GetTotalEnergy() << " - " << 258 // (*iter)->GetKineticEnergy()<< " / " << 259 // (*iter)->GetMomentum().x() << " " << 260 // (*iter)->GetMomentum().y() << " " << 261 // (*iter)->GetMomentum().z() << G4endl; 262 Efinal += (*iter)->GetTotalEnergy(); 263 } 264 265 // G4cout << "e outgoing/ total : " << Efinal << " " << Efinal+GetFinal4Momentum().e()<< G4endl; 266 251 } 252 253 // DebugEpConservation(track, products); 254 267 255 ClearAndDestroy(products); 268 256 delete products; … … 325 313 if(nucleus->GetMass()>120) theCutOnP = 45*MeV; 326 314 315 G4double StartingTime=DBL_MAX; // Search for minimal formation time Uzhi 316 for(iter = secondaries->begin(); iter != secondaries->end(); ++iter) // Uzhi 317 { // Uzhi 318 if((*iter)->GetFormationTime() < StartingTime) // Uzhi 319 StartingTime = (*iter)->GetFormationTime(); // Uzhi 320 } // Uzhi 321 327 322 for(iter = secondaries->begin(); iter != secondaries->end(); ++iter) 328 323 { 329 324 // G4cout << " Formation time : " << (*iter)->GetDefinition()->GetParticleName() << " " 330 325 // << (*iter)->GetFormationTime() << G4endl; 326 G4double FormTime = (*iter)->GetFormationTime() - StartingTime; // Uzhi 327 (*iter)->SetFormationTime(FormTime); // Uzhi 331 328 if( (*iter)->GetState() == G4KineticTrack::undefined ) 332 329 { … … 363 360 G4bool haveProducts = false; 364 361 G4int collisionCount=0; 365 theMomentumTransfer= 0;362 theMomentumTransfer=G4ThreeVector(0,0,0); 366 363 while(theCollisionMgr->Entries() > 0) 367 364 { … … 394 391 if (!DoTimeStep(nextCollision->GetCollisionTime()-theCurrentTime) ) 395 392 { 396 // Check if nextCollision is still valid, ie. part cile did not leave nucleus393 // Check if nextCollision is still valid, ie. particle did not leave nucleus 397 394 if (theCollisionMgr->GetNextCollision() != nextCollision ) 398 395 { … … 539 536 } 540 537 541 542 538 // find a fragment and call the precompound model. 543 539 G4Fragment * fragment = 0; 544 540 G4ReactionProductVector * precompoundProducts = 0; 545 546 if ( ExcitationEnergy >= 0 ) 547 { 548 fragment = FindFragments(); 549 550 // theDeExcitation =0; 551 if(fragment && fragment->GetA() >1.5) // hpw @@@@ still to add the nucleon, if one exists. 541 542 G4LorentzVector pFragment(0); 543 // G4cout << " final4mon " << GetFinal4Momentum() /MeV << G4endl; 544 545 // if ( ExcitationEnergy >= 0 ) // closed by Uzhi 546 // { // closed by Uzhi 547 fragment = FindFragments(); 548 if(fragment) // Uzhi 549 { // Uzhi 550 if(fragment->GetA() >1.5) // Uzhi 552 551 { 553 if (theDeExcitation) 552 if (theDeExcitation) // pre-compound 554 553 { 554 // G4cout << " going to preco with fragment 4 mom " << fragment->GetMomentum() << G4endl; 555 pFragment=fragment->GetMomentum(); 555 556 precompoundProducts= theDeExcitation->DeExcite(*fragment); 556 557 delete fragment; 557 558 fragment=0; 558 } else if (theExcitationHandler) 559 } else if (theExcitationHandler) // de-excitation 559 560 { 561 // G4cout << " going to de-excit with fragment 4 mom " << fragment->GetMomentum() << G4endl; 562 pFragment=fragment->GetMomentum(); 560 563 precompoundProducts=theExcitationHandler->BreakItUp(*fragment); 561 564 delete fragment; 562 565 fragment=0; 563 566 } 564 } else { 567 } else 568 { // fragment->GetA() < 1.5 569 precompoundProducts = new G4ReactionProductVector(); 570 std::vector<G4KineticTrack *>::iterator i; 565 571 if ( theTargetList.size() == 1 ) 566 572 { 567 precompoundProducts = new G4ReactionProductVector(); 568 std::vector<G4KineticTrack *>::iterator i=theTargetList.begin(); 573 i=theTargetList.begin(); 569 574 G4ReactionProduct * aNew = new G4ReactionProduct((*i)->GetDefinition()); 570 575 aNew->SetTotalEnergy((*i)->GetDefinition()->GetPDGMass()); 571 aNew->SetMomentum(G4ThreeVector(0)); // see boost fropreCompoundProducts below..576 aNew->SetMomentum(G4ThreeVector(0));// see boost for preCompoundProducts below.. 572 577 precompoundProducts->push_back(aNew); 573 } else if ( theTargetList.size() > 1) 578 } 579 580 if ( theCapturedList.size() == 1 ) // Uzhi 581 { // Uzhi 582 i=theCapturedList.begin(); // Uzhi 583 G4ReactionProduct * aNew = new G4ReactionProduct((*i)->GetDefinition()); // Uzhi 584 aNew->SetTotalEnergy((*i)->GetDefinition()->GetPDGMass()); // Uzhi 585 aNew->SetMomentum(G4ThreeVector(0));// see boost below.. // Uzhi 586 precompoundProducts->push_back(aNew); // Uzhi 587 } // Uzhi 588 } // End of fragment->GetA() < 1.5 589 } else // End of if(fragment) 590 { // No fragment, can be neutrons only // Uzhi 591 precompoundProducts = new G4ReactionProductVector(); 592 593 if ( (theTargetList.size()+theCapturedList.size()) > 0 ) 594 { 595 std::vector<G4KineticTrack *>::iterator aNuc; 596 G4LorentzVector aVec; 597 std::vector<G4double> masses; 598 G4double sumMass(0); 599 600 if ( theTargetList.size() != 0) // Uzhi 601 { 602 for ( aNuc=theTargetList.begin(); aNuc != theTargetList.end(); aNuc++) 603 { 604 G4double mass=(*aNuc)->GetDefinition()->GetPDGMass(); 605 masses.push_back(mass); 606 sumMass += mass; 607 } 608 } // Uzhi 609 610 if ( theCapturedList.size() != 0) // Uzhi 611 { // Uzhi 612 for(aNuc = theCapturedList.begin(); // Uzhi 613 aNuc != theCapturedList.end(); aNuc++) // Uzhi 614 { // Uzhi 615 G4double mass=(*aNuc)->GetDefinition()->GetPDGMass(); // Uzhi 616 masses.push_back(mass); // Uzhi 617 sumMass += mass; // Uzhi 618 } 619 } 620 621 G4LorentzVector finalP=GetFinal4Momentum(); 622 G4FermiPhaseSpaceDecay decay; 623 // G4cout << " some neutrons? " << masses.size() <<" " ; 624 // G4cout<< theTargetList.size()<<" "<<finalP <<" " << finalP.mag()<<G4endl; 625 626 G4double eCMS=finalP.mag(); 627 if ( eCMS < sumMass ) // @@GF --- Cheat!! 628 { 629 eCMS=sumMass + (2*MeV*masses.size()); 630 finalP.setE(std::sqrt(finalP.vect().mag2() + sqr(eCMS))); 631 } 632 633 precompoundLorentzboost.set(finalP.boostVector()); 634 std::vector<G4LorentzVector*> * momenta=decay.Decay(eCMS,masses); 635 std::vector<G4LorentzVector*>::iterator aMom=momenta->begin(); 636 637 if ( theTargetList.size() != 0) 638 { 639 for ( aNuc=theTargetList.begin(); 640 (aNuc != theTargetList.end()) && (aMom!=momenta->end()); 641 aNuc++, aMom++ ) 574 642 { 575 precompoundProducts = new G4ReactionProductVector(); 576 std::vector<G4KineticTrack *>::iterator aNuc; 577 G4LorentzVector aVec; 578 std::vector<G4double> masses; 579 G4double sumMass(0); 580 for ( aNuc=theTargetList.begin(); aNuc != theTargetList.end(); aNuc++) 581 { 582 G4double mass=(*aNuc)->GetDefinition()->GetPDGMass(); 583 masses.push_back(mass); 584 sumMass += mass; 585 } 586 G4LorentzVector finalP=GetFinal4Momentum(); 587 G4FermiPhaseSpaceDecay decay; 588 // G4cout << " some neutrons? " << masses.size() <<" " << theTargetList.size()<<" "<<finalP <<" " << finalP.mag()<<G4endl; 589 G4double eCMS=finalP.mag(); 590 if ( eCMS < sumMass ) // @@GF --- Cheat!! 591 { 592 eCMS=sumMass + (2*MeV*masses.size()); 593 finalP.setE(std::sqrt(finalP.vect().mag2() + sqr(eCMS))); 594 } 595 precompoundLorentzboost.set(finalP.boostVector()); 596 std::vector<G4LorentzVector*> * momenta=decay.Decay(eCMS,masses); 597 std::vector<G4LorentzVector*>::iterator aMom=momenta->begin(); 598 for ( aNuc=theTargetList.begin(); 599 (aNuc != theTargetList.end()) && (aMom!=momenta->end()); 600 aNuc++, aMom++ ) 601 { 602 G4ReactionProduct * aNew = new G4ReactionProduct((*aNuc)->GetDefinition()); 603 aNew->SetTotalEnergy((*aMom)->e()); 604 aNew->SetMomentum((*aMom)->vect()); 605 precompoundProducts->push_back(aNew); 606 // G4cout << " only neutrons? " << (*aNuc)->GetDefinition()->GetParticleName() << G4endl; 607 delete *aMom; 608 } 609 delete momenta; 643 G4ReactionProduct * aNew = new G4ReactionProduct((*aNuc)->GetDefinition()); 644 aNew->SetTotalEnergy((*aMom)->e()); 645 aNew->SetMomentum((*aMom)->vect()); 646 precompoundProducts->push_back(aNew); 647 648 delete *aMom; 610 649 } 611 } 612 613 } 650 } 651 652 if ( theCapturedList.size() != 0) // Uzhi 653 { // Uzhi 654 for ( aNuc=theCapturedList.begin(); // Uzhi 655 (aNuc != theCapturedList.end()) && (aMom!=momenta->end()); // Uzhi 656 aNuc++, aMom++ ) // Uzhi 657 { // Uzhi 658 G4ReactionProduct * aNew = new G4ReactionProduct( // Uzhi 659 (*aNuc)->GetDefinition()); // Uzhi 660 aNew->SetTotalEnergy((*aMom)->e()); // Uzhi 661 aNew->SetMomentum((*aMom)->vect()); // Uzhi 662 precompoundProducts->push_back(aNew); // Uzhi 663 delete *aMom; // Uzhi 664 } // Uzhi 665 } // Uzhi 666 667 if(momenta) delete momenta; 668 } 669 } // End if(!fragment) 670 614 671 615 672 { 616 673 // fill in products the outgoing particles 617 674 G4double Ekinout=0; 675 G4LorentzVector pSumBic(0); 618 676 size_t i(0); 619 677 for(i = 0; i< theFinalState.size(); i++) … … 636 694 aNew->SetTotalEnergy(kt->Get4Momentum().e()); 637 695 Ekinout += aNew->GetKineticEnergy(); 696 pSumBic += kt->Get4Momentum(); 638 697 if(kt->IsParticipant()) 639 698 { … … 655 714 } else 656 715 { 657 G4cout << "final un stable : ";716 G4cout << "final non stable : "; 658 717 } 659 718 G4cout <<kt->GetDefinition()->GetParticleName()<< G4endl; … … 666 725 } 667 726 // add precompound products to products 727 G4LorentzVector pSumPreco(0), pPreco(0); 668 728 if ( precompoundProducts ) 669 729 { … … 673 733 // boost back to system of moving nucleus 674 734 G4LorentzVector pProduct((*j)->GetMomentum(),(*j)->GetTotalEnergy()); 735 pPreco+= pProduct; 675 736 #ifdef debug_BIC_Propagate_finals 676 737 G4cout << " pProduct be4 boost " <<pProduct << G4endl; … … 680 741 G4cout << " pProduct aft boost " <<pProduct << G4endl; 681 742 #endif 743 pSumPreco += pProduct; 682 744 (*j)->SetTotalEnergy(pProduct.e()); 683 745 (*j)->SetMomentum(pProduct.vect()); … … 685 747 products->push_back(*j); 686 748 } 687 749 // G4cout << " unboosted preco result mom " << pPreco / MeV << " ..- fragmentMom " << (pPreco - pFragment)/MeV<< G4endl; 750 // G4cout << " preco result mom " << pSumPreco / MeV << " ..-file4Mom " << (pSumPreco - GetFinal4Momentum())/MeV<< G4endl; 688 751 precompoundProducts->clear(); 689 752 delete precompoundProducts; … … 740 803 nucleusMass = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(currentZ,currentA); 741 804 } 742 else if (currentZ==0 && currentA==1 ) 743 { 744 nucleusMass = G4Neutron::Neutron()->GetPDGMass(); 745 } 805 else if (currentZ==0 ) // Uzhi && currentA==1 ) // Uzhi 806 { // Uzhi 807 if(currentA == 1) {nucleusMass = G4Neutron::Neutron()->GetPDGMass();}// Uzhi 808 else {nucleusMass = GetFinalNucleusMomentum().mag() // Uzhi 809 - 3.*MeV*currentA;} // Uzhi 810 } // Uzhi 746 811 else 747 812 { … … 929 994 //---------------------------------------------------------------------------- 930 995 { 996 G4RKPropagation * RKprop=(G4RKPropagation *)thePropagator; 931 997 if ( secondary->GetTrackingMomentum().mag2() < -1.*eV ) 932 998 { … … 952 1018 } 953 1019 1020 // for barions, correct for fermi energy 1021 G4int PDGcode=std::abs(secondary->GetDefinition()->GetPDGEncoding()); 1022 if ( PDGcode > 1000 ) 1023 { 1024 G4double initial_Efermi = RKprop->GetField(G4Neutron::Neutron()->GetPDGEncoding(), 1025 secondary->GetPosition()); 1026 secondary->Update4Momentum(secondary->Get4Momentum().e() - initial_Efermi); 1027 } 1028 954 1029 #ifdef debug_BIC_FindCollision 955 1030 G4cout << "FindLateP Particle, 4-mom, times newState " … … 1019 1094 mom4Primary=primary->Get4Momentum(); 1020 1095 initial_Efermi=RKprop->GetField(primary->GetDefinition()->GetPDGEncoding(),primary->GetPosition()); 1096 1021 1097 if ( PDGcode > 1000 && PDGcode != 2112 && PDGcode != 2212 ) 1022 1098 { 1023 initial_Efermi = RKprop->GetField(G4Neutron::Neutron()->GetPDGEncoding(),primary->GetPosition()); 1099 initial_Efermi = RKprop->GetField(G4Neutron::Neutron()->GetPDGEncoding(), 1100 primary->GetPosition()); 1024 1101 primary->Update4Momentum(mom4Primary.e() - initial_Efermi); 1025 1102 } 1103 1026 1104 std::vector<G4KineticTrack *>::iterator titer; 1027 1105 for ( titer=target_collection.begin() ; titer!=target_collection.end(); ++titer) … … 1039 1117 1040 1118 #ifdef debug_BIC_ApplyCollision 1041 if ( !products ) 1119 G4bool havePion=false; 1120 for ( std::vector<G4KineticTrack *>::iterator i =products->begin(); i != products->end(); i++) 1121 { 1122 G4int PDGcode=std::abs((*i)->GetDefinition()->GetPDGEncoding()); 1123 if (std::abs(PDGcode)==211 || PDGcode==111 ) havePion=true; 1124 } 1125 if ( !products || havePion) 1042 1126 { 1043 G4cout << " Collision type: "<< typeid(*collision->GetGenerator()).name()1127 G4cout << " Collision " << collision << ", type: "<< typeid(*collision->GetGenerator()).name() 1044 1128 << ", with NO products! " <<G4endl; 1045 1129 G4cout << G4endl<<"Initial condition are these:"<<G4endl; … … 1123 1207 } 1124 1208 1125 #ifdef debug_BIC_ApplyCollision XX1126 DebugApplyColl sion(collision, products);1209 #ifdef debug_BIC_ApplyCollision 1210 DebugApplyCollision(collision, products); 1127 1211 #endif 1128 1212 … … 1231 1315 } 1232 1316 1233 //----------------------------------------------------------------------------1234 void G4BinaryCascade::DebugApplyCollision(G4CollisionInitialState * collision,1235 G4KineticTrackVector * products)1236 {1237 //**-------------------------begin debug Block---------------------------1238 1239 G4RKPropagation * RKprop=(G4RKPropagation *)thePropagator;1240 1241 G4KineticTrackVector debug1;1242 debug1.push_back(collision->GetPrimary());1243 PrintKTVector(&debug1,std::string(" Primary particle"));1244 PrintKTVector(&collision->GetTargetCollection(),std::string(" Target particles"));1245 PrintKTVector(products,std::string(" Scatterer products"));1246 1247 G4double thisExcitation(0);1248 // excitation energy from this collision1249 // initial state:1250 G4double initial(0);1251 G4KineticTrack * kt=collision->GetPrimary();1252 initial += kt->Get4Momentum().e();1253 1254 initial += RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition());1255 initial -= RKprop->GetBarrier(kt->GetDefinition()->GetPDGEncoding());1256 G4cout << "prim. E/field/Barr/Sum " << kt->Get4Momentum().e()1257 << " " << RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition())1258 << " " << RKprop->GetBarrier(kt->GetDefinition()->GetPDGEncoding())1259 << " " << initial << G4endl;;1260 1261 G4KineticTrackVector ktv=collision->GetTargetCollection();1262 for ( unsigned int it=0; it < ktv.size(); it++)1263 {1264 kt=ktv[it];1265 initial += kt->Get4Momentum().e();1266 thisExcitation += kt->GetDefinition()->GetPDGMass()1267 - kt->Get4Momentum().e()1268 - RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition());1269 // initial += RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition());1270 // initial -= RKprop->GetBarrier(kt->GetDefinition()->GetPDGEncoding());1271 G4cout << "Targ. def/E/field/Barr/Sum " << kt->GetDefinition()->GetPDGEncoding()1272 << " " << kt->Get4Momentum().e()1273 << " " << RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition())1274 << " " << RKprop->GetBarrier(kt->GetDefinition()->GetPDGEncoding())1275 << " " << initial <<" Excit " << thisExcitation << G4endl;;1276 }1277 1278 G4double final(0);1279 G4double mass_out(0);1280 G4int product_barions(0);1281 if ( products )1282 {1283 for ( unsigned int it=0; it < products->size(); it++)1284 {1285 kt=(*products)[it];1286 final += kt->Get4Momentum().e();1287 final += RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition());1288 final += RKprop->GetBarrier(kt->GetDefinition()->GetPDGEncoding());1289 if ( kt->GetDefinition()->GetBaryonNumber()==1 ) product_barions++;1290 mass_out += kt->GetDefinition()->GetPDGMass();1291 G4cout << "sec. def/E/field/Barr/Sum " << kt->GetDefinition()->GetPDGEncoding()1292 << " " << kt->Get4Momentum().e()1293 << " " << RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition())1294 << " " << RKprop->GetBarrier(kt->GetDefinition()->GetPDGEncoding())1295 << " " << final << G4endl;;1296 }1297 }1298 1299 1300 G4int finalA = currentA;1301 G4int finalZ = currentZ;1302 if ( products )1303 {1304 finalA -= product_barions;1305 finalZ -= GetTotalCharge(*products);1306 }1307 G4double delta = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(currentZ,currentA)1308 - (G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(finalZ,finalA)1309 + mass_out);1310 G4cout << " current/final a,z " << currentA << " " << currentZ << " "<< finalA<< " "<< finalZ1311 << " delta-mass " << delta<<G4endl;1312 final+=delta;1313 mass_out = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(finalZ,finalA);1314 G4cout << " initE/ E_out/ Mfinal/ Excit " << currentInitialEnergy1315 << " " << final << " "1316 << mass_out<<" "1317 << currentInitialEnergy - final - mass_out1318 << G4endl;1319 currentInitialEnergy-=final;1320 1321 //**-------------------------end debug Block---------------------------1322 1323 }1324 //----------------------------------------------------------------------------1325 1317 1326 1318 //---------------------------------------------------------------------------- … … 2706 2698 } 2707 2699 2708 2709 2710 2711 2712 2713 2714 2700 //---------------------------------------------------------------------------- 2701 void G4BinaryCascade::DebugApplyCollision(G4CollisionInitialState * collision, 2702 G4KineticTrackVector * products) 2703 { 2704 G4RKPropagation * RKprop=(G4RKPropagation *)thePropagator; 2705 2706 G4KineticTrackVector debug1; 2707 debug1.push_back(collision->GetPrimary()); 2708 PrintKTVector(&debug1,std::string(" Primary particle")); 2709 PrintKTVector(&collision->GetTargetCollection(),std::string(" Target particles")); 2710 PrintKTVector(products,std::string(" Scatterer products")); 2711 2712 G4double thisExcitation(0); 2713 // excitation energy from this collision 2714 // initial state: 2715 G4double initial(0); 2716 G4KineticTrack * kt=collision->GetPrimary(); 2717 initial += kt->Get4Momentum().e(); 2718 2719 initial += RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition()); 2720 initial -= RKprop->GetBarrier(kt->GetDefinition()->GetPDGEncoding()); 2721 G4cout << "prim. E/field/Barr/Sum " << kt->Get4Momentum().e() 2722 << " " << RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition()) 2723 << " " << RKprop->GetBarrier(kt->GetDefinition()->GetPDGEncoding()) 2724 << " " << initial << G4endl;; 2725 2726 G4KineticTrackVector ktv=collision->GetTargetCollection(); 2727 for ( unsigned int it=0; it < ktv.size(); it++) 2728 { 2729 kt=ktv[it]; 2730 initial += kt->Get4Momentum().e(); 2731 thisExcitation += kt->GetDefinition()->GetPDGMass() 2732 - kt->Get4Momentum().e() 2733 - RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition()); 2734 // initial += RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition()); 2735 // initial -= RKprop->GetBarrier(kt->GetDefinition()->GetPDGEncoding()); 2736 G4cout << "Targ. def/E/field/Barr/Sum " << kt->GetDefinition()->GetPDGEncoding() 2737 << " " << kt->Get4Momentum().e() 2738 << " " << RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition()) 2739 << " " << RKprop->GetBarrier(kt->GetDefinition()->GetPDGEncoding()) 2740 << " " << initial <<" Excit " << thisExcitation << G4endl;; 2741 } 2742 2743 G4double final(0); 2744 G4double mass_out(0); 2745 G4int product_barions(0); 2746 if ( products ) 2747 { 2748 for ( unsigned int it=0; it < products->size(); it++) 2749 { 2750 kt=(*products)[it]; 2751 final += kt->Get4Momentum().e(); 2752 final += RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition()); 2753 final += RKprop->GetBarrier(kt->GetDefinition()->GetPDGEncoding()); 2754 if ( kt->GetDefinition()->GetBaryonNumber()==1 ) product_barions++; 2755 mass_out += kt->GetDefinition()->GetPDGMass(); 2756 G4cout << "sec. def/E/field/Barr/Sum " << kt->GetDefinition()->GetPDGEncoding() 2757 << " " << kt->Get4Momentum().e() 2758 << " " << RKprop->GetField(kt->GetDefinition()->GetPDGEncoding(),kt->GetPosition()) 2759 << " " << RKprop->GetBarrier(kt->GetDefinition()->GetPDGEncoding()) 2760 << " " << final << G4endl;; 2761 } 2762 } 2763 2764 2765 G4int finalA = currentA; 2766 G4int finalZ = currentZ; 2767 if ( products ) 2768 { 2769 finalA -= product_barions; 2770 finalZ -= GetTotalCharge(*products); 2771 } 2772 G4double delta = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(currentZ,currentA) 2773 - (G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(finalZ,finalA) 2774 + mass_out); 2775 G4cout << " current/final a,z " << currentA << " " << currentZ << " "<< finalA<< " "<< finalZ 2776 << " delta-mass " << delta<<G4endl; 2777 final+=delta; 2778 mass_out = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(finalZ,finalA); 2779 G4cout << " initE/ E_out/ Mfinal/ Excit " << currentInitialEnergy 2780 << " " << final << " " 2781 << mass_out<<" " 2782 << currentInitialEnergy - final - mass_out 2783 << G4endl; 2784 currentInitialEnergy-=final; 2785 2786 } 2787 2788 //---------------------------------------------------------------------------- 2789 void G4BinaryCascade::DebugEpConservation(const G4HadProjectile & aTrack, 2790 G4ReactionProductVector* products) 2791 { 2792 G4ReactionProductVector::iterator iter; 2793 G4double Efinal(0); 2794 G4ThreeVector pFinal(0); 2795 if (std::abs(theParticleChange.GetWeightChange() -1 ) > 1e-5 ) 2796 { 2797 G4cout <<" BIC-weight change " << theParticleChange.GetWeightChange()<< G4endl; 2798 } 2799 2800 for(iter = products->begin(); iter != products->end(); ++iter) 2801 { 2802 2803 // G4cout << " Secondary E - Ekin / p " << 2804 // (*iter)->GetDefinition()->GetParticleName() << " " << 2805 // (*iter)->GetTotalEnergy() << " - " << 2806 // (*iter)->GetKineticEnergy()<< " / " << 2807 // (*iter)->GetMomentum().x() << " " << 2808 // (*iter)->GetMomentum().y() << " " << 2809 // (*iter)->GetMomentum().z() << G4endl; 2810 Efinal += (*iter)->GetTotalEnergy(); 2811 pFinal += (*iter)->GetMomentum(); 2812 } 2813 2814 // G4cout << "e outgoing/ total : " << Efinal << " " << Efinal+GetFinal4Momentum().e()<< G4endl; 2815 G4cout << "BIC E/p delta " << 2816 (aTrack.Get4Momentum().e()+ the3DNucleus->GetMass() - Efinal)/MeV << 2817 " MeV / mom " << (aTrack.Get4Momentum() - pFinal ) /MeV << G4endl; 2818 2819 } 2820 2821 //---------------------------------------------------------------------------- -
trunk/source/processes/hadronic/models/binary_cascade/src/G4BinaryLightIonReaction.cc
r962 r1196 38 38 #include <cmath> 39 39 40 G4BinaryLightIonReaction::G4BinaryLightIonReaction() 41 : G4HadronicInteraction("Binary Cascade"), theModel(), theHandler(), 42 theProjectileFragmentation(&theHandler) {} 40 G4BinaryLightIonReaction::G4BinaryLightIonReaction() 41 : G4HadronicInteraction("Binary Cascade"), theModel() , 42 theHandler(0) , theProjectileFragmentation(0) 43 { 44 theHandler= new G4ExcitationHandler; 45 SetPrecompound(new G4PreCompoundModel(theHandler)); 46 } 43 47 44 48 G4HadFinalState *G4BinaryLightIonReaction:: 45 49 ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus & targetNucleus ) 46 50 { 47 51 static G4int eventcounter=0; 48 52 eventcounter++; … … 118 122 // G4cout << "Fragment INFO "<< a1+a2 <<" "<<z1+z2<<" " 119 123 // << aL <<" "<<preFragDef->GetParticleName()<<G4endl; 120 cascaders = theProjectileFragmentation .DeExcite(aPreFrag);124 cascaders = theProjectileFragmentation->DeExcite(aPreFrag); 121 125 G4double tSum = 0; 122 126 for(size_t count = 0; count<cascaders->size(); count++) … … 402 406 resDef = G4ParticleTable::GetParticleTable()->FindIon(resZ,resA,0,resZ); 403 407 aProRes.SetParticleDefinition(resDef); 404 proFrag = theHandler .BreakItUp(aProRes);408 proFrag = theHandler->BreakItUp(aProRes); 405 409 if ( momentum.vect().mag() > momentum.e() ) 406 410 { -
trunk/source/processes/hadronic/models/binary_cascade/src/G4GeneratorPrecompoundInterface.cc
r819 r1196 31 31 // HPW, 10DEC 98, the decay part originally written by Gunter Folger in his FTF-test-program. 32 32 // 33 34 G4GeneratorPrecompoundInterface::G4GeneratorPrecompoundInterface() 35 : CaptureThreshold(80*MeV) 36 {} 33 37 34 38 G4HadFinalState* G4GeneratorPrecompoundInterface:: … … 51 55 result1=theSecondaries; 52 56 result=new G4KineticTrackVector(); 53 57 54 58 for (unsigned int aResult=0; aResult < result1->size(); aResult++) 55 59 { … … 101 105 theTotalResult->push_back(theNew); 102 106 } 103 else if(aTrack->Get4Momentum().t() - aTrack->Get4Momentum().mag()> 80*MeV)107 else if(aTrack->Get4Momentum().t() - aTrack->Get4Momentum().mag()>CaptureThreshold) 104 108 { 105 109 G4ReactionProduct * theNew = new G4ReactionProduct(aTrack->GetDefinition()); … … 143 147 theCurrentNucleon = theNucleus->GetNextNucleon(); 144 148 } 145 149 146 150 if(!theDeExcitation) 147 151 { … … 152 156 G4double residualMass = 153 157 G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(aZ ,anA); 154 residualMass += exEnergy; 158 residualMass += exEnergy; 159 155 160 G4LorentzVector exciton4Momentum(exciton3Momentum, 156 161 std::sqrt(exciton3Momentum.mag2()+residualMass*residualMass)); 157 162 158 163 anInitialState.SetA(anA); 159 164 anInitialState.SetZ(aZ); … … 167 172 const G4Fragment aFragment(anInitialState); 168 173 G4ReactionProductVector * aPreResult = theDeExcitation->DeExcite(aFragment); 169 // G4ReactionProductVector * aPreResult = new G4ReactionProductVector; 174 170 175 // fill pre-compound part into the result, and return 171 176 for(unsigned int ll=0; ll<aPreResult->size(); ll++) … … 186 191 } 187 192 193 G4double G4GeneratorPrecompoundInterface::SetCaptureThreshold(G4double value) 194 { 195 G4double old=CaptureThreshold; 196 CaptureThreshold=value; 197 return old; 198 199 } -
trunk/source/processes/hadronic/models/binary_cascade/src/G4KM_NucleonEqRhs.cc
r819 r1196 38 38 39 39 #include "G4KM_NucleonEqRhs.hh" 40 #include "G4NucleiPropertiesTable.hh"41 40 #include "G4VNuclearDensity.hh" 42 41 -
trunk/source/processes/hadronic/models/binary_cascade/src/G4NeutronField.cc
r819 r1196 37 37 // ------------------------------------------------------------------- 38 38 #include "G4NeutronField.hh" 39 #include "G4NucleiPropertiesTable.hh"40 39 #include "G4VNuclearDensity.hh" 41 40 #include "G4FermiMomentum.hh" -
trunk/source/processes/hadronic/models/binary_cascade/src/G4ProtonField.cc
r819 r1196 37 37 // ------------------------------------------------------------------- 38 38 #include "G4ProtonField.hh" 39 #include "G4NucleiPropertiesTable.hh"40 39 #include "G4VNuclearDensity.hh" 41 40 #include "G4FermiMomentum.hh" -
trunk/source/processes/hadronic/models/binary_cascade/src/G4RKPropagation.cc
r819 r1196 252 252 { 253 253 // reset momentum transfer to field 254 theMomentumTranfer= 0;254 theMomentumTranfer=G4ThreeVector(0,0,0); 255 255 256 256 // Loop over tracks … … 262 262 G4KineticTrack * kt = *i; 263 263 G4int encoding = kt->GetDefinition()->GetPDGEncoding(); 264 264 265 std::map <G4int, G4VNuclearField*, std::less<G4int> >::iterator fieldIter= theFieldMap->find(encoding); 265 266 … … 327 328 // GetField = Barrier + FermiPotential 328 329 G4double newE = kt->GetTrackingMomentum().e()-currentField->GetField(kt->GetPosition()); 329 // G4cout << " enter nucleus, E out/in: " << kt->GetTrackingMomentum().e() << " / " << newE <<G4endl; 330 // G4cout << " the Field "<< currentField->GetField(kt->GetPosition()) << " "<< kt->GetPosition()<<G4endl; 331 // G4cout << " the particle "<<kt->GetDefinition()->GetParticleName()<<G4endl; 330 332 331 if(newE <= kt->GetActualMass()) // the particle cannot enter the nucleus 333 332 { … … 350 349 kt->SetTrackingMomentum(new4Mom); 351 350 kt->SetState(G4KineticTrack::inside); 352 // G4cout <<" Enter Nucleus - E/Field/Sum: " <<kt->GetTrackingMomentum().e() << " / " 353 // << (*theFieldMap)[encoding]->GetField(kt->GetPosition()) << " / " 354 // << kt->GetTrackingMomentum().e()-currentField->GetField(kt->GetPosition()) 355 // << G4endl 356 // << " Barrier / field just inside nucleus (0.9999*kt->GetPosition())" 357 // << (*theFieldMap)[encoding]->GetBarrier() << " / " 358 // << (*theFieldMap)[encoding]->GetField(0.9999*kt->GetPosition()) 359 // << G4endl; 351 352 /* 353 G4cout <<" Enter Nucleus - E/Field/Sum: " <<kt->GetTrackingMomentum().e() << " / " 354 << (*theFieldMap)[encoding]->GetField(kt->GetPosition()) << " / " 355 << kt->GetTrackingMomentum().e()-currentField->GetField(kt->GetPosition()) 356 << G4endl 357 << " Barrier / field just inside nucleus (0.9999*kt->GetPosition())" 358 << (*theFieldMap)[encoding]->GetBarrier() << " / " 359 << (*theFieldMap)[encoding]->GetField(0.9999*kt->GetPosition()) 360 << G4endl; 361 */ 360 362 } 361 363 } … … 396 398 << G4endl << currentField->GetField(kt->GetPosition())<< G4endl 397 399 << kt->GetTrackingMomentum() 398 // << G4endl;400 << G4endl 399 401 << "delta p " << momold-kt->GetTrackingMomentum() << G4endl 400 402 << "del pos " << posold-kt->GetPosition() … … 483 485 } 484 486 485 486 487 487 } 488 488 … … 502 502 //---------------------------------------------------------------------------- 503 503 { 504 theMomentumTranfer= 0;504 theMomentumTranfer=G4ThreeVector(0,0,0); 505 505 // G4cout <<"Stepper input"<<kt->GetTrackingMomentum()<<G4endl; 506 506 // create the integrator stepper … … 538 538 } 539 539 /* 540 *G4cout <<" E/Field/Sum be4 : " <<mom.e() << " / "541 *<< (*theFieldMap)[encoding]->GetField(pos) << " / "542 *<< mom.e()+(*theFieldMap)[encoding]->GetField(pos)543 *<< G4endl;544 540 G4cout <<" E/Field/Sum be4 : " <<mom.e() << " / " 541 << (*theFieldMap)[encoding]->GetField(pos) << " / " 542 << mom.e()+(*theFieldMap)[encoding]->GetField(pos) 543 << G4endl; 544 */ 545 545 546 546 // Correct for momentum ( thus energy) transfered to nucleus, boost particle into moving nuclues frame.
Note: See TracChangeset
for help on using the changeset viewer.