500 G4cerr <<
"Error condition encountered in G4KineticTrack::Decay()"<<
G4endl;
501 G4cerr <<
" track has no particle definition associated."<<
G4endl;
507 G4cerr <<
"Error condition encountered in G4KineticTrack::Decay()"<<
G4endl;
508 G4cerr <<
" particle definiton has no decay table associated."<<
G4endl;
517 if (theTotalActualWidth !=0)
522 for (index =
nChannels - 1; index >= 0; index--)
525 theCumActualWidth[
index] = theSumActualWidth;
533 for (index =
nChannels - 1; index >= 0; index--)
535 if (r < theCumActualWidth[index])
544 delete [] theCumActualWidth;
548 G4cerr <<
"Error condition encountered in G4KineticTrack::Decay()"<<
G4endl;
549 G4cerr <<
" decay channel has 0x0 channel associated."<<
G4endl;
554 G4String theParentName = theDecayChannel->GetParentName();
558 G4int theNumberOfDaughters = theDecayChannel->GetNumberOfDaughters();
565 G4int shortlivedDaughters[4];
566 G4int numberOfShortliveds(0);
568 for (
G4int aD=0; aD < theNumberOfDaughters ; aD++)
574 shortlivedDaughters[numberOfShortliveds]=aD;
575 numberOfShortliveds++;
581 switch (theNumberOfDaughters)
586 theDaughtersName1 = theDecayChannel->GetDaughterName(0);
587 theDaughtersName2 =
"";
588 theDaughtersName3 =
"";
589 theDaughtersName4 =
"";
592 theDaughtersName1 = theDecayChannel->GetDaughterName(0);
593 theDaughtersName2 = theDecayChannel->GetDaughterName(1);
594 theDaughtersName3 =
"";
595 theDaughtersName4 =
"";
596 if ( numberOfShortliveds == 1)
598 G4double massmax=theParentMass - SumLongLivedMass;
600 masses[shortlivedDaughters[0]]= aSampler.
SampleMass(aDaughter,massmax);
601 }
else if ( numberOfShortliveds == 2) {
606 G4double massmax=theParentMass - aSampler.
GetMinimumMass(theDecayChannel->GetDaughter(shortlivedDaughters[one]));
608 masses[shortlivedDaughters[zero]]=aSampler.
SampleMass(aDaughter,massmax);
609 massmax=theParentMass - masses[shortlivedDaughters[zero]];
610 aDaughter=theDecayChannel->GetDaughter(shortlivedDaughters[one]);
611 masses[shortlivedDaughters[one]]=aSampler.
SampleMass(aDaughter,massmax);
615 theDaughtersName1 = theDecayChannel->GetDaughterName(0);
616 theDaughtersName2 = theDecayChannel->GetDaughterName(1);
617 theDaughtersName3 = theDecayChannel->GetDaughterName(2);
618 theDaughtersName4 =
"";
619 if ( numberOfShortliveds == 1)
621 G4double massmax=theParentMass - SumLongLivedMass;
623 masses[shortlivedDaughters[0]]= aSampler.
SampleMass(aDaughter,massmax);
627 theDaughtersName1 = theDecayChannel->GetDaughterName(0);
628 theDaughtersName2 = theDecayChannel->GetDaughterName(1);
629 theDaughtersName3 = theDecayChannel->GetDaughterName(2);
630 theDaughtersName4 = theDecayChannel->GetDaughterName(3);
631 if ( numberOfShortliveds == 1)
633 G4double massmax=theParentMass - SumLongLivedMass;
635 masses[shortlivedDaughters[0]]= aSampler.
SampleMass(aDaughter,massmax);
637 if ( theNumberOfDaughters > 4 ) {
639 ed <<
"More than 4 decay daughters: kept only the first 4" <<
G4endl;
652 theNumberOfDaughters,
658 G4DecayProducts* theDecayProducts = thePhaseSpaceDecayChannel.DecayIt();
659 if(!theDecayProducts)
662 ed <<
"Error condition encountered: phase-space decay failed." << G4endl
663 <<
"\t the decaying particle is: " << thisDefinition->
GetParticleName() << G4endl
664 <<
"\t the channel index is: "<< chosench <<
" of "<<
nChannels <<
"channels" << G4endl
665 <<
"\t " << theNumberOfDaughters <<
" daughter particles: " 666 << theDaughtersName1 <<
" " << theDaughtersName2 <<
" " << theDaughtersName3 <<
" " 667 << theDaughtersName4 <<
G4endl;
684 for (
G4int i=dEntries; i > 0; i--)
686 theDynamicParticle = theDecayProducts->
PopProducts();
690 momentumBalanceCMS += theDynamicParticle->
Get4Momentum();
692 energyMomentumBalance -= momentum;
697 delete theDynamicParticle;
699 delete theDecayProducts;
700 if(getenv(
"DecayEnergyBalanceCheck"))
701 std::cout <<
"DEBUGGING energy balance in cms and lab, charge baryon balance : " 702 << momentumBalanceCMS <<
" " 703 <<energyMomentumBalance <<
" " 707 return theDecayProductList;
const G4ParticleDefinition * GetDefinition() const
const G4ThreeVector & GetPosition() const
G4bool IsShortLived() const
G4int GetBaryonNumber() const
std::ostringstream G4ExceptionDescription
G4double SampleMass(const G4double poleMass, const G4double gamma, const G4double minMass, const G4double maxMass) const
const G4String & GetParticleName() const
G4double GetMinimumMass(const G4ParticleDefinition *p) const
G4DecayTable * GetDecayTable() const
G4double EvaluateTotalActualWidth()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4VDecayChannel * GetDecayChannel(G4int index) const
G4double GetPDGMass() const
G4DynamicParticle * PopProducts()
G4double * theActualWidth
G4double GetActualMass() const
G4LorentzVector Get4Momentum() const
G4ParticleDefinition * GetDefinition() const
G4double GetPDGCharge() const
G4GLOB_DLL std::ostream G4cerr
const G4LorentzVector & Get4Momentum() const
const G4ParticleDefinition * theDefinition