81 theProjectilePotential(0)
142 theDefinition(aDefinition),
143 theFormationTime(aFormationTime),
144 thePosition(aPosition),
145 the4Momentum(a4Momentum),
146 theFermi3Momentum(0),
147 theTotal4Momentum(a4Momentum),
150 theProjectilePotential(0)
170 if (theDecayTable != 0)
194 G4bool * theDaughterIsShortLived = 0;
200 for (index =
nChannels - 1; index >= 0; index--)
205 if (nDaughters == 2 || nDaughters == 3)
213 theDaughterIsShortLived =
new G4bool[nDaughters];
215 for (n = 0; n < nDaughters; n++)
232 if ( !theDaughterIsShortLived[0] && !theDaughterIsShortLived[1] )
252 else if ( !theDaughterIsShortLived[0] && theDaughterIsShortLived[1] )
274 else if ( theDaughterIsShortLived[0] && !theDaughterIsShortLived[1] )
304 else if ( theDaughterIsShortLived[0] && theDaughterIsShortLived[1] )
331 G4int nShortLived = 0;
332 if ( theDaughterIsShortLived[0] )
336 if ( theDaughterIsShortLived[1] )
342 if ( theDaughterIsShortLived[2] )
348 if ( nShortLived == 0 )
357 else if ( nShortLived >= 1 )
375 G4double theMomRatio = theActualMom / thePoleMom;
387 delete [] theDaughterIsShortLived;
388 theDaughterIsShortLived = 0;
419 : theDefinition(nucleon->GetDefinition()),
421 thePosition(aPosition),
422 the4Momentum(a4Momentum),
423 theFermi3Momentum(nucleon->GetMomentum()),
426 theActualMass(nucleon->GetDefinition()->GetPDGMass()),
431 theProjectilePotential(0)
474 return (
this == & right);
481 return (
this != & right);
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;
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)
587 theDaughtersName2 =
"";
588 theDaughtersName3 =
"";
589 theDaughtersName4 =
"";
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) {
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);
618 theDaughtersName4 =
"";
619 if ( numberOfShortliveds == 1)
621 G4double massmax=theParentMass - SumLongLivedMass;
623 masses[shortlivedDaughters[0]]= aSampler.
SampleMass(aDaughter,massmax);
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,
659 if(!theDecayProducts)
662 ed <<
"Error condition encountered: phase-space decay failed." <<
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;
722 G4double result = (1. / (2 * mass)) *
723 std::sqrt(
std::max((((mass * mass) - (mass1 + xmass) * (mass1 + xmass)) *
724 ((mass * mass) - (mass1 - xmass) * (mass1 - xmass))),0.0)) *
725 BrWig(gamma2, mass2, xmass);
735 G4double result = (1. / (2 * mass)) *
736 std::sqrt(
std::max((((mass * mass) - (mass1 + xmass) * (mass1 + xmass)) *
737 ((mass * mass) - (mass1 - xmass) * (mass1 - xmass))),0.0)) *
738 BrWig(gamma2, mass2, xmass);
749 const G4double result = (1. / (2 * mass)) *
752 BrWig(gamma2, mass2, xmass);
766 const G4double theUpperLimit = mass - xmass;
767 const G4int nIterations = 100;
779 const G4int nIterations = 100;
781 if (theLowerLimit>=theUpperLimit)
return 0.0;
785 theLowerLimit, theUpperLimit, nIterations);
786 return theIntegralOverMass2;
792 const G4int nIterations = 100;
794 if (theLowerLimit>=theUpperLimit)
return 0.0;
798 theLowerLimit, theUpperLimit, nIterations);
799 return theIntegralOverMass2;
807 const G4int nIterations = 100;
809 if (theLowerLimit>=theUpperLimit)
return 0.0;
813 theLowerLimit, theUpperLimit, nIterations);
814 return theIntegralOverMass2;
static G4KaonZero * KaonZero()
G4double SampleMass(const G4double poleMass, const G4double gamma, const G4double minMass, const G4double maxMass) const
G4double IntegrateCMMomentum2() const
void G4SwapObj(T *a, T *b)
G4int operator==(const G4KineticTrack &right) const
G4double theFormationTime
G4int GetnChannels() const
std::ostringstream G4ExceptionDescription
G4LorentzVector theTotal4Momentum
CLHEP::Hep3Vector G4ThreeVector
CLHEP::HepLorentzRotation G4LorentzRotation
const G4String & GetParentName() const
G4int GetNumberOfDaughters() const
G4double * theDaughterWidth
const G4ThreeVector & GetPosition() const
G4KineticTrackVector * Decay()
G4ParticleDefinition * GetDaughter(G4int anIndex)
static G4ThreadLocal G4double G4KineticTrack_Gmass
static G4KaonZeroLong * KaonZeroLong()
G4VDecayChannel * GetDecayChannel(G4int index) const
G4double GetActualMass() const
G4ParticleDefinition * GetDefinition() const
G4ThreeVector thePosition
const G4String & GetParticleName() const
G4double IntegrateCMMomentum(const G4double lowerLimit) const
G4double IntegrandFunction3(G4double xmass) const
G4double * theDaughterMass
G4LorentzVector theFermi3Momentum
G4DecayTable * GetDecayTable() const
G4double IntegrandFunction2(G4double xmass) const
G4int operator!=(const G4KineticTrack &right) const
G4double GetPDGWidth() const
G4double IntegrandFunction4(G4double xmass) const
static G4KaonZeroShort * KaonZeroShort()
G4bool nucleon(G4int ityp)
G4double GetFormationTime() const
G4LorentzVector the4Momentum
G4double EvaluateTotalActualWidth()
G4KineticTrack & operator=(const G4KineticTrack &right)
static G4ThreadLocal G4double G4KineticTrack_xmass1
void Set4Momentum(const G4LorentzVector &a4Momentum)
G4LorentzVector Get4Momentum() const
const G4String & GetDaughterName(G4int anIndex) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4double GetMinimumMass(const G4ParticleDefinition *p) const
virtual G4DecayProducts * DecayIt(G4double mass=0.0)
G4bool IsShortLived() const
G4double EvaluateCMMomentum(const G4double mass, const G4double *m_ij) const
static G4AntiKaonZero * AntiKaonZero()
G4double GetPDGMass() const
T max(const T t1, const T t2)
brief Return the largest of the two arguments
const G4LorentzVector & GetTrackingMomentum() const
G4DynamicParticle * PopProducts()
G4double * theActualWidth
G4double IntegrandFunction1(G4double xmass) const
G4double Simpson(T &typeT, F f, G4double a, G4double b, G4int n)
const G4LorentzVector & Get4Momentum() const
G4double GetPDGCharge() const
G4double theProjectilePotential
const G4ParticleDefinition * GetDefinition() const
G4double BrWig(const G4double Gamma, const G4double rmass, const G4double mass) const
G4GLOB_DLL std::ostream G4cerr
G4int GetBaryonNumber() const
CLHEP::HepLorentzVector G4LorentzVector
const G4ParticleDefinition * theDefinition
CascadeState theStateToNucleus