G4KineticTrack Class Reference

#include <G4KineticTrack.hh>

Inheritance diagram for G4KineticTrack:

G4VKineticNucleon

Public Types

 undefined
 outside
 going_in
 inside
 going_out
 gone_out
 captured
 miss_nucleus
enum  CascadeState {
  undefined, outside, going_in, inside,
  going_out, gone_out, captured, miss_nucleus
}

Public Member Functions

 G4KineticTrack ()
 G4KineticTrack (const G4KineticTrack &right)
 G4KineticTrack (G4ParticleDefinition *aDefinition, G4double aFormationTime, G4ThreeVector aPosition, G4LorentzVector &a4Momentum)
 G4KineticTrack (G4Nucleon *nucleon, G4ThreeVector aPosition, G4LorentzVector &a4Momentum)
 ~G4KineticTrack ()
G4KineticTrackoperator= (const G4KineticTrack &right)
G4int operator== (const G4KineticTrack &right) const
G4int operator!= (const G4KineticTrack &right) const
G4ParticleDefinitionGetDefinition () const
void SetDefinition (G4ParticleDefinition *aDefinition)
G4double GetFormationTime () const
void SetFormationTime (G4double aFormationTime)
const G4ThreeVectorGetPosition () const
void SetPosition (const G4ThreeVector aPosition)
const G4LorentzVectorGet4Momentum () const
void Set4Momentum (const G4LorentzVector &a4Momentum)
void Update4Momentum (G4double aEnergy)
void Update4Momentum (const G4ThreeVector &aMomentum)
void SetTrackingMomentum (const G4LorentzVector &a4Momentum)
void UpdateTrackingMomentum (G4double aEnergy)
void UpdateTrackingMomentum (const G4ThreeVector &aMomentum)
const G4LorentzVectorGetTrackingMomentum () const
G4double SampleResidualLifetime ()
void Hit ()
void SetNucleon (G4Nucleon *aN)
G4bool IsParticipant () const
G4KineticTrackVectorDecay ()
G4doubleGetActualWidth () const
G4double GetActualMass () const
G4int GetnChannels () const
CascadeState SetState (const CascadeState new_state)
CascadeState GetState () const
void SetProjectilePotential (const G4double aPotential)
G4double GetProjectilePotential () const
G4double BrWig (const G4double Gamma, const G4double rmass, const G4double mass) const

Detailed Description

Definition at line 60 of file G4KineticTrack.hh.


Member Enumeration Documentation

enum G4KineticTrack::CascadeState

Enumerator:
undefined 
outside 
going_in 
inside 
going_out 
gone_out 
captured 
miss_nucleus 

Definition at line 122 of file G4KineticTrack.hh.


Constructor & Destructor Documentation

G4KineticTrack::G4KineticTrack (  ) 

Definition at line 67 of file G4KineticTrack.cc.

00067                                :
00068                 theDefinition(0),
00069                 theFormationTime(0),
00070                 thePosition(0),
00071                 the4Momentum(0),
00072                 theFermi3Momentum(0),
00073                 theTotal4Momentum(0),
00074                 theNucleon(0),
00075                 nChannels(0),
00076                 theActualMass(0),            
00077                 theActualWidth(0),            
00078                 theDaughterMass(0),
00079                 theDaughterWidth(0),
00080                 theStateToNucleus(undefined),
00081                 theProjectilePotential(0)
00082 {
00084 //    DEBUG   //
00086 
00087 /*
00088  G4cerr << G4endl << G4endl << G4endl;
00089  G4cerr << "   G4KineticTrack default constructor invoked! \n";
00090  G4cerr << "   =========================================== \n" << G4endl;
00091 */
00092 }

G4KineticTrack::G4KineticTrack ( const G4KineticTrack right  ) 

Definition at line 100 of file G4KineticTrack.cc.

References GetActualMass(), GetDefinition(), GetFormationTime(), GetnChannels(), GetPosition(), GetTrackingMomentum(), theActualWidth, theFermi3Momentum, theNucleon, theProjectilePotential, theStateToNucleus, and theTotal4Momentum.

00100                                                           : G4VKineticNucleon()
00101 {
00102  G4int i;
00103  theDefinition = right.GetDefinition();
00104  theFormationTime = right.GetFormationTime();
00105  thePosition = right.GetPosition();
00106  the4Momentum = right.GetTrackingMomentum();
00107  theFermi3Momentum = right.theFermi3Momentum;
00108  theTotal4Momentum = right.theTotal4Momentum;
00109  theNucleon=right.theNucleon;
00110  nChannels = right.GetnChannels();
00111  theActualMass = right.GetActualMass();
00112  theActualWidth = new G4double[nChannels];
00113  for (i = 0; i < nChannels; i++)
00114   {
00115     theActualWidth[i] = right.theActualWidth[i];
00116   }
00117   theDaughterMass = 0;
00118   theDaughterWidth = 0;
00119   theStateToNucleus=right.theStateToNucleus;
00120   theProjectilePotential=right.theProjectilePotential;
00121  
00123 //    DEBUG   //
00125 
00126 /*
00127  G4cerr << G4endl << G4endl << G4endl;
00128  G4cerr << "   G4KineticTrack copy constructor invoked! \n";
00129  G4cerr << "   ======================================== \n" <<G4endl;
00130 */
00131 }

G4KineticTrack::G4KineticTrack ( G4ParticleDefinition aDefinition,
G4double  aFormationTime,
G4ThreeVector  aPosition,
G4LorentzVector a4Momentum 
)

Definition at line 138 of file G4KineticTrack.cc.

References G4AntiKaonZero::AntiKaonZero(), G4DecayTable::entries(), G4SwapObj(), G4UniformRand, GetActualMass(), G4DecayTable::GetDecayChannel(), G4ParticleDefinition::GetDecayTable(), G4SampleResonance::GetMinimumMass(), G4ParticleDefinition::GetPDGMass(), G4ParticleDefinition::GetPDGWidth(), G4ParticleDefinition::IsShortLived(), G4KaonZero::KaonZero(), G4KaonZeroLong::KaonZeroLong(), G4KaonZeroShort::KaonZeroShort(), and CLHEP::detail::n.

00141                                                             :
00142                 theDefinition(aDefinition),
00143                 theFormationTime(aFormationTime),
00144                 thePosition(aPosition),
00145                 the4Momentum(a4Momentum),
00146                 theFermi3Momentum(0),
00147                 theTotal4Momentum(a4Momentum),
00148                 theNucleon(0),
00149                 theStateToNucleus(undefined),
00150                 theProjectilePotential(0)
00151 {
00152   if(G4KaonZero::KaonZero() == theDefinition ||
00153     G4AntiKaonZero::AntiKaonZero() == theDefinition)
00154   {
00155     if(G4UniformRand()<0.5)
00156     {
00157       theDefinition = G4KaonZeroShort::KaonZeroShort();
00158     }
00159     else
00160     {
00161       theDefinition = G4KaonZeroLong::KaonZeroLong();
00162     }
00163   }
00164 
00165 //
00166 //      Get the number of decay channels
00167 //
00168 
00169  G4DecayTable* theDecayTable = theDefinition->GetDecayTable();
00170  if (theDecayTable != 0)
00171     {
00172      nChannels = theDecayTable->entries();
00173 
00174     }
00175  else
00176     {
00177      nChannels = 0;
00178     }  
00179 
00180 //
00181 //   Get the actual mass value
00182 //
00183 
00184  theActualMass = GetActualMass();
00185 
00186 //
00187 //   Create an array to Store the actual partial widths 
00188 //   of the decay channels
00189 //
00190 
00191   theDaughterMass = 0;
00192   theDaughterWidth = 0;
00193   theActualWidth = 0;
00194   G4bool * theDaughterIsShortLived = 0;
00195   
00196   if(nChannels!=0) theActualWidth = new G4double[nChannels];
00197 
00198   //  cout << " ****CONSTR*** ActualMass ******* " << theActualMass << G4endl;
00199   G4int index;
00200   for (index = nChannels - 1; index >= 0; index--)
00201     {
00202       G4VDecayChannel* theChannel = theDecayTable->GetDecayChannel(index);
00203       G4int nDaughters = theChannel->GetNumberOfDaughters();
00204       G4double theMotherWidth;
00205       if (nDaughters == 2 || nDaughters == 3) 
00206         {
00207           G4double thePoleMass  = theDefinition->GetPDGMass();
00208           theMotherWidth = theDefinition->GetPDGWidth();
00209           G4double thePoleWidth = theChannel->GetBR()*theMotherWidth;
00210           G4ParticleDefinition* aDaughter;
00211           theDaughterMass = new G4double[nDaughters];
00212           theDaughterWidth = new G4double[nDaughters];
00213           theDaughterIsShortLived = new G4bool[nDaughters];
00214           G4int n;
00215           for (n = 0; n < nDaughters; n++)
00216             {
00217               aDaughter = theChannel->GetDaughter(n);
00218               theDaughterMass[n] = aDaughter->GetPDGMass();
00219               theDaughterWidth[n] = aDaughter->GetPDGWidth();
00220               theDaughterIsShortLived[n] = aDaughter->IsShortLived();
00221             }     
00222           
00223 //
00224 //           Check whether both the decay products are stable
00225 //
00226 
00227           G4double theActualMom = 0.0;
00228           G4double thePoleMom = 0.0;
00229           G4SampleResonance aSampler;
00230           if (nDaughters==2) 
00231             {
00232               if ( !theDaughterIsShortLived[0] && !theDaughterIsShortLived[1] )
00233                 {
00234                   
00235                   //              G4cout << G4endl << "Both the " << nDaughters <<
00236                   //                              " decay products are stable!";
00237                   //                   cout << " LB: Both decay products STABLE !" << G4endl;
00238                   //                   cout << " parent:     " << theChannel->GetParentName() << G4endl;
00239                   //                   cout << " particle1:  " << theChannel->GetDaughterName(0) << G4endl;
00240                   //                   cout << " particle2:  " << theChannel->GetDaughterName(1) << G4endl;
00241                   
00242                   theActualMom = EvaluateCMMomentum(theActualMass, 
00243                                                     theDaughterMass);   
00244                   thePoleMom = EvaluateCMMomentum(thePoleMass, 
00245                                                   theDaughterMass);
00246                   //          cout << G4endl;
00247                   //          cout << " LB: ActualMass/DaughterMass  " << theActualMass << "   " << theDaughterMass << G4endl; 
00248                   //          cout << " LB: ActualMom " << theActualMom << G4endl;
00249                   //          cout << " LB: PoleMom   " << thePoleMom << G4endl;
00250                   //          cout << G4endl;
00251                 }
00252               else if ( !theDaughterIsShortLived[0] && theDaughterIsShortLived[1] )   
00253                 {
00254                   
00255                   //              G4cout << G4endl << "Only the first of the " << nDaughters <<" decay products is stable!";
00256                   //           cout << " LB: only the first decay product is STABLE !" << G4endl;
00257                   //           cout << " parent:     " << theChannel->GetParentName() << G4endl;
00258                   //           cout << " particle1:  " << theChannel->GetDaughterName(0) << G4endl;
00259                   //           cout << " particle2:  " << theChannel->GetDaughterName(1) << G4endl;
00260                   
00261 // global variable definition
00262                   G4double lowerLimit = aSampler.GetMinimumMass(theChannel->GetDaughter(1));
00263                   theActualMom = IntegrateCMMomentum(lowerLimit);
00264                   thePoleMom = IntegrateCMMomentum(lowerLimit, thePoleMass);
00265                   //          cout << " LB Parent Mass = " <<  G4KineticTrack_Gmass << G4endl;
00266                   //          cout << " LB Actual Mass = " << theActualMass << G4endl;
00267                   //          cout << " LB Daughter1 Mass = " <<  G4KineticTrack_Gmass1 << G4endl;
00268                   //          cout << " LB Daughter2 Mass = " <<  G4KineticTrack_Gmass2 << G4endl;
00269                   //          cout << " The Actual Momentum = " << theActualMom << G4endl;
00270                   //          cout << " The Pole Momentum   = " << thePoleMom << G4endl;
00271                   //          cout << G4endl;
00272                   
00273                 }        
00274               else if ( theDaughterIsShortLived[0] && !theDaughterIsShortLived[1] )   
00275                 {
00276                   
00277                   //              G4cout << G4endl << "Only the second of the " << nDaughters <<
00278                   //                              " decay products is stable!";
00279                   //                   cout << " LB: only the second decay product is STABLE !" << G4endl;
00280                   //           cout << " parent:     " << theChannel->GetParentName() << G4endl;
00281                   //           cout << " particle1:  " << theChannel->GetDaughterName(0) << G4endl;
00282                   //           cout << " particle2:  " << theChannel->GetDaughterName(1) << G4endl;
00283                   
00284 //
00285 //               Swap the content of the theDaughterMass and theDaughterWidth arrays!!!
00286 //
00287                   
00288                   G4SwapObj(theDaughterMass, theDaughterMass + 1);
00289                   G4SwapObj(theDaughterWidth, theDaughterWidth + 1);
00290                   
00291 // global variable definition
00292                   G4double lowerLimit = aSampler.GetMinimumMass(theChannel->GetDaughter(0));
00293                   theActualMom = IntegrateCMMomentum(lowerLimit);
00294                   thePoleMom = IntegrateCMMomentum(lowerLimit, thePoleMass);
00295                   //          cout << " LB Parent Mass = " <<  G4KineticTrack_Gmass << G4endl;
00296                   //          cout << " LB Actual Mass = " << theActualMass << G4endl;
00297                   //          cout << " LB Daughter1 Mass = " <<  G4KineticTrack_Gmass1 << G4endl;
00298                   //          cout << " LB Daughter2 Mass = " <<  G4KineticTrack_Gmass2 << G4endl;
00299                   //          cout << " The Actual Momentum = " << theActualMom << G4endl;
00300                   //          cout << " The Pole Momentum   = " << thePoleMom << G4endl;
00301                   //              cout << G4endl;
00302                   
00303                 }        
00304               else if ( theDaughterIsShortLived[0] && theDaughterIsShortLived[1] )   
00305                 {
00306                
00307 //              G4cout << G4endl << "Both the " << nDaughters <<
00308 //                              " decay products are resonances!";
00309                   //           cout << " LB: both decay products are RESONANCES !" << G4endl;
00310                   //           cout << " parent:     " << theChannel->GetParentName() << G4endl;
00311                   //           cout << " particle1:  " << theChannel->GetDaughterName(0) << G4endl;
00312                   //           cout << " particle2:  " << theChannel->GetDaughterName(1) << G4endl;
00313                   
00314 // global variable definition
00315                   G4KineticTrack_Gmass = theActualMass;
00316                   theActualMom = IntegrateCMMomentum2();
00317                   G4KineticTrack_Gmass = thePoleMass;
00318                   thePoleMom = IntegrateCMMomentum2();
00319                   //          cout << " LB Parent Mass = " <<  G4KineticTrack_Gmass << G4endl;
00320                   //          cout << " LB Daughter1 Mass = " <<  G4KineticTrack_Gmass1 << G4endl;
00321                   //          cout << " LB Daughter2 Mass = " <<  G4KineticTrack_Gmass2 << G4endl;
00322                   //              cout << " The Actual Momentum = " << theActualMom << G4endl;
00323                   //              cout << " The Pole Momentum   = " << thePoleMom << G4endl;
00324                   //              cout << G4endl;
00325                   
00326                 }        
00327             } 
00328           else  // (nDaughter==3)
00329             {
00330               
00331               int nShortLived = 0;
00332               if ( theDaughterIsShortLived[0] ) 
00333                 { 
00334                   nShortLived++; 
00335                 }
00336               if ( theDaughterIsShortLived[1] )
00337                 { 
00338                   nShortLived++; 
00339                   G4SwapObj(theDaughterMass, theDaughterMass + 1);
00340                   G4SwapObj(theDaughterWidth, theDaughterWidth + 1);        
00341                 }
00342               if ( theDaughterIsShortLived[2] )
00343                 { 
00344                   nShortLived++; 
00345                   G4SwapObj(theDaughterMass, theDaughterMass + 2);
00346                   G4SwapObj(theDaughterWidth, theDaughterWidth + 2);        
00347                 }
00348               if ( nShortLived == 0 ) 
00349                 {
00350                   theDaughterMass[1]+=theDaughterMass[2];
00351                   theActualMom = EvaluateCMMomentum(theActualMass, 
00352                                                     theDaughterMass);   
00353                   thePoleMom = EvaluateCMMomentum(thePoleMass, 
00354                                                   theDaughterMass);
00355                 }
00356 //            else if ( nShortLived == 1 )
00357               else if ( nShortLived >= 1 )
00358                 { 
00359                   // need the shortlived particle in slot 1! (very bad style...)
00360                   G4SwapObj(theDaughterMass, theDaughterMass + 1);
00361                   G4SwapObj(theDaughterWidth, theDaughterWidth + 1);        
00362                   theDaughterMass[0] += theDaughterMass[2];
00363                   theActualMom = IntegrateCMMomentum(0.0);
00364                   thePoleMom = IntegrateCMMomentum(0.0, thePoleMass);
00365                 }
00366 //            else
00367 //              {
00368 //                throw G4HadronicException(__FILE__, __LINE__,  ("can't handle more than one shortlived in 3 particle output channel");
00369 //              }     
00370               
00371             }
00372           
00373           G4double l=0;
00374           //if(nDaughters<3) theChannel->GetAngularMomentum(); 
00375           G4double theMassRatio = thePoleMass / theActualMass;
00376           G4double theMomRatio = theActualMom / thePoleMom;
00377           theActualWidth[index] = thePoleWidth * theMassRatio *
00378                                   std::pow(theMomRatio, (2 * l + 1)) *
00379                                   (1.2 / (1+ 0.2*std::pow(theMomRatio, (2 * l))));
00380           delete [] theDaughterMass;
00381           theDaughterMass = 0;
00382           delete [] theDaughterWidth;
00383           theDaughterWidth = 0;
00384           delete [] theDaughterIsShortLived;
00385           theDaughterIsShortLived = 0;
00386         }
00387       
00388       else //  nDaughter = 1 ( e.g. K0  decays 50% to Kshort, 50% Klong 
00389         {
00390           theMotherWidth = theDefinition->GetPDGWidth();
00391           theActualWidth[index] = theChannel->GetBR()*theMotherWidth;
00392         }
00393     }
00394 
00396 //    DEBUG   //
00398 
00399 // for (G4int y = nChannels - 1; y >= 0; y--)
00400 //     {
00401 //      G4cout << G4endl << theActualWidth[y];
00402 //     }
00403 // G4cout << G4endl << G4endl << G4endl;
00404 
00405  /*
00406  G4cerr << G4endl << G4endl << G4endl;
00407  G4cerr << "   G4KineticTrack by argument constructor invoked! \n";
00408  G4cerr << "   =============================================== \n" << G4endl;
00409  */
00410 
00411 }

G4KineticTrack::G4KineticTrack ( G4Nucleon nucleon,
G4ThreeVector  aPosition,
G4LorentzVector a4Momentum 
)

Definition at line 413 of file G4KineticTrack.cc.

References Set4Momentum().

00416   :     theDefinition(nucleon->GetDefinition()),
00417         theFormationTime(0),
00418         thePosition(aPosition),
00419         the4Momentum(a4Momentum),
00420         theFermi3Momentum(nucleon->GetMomentum()),
00421         theNucleon(nucleon),
00422         nChannels(0),
00423         theActualMass(nucleon->GetDefinition()->GetPDGMass()),
00424         theActualWidth(0),
00425         theDaughterMass(0),
00426         theDaughterWidth(0),
00427         theStateToNucleus(undefined),
00428         theProjectilePotential(0)
00429 {
00430         theFermi3Momentum.setE(0);
00431         Set4Momentum(a4Momentum);
00432 }

G4KineticTrack::~G4KineticTrack (  ) 

Definition at line 435 of file G4KineticTrack.cc.

00436 {
00437  if (theActualWidth != 0) delete [] theActualWidth;
00438  if (theDaughterMass != 0) delete [] theDaughterMass;
00439  if (theDaughterWidth != 0) delete [] theDaughterWidth;
00440 }


Member Function Documentation

G4double G4KineticTrack::BrWig ( const G4double  Gamma,
const G4double  rmass,
const G4double  mass 
) const [inline]

Definition at line 398 of file G4KineticTrack.hh.

00399 {                
00400   G4double Norm = CLHEP::twopi;
00401   return (Gamma/((mass-rmass)*(mass-rmass)+Gamma*Gamma/4.))/Norm;
00402 }

G4KineticTrackVector * G4KineticTrack::Decay (  )  [virtual]

Reimplemented from G4VKineticNucleon.

Definition at line 483 of file G4KineticTrack.cc.

References G4GeneralPhaseSpaceDecay::DecayIt(), G4DecayProducts::entries(), G4cerr, G4endl, G4lrint(), G4UniformRand, G4DynamicParticle::Get4Momentum(), Get4Momentum(), GetActualMass(), G4ParticleDefinition::GetBaryonNumber(), G4VDecayChannel::GetDaughter(), G4VDecayChannel::GetDaughterName(), G4DecayTable::GetDecayChannel(), G4ParticleDefinition::GetDecayTable(), G4DynamicParticle::GetDefinition(), GetDefinition(), G4SampleResonance::GetMinimumMass(), G4VDecayChannel::GetNumberOfDaughters(), G4VDecayChannel::GetParentName(), G4ParticleDefinition::GetParticleName(), G4ParticleDefinition::GetPDGCharge(), G4ParticleDefinition::GetPDGMass(), GetPosition(), G4DecayProducts::PopProducts(), position, and G4SampleResonance::SampleMass().

Referenced by G4QMDCollision::CalKinematicsOfBinaryCollisions(), and G4BCDecay::GetFinalState().

00484 {
00485 //
00486 //   Select a possible decay channel
00487 //
00488 /*
00489     G4int index1;
00490     for (index1 = nChannels - 1; index1 >= 0; index1--)
00491       G4cout << "DECAY Actual Width IND/ActualW " << index1 << "  " << theActualWidth[index1] << G4endl;
00492       G4cout << "DECAY Actual Mass " << theActualMass << G4endl;
00493 */
00494   G4ParticleDefinition* thisDefinition = this->GetDefinition();
00495   if(!thisDefinition)
00496   {
00497     G4cerr << "Error condition encountered in G4KineticTrack::Decay()"<<G4endl;
00498     G4cerr << "  track has no particle definition associated."<<G4endl;
00499     return 0;
00500   }
00501   G4DecayTable* theDecayTable = thisDefinition->GetDecayTable();
00502   if(!theDecayTable)
00503   {
00504     G4cerr << "Error condition encountered in G4KineticTrack::Decay()"<<G4endl;
00505     G4cerr << "  particle definiton has no decay table associated."<<G4endl;
00506     G4cerr << "  particle was "<<thisDefinition->GetParticleName()<<G4endl;
00507     return 0;
00508   }
00509  
00510  G4int chargeBalance = G4lrint(theDefinition->GetPDGCharge() );     
00511  G4int baryonBalance = G4lrint(theDefinition->GetBaryonNumber() );
00512  G4LorentzVector energyMomentumBalance(Get4Momentum());
00513  G4double theTotalActualWidth = this->EvaluateTotalActualWidth();
00514  if (theTotalActualWidth !=0)
00515     {
00516      G4int index;
00517      G4double theSumActualWidth = 0.0;
00518      G4double* theCumActualWidth = new G4double[nChannels];
00519      for (index = nChannels - 1; index >= 0; index--)
00520         {
00521          theSumActualWidth += theActualWidth[index];
00522          theCumActualWidth[index] = theSumActualWidth;
00523          //      cout << "DECAY Cum. Width " << index << "  " << theCumActualWidth[index] << G4endl;
00524         }
00525      //  cout << "DECAY Total Width " << theSumActualWidth << G4endl;
00526      //  cout << "DECAY Total Width " << theTotalActualWidth << G4endl;
00527      G4double r = theTotalActualWidth * G4UniformRand();
00528      G4VDecayChannel* theDecayChannel(0);
00529      G4int chosench=-1;
00530      for (index = nChannels - 1; index >= 0; index--)
00531         {
00532          if (r < theCumActualWidth[index])
00533             {
00534              theDecayChannel = theDecayTable->GetDecayChannel(index);
00535              //      cout << "DECAY SELECTED CHANNEL" << index << G4endl;
00536              chosench=index;
00537              break; 
00538             }
00539         }
00540 
00541      delete [] theCumActualWidth;
00542    
00543      if(!theDecayChannel)
00544      {
00545        G4cerr << "Error condition encountered in G4KineticTrack::Decay()"<<G4endl;
00546        G4cerr << "  decay channel has 0x0 channel associated."<<G4endl;
00547        G4cerr << "  particle was "<<thisDefinition->GetParticleName()<<G4endl;
00548        G4cerr << "  channel index "<< chosench << "of "<<nChannels<<"channels"<<G4endl;
00549        return 0;
00550      }
00551      G4String theParentName = theDecayChannel->GetParentName();
00552      G4double theParentMass = this->GetActualMass();
00553      G4double theBR = theActualWidth[index];
00554      //     cout << "**BR*** DECAYNEW  " << theBR << G4endl;
00555      G4int theNumberOfDaughters = theDecayChannel->GetNumberOfDaughters();
00556      G4String theDaughtersName1 = "";
00557      G4String theDaughtersName2 = "";
00558      G4String theDaughtersName3 = "";
00559      
00560      G4double masses[3]={0.,0.,0.};
00561      G4int shortlivedDaughters[3];
00562      G4int numberOfShortliveds(0);
00563      G4double SumLongLivedMass(0);
00564      for (G4int aD=0; aD < theNumberOfDaughters ; aD++)
00565      {
00566         G4ParticleDefinition* aDaughter = theDecayChannel->GetDaughter(aD);
00567         masses[aD] = aDaughter->GetPDGMass();
00568         if ( aDaughter->IsShortLived() ) 
00569         {
00570             shortlivedDaughters[numberOfShortliveds]=aD;
00571             numberOfShortliveds++;
00572         } else {
00573             SumLongLivedMass += aDaughter->GetPDGMass();
00574         }
00575                 
00576      }    
00577      switch (theNumberOfDaughters)
00578         {
00579          case 0:
00580             break;
00581          case 1:
00582             theDaughtersName1 = theDecayChannel->GetDaughterName(0);
00583             theDaughtersName2 = "";
00584             theDaughtersName3 = "";
00585             break;
00586          case 2:    
00587             theDaughtersName1 = theDecayChannel->GetDaughterName(0);        
00588             theDaughtersName2 = theDecayChannel->GetDaughterName(1);
00589             theDaughtersName3 = "";
00590             if (  numberOfShortliveds == 1) 
00591             {   G4SampleResonance aSampler;
00592                 G4double massmax=theParentMass - SumLongLivedMass;
00593                 G4ParticleDefinition * aDaughter=theDecayChannel->GetDaughter(shortlivedDaughters[0]);      
00594                 masses[shortlivedDaughters[0]]= aSampler.SampleMass(aDaughter,massmax);
00595             } else if (  numberOfShortliveds == 2) {
00596                 // choose masses one after the other, start with randomly choosen
00597                 G4int zero= (G4UniformRand() > 0.5) ? 0 : 1;
00598                 G4int one = 1-zero;
00599                 G4SampleResonance aSampler;
00600                 G4double massmax=theParentMass - aSampler.GetMinimumMass(theDecayChannel->GetDaughter(shortlivedDaughters[one]));
00601                 G4ParticleDefinition * aDaughter=theDecayChannel->GetDaughter(shortlivedDaughters[zero]);           
00602                 masses[shortlivedDaughters[zero]]=aSampler.SampleMass(aDaughter,massmax);
00603                 massmax=theParentMass - masses[shortlivedDaughters[zero]];
00604                 aDaughter=theDecayChannel->GetDaughter(shortlivedDaughters[one]);
00605                 masses[shortlivedDaughters[one]]=aSampler.SampleMass(aDaughter,massmax);
00606             }
00607             break;              
00608          default:    
00609             theDaughtersName1 = theDecayChannel->GetDaughterName(0);
00610             theDaughtersName2 = theDecayChannel->GetDaughterName(1);
00611             theDaughtersName3 = theDecayChannel->GetDaughterName(2);
00612             if (  numberOfShortliveds == 1) 
00613             {   G4SampleResonance aSampler;
00614                 G4double massmax=theParentMass - SumLongLivedMass;
00615                 G4ParticleDefinition * aDaughter=theDecayChannel->GetDaughter(shortlivedDaughters[0]);      
00616                 masses[shortlivedDaughters[0]]= aSampler.SampleMass(aDaughter,massmax);
00617             }
00618             break;
00619         }
00620 
00621 //      
00622 //      Get the decay products List
00623 //
00624      
00625      G4GeneralPhaseSpaceDecay thePhaseSpaceDecayChannel(theParentName,
00626                                                         theParentMass,
00627                                                         theBR,
00628                                                         theNumberOfDaughters,
00629                                                         theDaughtersName1,                  
00630                                                         theDaughtersName2,
00631                                                         theDaughtersName3,
00632                                                         masses);
00633      G4DecayProducts* theDecayProducts = thePhaseSpaceDecayChannel.DecayIt();
00634      if(!theDecayProducts)
00635      {
00636        G4cerr << "Error condition encountered in G4KineticTrack::Decay()"<<G4endl;
00637        G4cerr << "  phase-space decay failed."<<G4endl;
00638        G4cerr << "  particle was "<<thisDefinition->GetParticleName()<<G4endl;
00639        G4cerr << "  channel index "<< chosench << "of "<<nChannels<<"channels"<<G4endl;
00640        G4cerr << "  "<<theNumberOfDaughters<< " Daughter particles: "
00641               << theDaughtersName1<<" "<<theDaughtersName2<<" "<<theDaughtersName3<<G4endl;
00642        return 0;
00643      }
00644                                                         
00645 //
00646 //      Create the kinetic track List associated to the decay products
00647 //
00648      G4LorentzRotation toMoving(Get4Momentum().boostVector());
00649      G4DynamicParticle* theDynamicParticle;
00650      G4double formationTime = 0.0;
00651      G4ThreeVector position = this->GetPosition();
00652      G4LorentzVector momentum;
00653      G4LorentzVector momentumBalanceCMS(0);
00654      G4KineticTrackVector* theDecayProductList = new G4KineticTrackVector;
00655      G4int dEntries = theDecayProducts->entries();
00656      G4ParticleDefinition * aProduct = 0;
00657      for (G4int i=dEntries; i > 0; i--)
00658         {
00659          theDynamicParticle = theDecayProducts->PopProducts();
00660          aProduct = theDynamicParticle->GetDefinition();
00661          chargeBalance -= G4lrint(aProduct->GetPDGCharge() );
00662          baryonBalance -= G4lrint(aProduct->GetBaryonNumber() );
00663          momentumBalanceCMS += theDynamicParticle->Get4Momentum();
00664          momentum = toMoving*theDynamicParticle->Get4Momentum();
00665          energyMomentumBalance -= momentum;
00666          theDecayProductList->push_back(new G4KineticTrack (aProduct,
00667                                                          formationTime,
00668                                                          position,
00669                                                          momentum));
00670          delete theDynamicParticle;
00671         }
00672      delete theDecayProducts;
00673      if(getenv("DecayEnergyBalanceCheck"))
00674        std::cout << "DEBUGGING energy balance in cms and lab, charge baryon balance : "
00675                  << momentumBalanceCMS << " " 
00676                  <<energyMomentumBalance << " " 
00677                  <<chargeBalance<<" "
00678                  <<baryonBalance<<" "
00679                  <<G4endl;
00680      return theDecayProductList;
00681     }
00682  else
00683     {
00684      return 0;
00685     }
00686 }

const G4LorentzVector & G4KineticTrack::Get4Momentum (  )  const [inline, virtual]

Implements G4VKineticNucleon.

Definition at line 248 of file G4KineticTrack.hh.

Referenced by G4CollisionManager::AddCollision(), G4XResonance::CrossSection(), G4XpipNTotal::CrossSection(), G4XpimNTotal::CrossSection(), G4XPDGTotal::CrossSection(), G4XPDGElastic::CrossSection(), G4XnpTotalLowE::CrossSection(), G4XnpElasticLowE::CrossSection(), G4XNNTotalLowE::CrossSection(), G4XNNElasticLowE::CrossSection(), G4XMesonBaryonElastic::CrossSection(), G4XAnnihilationChannel::CrossSection(), G4CrossSectionPatch::CrossSection(), G4CrossSectionComposite::CrossSection(), G4CrossSectionBuffer::CrossSection(), G4CollisionNN::CrossSection(), Decay(), G4VXResonance::DetailedBalance(), G4VScatteringCollision::FinalState(), G4VElasticCollision::FinalState(), G4VAnnihilationCollision::FinalState(), G4Absorber::FindProducts(), G4MesonAbsorption::GetFinalState(), G4Scatterer::GetTimeToInteraction(), G4VCrossSectionSource::PrintAll(), G4IntraNucleiCascader::processSecondary(), G4StringChipsParticleLevelInterface::Propagate(), G4QStringChipsParticleLevelInterface::Propagate(), G4IntraNucleiCascader::releaseSecondary(), G4Scatterer::Scatter(), G4CrossSectionPatch::Transition(), and G4Absorber::WillBeAbsorbed().

00249 {
00250   return theTotal4Momentum;
00251 }

G4double G4KineticTrack::GetActualMass (  )  const [inline]

Definition at line 330 of file G4KineticTrack.hh.

Referenced by G4CollisionNN::CrossSection(), Decay(), G4VScatteringCollision::FinalState(), G4VElasticCollision::FinalState(), G4KineticTrack(), G4Scatterer::GetTimeToInteraction(), G4RKPropagation::Transport(), and G4Absorber::WillBeAbsorbed().

00331 {
00332   return std::sqrt(std::abs(the4Momentum.mag2()));
00333 }

G4double * G4KineticTrack::GetActualWidth (  )  const [inline]

Definition at line 349 of file G4KineticTrack.hh.

00350 {
00351   return theActualWidth;
00352 }

G4ParticleDefinition * G4KineticTrack::GetDefinition (  )  const [inline, virtual]

Implements G4VKineticNucleon.

Definition at line 213 of file G4KineticTrack.hh.

Referenced by G4CollisionManager::AddCollision(), G4XResonance::CrossSection(), G4XPDGTotal::CrossSection(), G4XPDGElastic::CrossSection(), G4XnpTotalLowE::CrossSection(), G4XnpElasticLowE::CrossSection(), G4XAqmTotal::CrossSection(), G4XAnnihilationChannel::CrossSection(), G4CollisionNN::CrossSection(), G4CollisionComposite::CrossSection(), Decay(), G4VXResonance::DegeneracyFactor(), G4VXResonance::DetailedBalance(), G4VScatteringCollision::FinalState(), G4VElasticCollision::FinalState(), G4Absorber::FindAbsorbers(), G4VCrossSectionSource::FindKeyParticle(), G4VCrossSectionSource::FindLightParticle(), G4Absorber::FindProducts(), G4KineticTrack(), G4BCDecay::GetCollisions(), G4MesonAbsorption::GetFinalState(), G4ParticleTypeConverter::GetGenericType(), G4ConcreteMesonBaryonToResonance::GetOutgoingParticle(), G4Scatterer::GetTimeToInteraction(), G4GeneralNNCollision::IsInCharge(), G4ConcreteNNTwoBodyResonance::IsInCharge(), G4CollisionnpElastic::IsInCharge(), G4CollisionNNElastic::IsInCharge(), G4CollisionMesonBaryonElastic::IsInCharge(), G4VXResonance::IsospinCorrection(), operator=(), G4CollisionManager::Print(), G4CollisionInitialState::Print(), G4IntraNucleiCascader::processSecondary(), G4StringChipsParticleLevelInterface::Propagate(), G4QStringChipsParticleLevelInterface::Propagate(), G4IntraNucleiCascader::releaseSecondary(), G4Scatterer::Scatter(), G4RKPropagation::Transport(), and G4Absorber::WillBeAbsorbed().

00214 {
00215   return theDefinition;
00216 }

G4double G4KineticTrack::GetFormationTime (  )  const [inline]

Definition at line 225 of file G4KineticTrack.hh.

Referenced by G4XMesonBaryonElastic::CrossSection(), G4ExcitedString::G4ExcitedString(), G4KineticTrack(), G4BCLateParticle::GetCollisions(), and operator=().

00226 {
00227   return theFormationTime;
00228 }

G4int G4KineticTrack::GetnChannels (  )  const [inline]

Definition at line 337 of file G4KineticTrack.hh.

Referenced by G4KineticTrack(), and operator=().

00338 {
00339   return nChannels;
00340 }

const G4ThreeVector & G4KineticTrack::GetPosition (  )  const [inline, virtual]

Implements G4VKineticNucleon.

Definition at line 237 of file G4KineticTrack.hh.

Referenced by G4XMesonBaryonElastic::CrossSection(), Decay(), G4VScatteringCollision::FinalState(), G4VAnnihilationCollision::FinalState(), G4Absorber::FindAbsorbers(), G4Absorber::FindProducts(), G4ExcitedString::G4ExcitedString(), G4KineticTrack(), G4RKPropagation::GetSphereIntersectionTimes(), G4Scatterer::GetTimeToInteraction(), G4IntraNucleiCascader::processSecondary(), and G4RKPropagation::Transport().

00238 {
00239   return thePosition;
00240 }

G4double G4KineticTrack::GetProjectilePotential (  )  const [inline]

Definition at line 440 of file G4KineticTrack.hh.

Referenced by G4RKPropagation::Transport().

00441 {
00442         return theProjectilePotential;
00443 }

G4KineticTrack::CascadeState G4KineticTrack::GetState (  )  const [inline]

Definition at line 421 of file G4KineticTrack.hh.

Referenced by G4RKPropagation::Transport().

00422 {
00423         return theStateToNucleus;
00424 }

const G4LorentzVector & G4KineticTrack::GetTrackingMomentum (  )  const [inline]

Definition at line 253 of file G4KineticTrack.hh.

Referenced by G4KineticTrack(), G4RKPropagation::GetSphereIntersectionTimes(), G4Scatterer::GetTimeToInteraction(), operator=(), and G4RKPropagation::Transport().

00254 {
00255    return the4Momentum;
00256 }

void G4KineticTrack::Hit (  )  [inline]

Definition at line 405 of file G4KineticTrack.hh.

References G4Nucleon::Hit().

00406 {
00407   if(theNucleon) 
00408   {
00409     theNucleon->Hit(1);
00410   }
00411 }

G4bool G4KineticTrack::IsParticipant (  )  const [inline]

Definition at line 414 of file G4KineticTrack.hh.

References G4Nucleon::AreYouHit().

00415 { 
00416   if(!theNucleon) return true;
00417   return theNucleon->AreYouHit(); 
00418 }

G4int G4KineticTrack::operator!= ( const G4KineticTrack right  )  const

Definition at line 476 of file G4KineticTrack.cc.

00477 {
00478  return (this != & right);
00479 }

G4KineticTrack & G4KineticTrack::operator= ( const G4KineticTrack right  ) 

Definition at line 444 of file G4KineticTrack.cc.

References GetDefinition(), GetFormationTime(), GetnChannels(), GetTrackingMomentum(), the4Momentum, theActualWidth, theFermi3Momentum, theNucleon, theStateToNucleus, and theTotal4Momentum.

00445 {
00446  if (this != &right)
00447     {
00448      theDefinition = right.GetDefinition();
00449      theFormationTime = right.GetFormationTime();
00450      the4Momentum = right.the4Momentum;  
00451      the4Momentum = right.GetTrackingMomentum();
00452      theFermi3Momentum = right.theFermi3Momentum;
00453      theTotal4Momentum = right.theTotal4Momentum;
00454      theNucleon=right.theNucleon;
00455      theStateToNucleus=right.theStateToNucleus;
00456      if (theActualWidth != 0) delete [] theActualWidth;
00457      nChannels = right.GetnChannels();      
00458      theActualWidth = new G4double[nChannels];
00459      for ( G4int i = 0; i < nChannels; i++)
00460         {
00461          theActualWidth[i] = right.theActualWidth[i];
00462         }
00463     }
00464  return *this;
00465 }

G4int G4KineticTrack::operator== ( const G4KineticTrack right  )  const

Definition at line 469 of file G4KineticTrack.cc.

00470 {
00471  return (this == & right);
00472 }

G4double G4KineticTrack::SampleResidualLifetime (  )  [inline]

Definition at line 374 of file G4KineticTrack.hh.

References G4UniformRand.

Referenced by G4BCDecay::GetCollisions().

00375 {
00376  G4double theTotalActualWidth = this->EvaluateTotalActualWidth();
00377  G4double tau = CLHEP::hbar_Planck * (-1.0 / theTotalActualWidth);
00378  G4double theResidualLifetime = tau * std::log(G4UniformRand());
00379  return theResidualLifetime*the4Momentum.gamma();
00380 }

void G4KineticTrack::Set4Momentum ( const G4LorentzVector a4Momentum  )  [inline]

Definition at line 258 of file G4KineticTrack.hh.

Referenced by G4CollisionNN::CrossSection(), G4VElasticCollision::FinalState(), G4KineticTrack(), and Update4Momentum().

00259 {
00260 //  set the4Momentum and update theTotal4Momentum
00261 
00262   theTotal4Momentum=a4Momentum;
00263   the4Momentum = theTotal4Momentum;
00264   theFermi3Momentum=G4LorentzVector(0);
00265 }

void G4KineticTrack::SetDefinition ( G4ParticleDefinition aDefinition  )  [inline]

Definition at line 218 of file G4KineticTrack.hh.

00219 {
00220   theDefinition = aDefinition;
00221 }

void G4KineticTrack::SetFormationTime ( G4double  aFormationTime  )  [inline]

Definition at line 230 of file G4KineticTrack.hh.

00231 {
00232   theFormationTime = aFormationTime;
00233 }

void G4KineticTrack::SetNucleon ( G4Nucleon aN  )  [inline]

Definition at line 109 of file G4KineticTrack.hh.

00109 {theNucleon = aN;}

void G4KineticTrack::SetPosition ( const G4ThreeVector  aPosition  )  [inline]

Definition at line 242 of file G4KineticTrack.hh.

00243 {
00244   thePosition = aPosition;
00245 }

void G4KineticTrack::SetProjectilePotential ( const G4double  aPotential  )  [inline]

Definition at line 435 of file G4KineticTrack.hh.

00436 {
00437         theProjectilePotential = aPotential;
00438 }

G4KineticTrack::CascadeState G4KineticTrack::SetState ( const CascadeState  new_state  )  [inline]

Definition at line 427 of file G4KineticTrack.hh.

Referenced by G4BinaryCascade::ApplyYourself(), and G4RKPropagation::Transport().

00428 {
00429         CascadeState old_state=theStateToNucleus;
00430         theStateToNucleus=new_state;
00431         return old_state;
00432 }

void G4KineticTrack::SetTrackingMomentum ( const G4LorentzVector a4Momentum  )  [inline]

Definition at line 291 of file G4KineticTrack.hh.

Referenced by G4RKPropagation::Transport(), and UpdateTrackingMomentum().

00292 {
00293 //  set the4Momentum and update theTotal4Momentum, keep the mass of aMomentum
00294 
00295   the4Momentum = aMomentum;
00296   theTotal4Momentum=the4Momentum+theFermi3Momentum;
00297 //     keep mass of aMomentum for the total momentum
00298   G4double mass2 = aMomentum.mag2();
00299   G4double p2=theTotal4Momentum.vect().mag2();
00300   theTotal4Momentum.setE(std::sqrt(mass2+p2));
00301 }

void G4KineticTrack::Update4Momentum ( const G4ThreeVector aMomentum  )  [inline]

Definition at line 283 of file G4KineticTrack.hh.

References Set4Momentum().

00284 {
00285 // update the4Momentum with aMomentum at constant mass (the4Momentum.mag()  
00286 //   updates theTotal4Momentum as well.
00287   G4double newE=std::sqrt(theTotal4Momentum.mag2() + aMomentum.mag2());
00288   Set4Momentum(G4LorentzVector(aMomentum, newE));
00289 }

void G4KineticTrack::Update4Momentum ( G4double  aEnergy  )  [inline]

Definition at line 267 of file G4KineticTrack.hh.

References Set4Momentum(), and sqr().

00268 {
00269 // update the4Momentum with aEnergy at constant mass (the4Momentum.mag()  
00270 //   updates theTotal4Momentum as well.
00271   G4double newP(0);
00272   G4double mass2=theTotal4Momentum.mag2();
00273   if ( sqr(aEnergy) > mass2 )
00274   {
00275       newP = std::sqrt(sqr(aEnergy) - mass2 );
00276   } else
00277   {
00278       aEnergy=std::sqrt(mass2);
00279   }
00280   Set4Momentum(G4LorentzVector(newP*the4Momentum.vect().unit(), aEnergy));
00281 }

void G4KineticTrack::UpdateTrackingMomentum ( const G4ThreeVector aMomentum  )  [inline]

Definition at line 319 of file G4KineticTrack.hh.

References SetTrackingMomentum().

00320 {
00321 // update the4Momentum with aMomentum at constant mass (the4Momentum.mag()  
00322 //   updates theTotal4Momentum as well.
00323   G4double newE=std::sqrt(theTotal4Momentum.mag2() + aMomentum.mag2());
00324   SetTrackingMomentum(G4LorentzVector(aMomentum, newE));
00325 }

void G4KineticTrack::UpdateTrackingMomentum ( G4double  aEnergy  )  [inline]

Definition at line 303 of file G4KineticTrack.hh.

References SetTrackingMomentum(), and sqr().

00304 {
00305 // update the4Momentum with aEnergy at constant mass (the4Momentum.mag()  
00306 //   updates theTotal4Momentum as well.
00307   G4double newP(0);
00308   G4double mass2=theTotal4Momentum.mag2();
00309   if ( sqr(aEnergy) > mass2 )
00310   {
00311       newP = std::sqrt(sqr(aEnergy) - mass2 );
00312   } else
00313   {
00314       aEnergy=std::sqrt(mass2);
00315   }
00316   SetTrackingMomentum(G4LorentzVector(newP*the4Momentum.vect().unit(), aEnergy));
00317 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:52:21 2013 for Geant4 by  doxygen 1.4.7