#include <G4InelasticInteraction.hh>
Inheritance diagram for G4InelasticInteraction:
Public Member Functions | |
G4InelasticInteraction (const G4String &name="LEInelastic") | |
virtual | ~G4InelasticInteraction () |
void | RegisterIsotopeProductionModel (G4VIsotopeProduction *aModel) |
void | TurnOnIsotopeProduction () |
virtual const std::pair< G4double, G4double > | GetFatalEnergyCheckLevels () const |
Static Public Member Functions | |
static G4IsoParticleChange * | GetIsotopeProductionInfo () |
Protected Member Functions | |
G4double | Pmltpc (G4int np, G4int nm, G4int nz, G4int n, G4double b, G4double c) |
G4bool | MarkLeadingStrangeParticle (const G4ReactionProduct ¤tParticle, const G4ReactionProduct &targetParticle, G4ReactionProduct &leadParticle) |
void | SetUpPions (const G4int np, const G4int nm, const G4int nz, G4FastVector< G4ReactionProduct, GHADLISTSIZE > &vec, G4int &vecLen) |
void | Rotate (G4FastVector< G4ReactionProduct, GHADLISTSIZE > &vec, G4int &vecLen) |
void | GetNormalizationConstant (const G4double availableEnergy, G4double &n, G4double &anpn) |
void | CalculateMomenta (G4FastVector< G4ReactionProduct, GHADLISTSIZE > &vec, G4int &vecLen, const G4HadProjectile *originalIncident, const G4DynamicParticle *originalTarget, G4ReactionProduct &modifiedOriginal, G4Nucleus &targetNucleus, G4ReactionProduct ¤tParticle, G4ReactionProduct &targetParticle, G4bool &incidentHasChanged, G4bool &targetHasChanged, G4bool quasiElastic) |
void | SetUpChange (G4FastVector< G4ReactionProduct, GHADLISTSIZE > &vec, G4int &vecLen, G4ReactionProduct ¤tParticle, G4ReactionProduct &targetParticle, G4bool &incidentHasChanged) |
void | DoIsotopeCounting (const G4HadProjectile *theProjectile, const G4Nucleus &aNucleus) |
G4IsoResult * | ExtractResidualNucleus (const G4Nucleus &aNucleus) |
Protected Attributes | |
G4bool | isotopeProduction |
G4ReactionDynamics | theReactionDynamics |
Definition at line 61 of file G4InelasticInteraction.hh.
G4InelasticInteraction::G4InelasticInteraction | ( | const G4String & | name = "LEInelastic" |
) |
Definition at line 55 of file G4InelasticInteraction.cc.
00056 : G4HadronicInteraction(name), isotopeProduction(false), cache(0.0) 00057 {}
G4InelasticInteraction::~G4InelasticInteraction | ( | ) | [virtual] |
void G4InelasticInteraction::CalculateMomenta | ( | G4FastVector< G4ReactionProduct, GHADLISTSIZE > & | vec, | |
G4int & | vecLen, | |||
const G4HadProjectile * | originalIncident, | |||
const G4DynamicParticle * | originalTarget, | |||
G4ReactionProduct & | modifiedOriginal, | |||
G4Nucleus & | targetNucleus, | |||
G4ReactionProduct & | currentParticle, | |||
G4ReactionProduct & | targetParticle, | |||
G4bool & | incidentHasChanged, | |||
G4bool & | targetHasChanged, | |||
G4bool | quasiElastic | |||
) | [protected] |
Definition at line 186 of file G4InelasticInteraction.cc.
References G4Nucleus::AnnihilationEvaporationEffects(), G4Nucleus::Cinema(), G4cout, G4UniformRand, G4ReactionDynamics::GenerateXandPt(), G4HadProjectile::Get4Momentum(), G4Nucleus::GetA_asInt(), G4DynamicParticle::GetDefinition(), G4HadProjectile::GetDefinition(), G4ReactionProduct::GetKineticEnergy(), G4HadProjectile::GetKineticEnergy(), G4ReactionProduct::GetMass(), G4ReactionProduct::GetMomentum(), G4ParticleDefinition::GetPDGEncoding(), G4ParticleDefinition::GetPDGMass(), G4ReactionProduct::GetTotalMomentum(), G4FastVector< Type, N >::Initialize(), G4KaonMinus::KaonMinus(), G4KaonPlus::KaonPlus(), G4KaonZeroLong::KaonZeroLong(), G4KaonZeroShort::KaonZeroShort(), MarkLeadingStrangeParticle(), G4InuclParticleNames::pp, G4ReactionDynamics::ProduceStrangeParticlePairs(), G4HadReentrentException::Report(), Rotate(), G4FastVector< Type, N >::SetElement(), G4ReactionProduct::SetKineticEnergy(), G4ReactionProduct::SetMomentum(), G4ReactionDynamics::SuppressChargedPions(), theReactionDynamics, G4ReactionDynamics::TwoBody(), and G4ReactionDynamics::TwoCluster().
Referenced by G4LEXiZeroInelastic::ApplyYourself(), G4LEXiMinusInelastic::ApplyYourself(), G4LESigmaPlusInelastic::ApplyYourself(), G4LESigmaMinusInelastic::ApplyYourself(), G4LEProtonInelastic::ApplyYourself(), G4LEPionPlusInelastic::ApplyYourself(), G4LEPionMinusInelastic::ApplyYourself(), G4LEOmegaMinusInelastic::ApplyYourself(), G4LENeutronInelastic::ApplyYourself(), G4LELambdaInelastic::ApplyYourself(), G4LEKaonZeroInelastic::ApplyYourself(), G4LEKaonPlusInelastic::ApplyYourself(), G4LEKaonMinusInelastic::ApplyYourself(), G4LEAntiXiZeroInelastic::ApplyYourself(), G4LEAntiXiMinusInelastic::ApplyYourself(), G4LEAntiSigmaPlusInelastic::ApplyYourself(), G4LEAntiSigmaMinusInelastic::ApplyYourself(), G4LEAntiProtonInelastic::ApplyYourself(), G4LEAntiOmegaMinusInelastic::ApplyYourself(), G4LEAntiNeutronInelastic::ApplyYourself(), G4LEAntiLambdaInelastic::ApplyYourself(), and G4LEAntiKaonZeroInelastic::ApplyYourself().
00198 { 00199 cache = 0; 00200 what = originalIncident->Get4Momentum().vect(); 00201 00202 theReactionDynamics.ProduceStrangeParticlePairs(vec, vecLen, modifiedOriginal, 00203 originalTarget, currentParticle, 00204 targetParticle, incidentHasChanged, 00205 targetHasChanged); 00206 00207 if (quasiElastic) { 00208 theReactionDynamics.TwoBody(vec, vecLen, 00209 modifiedOriginal, originalTarget, 00210 currentParticle, targetParticle, 00211 targetNucleus, targetHasChanged); 00212 return; 00213 } 00214 G4ReactionProduct leadingStrangeParticle; 00215 G4bool leadFlag = MarkLeadingStrangeParticle(currentParticle, 00216 targetParticle, 00217 leadingStrangeParticle); 00218 00219 // Note: the number of secondaries can be reduced in GenerateXandPt and TwoCluster 00220 G4bool finishedGenXPt = false; 00221 G4bool annihilation = false; 00222 if( originalIncident->GetDefinition()->GetPDGEncoding() < 0 && 00223 currentParticle.GetMass() == 0.0 && targetParticle.GetMass() == 0.0 ) 00224 { 00225 // original was an anti-particle and annihilation has taken place 00226 annihilation = true; 00227 G4double ekcor = 1.0; 00228 G4double ek = originalIncident->GetKineticEnergy(); 00229 G4double ekOrg = ek; 00230 00231 const G4double tarmas = originalTarget->GetDefinition()->GetPDGMass(); 00232 if( ek > 1.0*GeV )ekcor = 1./(ek/GeV); 00233 const G4double atomicWeight = targetNucleus.GetA_asInt(); 00234 ek = 2*tarmas + ek*(1.+ekcor/atomicWeight); 00235 G4double tkin = targetNucleus.Cinema(ek); 00236 ek += tkin; 00237 ekOrg += tkin; 00238 // modifiedOriginal.SetKineticEnergy( ekOrg ); 00239 // 00240 // evaporation -- re-calculate black track energies 00241 // this was Done already just before the cascade 00242 // 00243 tkin = targetNucleus.AnnihilationEvaporationEffects(ek, ekOrg); 00244 ekOrg -= tkin; 00245 ekOrg = std::max( 0.0001*GeV, ekOrg ); 00246 modifiedOriginal.SetKineticEnergy( ekOrg ); 00247 G4double amas = originalIncident->GetDefinition()->GetPDGMass(); 00248 G4double et = ekOrg + amas; 00249 G4double p = std::sqrt( std::abs(et*et-amas*amas) ); 00250 G4double pp = modifiedOriginal.GetMomentum().mag(); 00251 if( pp > 0.0 ) 00252 { 00253 G4ThreeVector momentum = modifiedOriginal.GetMomentum(); 00254 modifiedOriginal.SetMomentum( momentum * (p/pp) ); 00255 } 00256 if( ekOrg <= 0.0001 ) 00257 { 00258 modifiedOriginal.SetKineticEnergy( 0.0 ); 00259 modifiedOriginal.SetMomentum( 0.0, 0.0, 0.0 ); 00260 } 00261 } 00262 const G4double twsup[] = { 1.0, 0.7, 0.5, 0.3, 0.2, 0.1 }; 00263 G4double rand1 = G4UniformRand(); 00264 G4double rand2 = G4UniformRand(); 00265 00266 // Cache current, target, and secondaries 00267 G4ReactionProduct saveCurrent = currentParticle; 00268 G4ReactionProduct saveTarget = targetParticle; 00269 std::vector<G4ReactionProduct> savevec; 00270 for (G4int i = 0; i < vecLen; i++) savevec.push_back(*vec[i]); 00271 00272 if (annihilation || 00273 vecLen >= 6 || 00274 ( modifiedOriginal.GetKineticEnergy()/GeV >= 1.0 && 00275 ( ( (originalIncident->GetDefinition() == G4KaonPlus::KaonPlus() || 00276 originalIncident->GetDefinition() == G4KaonMinus::KaonMinus() || 00277 originalIncident->GetDefinition() == G4KaonZeroLong::KaonZeroLong() || 00278 originalIncident->GetDefinition() == G4KaonZeroShort::KaonZeroShort() ) 00279 && 00280 rand1 < 0.5 ) 00281 || rand2 > twsup[vecLen] ) ) ) 00282 00283 finishedGenXPt = 00284 theReactionDynamics.GenerateXandPt( vec, vecLen, 00285 modifiedOriginal, originalIncident, 00286 currentParticle, targetParticle, 00287 originalTarget, 00288 targetNucleus, incidentHasChanged, 00289 targetHasChanged, leadFlag, 00290 leadingStrangeParticle ); 00291 if( finishedGenXPt ) 00292 { 00293 Rotate(vec, vecLen); 00294 return; 00295 } 00296 00297 G4bool finishedTwoClu = false; 00298 if( modifiedOriginal.GetTotalMomentum()/MeV < 1.0 ) 00299 { 00300 for(G4int i=0; i<vecLen; i++) delete vec[i]; 00301 vecLen = 0; 00302 } 00303 else 00304 { 00305 // Occaisionally, GenerateXandPt will fail in the annihilation channel. 00306 // Restore current, target and secondaries to pre-GenerateXandPt state 00307 // before trying annihilation in TwoCluster 00308 00309 if (!finishedGenXPt && annihilation) { 00310 currentParticle = saveCurrent; 00311 targetParticle = saveTarget; 00312 for (G4int i = 0; i < vecLen; i++) delete vec[i]; 00313 vecLen = 0; 00314 vec.Initialize( 0 ); 00315 for (G4int i = 0; i < G4int(savevec.size()); i++) { 00316 G4ReactionProduct* p = new G4ReactionProduct; 00317 *p = savevec[i]; 00318 vec.SetElement( vecLen++, p ); 00319 } 00320 } 00321 00322 theReactionDynamics.SuppressChargedPions( vec, vecLen, 00323 modifiedOriginal, currentParticle, 00324 targetParticle, targetNucleus, 00325 incidentHasChanged, targetHasChanged ); 00326 try 00327 { 00328 finishedTwoClu = theReactionDynamics.TwoCluster( vec, vecLen, 00329 modifiedOriginal, originalIncident, 00330 currentParticle, targetParticle, 00331 originalTarget, 00332 targetNucleus, incidentHasChanged, 00333 targetHasChanged, leadFlag, 00334 leadingStrangeParticle ); 00335 } 00336 catch(G4HadReentrentException aC) 00337 { 00338 aC.Report(G4cout); 00339 throw G4HadReentrentException(__FILE__, __LINE__, "Failing to calculate momenta"); 00340 } 00341 } 00342 00343 if (finishedTwoClu) { 00344 Rotate(vec, vecLen); 00345 return; 00346 } 00347 00348 theReactionDynamics.TwoBody(vec, vecLen, modifiedOriginal, originalTarget, 00349 currentParticle, targetParticle, 00350 targetNucleus, targetHasChanged); 00351 }
void G4InelasticInteraction::DoIsotopeCounting | ( | const G4HadProjectile * | theProjectile, | |
const G4Nucleus & | aNucleus | |||
) | [protected] |
Definition at line 454 of file G4InelasticInteraction.cc.
References ExtractResidualNucleus(), G4HadProjectile::GetDefinition(), G4HadProjectile::GetGlobalTime(), G4IsoResult::GetIsotope(), G4IsoResult::GetMotherNucleus(), G4IsoParticleChange::SetIsotope(), G4IsoParticleChange::SetMotherNucleus(), G4IsoParticleChange::SetParentParticle(), G4IsoParticleChange::SetProducer(), and G4IsoParticleChange::SetProductionTime().
Referenced by G4LEXiZeroInelastic::ApplyYourself(), G4LEXiMinusInelastic::ApplyYourself(), G4LETritonInelastic::ApplyYourself(), G4LESigmaPlusInelastic::ApplyYourself(), G4LESigmaMinusInelastic::ApplyYourself(), G4LEProtonInelastic::ApplyYourself(), G4LEPionPlusInelastic::ApplyYourself(), G4LEPionMinusInelastic::ApplyYourself(), G4LEOmegaMinusInelastic::ApplyYourself(), G4LENeutronInelastic::ApplyYourself(), G4LELambdaInelastic::ApplyYourself(), G4LEKaonZeroInelastic::ApplyYourself(), G4LEKaonPlusInelastic::ApplyYourself(), G4LEKaonMinusInelastic::ApplyYourself(), G4LEDeuteronInelastic::ApplyYourself(), G4LEAntiXiZeroInelastic::ApplyYourself(), G4LEAntiXiMinusInelastic::ApplyYourself(), G4LEAntiSigmaPlusInelastic::ApplyYourself(), G4LEAntiSigmaMinusInelastic::ApplyYourself(), G4LEAntiProtonInelastic::ApplyYourself(), G4LEAntiOmegaMinusInelastic::ApplyYourself(), G4LEAntiNeutronInelastic::ApplyYourself(), G4LEAntiLambdaInelastic::ApplyYourself(), G4LEAntiKaonZeroInelastic::ApplyYourself(), and G4LEAlphaInelastic::ApplyYourself().
00456 { 00457 delete theOldIsoResult; 00458 theOldIsoResult = 0; 00459 delete theIsoResult; 00460 theIsoResult = new G4IsoParticleChange; 00461 G4IsoResult* anIsoResult = 0; 00462 G4int nModels = theProductionModels.size(); 00463 if (nModels > 0) { 00464 for (G4int i = 0; i < nModels; i++) { 00465 anIsoResult = theProductionModels[i]->GetIsotope(theProjectile, aNucleus); 00466 if (anIsoResult) break; // accept first result 00467 } 00468 if (!anIsoResult) anIsoResult = ExtractResidualNucleus(aNucleus); 00469 } else { 00470 // No production models active, use default iso production 00471 anIsoResult = ExtractResidualNucleus(aNucleus); 00472 } 00473 00474 /* 00475 G4cout << " contents of anIsoResult (from ExtractResidualNucleus) " << G4endl; 00476 G4cout << " original projectile: " 00477 << theProjectile->GetDefinition()->GetParticleName() << G4endl; 00478 G4cout << " mother nucleus: " 00479 << anIsoResult->GetMotherNucleus().GetA_asInt() << "," 00480 << anIsoResult->GetMotherNucleus().GetZ_asInt() << G4endl; 00481 G4cout << " extracted nucleus = " << anIsoResult->GetIsotope() << G4endl; 00482 G4cout << " end contents of anIsoResult " << G4endl; 00483 */ 00484 // Add all info explicitly and add typename from model called. 00485 theIsoResult->SetIsotope(anIsoResult->GetIsotope()); 00486 theIsoResult->SetProductionTime(theProjectile->GetGlobalTime() ); 00487 theIsoResult->SetParentParticle(theProjectile->GetDefinition() ); 00488 theIsoResult->SetMotherNucleus(anIsoResult->GetMotherNucleus()); 00489 theIsoResult->SetProducer(this->GetModelName() ); 00490 00491 delete anIsoResult; 00492 00493 // If isotope production is enabled the GetIsotopeProductionInfo() 00494 // method must be called or else a memory leak will result 00495 // 00496 // The following code will fix the memory leak, but remove the 00497 // isotope information: 00498 // 00499 // if(theIsoResult) { 00500 // delete theIsoResult; 00501 // theIsoResult = 0; 00502 // } 00503 }
G4IsoResult * G4InelasticInteraction::ExtractResidualNucleus | ( | const G4Nucleus & | aNucleus | ) | [protected] |
Definition at line 507 of file G4InelasticInteraction.cc.
References G4Nucleus::GetA_asInt(), G4ParticleDefinition::GetBaryonNumber(), G4HadFinalState::GetNumberOfSecondaries(), G4HadSecondary::GetParticle(), G4DynamicParticle::GetParticleDefinition(), G4ParticleDefinition::GetPDGCharge(), G4HadFinalState::GetSecondary(), G4Nucleus::GetZ_asInt(), and G4HadronicInteraction::theParticleChange.
Referenced by DoIsotopeCounting().
00508 { 00509 G4double A = aNucleus.GetA_asInt(); 00510 G4double Z = aNucleus.GetZ_asInt(); 00511 G4double bufferA = 0; 00512 G4double bufferZ = 0; 00513 00514 // Loop over theParticleChange, decrement A, Z accordingly, and 00515 // cache the largest fragment 00516 for (G4int i = 0; i < theParticleChange.GetNumberOfSecondaries(); ++i) { 00517 G4HadSecondary* aSecTrack = theParticleChange.GetSecondary(i); 00518 const G4ParticleDefinition* part = aSecTrack->GetParticle()->GetParticleDefinition(); 00519 G4double Q = part->GetPDGCharge()/eplus; 00520 G4double BN = part->GetBaryonNumber(); 00521 if (bufferA < BN) { 00522 bufferA = BN; 00523 bufferZ = Q; 00524 } 00525 Z -= Q; 00526 A -= BN; 00527 } 00528 00529 // if the fragment was part of the final state, it is 00530 // assumed to be the heaviest secondary. 00531 if (A < 0.1) { 00532 A = bufferA; 00533 Z = bufferZ; 00534 } 00535 00536 // Prepare the IsoResult 00537 std::ostringstream ost1; 00538 ost1 << Z << "_" << A; 00539 G4String biff = ost1.str(); 00540 G4IsoResult* theResult = new G4IsoResult(biff, aNucleus); 00541 00542 return theResult; 00543 }
const std::pair< G4double, G4double > G4InelasticInteraction::GetFatalEnergyCheckLevels | ( | ) | const [virtual] |
Reimplemented from G4HadronicInteraction.
Definition at line 545 of file G4InelasticInteraction.cc.
00546 { 00547 // max energy non-conservation is mass of heavy nucleus 00548 return std::pair<G4double, G4double>(5*perCent,250*GeV); 00549 }
G4IsoParticleChange * G4InelasticInteraction::GetIsotopeProductionInfo | ( | ) | [static] |
Definition at line 444 of file G4InelasticInteraction.cc.
00445 { 00446 G4IsoParticleChange* anIsoResult = theIsoResult; 00447 if(theIsoResult) theOldIsoResult = theIsoResult; 00448 theIsoResult = 0; 00449 return anIsoResult; 00450 }
void G4InelasticInteraction::GetNormalizationConstant | ( | const G4double | availableEnergy, | |
G4double & | n, | |||
G4double & | anpn | |||
) | [protected] |
Definition at line 143 of file G4InelasticInteraction.cc.
References G4INCL::Math::pi.
00147 { 00148 const G4double expxu = 82.; // upper bound for arg. of exp 00149 const G4double expxl = -expxu; // lower bound for arg. of exp 00150 const G4int numSec = 60; 00151 // 00152 // the only difference between the calculation for annihilation channels 00153 // and normal is the starting value, iBegin, for the loop below 00154 // 00155 G4int iBegin = 1; 00156 G4double en = energy; 00157 if( energy < 0.0 ) 00158 { 00159 iBegin = 2; 00160 en *= -1.0; 00161 } 00162 // 00163 // number of total particles vs. centre of mass Energy - 2*proton mass 00164 // 00165 G4double aleab = std::log(en/GeV); 00166 n = 3.62567 + aleab*(0.665843 + aleab*(0.336514 + aleab*(0.117712 + 0.0136912*aleab))); 00167 n -= 2.0; 00168 // 00169 // normalization constant for kno-distribution 00170 // 00171 anpn = 0.0; 00172 G4double test, temp; 00173 for( G4int i=iBegin; i<=numSec; ++i ) 00174 { 00175 temp = pi*i/(2.0*n*n); 00176 test = std::exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(i*i)/(n*n) ) ) ); 00177 if( temp < 1.0 ) 00178 { 00179 if( test >= 1.0e-10 )anpn += temp*test; 00180 } 00181 else 00182 anpn += temp*test; 00183 } 00184 }
G4bool G4InelasticInteraction::MarkLeadingStrangeParticle | ( | const G4ReactionProduct & | currentParticle, | |
const G4ReactionProduct & | targetParticle, | |||
G4ReactionProduct & | leadParticle | |||
) | [protected] |
Definition at line 83 of file G4InelasticInteraction.cc.
References G4ReactionProduct::GetDefinition(), G4ReactionProduct::GetMass(), G4ParticleDefinition::GetPDGMass(), G4KaonPlus::KaonPlus(), G4Neutron::Neutron(), and G4Proton::Proton().
Referenced by CalculateMomenta().
00087 { 00088 // the following was in GenerateXandPt and TwoCluster 00089 // add a parameter to the GenerateXandPt function telling it about the strange particle 00090 // 00091 // assumes that the original particle was a strange particle 00092 // 00093 G4bool lead = false; 00094 if ((currentParticle.GetMass() >= G4KaonPlus::KaonPlus()->GetPDGMass()) && 00095 (currentParticle.GetDefinition() != G4Proton::Proton()) && 00096 (currentParticle.GetDefinition() != G4Neutron::Neutron()) ) { 00097 lead = true; 00098 leadParticle = currentParticle; // set lead to the incident particle 00099 00100 } else if ((targetParticle.GetMass() >= G4KaonPlus::KaonPlus()->GetPDGMass()) && 00101 (targetParticle.GetDefinition() != G4Proton::Proton()) && 00102 (targetParticle.GetDefinition() != G4Neutron::Neutron() ) ) { 00103 lead = true; 00104 leadParticle = targetParticle; // set lead to the target particle 00105 } 00106 00107 return lead; 00108 }
G4double G4InelasticInteraction::Pmltpc | ( | G4int | np, | |
G4int | nm, | |||
G4int | nz, | |||
G4int | n, | |||
G4double | b, | |||
G4double | c | |||
) | [protected] |
Definition at line 64 of file G4InelasticInteraction.cc.
00066 { 00067 const G4double expxu = 82.; // upper bound for arg. of exp 00068 const G4double expxl = -expxu; // lower bound for arg. of exp 00069 G4double npf = 0.0; 00070 G4double nmf = 0.0; 00071 G4double nzf = 0.0; 00072 G4int i; 00073 for (i = 2; i <= npos; i++) npf += std::log((G4double)i); 00074 for (i = 2; i <= nneg; i++) nmf += std::log((G4double)i); 00075 for (i = 2; i <= nzero; i++) nzf += std::log((G4double)i); 00076 G4double r = std::min(expxu, std::max(expxl, 00077 -(npos-nneg+nzero+b)*(npos-nneg+nzero+b)/(2*c*c*n*n) 00078 - npf - nmf - nzf ) ); 00079 return std::exp(r); 00080 }
void G4InelasticInteraction::RegisterIsotopeProductionModel | ( | G4VIsotopeProduction * | aModel | ) | [inline] |
void G4InelasticInteraction::Rotate | ( | G4FastVector< G4ReactionProduct, GHADLISTSIZE > & | vec, | |
G4int & | vecLen | |||
) | [protected] |
Definition at line 354 of file G4InelasticInteraction.cc.
References G4UniformRand, and G4INCL::Math::pi.
Referenced by CalculateMomenta().
00356 { 00357 G4double rotation = 2.*pi*G4UniformRand(); 00358 cache = rotation; 00359 G4int i; 00360 for (i = 0; i < vecLen; ++i) { 00361 G4ThreeVector momentum = vec[i]->GetMomentum(); 00362 momentum = momentum.rotate(rotation, what); 00363 vec[i]->SetMomentum(momentum); 00364 } 00365 }
void G4InelasticInteraction::SetUpChange | ( | G4FastVector< G4ReactionProduct, GHADLISTSIZE > & | vec, | |
G4int & | vecLen, | |||
G4ReactionProduct & | currentParticle, | |||
G4ReactionProduct & | targetParticle, | |||
G4bool & | incidentHasChanged | |||
) | [protected] |
Definition at line 368 of file G4InelasticInteraction.cc.
References G4HadFinalState::AddSecondary(), G4HadFinalState::Clear(), DBL_MIN, G4UniformRand, G4ReactionProduct::GetDefinition(), G4ReactionProduct::GetKineticEnergy(), G4ReactionProduct::GetMass(), G4ReactionProduct::GetMomentum(), G4KaonZeroLong::KaonZeroLong(), G4KaonZeroShort::KaonZeroShort(), G4DynamicParticle::SetDefinition(), G4ReactionProduct::SetDefinition(), G4HadFinalState::SetEnergyChange(), G4DynamicParticle::SetMomentum(), G4HadFinalState::SetMomentumChange(), G4HadFinalState::SetStatusChange(), stopAndKill, and G4HadronicInteraction::theParticleChange.
Referenced by G4LEXiZeroInelastic::ApplyYourself(), G4LEXiMinusInelastic::ApplyYourself(), G4LESigmaPlusInelastic::ApplyYourself(), G4LESigmaMinusInelastic::ApplyYourself(), G4LEProtonInelastic::ApplyYourself(), G4LEPionPlusInelastic::ApplyYourself(), G4LEPionMinusInelastic::ApplyYourself(), G4LEOmegaMinusInelastic::ApplyYourself(), G4LENeutronInelastic::ApplyYourself(), G4LELambdaInelastic::ApplyYourself(), G4LEKaonZeroInelastic::ApplyYourself(), G4LEKaonPlusInelastic::ApplyYourself(), G4LEKaonMinusInelastic::ApplyYourself(), G4LEAntiXiZeroInelastic::ApplyYourself(), G4LEAntiXiMinusInelastic::ApplyYourself(), G4LEAntiSigmaPlusInelastic::ApplyYourself(), G4LEAntiSigmaMinusInelastic::ApplyYourself(), G4LEAntiProtonInelastic::ApplyYourself(), G4LEAntiOmegaMinusInelastic::ApplyYourself(), G4LEAntiNeutronInelastic::ApplyYourself(), G4LEAntiLambdaInelastic::ApplyYourself(), and G4LEAntiKaonZeroInelastic::ApplyYourself().
00374 { 00375 theParticleChange.Clear(); 00376 G4ParticleDefinition* aKaonZL = G4KaonZeroLong::KaonZeroLong(); 00377 G4ParticleDefinition* aKaonZS = G4KaonZeroShort::KaonZeroShort(); 00378 G4int i; 00379 if (currentParticle.GetDefinition() == aKaonZL) { 00380 if (G4UniformRand() <= 0.5) { 00381 currentParticle.SetDefinition(aKaonZS); 00382 incidentHasChanged = true; 00383 } 00384 } else if (currentParticle.GetDefinition() == aKaonZS) { 00385 if (G4UniformRand() > 0.5) { 00386 currentParticle.SetDefinition(aKaonZL); 00387 incidentHasChanged = true; 00388 } 00389 } 00390 00391 if (targetParticle.GetDefinition() == aKaonZL) { 00392 if (G4UniformRand() <= 0.5) targetParticle.SetDefinition(aKaonZS); 00393 } else if (targetParticle.GetDefinition() == aKaonZS) { 00394 if (G4UniformRand() > 0.5 ) targetParticle.SetDefinition(aKaonZL); 00395 } 00396 00397 for (i = 0; i < vecLen; ++i) { 00398 if (vec[i]->GetDefinition() == aKaonZL) { 00399 if( G4UniformRand() <= 0.5) vec[i]->SetDefinition(aKaonZS); 00400 } else if (vec[i]->GetDefinition() == aKaonZS) { 00401 if (G4UniformRand() > 0.5) vec[i]->SetDefinition(aKaonZL); 00402 } 00403 } 00404 00405 if (incidentHasChanged) { 00406 G4DynamicParticle* p0 = new G4DynamicParticle; 00407 p0->SetDefinition( currentParticle.GetDefinition() ); 00408 p0->SetMomentum( currentParticle.GetMomentum() ); 00409 theParticleChange.AddSecondary( p0 ); 00410 theParticleChange.SetStatusChange( stopAndKill ); 00411 theParticleChange.SetEnergyChange( 0.0 ); 00412 } else { 00413 G4double p = currentParticle.GetMomentum().mag()/MeV; 00414 G4ThreeVector pvec = currentParticle.GetMomentum(); 00415 if (p > DBL_MIN) 00416 theParticleChange.SetMomentumChange(pvec.x()/p, pvec.y()/p, pvec.z()/p); 00417 else 00418 theParticleChange.SetMomentumChange(1.0, 0.0, 0.0); 00419 00420 G4double aE = currentParticle.GetKineticEnergy(); 00421 if (std::fabs(aE) < .1*eV) aE = .1*eV; 00422 theParticleChange.SetEnergyChange(aE); 00423 } 00424 00425 if (targetParticle.GetMass() > 0.0) { 00426 // targetParticle can be eliminated in TwoBody 00427 G4DynamicParticle* p1 = new G4DynamicParticle; 00428 p1->SetDefinition(targetParticle.GetDefinition() ); 00429 G4ThreeVector momentum = targetParticle.GetMomentum(); 00430 momentum = momentum.rotate(cache, what); 00431 p1->SetMomentum(momentum); 00432 theParticleChange.AddSecondary(p1); 00433 } 00434 00435 G4DynamicParticle* p; 00436 for (i = 0; i < vecLen; ++i) { 00437 p = new G4DynamicParticle(vec[i]->GetDefinition(), vec[i]->GetMomentum() ); 00438 theParticleChange.AddSecondary( p ); 00439 delete vec[i]; 00440 } 00441 }
void G4InelasticInteraction::SetUpPions | ( | const G4int | np, | |
const G4int | nm, | |||
const G4int | nz, | |||
G4FastVector< G4ReactionProduct, GHADLISTSIZE > & | vec, | |||
G4int & | vecLen | |||
) | [protected] |
Definition at line 112 of file G4InelasticInteraction.cc.
References G4UniformRand, G4PionMinus::PionMinus(), G4PionPlus::PionPlus(), G4PionZero::PionZero(), G4ReactionProduct::SetDefinition(), G4FastVector< Type, N >::SetElement(), and G4ReactionProduct::SetSide().
00116 { 00117 if (npos + nneg + nzero == 0) return; 00118 G4int i; 00119 G4ReactionProduct* p; 00120 00121 for (i = 0; i < npos; ++i) { 00122 p = new G4ReactionProduct; 00123 p->SetDefinition( G4PionPlus::PionPlus() ); 00124 (G4UniformRand() < 0.5) ? p->SetSide( -1 ) : p->SetSide( 1 ); 00125 vec.SetElement( vecLen++, p ); 00126 } 00127 for (i = npos; i < npos+nneg; ++i) { 00128 p = new G4ReactionProduct; 00129 p->SetDefinition( G4PionMinus::PionMinus() ); 00130 (G4UniformRand() < 0.5) ? p->SetSide(-1) : p->SetSide(1); 00131 vec.SetElement( vecLen++, p ); 00132 } 00133 for (i = npos+nneg; i < npos+nneg+nzero; ++i) { 00134 p = new G4ReactionProduct; 00135 p->SetDefinition( G4PionZero::PionZero() ); 00136 (G4UniformRand() < 0.5) ? p->SetSide(-1) : p->SetSide(1); 00137 vec.SetElement( vecLen++, p ); 00138 } 00139 }
void G4InelasticInteraction::TurnOnIsotopeProduction | ( | ) | [inline] |
Definition at line 71 of file G4InelasticInteraction.hh.
References isotopeProduction.
00071 {isotopeProduction = true;}
G4bool G4InelasticInteraction::isotopeProduction [protected] |
Definition at line 117 of file G4InelasticInteraction.hh.
Referenced by G4LEXiZeroInelastic::ApplyYourself(), G4LEXiMinusInelastic::ApplyYourself(), G4LETritonInelastic::ApplyYourself(), G4LESigmaPlusInelastic::ApplyYourself(), G4LESigmaMinusInelastic::ApplyYourself(), G4LEProtonInelastic::ApplyYourself(), G4LEPionPlusInelastic::ApplyYourself(), G4LEPionMinusInelastic::ApplyYourself(), G4LEOmegaMinusInelastic::ApplyYourself(), G4LENeutronInelastic::ApplyYourself(), G4LELambdaInelastic::ApplyYourself(), G4LEKaonZeroInelastic::ApplyYourself(), G4LEKaonPlusInelastic::ApplyYourself(), G4LEKaonMinusInelastic::ApplyYourself(), G4LEDeuteronInelastic::ApplyYourself(), G4LEAntiXiZeroInelastic::ApplyYourself(), G4LEAntiXiMinusInelastic::ApplyYourself(), G4LEAntiSigmaPlusInelastic::ApplyYourself(), G4LEAntiSigmaMinusInelastic::ApplyYourself(), G4LEAntiProtonInelastic::ApplyYourself(), G4LEAntiOmegaMinusInelastic::ApplyYourself(), G4LEAntiNeutronInelastic::ApplyYourself(), G4LEAntiLambdaInelastic::ApplyYourself(), G4LEAntiKaonZeroInelastic::ApplyYourself(), G4LEAlphaInelastic::ApplyYourself(), and TurnOnIsotopeProduction().
Definition at line 119 of file G4InelasticInteraction.hh.
Referenced by G4LETritonInelastic::ApplyYourself(), G4LEDeuteronInelastic::ApplyYourself(), G4LEAlphaInelastic::ApplyYourself(), and CalculateMomenta().