Changeset 1228 for trunk/source/processes/hadronic/models/binary_cascade
- Timestamp:
- Jan 8, 2010, 11:56:51 AM (14 years ago)
- Location:
- trunk/source/processes/hadronic/models/binary_cascade
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/models/binary_cascade/History
r1196 r1228 13 13 * Please list in reverse chronological order (last date on top) 14 14 --------------------------------------------------------------- 15 16 4-Dec-2009, Gunter Folger had-binary-V09-02-06 17 - Bug fix in G4BinaryCascade::ApplyCollision; decay products outside 18 nucleus were nevertheless counted in currentZ/A as if these were within 19 nucleus. 15 20 16 21 13-Nov-2009, Gunter Folger had-binary-V09-02-05 -
trunk/source/processes/hadronic/models/binary_cascade/include/G4BinaryCascade.hh
r1196 r1228 1 1 // 2 2 // ******************************************************************** 3 3 // * License and Disclaimer * -
trunk/source/processes/hadronic/models/binary_cascade/src/G4BinaryCascade.cc
r1196 r1228 787 787 // get A and Z for the residual nucleus 788 788 #if defined(debug_G4BinaryCascade) || defined(debug_BIC_GetExcitationEnergy) 789 G4int finalA = theTargetList.size()+theCapturedList.size();790 G4int finalZ = GetTotalCharge(theTargetList)+GetTotalCharge(theCapturedList);791 if ( (currentA - finalA) != 0 || (currentZ - finalZ) != 0 )792 {793 794 << currentA << " " << finalA << " "<< currentZ << " " << finalZ << G4endl;795 }789 G4int finalA = theTargetList.size()+theCapturedList.size(); 790 G4int finalZ = GetTotalCharge(theTargetList)+GetTotalCharge(theCapturedList); 791 if ( (currentA - finalA) != 0 || (currentZ - finalZ) != 0 ) 792 { 793 G4cerr << "G4BIC:GetExcitationEnergy(): Nucleon counting error current/final{A,Z} " 794 << currentA << " " << finalA << " "<< currentZ << " " << finalZ << G4endl; 795 } 796 796 797 797 #endif … … 852 852 initialExc = theInitial4Mom.mag()- 853 853 G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(Z, A); 854 G4cout << " Initial nucleus A Z" << A << " " << Z<< initialExc << G4endl;854 G4cout << "GetExcitationEnergy: Initial nucleus A Z " << A << " " << Z << " " << initialExc << G4endl; 855 855 } 856 856 } … … 1081 1081 G4int initialBaryon(0); 1082 1082 G4int initialCharge(0); 1083 G4double initial_Efermi(0);1084 1083 G4LorentzVector mom4Primary(0); 1085 1084 … … 1090 1089 } 1091 1090 1092 // for primary resonances, subtract neutron ( = proton) field ( ie. add std::abs(field))1093 1091 G4int PDGcode=std::abs(primary->GetDefinition()->GetPDGEncoding()); 1094 1092 mom4Primary=primary->Get4Momentum(); 1095 initial_Efermi=RKprop->GetField(primary->GetDefinition()->GetPDGEncoding(),primary->GetPosition()); 1096 1097 if ( PDGcode > 1000 && PDGcode != 2112 && PDGcode != 2212 ) 1098 { 1099 initial_Efermi = RKprop->GetField(G4Neutron::Neutron()->GetPDGEncoding(), 1100 primary->GetPosition()); 1101 primary->Update4Momentum(mom4Primary.e() - initial_Efermi); 1102 } 1103 1104 std::vector<G4KineticTrack *>::iterator titer; 1105 for ( titer=target_collection.begin() ; titer!=target_collection.end(); ++titer) 1106 { 1107 G4ParticleDefinition * aDef=(*titer)->GetDefinition(); 1108 G4int aCode=aDef->GetPDGEncoding(); 1109 G4ThreeVector aPos=(*titer)->GetPosition(); 1110 initial_Efermi+= RKprop->GetField(aCode, aPos); 1111 // initial_Efermi+= RKprop->GetField((*titer)->GetDefinition()->GetPDGEncoding(),(*titer)->GetPosition()); 1093 1094 // for primary resonances, subtract neutron ( = proton) field ( ie. add std::abs(field)) 1095 G4double initial_Efermi(0); 1096 if (primary->GetState() == G4KineticTrack::inside ) { 1097 initial_Efermi=RKprop->GetField(primary->GetDefinition()->GetPDGEncoding(),primary->GetPosition()); 1098 1099 if ( PDGcode > 1000 && PDGcode != 2112 && PDGcode != 2212 ) 1100 { 1101 initial_Efermi = RKprop->GetField(G4Neutron::Neutron()->GetPDGEncoding(), 1102 primary->GetPosition()); 1103 primary->Update4Momentum(mom4Primary.e() - initial_Efermi); 1104 } 1105 1106 std::vector<G4KineticTrack *>::iterator titer; 1107 for ( titer=target_collection.begin() ; titer!=target_collection.end(); ++titer) 1108 { 1109 G4ParticleDefinition * aDef=(*titer)->GetDefinition(); 1110 G4int aCode=aDef->GetPDGEncoding(); 1111 G4ThreeVector aPos=(*titer)->GetPosition(); 1112 initial_Efermi+= RKprop->GetField(aCode, aPos); 1113 } 1112 1114 } 1113 1115 //**************************************** … … 1140 1142 G4bool lateParticleCollision= (!haveTarget) && products && products->size() == 1; 1141 1143 // if ( lateParticleCollision ) G4cout << " Added late particle--------------------------"<<G4endl; 1142 // if ( products ) PrintKTVector(products, " reaction products");1144 // if ( lateParticleCollision && products ) PrintKTVector(products, " reaction products"); 1143 1145 //**************************************** 1144 1146 … … 1172 1174 } 1173 1175 1174 G4double final_Efermi(0); 1175 G4KineticTrackVector resonances; 1176 for ( std::vector<G4KineticTrack *>::iterator i =products->begin(); i != products->end(); i++) 1177 { 1178 G4int PDGcode=std::abs((*i)->GetDefinition()->GetPDGEncoding()); 1179 // G4cout << " PDGcode, state " << PDGcode << " " << (*i)->GetState()<<G4endl; 1180 final_Efermi+=RKprop->GetField(PDGcode,(*i)->GetPosition()); 1181 if ( PDGcode > 1000 && PDGcode != 2112 && PDGcode != 2212 ) 1182 { 1183 resonances.push_back(*i); 1184 } 1185 } 1186 if ( resonances.size() > 0 ) 1187 { 1188 G4double delta_Fermi= (initial_Efermi-final_Efermi)/resonances.size(); 1189 for (std::vector<G4KineticTrack *>::iterator res=resonances.begin(); res != resonances.end(); res++) 1190 { 1191 G4LorentzVector mom=(*res)->Get4Momentum(); 1192 G4double mass2=mom.mag2(); 1193 G4double newEnergy=mom.e() + delta_Fermi; 1194 G4double newEnergy2= newEnergy*newEnergy; 1195 //G4cout << "mom = " << mom <<" newE " << newEnergy<< G4endl; 1196 if ( newEnergy2 < mass2 ) 1197 { 1198 ClearAndDestroy(products); 1199 if (target_collection.size() == 0 ) FindDecayCollision(primary); // for decay, sample new decay 1200 delete products; 1201 return false; 1202 } 1203 // G4cout << " correct resonance from /to " << mom.e() << " / " << newEnergy<< G4endl; 1204 G4ThreeVector mom3=std::sqrt(newEnergy2 - mass2) * mom.vect().unit(); 1205 (*res)->Set4Momentum(G4LorentzVector(mom3,newEnergy)); 1206 } 1207 } 1176 if (primary->GetState() == G4KineticTrack::inside ) { // if the primary was outside, nothing to correct 1177 G4double final_Efermi(0); 1178 G4KineticTrackVector resonances; 1179 for ( std::vector<G4KineticTrack *>::iterator i =products->begin(); i != products->end(); i++) 1180 { 1181 G4int PDGcode=std::abs((*i)->GetDefinition()->GetPDGEncoding()); 1182 // G4cout << " PDGcode, state " << PDGcode << " " << (*i)->GetState()<<G4endl; 1183 final_Efermi+=RKprop->GetField(PDGcode,(*i)->GetPosition()); 1184 if ( PDGcode > 1000 && PDGcode != 2112 && PDGcode != 2212 ) 1185 { 1186 resonances.push_back(*i); 1187 } 1188 } 1189 if ( resonances.size() > 0 ) 1190 { 1191 G4double delta_Fermi= (initial_Efermi-final_Efermi)/resonances.size(); 1192 for (std::vector<G4KineticTrack *>::iterator res=resonances.begin(); res != resonances.end(); res++) 1193 { 1194 G4LorentzVector mom=(*res)->Get4Momentum(); 1195 G4double mass2=mom.mag2(); 1196 G4double newEnergy=mom.e() + delta_Fermi; 1197 G4double newEnergy2= newEnergy*newEnergy; 1198 //G4cout << "mom = " << mom <<" newE " << newEnergy<< G4endl; 1199 if ( newEnergy2 < mass2 ) 1200 { 1201 ClearAndDestroy(products); 1202 if (target_collection.size() == 0 ) FindDecayCollision(primary); // for decay, sample new decay 1203 delete products; 1204 return false; 1205 } 1206 // G4cout << " correct resonance from /to " << mom.e() << " / " << newEnergy<< G4endl; 1207 G4ThreeVector mom3=std::sqrt(newEnergy2 - mass2) * mom.vect().unit(); 1208 (*res)->Set4Momentum(G4LorentzVector(mom3,newEnergy)); 1209 } 1210 } 1211 } 1208 1212 1209 1213 #ifdef debug_BIC_ApplyCollision … … 1218 1222 if ( ! lateParticleCollision ) 1219 1223 { 1220 (*i)->SetState(primary->GetState()); // secondaries are created inside nucleus, except for decay in propagate 1221 finalBaryon+=(*i)->GetDefinition()->GetBaryonNumber(); 1222 finalCharge+=G4lrint((*i)->GetDefinition()->GetPDGCharge()); 1224 (*i)->SetState(primary->GetState()); // decay may be anywhere! 1225 if ( (*i)->GetState() == G4KineticTrack::inside ){ 1226 finalBaryon+=(*i)->GetDefinition()->GetBaryonNumber(); 1227 finalCharge+=G4lrint((*i)->GetDefinition()->GetPDGCharge()); 1228 } 1223 1229 } else { 1224 1230 G4double tin=0., tout=0.; … … 1247 1253 } 1248 1254 1249 //G4cout << " PDGcode, state " << (*i)->GetDefinition()->GetPDGEncoding() << " " << (*i)->GetState()<<G4endl;1255 //G4cout << " PDGcode, state " << (*i)->GetDefinition()->GetPDGEncoding() << " " << (*i)->GetState()<<G4endl; 1250 1256 1251 1257 } … … 1269 1275 currentA += finalBaryon-initialBaryon; 1270 1276 currentZ += finalCharge-initialCharge; 1271 //G4cout << " currentA, Z aft: " << currentA << " " << currentZ << G4endl;1277 //G4cout << " ApplyCollision currentA, Z aft: " << currentA << " " << currentZ << G4endl; 1272 1278 1273 1279 G4KineticTrackVector oldSecondaries; … … 2351 2357 G4cerr << "G4BinaryCascade::GetFinal4Momentum - Fatal"<<G4endl; 2352 2358 G4KineticTrackVector::iterator i; 2353 G4cerr <<" Initial nucleus "<<theInitial4Mom<<G4endl;2359 G4cerr <<" GetFinal4Momentum: Initial nucleus "<<theInitial4Mom<<G4endl; 2354 2360 for(i = theProjectileList.begin() ; i != theProjectileList.end(); ++i) 2355 2361 {
Note: See TracChangeset
for help on using the changeset viewer.