Ignore:
Timestamp:
Nov 25, 2009, 5:13:58 PM (15 years ago)
Author:
garnier
Message:

update CVS release candidate geant4.9.3.01

Location:
trunk/source/particles/management/src
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/particles/management/src/G4DalitzDecayChannel.cc

    r992 r1196  
    2525//
    2626//
    27 // $Id: G4DalitzDecayChannel.cc,v 1.8 2006/06/29 19:24:58 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4DalitzDecayChannel.cc,v 1.9 2009/08/17 14:52:19 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
     
    5252                   :G4VDecayChannel("Dalitz Decay",1)
    5353{
    54   //#ifdef G4VERBOSE
    55   //if (GetVerboseLevel()>1) {
    56   //  G4cout << "G4DalitzDecayChannel:: constructor ";
    57   //  G4cout << "addr[" << this << "]" << G4endl;
    58   //}
    59   //#endif
    6054  // set names for daughter particles
    6155  SetParent(theParentName);
     
    6660  SetDaughter(idLepton, theLeptonName);
    6761  SetDaughter(idAntiLepton, theAntiLeptonName);
    68   //
    69   //#ifdef G4VERBOSE
    70   //if (GetVerboseLevel()>1) DumpInfo();
    71   //#endif
    7262}
    7363
  • trunk/source/particles/management/src/G4DecayProducts.cc

    r992 r1196  
    2525//
    2626//
    27 // $Id: G4DecayProducts.cc,v 1.16 2007/10/06 06:49:29 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4DecayProducts.cc,v 1.17 2009/04/02 02:24:53 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
     
    240240  G4ThreeVector parent_momentum = direction*(theParentParticle->GetTotalMomentum());
    241241  // check momentum dirction is a unit vector
    242   if ( (parent_momentum.mag() >0.0) && (std::abs(direction.mag()-1.0) >1.0e-6 ) ) {
     242  if ( (parent_momentum.mag() >0.0) && (std::fabs(direction.mag()-1.0) >1.0e-6 ) ) {
    243243#ifdef G4VERBOSE
    244244    G4cout << " Momentum Direction Vector of Parent is not normalized ";
     
    261261    momentum = direction*(theProductVector[index]->GetTotalMomentum());
    262262    // check momentum dirction is a unit vector
    263     if ( (momentum.mag()>0.0) && (std::abs(direction.mag()-1.0) > 1.0e-6)) {
     263    if ( (momentum.mag()>0.0) && (std::fabs(direction.mag()-1.0) > 1.0e-6)) {
    264264#ifdef G4VERBOSE
    265265      G4cout << " Momentum Direction Vector of Daughter [" << index;
     
    280280  }
    281281  // check energy/momentum conservation
    282   if ( (std::abs(total_energy) >1.0e-6) || (total_momentum.mag() >1.0e-6 ) ){
     282  if ( (std::fabs(total_energy) >1.0e-9*MeV) || (total_momentum.mag() >1.0e-9*MeV ) ){
    283283#ifdef G4VERBOSE
    284284    G4cout << " Energy/Momentum is not conserved   "<< G4endl;
  • trunk/source/particles/management/src/G4DecayTable.cc

    r992 r1196  
    2626//
    2727// $Id: G4DecayTable.cc,v 1.8 2006/06/29 19:25:02 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
  • trunk/source/particles/management/src/G4DecayTableMessenger.cc

    r992 r1196  
    2626//
    2727// $Id: G4DecayTableMessenger.cc,v 1.6 2006/06/29 19:25:04 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
  • trunk/source/particles/management/src/G4DynamicParticle.cc

    r992 r1196  
    2525//
    2626//
    27 // $Id: G4DynamicParticle.cc,v 1.25 2007/03/11 07:17:35 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4DynamicParticle.cc,v 1.26 2009/08/17 14:52:19 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
     
    173173    G4double totalenergy = aParticleMomentum.t();
    174174    G4double mass2 = totalenergy*totalenergy - pModule2;
    175     if(mass2 < 0.0001*MeV*MeV) {
     175    if(mass2 < EnergyMomentumRelationAllowance*EnergyMomentumRelationAllowance) {
    176176      theDynamicalMass = 0.;
    177177      SetKineticEnergy(totalenergy);
     
    213213
    214214    G4double mass2 = totalEnergy*totalEnergy - pModule2;
    215     if(mass2 < 0.0001*MeV*MeV) {
     215    if(mass2 < EnergyMomentumRelationAllowance*EnergyMomentumRelationAllowance) {
    216216      theDynamicalMass = 0.;
    217217      SetKineticEnergy(totalEnergy);
     
    309309  // remove preassigned decay
    310310  if (thePreAssignedDecayProducts != 0) {
    311     G4cout << " G4DynamicParticle::SetDefinition()::";
    312     G4cout << "!!! Pre-assigned decay products is attached !!!! " << G4endl;
    313     DumpInfo(0);
    314     G4cout << "!!! New Definition is " << aParticleDefinition->GetParticleName() << " !!! " << G4endl;
    315     G4cout << "!!! Pre-assigned decay products will be deleted !!!! " << G4endl;
     311#ifdef G4VERBOSE
     312    if (verboseLevel>0) {
     313      G4cout << " G4DynamicParticle::SetDefinition()::";
     314      G4cout << "!!! Pre-assigned decay products is attached !!!! " << G4endl;
     315      DumpInfo(0);
     316      G4cout << "!!! New Definition is " << aParticleDefinition->GetParticleName()
     317             << " !!! " << G4endl;
     318      G4cout << "!!! Pre-assigned decay products will be deleted !!!! " << G4endl;
     319    }
     320#endif
    316321    delete thePreAssignedDecayProducts;
    317322  }
     
    414419void G4DynamicParticle::DumpInfo(G4int mode) const
    415420{
     421#ifdef G4VERBOSE
    416422  if (theParticleDefinition == 0) {
    417423    G4cout << " G4DynamicParticle::DumpInfo():: !!!Particle type not defined !!!! " << G4endl;
     
    438444    }
    439445  }
     446#endif
    440447}
    441448
  • trunk/source/particles/management/src/G4ElectronOccupancy.cc

    r992 r1196  
    2626//
    2727// $Id: G4ElectronOccupancy.cc,v 1.9 2006/06/29 19:25:24 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
  • trunk/source/particles/management/src/G4HyperNucleiProperties.cc

    r992 r1196  
    2525//
    2626// $Id: G4HyperNucleiProperties.cc,v 1.4 2008/10/22 12:35:46 kurasige Exp $
    27 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2828//
    2929// ------------------------------------------------------------
  • trunk/source/particles/management/src/G4IonTable.cc

    r992 r1196  
    2525//
    2626//
    27 // $Id: G4IonTable.cc,v 1.54 2009/01/28 13:49:04 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4IonTable.cc,v 1.60 2009/09/23 12:13:48 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
     
    129129    }
    130130#endif
    131       return 0;
     131    return 0;
    132132  }
    133133
     
    137137  G4double mu = 0.0;
    138138
    139   G4IsotopeProperty*  fProperty = FindIsotope(Z, A, E, J);
     139  const G4IsotopeProperty*  fProperty = FindIsotope(Z, A, E, J);
    140140  if (fProperty !=0 ){
    141141    E    = fProperty->GetEnergy();
     
    167167 
    168168#ifdef G4VERBOSE
    169   if (GetVerboseLevel()>1) {
    170     G4cout << "G4IonTable::CreateIon() : create ion of " << name << G4endl;
     169   if (GetVerboseLevel()>1) {
     170    G4cout << "G4IonTable::CreateIon() : create ion of " << name
     171           << "  " << Z << ", " << A
     172           << " encoding=" << encoding << G4endl;
    171173  }
    172174#endif
     
    174176  // Add process manager to the ion
    175177  AddProcessManager(name);
    176      
    177   if (fProperty !=0) delete fProperty;
     178 
    178179  return ion;
    179180}
     
    243244#ifdef G4VERBOSE
    244245  if (GetVerboseLevel()>1) {
    245     G4cout << "G4IonTable::CreateIon() : create ion of " << name << G4endl;
     246    G4cout << "G4IonTable::CreateIon() : create hyper ion of " << name
     247           << " encoding=" << encoding << G4endl;
    246248  }
    247249#endif
     
    369371
    370372  // -- loop over all particles in Ion table
    371   G4IonList::iterator idx;
    372   for (idx = fIonList->begin(); idx!= fIonList->end(); ++idx) {
    373     ion = *idx;
    374 
    375     // Z = Atomic Number
    376     G4int     anAtomicNumber   = ion->GetAtomicNumber();
    377      // A = baryon number
    378     G4int  anAtomicMass    =  ion->GetAtomicMass();
     373  G4int encoding=GetNucleusEncoding(Z, A, 0);
     374  G4IonList::iterator i = fIonList->find(encoding);
     375  for( ;i != fIonList->end() ; i++) {
     376    ion = i->second;
     377    if ( ( ion->GetAtomicNumber() != Z) || (ion->GetAtomicMass()!=A) ) break;
     378
    379379     // excitation level
    380380    G4double anExcitaionEnergy = ((const G4Ions*)(ion))->GetExcitationEnergy();
    381 
    382     if ( (A == anAtomicMass) &&
    383          (Z == anAtomicNumber ) &&
    384          ( std::abs(E - anExcitaionEnergy ) < EnergyTorelance ) ) {
     381    if ( ( std::fabs(E - anExcitaionEnergy ) < EnergyTorelance ) ) {
    385382      isFound = true;
    386383      break;
     
    421418
    422419  // -- loop over all particles in Ion table
    423   G4IonList::iterator idx;
    424   for (idx = fIonList->begin(); idx!= fIonList->end(); ++idx) {
    425     ion = *idx;
    426 
    427     // Z = Atomic Number
    428     G4int     anAtomicNumber   = ion->GetAtomicNumber();
    429     // A = baryon number
    430     G4int  anAtomicMass    =  ion->GetAtomicMass();
    431     // L = lambda number
    432     G4int lambdaNumber = ion->GetQuarkContent(3);
     420  G4int encoding=GetNucleusEncoding(Z, A, L);
     421  G4IonList::iterator i = fIonList->find(encoding);
     422  for( ;i != fIonList->end() ; i++) {
     423    ion = i->second;
     424    if ( ( ion->GetAtomicNumber() != Z) || (ion->GetAtomicMass()!=A) ) break;
     425    if(  ion->GetQuarkContent(3) != L) break;
     426
    433427     // excitation level
    434428    G4double anExcitaionEnergy = ((const G4Ions*)(ion))->GetExcitationEnergy();
    435429
    436     if ( (A == anAtomicMass) &&
    437          (Z == anAtomicNumber ) &&
    438          (L == lambdaNumber ) &&
    439          ( std::abs(E - anExcitaionEnergy ) < EnergyTorelance ) ) {
     430    if ( ( std::fabs(E - anExcitaionEnergy ) < EnergyTorelance ) ) {
    440431      isFound = true;
    441432      break;
     
    454445G4int G4IonTable::GetNucleusEncoding(G4int Z, G4int A, G4double E, G4int )
    455446{
    456 // PDG code for Ions
    457 // Nuclear codes are given as 10-digit numbers +-100ZZZAAAI.
    458 //For a nucleus consisting of np protons and nn neutrons
    459 // A = np + nn and Z = np.
    460 // I gives the isomer level, with I = 0 corresponding
    461 // to the ground state and I >0 to excitations
    462 
    463 //!!! I = 1 is assigned fo all excitation states !!!   
    464 
     447  // PDG code for Ions
     448  // Nuclear codes are given as 10-digit numbers +-100ZZZAAAI.
     449  //For a nucleus consisting of np protons and nn neutrons
     450  // A = np + nn and Z = np.
     451  // I gives the isomer level, with I = 0 corresponding
     452  // to the ground state and I >0 to excitations
     453 
     454  //!!! I = 1 is assigned fo all excitation states !!!   
     455  const G4double EnergyTorelance = 0.1 * keV;
     456  if ( Z==1 && A==1 && E< EnergyTorelance ) {
     457    //proton
     458    return 2212;
     459  }
     460 
    465461  G4int encoding = 1000000000;
    466462  encoding += Z * 10000;
     
    502498    // anti particle   
    503499    return false;
    504   }
     500  }
     501  if (encoding == 2212) {
     502    // proton
     503    Z = 1;
     504    A = 1;
     505    E=0.0;
     506    J=0;
     507    return true;
     508  }
     509
    505510  if (encoding % 10 != 0) {
    506511    //!!!not supported for excitation states !!!   
     
    586591
    587592/////////////////
    588 G4bool G4IonTable::IsIon(G4ParticleDefinition* particle)
     593G4bool G4IonTable::IsIon(const G4ParticleDefinition* particle)
    589594{
    590595  // return true if the particle is ion
     
    593598  static G4String proton("proton");
    594599
     600  // neutron is not ion
     601  if ((particle->GetAtomicMass() >0) && (particle->GetAtomicNumber()>0)) return true;
     602   
    595603  //  particles derived from G4VIon and G4Ions
    596   G4bool value = (particle->GetParticleType() == nucleus);
     604  if (particle->GetParticleType() == nucleus) return true;
    597605
    598606  // proton (Hydrogen nucleus)
    599   value = value || (particle->GetParticleName() == proton);
    600 
    601   return value;
     607  if (particle->GetParticleName() == proton) return true;
     608
     609  return false;
    602610}
    603611
     
    702710void G4IonTable::Insert(G4ParticleDefinition* particle)
    703711{
     712  if (!IsIon(particle)) return;
     713  if (Contains(particle)) return;
     714 
     715  G4int Z = particle->GetAtomicNumber();
     716  G4int A = particle->GetAtomicMass(); 
     717  G4int L = particle->GetQuarkContent(3);  //strangeness
     718  G4int encoding=GetNucleusEncoding(Z, A, L);
     719
     720  fIonList->insert( std::pair<G4int, G4ParticleDefinition*>(encoding, particle) );
     721
     722}
     723
     724/////////////////
     725void G4IonTable::Remove(G4ParticleDefinition* particle)
     726{
    704727  if (IsIon(particle)) {
    705     fIonList->push_back(particle);
    706   }
    707 }
    708 
    709 /////////////////
    710 void G4IonTable::Remove(G4ParticleDefinition* particle)
    711 {
    712   if (IsIon(particle)) {
    713     G4IonList::iterator idx;
    714     for (idx = fIonList->begin(); idx!= fIonList->end(); ++idx) {
    715       if ( particle == *idx) {
    716         fIonList->erase(idx);
    717         break;
     728    G4int Z = particle->GetAtomicNumber();
     729    G4int A = particle->GetAtomicMass(); 
     730    G4int L = particle->GetQuarkContent(3);  //strangeness
     731    G4int encoding=GetNucleusEncoding(Z, A, L);
     732    if (encoding !=0 ) {
     733      G4IonList::iterator i = fIonList->find(encoding);
     734      for( ;i != fIonList->end() ; i++) {
     735        if (particle == i->second) {
     736          fIonList->erase(i);
     737          break;
     738        }
    718739      }
    719740    }
     
    739760  G4IonList::iterator idx;
    740761  for (idx = fIonList->begin(); idx!= fIonList->end(); ++idx) {
    741     ion = *idx;
     762    ion = idx->second;
    742763    if (( particle_name == "ALL" ) || (particle_name == "all")){
    743764      ion->DumpTable();
     
    860881
    861882
    862 
    863 
    864 
    865 
    866 
    867 
    868 
    869 
    870 
    871 
    872 
    873 
     883////////////////////
     884void G4IonTable::CreateAllIon()
     885{
     886  G4int    Z;
     887  G4int    A;
     888  G4double E=0.0;
     889  G4int    J=0;
     890 
     891  for (Z=1; Z<=120; Z++) {
     892    for (A=Z;A<999 && A<Z*3+10; A++) {
     893      if (G4NucleiProperties::IsInStableTable(A,Z)){     
     894        GetIon(Z,A,E,J);
     895      }
     896    }
     897  }
     898}
     899
     900////////////////////
     901G4ParticleDefinition* G4IonTable::GetParticle(G4int index) const
     902{
     903  if ( (index >=0) && (index < Entries()) ) {
     904    G4IonList::iterator idx = fIonList->begin();
     905    G4int counter = 0;
     906    while( idx != fIonList->end() ){
     907      if ( counter == index ) return idx->second;
     908      counter++;
     909      idx++;
     910    }
     911  }
     912#ifdef G4VERBOSE
     913  if (GetVerboseLevel()>1){
     914    G4cout << " G4IonTable::GetParticle";
     915    G4cout << " invalid index (=" << index << ")"
     916           << " entries = " << Entries() << G4endl;
     917  }
     918#endif
     919  return 0;
     920}
     921
     922
     923
     924
     925
     926
     927
     928
     929
     930
     931
  • trunk/source/particles/management/src/G4Ions.cc

    r992 r1196  
    2525//
    2626//
    27 // $Id: G4Ions.cc,v 1.13 2008/06/08 12:43:19 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4Ions.cc,v 1.16 2009/08/06 15:53:42 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
     
    6666   theExcitationEnergy = excitation;
    6767
    68    SetAtomicNumber( G4int(GetPDGCharge()/eplus) );
    69    SetAtomicMass( GetBaryonNumber() );
    70 
    71    //G4cout << "G4Ions::" << GetParticleName() << G4endl;
     68   if (GetAtomicNumber() == 0  ) {
     69     SetAtomicNumber( G4int(GetPDGCharge()/eplus) );
     70     SetAtomicMass( GetBaryonNumber() );
     71   }
    7272}
    7373
  • trunk/source/particles/management/src/G4IsotopeProperty.cc

    r992 r1196  
    2525//
    2626//
    27 // $Id: G4IsotopeProperty.cc,v 1.7 2007/03/16 05:25:08 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4IsotopeProperty.cc,v 1.8 2009/08/17 14:52:19 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
     
    107107void G4IsotopeProperty::DumpInfo() const
    108108{
     109#ifdef G4VERBOSE
    109110  G4cout << "AtomicNumber: " << fAtomicNumber << G4endl;
    110111  G4cout << "AtomicMass: " << fAtomicMass << G4endl;
     
    122123    G4cout << "Decay Table is not defined !" << G4endl;
    123124  }
     125#endif
    124126}
    125127
  • trunk/source/particles/management/src/G4KL3DecayChannel.cc

    r992 r1196  
    2525//
    2626//
    27 // $Id: G4KL3DecayChannel.cc,v 1.8 2006/06/29 19:25:32 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4KL3DecayChannel.cc,v 1.9 2009/08/17 14:52:19 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
     
    5555                                   thePionName,theLeptonName,theNutrinoName)
    5656{
    57   //#ifdef G4VERBOSE
    58   //if (GetVerboseLevel()>1) {
    59   //  G4cout << "G4KL3DecayChannel:: constructor ";
    60   //  G4cout << "addr[" << this << "]" << G4endl;
    61   //}
    62   //#endif
     57  static const G4String K_plus("kaon+");
     58  static const G4String K_minus("kaon-");
     59  static const G4String K_L("kaon0L");
     60  static const G4String Mu_plus("mu+");
     61  static const G4String Mu_minus("mu-");
     62  static const G4String E_plus("e+");
     63  static const G4String E_minus("e-");
     64 
    6365  // check modes
    64   if ( ((theParentName == "kaon+")&&(theLeptonName == "e+")) ||
    65        ((theParentName == "kaon-")&&(theLeptonName == "e-"))   ) {
     66  if ( ((theParentName == K_plus)&&(theLeptonName == E_plus)) ||
     67       ((theParentName == K_minus)&&(theLeptonName == E_minus))   ) {
    6668    // K+- (Ke3)
    6769    pLambda = 0.0286;
    6870    pXi0    = -0.35;
    69    } else if ( ((theParentName == "kaon+")&&(theLeptonName == "mu+")) ||
    70        ((theParentName == "kaon-")&&(theLeptonName == "mu-"))   ) {
     71   } else if ( ((theParentName == K_plus)&&(theLeptonName == Mu_plus)) ||
     72       ((theParentName == K_minus)&&(theLeptonName == Mu_minus))   ) {
    7173    // K+- (Kmu3)
    7274    pLambda = 0.033;
    7375    pXi0    = -0.35;
    74   } else if ( (theParentName == "kaon0L") &&
    75               ((theLeptonName == "e+") ||(theLeptonName == "e-"))  ){
     76  } else if ( (theParentName == K_L) &&
     77              ((theLeptonName == E_plus) ||(theLeptonName == E_minus))  ){
    7678    // K0L (Ke3)
    7779    pLambda = 0.0300;
    7880    pXi0    = -0.11;
    79   } else if ( (theParentName == "kaon0L") &&
    80               ((theLeptonName == "mu+") ||(theLeptonName == "mu-"))  ){
     81  } else if ( (theParentName == K_L) &&
     82              ((theLeptonName == Mu_plus) ||(theLeptonName == Mu_minus))  ){
    8183    // K0L (Kmu3)
    8284    pLambda = 0.034;
    8385    pXi0    = -0.11;
    8486  } else {
    85     //#ifdef G4VERBOSE
    86     //if (GetVerboseLevel()>0) {
    87     //   G4cout << "G4KL3DecayChannel:: constructor :";
    88     //   G4cout << "illegal arguments " << G4endl;;
    89     //   DumpInfo();
    90     // }
    91     //#endif
     87#ifdef G4VERBOSE
     88    if (GetVerboseLevel()>2) {
     89      G4cout << "G4KL3DecayChannel:: constructor :";
     90      G4cout << "illegal arguments " << G4endl;;
     91      DumpInfo();
     92    }
     93#endif
    9294    // set values for K0L (Ke3) temporarily
    9395    pLambda = 0.0300;
     
    108110  if (GetVerboseLevel()>1) G4cout << "G4KL3DecayChannel::DecayIt " << G4endl;
    109111#endif
     112
    110113  // fill parent particle and its mass
    111114  if (parent == 0) {
  • trunk/source/particles/management/src/G4MuonDecayChannel.cc

    r992 r1196  
    2626//
    2727// $Id: G4MuonDecayChannel.cc,v 1.17 2006/06/29 19:25:34 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
  • trunk/source/particles/management/src/G4MuonRadiativeDecayChannelWithSpin.cc

    r824 r1196  
    144144        rn3dim(xx,yy,zz,x);
    145145
    146         if(std::abs((xx*xx)+(yy*yy)+(zz*zz)-(x*x))>0.001){
     146        if(std::fabs((xx*xx)+(yy*yy)+(zz*zz)-(x*x))>0.001){
    147147          G4cout << "Norm of x not correct" << G4endl;
    148148        }
     
    173173        rn3dim(xx,yy,zz,y);
    174174
    175         if(std::abs((xx*xx)+(yy*yy)+(zz*zz)-(y*y))>0.001){
     175        if(std::fabs((xx*xx)+(yy*yy)+(zz*zz)-(y*y))>0.001){
    176176          G4cout << " Norm of y not correct " << G4endl;
    177177        }
     
    200200////      if (cthetaE    > 0.01)goto leap2;
    201201////      if (cthetaG    > 0.01)goto leap2;
    202 ////      if (std::abs(x-0.5) > 0.5 )goto leap2;
    203 ////      if (std::abs(y-0.5) > 0.5 )goto leap2;
     202////      if (std::fabs(x-0.5) > 0.5 )goto leap2;
     203////      if (std::fabs(y-0.5) > 0.5 )goto leap2;
    204204//
    205205//-----------------------------------------------------------------------
     
    330330                               (energy2+
    331331                                (daughtermomentum[0]+daughtermomentum[1])));
    332   G4double beta = -1.0*(daughtermomentum[0]+daughtermomentum[1])/energy2;
     332  G4double beta = (daughtermomentum[0]+daughtermomentum[1])/energy2;
     333  beta = -1.0 * std::min(beta,0.99);
    333334
    334335  G4double costhetan = 2.*G4UniformRand()-1.0;
     
    346347
    347348  // boost to the muon rest frame
    348   G4LorentzVector p4;
    349   p4 = daughterparticle2->Get4Momentum();
    350 
    351   p4.boost( (direction0.x()+direction1.x())*beta,
    352             (direction0.y()+direction1.y())*beta,
    353             (direction0.z()+direction1.z())*beta);
    354 
     349
     350  G4ThreeVector direction34(direction0.x()+direction1.x(),
     351                            direction0.y()+direction1.y(),
     352                            direction0.z()+direction1.z());
     353  direction34 = direction34.unit();
     354
     355  G4LorentzVector p4 = daughterparticle2->Get4Momentum();
     356  p4.boost(direction34.x()*beta,direction34.y()*beta,direction34.z()*beta);
    355357  daughterparticle2->Set4Momentum(p4);
     358
    356359  p4 = daughterparticle3->Get4Momentum();
    357 
    358   p4.boost( (direction0.x()+direction1.x())*beta,
    359             (direction0.y()+direction1.y())*beta,
    360             (direction0.z()+direction1.z())*beta);
     360  p4.boost(direction34.x()*beta,direction34.y()*beta,direction34.z()*beta);
    361361  daughterparticle3->Set4Momentum(p4);
    362362
  • trunk/source/particles/management/src/G4NeutronBetaDecayChannel.cc

    r992 r1196  
    2626//
    2727// $Id: G4NeutronBetaDecayChannel.cc,v 1.7 2006/06/29 19:25:38 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
  • trunk/source/particles/management/src/G4NucleiProperties.cc

    r992 r1196  
    2525//
    2626//
    27 // $Id: G4NucleiProperties.cc,v 1.18 2008/11/06 13:17:36 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4NucleiProperties.cc,v 1.21 2009/05/02 11:58:17 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
     
    3939// Added Shell-Pairing corrections to the Cameron mass
    4040// excess formula by V.Lara (9 May 99)
    41 
     41// 090331 Migrate to AME03 by Koi, Tatsumi
    4242
    4343#include "G4NucleiProperties.hh"
    4444
    45 G4bool   G4NucleiProperties::isIntialized = false;
    4645
    4746G4double G4NucleiProperties::mass_proton = -1.;
     
    5150G4double G4NucleiProperties::mass_alpha = -1.;
    5251G4double G4NucleiProperties::mass_He3 = -1.;
    53 G4double G4NucleiProperties::electronMass[MaxZ];
     52
     53G4double G4NucleiProperties::GetNuclearMass(const G4double A, const G4double Z)
     54{
     55  G4double mass=0.0;
     56
     57  if (std::fabs(A - G4int(A)) > 1.e-10) {
     58    mass = NuclearMass(A,Z);
     59 
     60  } else {
     61    // use mass table
     62    G4int iZ = G4int(Z);
     63    G4int iA = G4int(A);
     64    mass =GetNuclearMass(iA,iZ);
     65  }
     66 
     67   return mass;
     68}
     69
     70G4double G4NucleiProperties::GetNuclearMass(const G4int A, const G4int Z)
     71{
     72  if (mass_proton  <= 0.0 ) {
     73    G4ParticleDefinition * nucleus = 0;
     74    nucleus = G4ParticleTable::GetParticleTable()->FindParticle("proton"); // proton
     75    if (nucleus!=0) mass_proton = nucleus->GetPDGMass();
     76    nucleus = G4ParticleTable::GetParticleTable()->FindParticle("neutron"); // neutron
     77    if (nucleus!=0) mass_neutron = nucleus->GetPDGMass();
     78    nucleus = G4ParticleTable::GetParticleTable()->FindParticle("deuteron"); // deuteron
     79    if (nucleus!=0) mass_deuteron = nucleus->GetPDGMass();
     80    nucleus = G4ParticleTable::GetParticleTable()->FindParticle("triton"); // triton
     81    if (nucleus!=0) mass_triton = nucleus->GetPDGMass();
     82    nucleus = G4ParticleTable::GetParticleTable()->FindParticle("alpha"); // alpha
     83    if (nucleus!=0) mass_alpha = nucleus->GetPDGMass();
     84    nucleus = G4ParticleTable::GetParticleTable()->FindParticle("He3"); // He3
     85    if (nucleus!=0) mass_He3 = nucleus->GetPDGMass();
     86
     87  }
     88
     89  if (A < 1 || Z < 0 || Z > A) {
     90#ifdef G4VERBOSE
     91    if (G4ParticleTable::GetParticleTable()->GetVerboseLevel()>0) {
     92      G4cout << "G4NucleiProperties::GetNuclearMass: Wrong values for A = " << A
     93             << " and Z = " << Z << G4endl;
     94    }
     95#endif   
     96    return 0.0;
     97  }
     98 
     99  G4double mass= -1.;
     100  if ( (Z<=2) ) {
     101    // light nuclei
     102    if ( (Z==1)&&(A==1) ) {
     103      mass = mass_proton;
     104    } else if ( (Z==0)&&(A==1) ) {
     105      mass = mass_neutron;
     106    } else if ( (Z==1)&&(A==2) ) {
     107      mass = mass_deuteron;
     108    } else if ( (Z==1)&&(A==3) ) {
     109      mass = mass_triton;
     110    } else if ( (Z==2)&&(A==4) ) {
     111      mass = mass_alpha;
     112    } else if ( (Z==2)&&(A==3) ) {
     113      mass = mass_He3;
     114    }
     115  }
     116 
     117  if (mass < 0.) {
     118    if (G4NucleiPropertiesTableAME03::IsInTable(Z,A)) {
     119      // AME 03 table
     120      mass = G4NucleiPropertiesTableAME03::GetNuclearMass(Z,A);
     121    } else if (G4NucleiPropertiesTheoreticalTable::IsInTable(Z,A)){
     122      // Theoretical table
     123      mass = G4NucleiPropertiesTheoreticalTable::GetNuclearMass(Z,A);
     124    } else {
     125      mass = NuclearMass(G4double(A),G4double(Z));
     126    }
     127  }
     128
     129  if (mass < 0.) mass = 0.0;
     130  return mass;
     131}
     132
     133G4bool G4NucleiProperties::IsInStableTable(const G4double A, const G4double Z)
     134{
     135  G4int iA = G4int(A);
     136  G4int iZ = G4int(Z);
     137  return IsInStableTable(iA, iZ);
     138}
     139
     140G4bool G4NucleiProperties::IsInStableTable(const G4int A, const int Z)
     141{
     142  if (A < 1 || Z < 0 || Z > A) {
     143#ifdef G4VERBOSE
     144    if (G4ParticleTable::GetParticleTable()->GetVerboseLevel()>0) {
     145      G4cout << "G4NucleiProperties::IsInStableTable: Wrong values for A = "
     146             << A << " and Z = " << Z << G4endl;       
     147    }
     148#endif
     149    return false;
     150  }
     151
     152  return G4NucleiPropertiesTableAME03::IsInTable(Z,A);
     153
     154}
     155
     156G4double G4NucleiProperties::GetMassExcess(const G4double A, const G4double Z)
     157{
     158  G4int iA = G4int(A);
     159  G4int iZ = G4int(Z);
     160  return GetMassExcess(iA,iZ);
     161}
     162
     163G4double G4NucleiProperties::GetMassExcess(const G4int A, const G4int Z)
     164{
     165  if (A < 1 || Z < 0 || Z > A) {
     166#ifdef G4VERBOSE
     167    if (G4ParticleTable::GetParticleTable()->GetVerboseLevel()>0) {
     168      G4cout << "G4NucleiProperties::GetMassExccess: Wrong values for A = "
     169             << A << " and Z = " << Z << G4endl;
     170    }
     171#endif   
     172    return 0.0;
     173   
     174  } else {
     175
     176    if (G4NucleiPropertiesTableAME03::IsInTable(Z,A)){
     177      return G4NucleiPropertiesTableAME03::GetMassExcess(Z,A);
     178    } else if (G4NucleiPropertiesTheoreticalTable::IsInTable(Z,A)){
     179      return G4NucleiPropertiesTheoreticalTable::GetMassExcess(Z,A);
     180    } else {
     181      return MassExcess(A,Z);
     182    }
     183  }
     184
     185}
     186
     187
     188G4double G4NucleiProperties::GetAtomicMass(const G4double A, const G4double Z)
     189{
     190  if (A < 1 || Z < 0 || Z > A) {
     191#ifdef G4VERBOSE
     192    if (G4ParticleTable::GetParticleTable()->GetVerboseLevel()>0) {
     193      G4cout << "G4NucleiProperties::GetAtomicMass: Wrong values for A = "
     194             << A << " and Z = " << Z << G4endl;       
     195    }
     196#endif
     197    return 0.0;
     198
     199  } else if (std::fabs(A - G4int(A)) > 1.e-10) {
     200    return AtomicMass(A,Z);
     201
     202  } else {
     203    G4int iA = G4int(A);
     204    G4int iZ = G4int(Z);
     205    if (G4NucleiPropertiesTableAME03::IsInTable(iZ,iA)) {
     206      return G4NucleiPropertiesTableAME03::GetAtomicMass(iZ,iA);
     207    } else if (G4NucleiPropertiesTheoreticalTable::IsInTable(iZ,iA)){
     208      return G4NucleiPropertiesTheoreticalTable::GetAtomicMass(iZ,iA);
     209    } else {
     210      return AtomicMass(A,Z);
     211    }
     212  }
     213}
     214
     215G4double G4NucleiProperties::GetBindingEnergy(const G4double A, const G4double Z)
     216{
     217  G4int iA = G4int(A);
     218  G4int iZ = G4int(Z);
     219  return GetBindingEnergy(iA,iZ);
     220}
     221
     222G4double G4NucleiProperties::GetBindingEnergy(const G4int A, const G4int Z)
     223{
     224  if (A < 1 || Z < 0 || Z > A) {
     225#ifdef G4VERBOSE
     226    if (G4ParticleTable::GetParticleTable()->GetVerboseLevel()>0) {
     227      G4cout << "G4NucleiProperties::GetMassExccess: Wrong values for A = "
     228             << A << " and Z = " << Z << G4endl;
     229    }
     230#endif
     231    return 0.0;
     232
     233  } else {
     234    if (G4NucleiPropertiesTableAME03::IsInTable(Z,A)) {
     235      return G4NucleiPropertiesTableAME03::GetBindingEnergy(Z,A);
     236    } else if (G4NucleiPropertiesTheoreticalTable::IsInTable(Z,A)) {
     237      return G4NucleiPropertiesTheoreticalTable::GetBindingEnergy(Z,A);
     238    }else {
     239      return BindingEnergy(A,Z);
     240    }
     241
     242  }
     243}
     244
     245
     246G4double G4NucleiProperties::MassExcess(G4double A, G4double Z)
     247{
     248  return GetAtomicMass(A,Z) - A*amu_c2;
     249}
    54250
    55251G4double  G4NucleiProperties::AtomicMass(G4double A, G4double Z)
    56252{
    57   const G4double hydrogen_mass_excess = G4NucleiPropertiesTable::GetMassExcess(1,1);
    58   const G4double neutron_mass_excess =  G4NucleiPropertiesTable::GetMassExcess(0,1);
     253  const G4double hydrogen_mass_excess = G4NucleiPropertiesTableAME03::GetMassExcess(1,1);
     254  const G4double neutron_mass_excess =  G4NucleiPropertiesTableAME03::GetMassExcess(0,1);
    59255
    60256  G4double mass =
    61257      (A-Z)*neutron_mass_excess + Z*hydrogen_mass_excess - BindingEnergy(A,Z) + A*amu_c2;
     258
     259  return mass;
     260}
     261
     262G4double  G4NucleiProperties::NuclearMass(G4double A, G4double Z)
     263{
     264  if (A < 1 || Z < 0 || Z > A) {
     265#ifdef G4VERBOSE
     266    if (G4ParticleTable::GetParticleTable()->GetVerboseLevel()>0) {
     267      G4cout << "G4NucleiProperties::NuclearMass: Wrong values for A = "
     268             << A << " and Z = " << Z << G4endl;
     269    }
     270#endif
     271    return 0.0;
     272  }
     273
     274  G4double mass = AtomicMass(A,Z);
     275  // atomic mass is converted to nuclear mass according formula in  AME03
     276  mass -= Z*electron_mass_c2;
     277  mass += ( 14.4381*std::pow ( Z , 2.39 ) + 1.55468*1e-6*std::pow ( Z , 5.35 ) )*eV;     
    62278
    63279  return mass;
     
    81297}
    82298
    83 
    84 G4double G4NucleiProperties::GetNuclearMass(const G4double A, const G4double Z)
    85 {
    86   if (!isIntialized) {
    87     isIntialized = true;
    88     G4ParticleDefinition * nucleus = 0;
    89     nucleus = G4ParticleTable::GetParticleTable()->FindParticle("proton"); // proton
    90     if (nucleus!=0) mass_proton = nucleus->GetPDGMass();
    91     nucleus = G4ParticleTable::GetParticleTable()->FindParticle("neutron"); // neutron
    92     if (nucleus!=0) mass_neutron = nucleus->GetPDGMass();
    93     nucleus = G4ParticleTable::GetParticleTable()->FindParticle("deuteron"); // deuteron
    94     if (nucleus!=0) mass_deuteron = nucleus->GetPDGMass();
    95     nucleus = G4ParticleTable::GetParticleTable()->FindParticle("triton"); // triton
    96     if (nucleus!=0) mass_triton = nucleus->GetPDGMass();
    97     nucleus = G4ParticleTable::GetParticleTable()->FindParticle("alpha"); // alpha
    98     if (nucleus!=0) mass_alpha = nucleus->GetPDGMass();
    99     nucleus = G4ParticleTable::GetParticleTable()->FindParticle("He3"); // He3
    100     if (nucleus!=0) mass_He3 = nucleus->GetPDGMass();
    101 
    102     for (int iz=1; iz<MaxZ; iz+=1){
    103       electronMass[iz] =  iz*electron_mass_c2
    104                                  - 1.433e-5*MeV*std::pow(G4double(iz),2.39); ;
    105     }
    106   }
    107 
    108   if (A < 1 || Z < 0 || Z > A) {
    109 #ifdef G4VERBOSE
    110     if (G4ParticleTable::GetParticleTable()->GetVerboseLevel()>0) {
    111       G4cout << "G4NucleiProperties::GetNuclearMass: Wrong values for A = " << A
    112              << " and Z = " << Z << G4endl;
    113     }
    114 #endif   
    115     return 0.0;
    116   } else {
    117     G4double mass= -1.;
    118     if ( (Z<=2) ) {
    119       if ( (Z==1)&&(A==1) ) {
    120         mass = mass_proton;
    121       } else if ( (Z==0)&&(A==1) ) {
    122         mass = mass_neutron;
    123       } else if ( (Z==1)&&(A==2) ) {
    124         mass = mass_deuteron;
    125       } else if ( (Z==1)&&(A==3) ) {
    126         mass = mass_triton;
    127       } else if ( (Z==2)&&(A==4) ) {
    128         mass = mass_alpha;
    129       } else if ( (Z==2)&&(A==3) ) {
    130         mass = mass_He3;
    131       }
    132     }
    133     if (mass < 0.) {
    134       if (Z >= MaxZ) {
    135         mass = GetAtomicMass(A,Z) - Z*electron_mass_c2 + 1.433e-5*MeV*std::pow(Z,2.39);     
    136       } else {
    137         mass = GetAtomicMass(A,Z) - electronMass[G4int(Z)];
    138       }
    139     }
    140     if (mass < 0.) mass = 0.0;
    141     return mass;
    142   }
    143 }
    144 
    145 G4bool G4NucleiProperties::IsInStableTable(const G4double A, const G4double Z)
    146 {
    147   if (Z < 0 || Z > A) {
    148 #ifdef G4VERBOSE
    149     if (G4ParticleTable::GetParticleTable()->GetVerboseLevel()>0) {
    150       G4cout << "G4NucleiProperties::IsInStableTable: Wrong values for A = "
    151              << A << " and Z = " << Z << G4endl;       
    152     }
    153 #endif
    154     return false;
    155 
    156   } else {
    157     G4int iA = G4int(A);
    158     G4int iZ = G4int(Z);
    159     return G4NucleiPropertiesTable::IsInTable(iZ,iA);
    160   }
    161 }
    162 
    163 G4double G4NucleiProperties::GetMassExcess(const G4double A, const G4double Z)
    164 {
    165   G4int iA = G4int(A);
    166   G4int iZ = G4int(Z);
    167   return GetMassExcess(iA,iZ);
    168 }
    169 
    170 G4double G4NucleiProperties::GetMassExcess(const G4int A, const G4int Z)
    171 {
    172   if (A < 1 || Z < 0 || Z > A) {
    173 #ifdef G4VERBOSE
    174     if (G4ParticleTable::GetParticleTable()->GetVerboseLevel()>0) {
    175       G4cout << "G4NucleiProperties::GetMassExccess: Wrong values for A = "
    176              << A << " and Z = " << Z << G4endl;
    177     }
    178 #endif   
    179     return 0.0;
    180    
    181   } else {
    182 
    183     if (G4NucleiPropertiesTable::IsInTable(Z,A)){
    184       return G4NucleiPropertiesTable::GetMassExcess(Z,A);
    185     } else if (G4NucleiPropertiesTheoreticalTable::IsInTable(Z,A)){
    186       return G4NucleiPropertiesTheoreticalTable::GetMassExcess(Z,A);
    187     } else {
    188       return MassExcess(A,Z);
    189     }
    190   }
    191 
    192 }
    193 
    194 
    195 G4double G4NucleiProperties::GetAtomicMass(const G4double A, const G4double Z)
    196 {
    197   if (Z < 0 || Z > A) {
    198 #ifdef G4VERBOSE
    199     if (G4ParticleTable::GetParticleTable()->GetVerboseLevel()>0) {
    200       G4cout << "G4NucleiProperties::GetAtomicMass: Wrong values for A = "
    201              << A << " and Z = " << Z << G4endl;       
    202     }
    203 #endif
    204     return 0.0;
    205 
    206   } else if (std::abs(A - G4int(A)) > 1.e-10) {
    207     return AtomicMass(A,Z);
    208 
    209   } else {
    210     G4int iA = G4int(A);
    211     G4int iZ = G4int(Z);
    212     if (G4NucleiPropertiesTable::IsInTable(iZ,iA)) {
    213       return G4NucleiPropertiesTable::GetAtomicMass(iZ,iA);
    214     } else if (G4NucleiPropertiesTheoreticalTable::IsInTable(iZ,iA)){
    215       return G4NucleiPropertiesTheoreticalTable::GetAtomicMass(iZ,iA);
    216     } else {
    217       return AtomicMass(A,Z);
    218     }
    219   }
    220 }
    221 
    222 G4double G4NucleiProperties::GetBindingEnergy(const G4double A, const G4double Z)
    223 {
    224   G4int iA = G4int(A);
    225   G4int iZ = G4int(Z);
    226   return GetBindingEnergy(iA,iZ);
    227 }
    228 
    229 G4double G4NucleiProperties::GetBindingEnergy(const G4int A, const G4int Z)
    230 {
    231   if (A < 1 || Z < 0 || Z > A) {
    232 #ifdef G4VERBOSE
    233     if (G4ParticleTable::GetParticleTable()->GetVerboseLevel()>0) {
    234       G4cout << "G4NucleiProperties::GetMassExccess: Wrong values for A = "
    235              << A << " and Z = " << Z << G4endl;
    236     }
    237 #endif
    238     return 0.0;
    239 
    240   } else {
    241     if (G4NucleiPropertiesTable::IsInTable(Z,A)) {
    242       return G4NucleiPropertiesTable::GetBindingEnergy(Z,A);
    243     } else if (G4NucleiPropertiesTheoreticalTable::IsInTable(Z,A)) {
    244       return G4NucleiPropertiesTheoreticalTable::GetBindingEnergy(Z,A);
    245     }else {
    246       return BindingEnergy(A,Z);
    247     }
    248 
    249   }
    250 }
    251 
    252 
    253 G4double G4NucleiProperties::MassExcess(G4double A, G4double Z)
    254 {
    255   return GetAtomicMass(A,Z) - A*amu_c2;
    256 }
    257        
  • trunk/source/particles/management/src/G4NucleiPropertiesTheoreticalTableA.cc

    r992 r1196  
    2626//
    2727// $Id: G4NucleiPropertiesTheoreticalTableA.cc,v 1.8 2006/06/29 19:25:46 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
  • trunk/source/particles/management/src/G4PDGCodeChecker.cc

    r992 r1196  
    2525//
    2626//
    27 // $Id: G4PDGCodeChecker.cc,v 1.11 2008/06/08 12:43:19 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4PDGCodeChecker.cc,v 1.12 2009/04/02 02:24:53 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
     
    343343  }
    344344
    345   if (std::abs(totalCharge-thePDGCharge)>0.1*eplus) {
     345  if (std::fabs(totalCharge-thePDGCharge)>0.1*eplus) {
    346346#ifdef G4VERBOSE
    347347    if (verboseLevel>0) {
  • trunk/source/particles/management/src/G4ParticleDefinition.cc

    r992 r1196  
    2525//
    2626//
    27 // $Id: G4ParticleDefinition.cc,v 1.31 2008/06/08 12:43:19 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4ParticleDefinition.cc,v 1.34 2009/09/21 04:08:24 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
     
    5454#include "G4ParticleDefinition.hh"
    5555#include "G4ParticleTable.hh"
     56#include "G4IonTable.hh"
    5657#include "G4DecayTable.hh"
    5758#include "G4PDGCodeChecker.hh"
     59#include "G4StateManager.hh"
    5860
    5961G4ParticleDefinition::G4ParticleDefinition(
     
    110112                   fApplyCutsFlag(false)
    111113{
    112    // check name and register this particle into ParticleTable
    113    theParticleTable = G4ParticleTable::GetParticleTable();
    114    theParticleTable->Insert(this);
     114  static G4String nucleus("nucleus");
     115  theParticleTable = G4ParticleTable::GetParticleTable();
    115116   
    116117   //set verboseLevel equal to ParticleTable
     
    128129#endif
    129130   }
     131
     132   // check initialization is in Pre_Init state except for ions
     133   G4ApplicationState currentState = G4StateManager::GetStateManager()->GetCurrentState();
     134
     135   if ( (theParticleType!=nucleus) && (currentState!=G4State_PreInit)){
     136#ifdef G4VERBOSE
     137     if (GetVerboseLevel()>0) {
     138       G4cout << "G4ParticleDefintion (other than ions) should be created in Pre_Init state  ";
     139       G4cout << aName << G4endl;
     140     }
     141#endif
     142     G4Exception( "G4ParticleDefintion::G4ParticleDefintion",
     143                  "Illegal operation", JustWarning,
     144                  "G4ParticleDefinition should be created in PreInit state");
     145   }
     146
     147   
     148   if (theParticleTable->GetIonTable()->IsIon(this)) {
     149     SetAtomicNumber( G4int(GetPDGCharge()/eplus) );
     150     SetAtomicMass( GetBaryonNumber() );
     151   }
     152 
     153   
     154   // check name and register this particle into ParticleTable
     155   theParticleTable->Insert(this);
     156
    130157}
    131158
  • trunk/source/particles/management/src/G4ParticleMessenger.cc

    r992 r1196  
    2525//
    2626//
    27 // $Id: G4ParticleMessenger.cc,v 1.10 2008/06/08 12:43:19 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4ParticleMessenger.cc,v 1.11 2009/07/31 06:39:22 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
     
    5353#include "G4UIcmdWithAString.hh"
    5454#include "G4UIcmdWithAnInteger.hh"
     55#include "G4UIcmdWithoutParameter.hh"
    5556#include "G4ParticleTable.hh"
     57#include "G4IonTable.hh"
    5658#include "G4ParticleDefinition.hh"
    5759#include "G4ParticlePropertyMessenger.hh"
     
    7577  selectCmd->SetDefaultValue("none");
    7678  selectCmd->SetParameterName("particle name", false);
     79  selectCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
    7780
    7881  //Commnad   /particle/list
     
    8386  listCmd->SetDefaultValue("all");
    8487  listCmd->SetCandidates("all lepton baryon meson nucleus quarks");
     88  listCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
    8589
    8690  //Commnad   /particle/find
     
    8993  findCmd->SetDefaultValue(0);
    9094  findCmd->SetParameterName("encoding", false);
     95  findCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
     96
     97  //Commnad   /particle/createAllIon
     98  createAllCmd = new G4UIcmdWithoutParameter("/particle/createAllIon",this);
     99  createAllCmd->SetGuidance("Create All ions");
     100  createAllCmd->AvailableForStates(G4State_Idle);
    91101
    92102  // -- particle/property/Verbose ---
     
    114124  delete selectCmd;
    115125  delete findCmd;
     126  delete createAllCmd;
    116127  delete verboseCmd;
    117128
     
    158169      G4cout << "Unknown particle [" << newValues << "]. Command ignored." << G4endl;
    159170    }   
     171
    160172  } else if( command==findCmd ){
    161173    //Commnad   /particle/find
     
    167179      tmp->DumpTable();
    168180    }
     181
     182  } else if( command==createAllCmd ) {
     183    //Commnad   /particle/createAllIon
     184    theParticleTable->GetIonTable()->CreateAllIon();
     185
    169186  } else if( command==verboseCmd ) {
    170187    //Commnad   /particle/verbose
  • trunk/source/particles/management/src/G4ParticlePropertyData.cc

    r824 r1196  
    2424// ********************************************************************
    2525//
    26 // $Id: G4ParticlePropertyData.cc,v 1.3 2007/03/11 07:17:35 kurasige Exp $
     26// $Id: G4ParticlePropertyData.cc,v 1.4 2009/08/17 14:52:19 kurasige Exp $
    2727//
    2828// class G4ParticlePropertyData
     
    197197void G4ParticlePropertyData::Print() const
    198198{
     199#ifdef G4VERBOSE
    199200  G4cout << " Particle Name : " << theParticleName << G4endl;
    200201  G4cout << " PDG particle code : " << thePDGEncoding;
     
    230231  G4cout << ", " << theAntiQuarkContent[4];
    231232  G4cout << ", " << theAntiQuarkContent[5] << G4endl;
    232 }
    233 
    234 
    235 
    236 
    237 
    238 
    239 
    240 
    241 
     233#endif
     234}
     235
     236
     237
     238
     239
     240
     241
     242
     243
  • trunk/source/particles/management/src/G4ParticlePropertyMessenger.cc

    r992 r1196  
    2626//
    2727// $Id: G4ParticlePropertyMessenger.cc,v 1.7 2006/06/29 19:25:59 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
  • trunk/source/particles/management/src/G4ParticleTable.cc

    r992 r1196  
    2525//
    2626//
    27 // $Id: G4ParticleTable.cc,v 1.33 2008/06/08 12:55:45 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4ParticleTable.cc,v 1.35 2009/08/17 14:52:19 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030// class G4ParticleTable
     
    235235#ifdef G4VERBOSE
    236236      if (verboseLevel>0){
    237         G4cout << "The particle has same name "<< G4endl;
     237        G4cout << "The particle " << particle->GetParticleName()
     238               << "has been already registered in the Particle Table "<< G4endl;
    238239      }
    239240      if (verboseLevel>1){
     
    454455void G4ParticleTable::CheckReadiness()
    455456{
    456   if(!readyToUse)
    457   {
     457  if(!readyToUse) {
    458458   G4String msg;
    459459   msg = " Access to G4ParticleTable for finding a particle or equivalent\n";
  • trunk/source/particles/management/src/G4PhaseSpaceDecayChannel.cc

    r992 r1196  
    2626//
    2727// $Id: G4PhaseSpaceDecayChannel.cc,v 1.13 2007/10/06 06:49:29 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
  • trunk/source/particles/management/src/G4PrimaryParticle.cc

    r992 r1196  
    2626//
    2727// $Id: G4PrimaryParticle.cc,v 1.5 2007/10/06 06:49:29 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030
  • trunk/source/particles/management/src/G4PrimaryVertex.cc

    r992 r1196  
    2626//
    2727// $Id: G4PrimaryVertex.cc,v 1.4 2007/10/06 06:49:29 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030
  • trunk/source/particles/management/src/G4ShortLivedTable.cc

    r992 r1196  
    2525//
    2626//
    27 // $Id: G4ShortLivedTable.cc,v 1.16 2008/06/08 12:55:45 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4ShortLivedTable.cc,v 1.17 2009/08/17 14:52:19 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
     
    5353
    5454  //  No need to delete here because all particles are dynamic objects
    55   //   
    56   // remove all contents in the short lived List and delete all particles 
    57   //G4ShortLivedList::iterator i;
    58   //for (i = fShortLivedList->begin(); i!= fShortLivedList->end(); ++i) {
    59   //  delete (*i);
    60   //}
    6155
    6256  fShortLivedList->clear();
  • trunk/source/particles/management/src/G4TauLeptonicDecayChannel.cc

    r992 r1196  
    2626//
    2727// $Id: G4TauLeptonicDecayChannel.cc,v 1.5 2006/06/29 19:26:18 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
  • trunk/source/particles/management/src/G4VDecayChannel.cc

    r992 r1196  
    2525//
    2626//
    27 // $Id: G4VDecayChannel.cc,v 1.18 2006/06/29 19:26:20 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4VDecayChannel.cc,v 1.19 2009/08/17 14:52:19 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
     
    166166G4VDecayChannel::~G4VDecayChannel()
    167167{
     168  ClearDaughtersName();
    168169  if (parent_name != 0) delete parent_name;
    169   ClearDaughtersName();
     170  parent_name = 0;
    170171  if (daughters_mass != 0) delete [] daughters_mass;
     172  daughters_mass =0;
    171173}
    172174
     
    177179#ifdef G4VERBOSE
    178180      if (verboseLevel>1) {
    179         G4cout << "G4VDecayChannel::ClearDaughtersName ";
    180         G4cout << "clear all daughters " << G4endl;
     181        G4cerr << "G4VDecayChannel::ClearDaughtersName "
     182               << " for " << *parent_name << G4endl;
    181183      }
    182184#endif
  • trunk/source/particles/management/src/G4VUserPrimaryParticleInformation.cc

    r992 r1196  
    2626//
    2727// $Id: G4VUserPrimaryParticleInformation.cc,v 1.2 2006/06/29 19:26:22 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030#include "G4VUserPrimaryParticleInformation.hh"
  • trunk/source/particles/management/src/G4VUserPrimaryVertexInformation.cc

    r992 r1196  
    2626//
    2727// $Id: G4VUserPrimaryVertexInformation.cc,v 1.2 2006/06/29 19:26:24 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
Note: See TracChangeset for help on using the changeset viewer.