Ignore:
Timestamp:
Nov 5, 2010, 3:45:55 PM (15 years ago)
Author:
garnier
Message:

update ti head

Location:
trunk/source/particles/management
Files:
29 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/particles/management/GNUmakefile

    r824 r1340  
    1 # $Id: GNUmakefile,v 1.6 2004/06/11 14:25:25 gcosmo Exp $
     1# $Id: GNUmakefile,v 1.8 2010/10/27 07:47:04 gcosmo Exp $
    22# ----------------------------------------------------------------
    33# GNUmakefile for particle management library.  G.Cosmo, 4/4/97.
  • trunk/source/particles/management/include/G4DecayProducts.hh

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4DecayProducts.hh,v 1.12 2006/06/29 19:22:45 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4DecayProducts.hh,v 1.14 2010/10/27 07:47:04 gcosmo Exp $
     28// GEANT4 tag $Name: particles-V09-03-15 $
    2929//
    3030//
  • trunk/source/particles/management/include/G4DynamicParticle.hh

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4DynamicParticle.hh,v 1.20 2010/04/20 00:50:18 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4DynamicParticle.hh,v 1.22 2010/08/11 17:14:02 kurasige Exp $
     28// GEANT4 tag $Name: particles-V09-03-15 $
    2929//
    3030//
     
    8383     G4DynamicParticle();
    8484
    85      G4DynamicParticle(G4ParticleDefinition * aParticleDefinition,
     85     G4DynamicParticle(const G4ParticleDefinition * aParticleDefinition,
    8686                        const G4ThreeVector& aMomentumDirection,
    8787                        G4double aKineticEnergy);
    88      G4DynamicParticle(G4ParticleDefinition * aParticleDefinition,
     88     G4DynamicParticle(const G4ParticleDefinition * aParticleDefinition,
    8989                        const G4ThreeVector& aParticleMomentum);
    90      G4DynamicParticle(G4ParticleDefinition * aParticleDefinition,
     90     G4DynamicParticle(const G4ParticleDefinition * aParticleDefinition,
    9191                        const G4LorentzVector    &aParticleMomentum);
    92      G4DynamicParticle(G4ParticleDefinition * aParticleDefinition,
     92     G4DynamicParticle(const G4ParticleDefinition * aParticleDefinition,
    9393                        G4double aTotalEnergy,
    9494                        const G4ThreeVector &aParticleMomentum);
     
    182182     void   RemoveElectron(G4int orbit, G4int number = 1);
    183183 
     184 
     185     const G4ParticleDefinition* GetParticleDefinition() const;
     186     void SetDefinition(const G4ParticleDefinition * aParticleDefinition);
     187     //   Set/Get particle definition 
     188     //  following method of GetDefinition remains
     189     //  because of backward compatiblity. It will be removed in future
    184190     G4ParticleDefinition* GetDefinition() const;
    185      void SetDefinition(G4ParticleDefinition * aParticleDefinition);
    186       //   Set/Get particle definition 
    187 
     191 
    188192     
    189193     const G4DecayProducts *GetPreAssignedDecayProducts() const;
     
    209213      //  The normalized momentum vector
    210214
    211      G4ParticleDefinition *theParticleDefinition;
     215     const G4ParticleDefinition *theParticleDefinition;
    212216      //  Contains the static information of this particle.
    213217
  • trunk/source/particles/management/include/G4DynamicParticle.icc

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4DynamicParticle.icc,v 1.17 2010/04/19 00:23:08 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4DynamicParticle.icc,v 1.21 2010/10/27 07:47:05 gcosmo Exp $
     28// GEANT4 tag $Name: particles-V09-03-15 $
    2929//
    3030//
     
    193193inline G4ParticleDefinition* G4DynamicParticle::GetDefinition() const
    194194{
    195   return theParticleDefinition;
     195  return const_cast<G4ParticleDefinition*>(theParticleDefinition);
     196}
     197
     198inline const G4ParticleDefinition* G4DynamicParticle::GetParticleDefinition() const
     199{
     200  return const_cast<G4ParticleDefinition*>(theParticleDefinition);
    196201}
    197202
  • trunk/source/particles/management/include/G4ElectronOccupancy.hh

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4ElectronOccupancy.hh,v 1.10 2009/10/21 12:50:31 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4ElectronOccupancy.hh,v 1.12 2010/10/27 07:47:05 gcosmo Exp $
     28// GEANT4 tag $Name: particles-V09-03-15 $
    2929//
    3030//
  • trunk/source/particles/management/include/G4IonTable.hh

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4IonTable.hh,v 1.28 2009/09/23 12:13:48 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4IonTable.hh,v 1.31 2010/10/16 06:04:51 kurasige Exp $
     28// GEANT4 tag $Name: particles-V09-03-15 $
    2929//
    3030//
     
    5151#include "globals.hh"
    5252#include "G4ParticleDefinition.hh"
    53 #include "G4ParticleTableIterator.hh"
     53#include "G4ParticleTable.hh"
    5454#include "G4Ions.hh"
    5555
     
    7171 public:
    7272   // Use STL map as list of ions
    73    typedef  std::multimap<G4int, G4ParticleDefinition*> G4IonList;
    74    typedef  std::multimap<G4int, G4ParticleDefinition*>::iterator G4IonListIterator;
     73   typedef  std::multimap<G4int, const G4ParticleDefinition*> G4IonList;
     74   typedef  std::multimap<G4int, const G4ParticleDefinition*>::iterator G4IonListIterator;
    7575
    7676 public:
     
    139139   static G4bool        IsIon(const G4ParticleDefinition*);
    140140   // return true if the particle is ion
     141
     142   static G4bool        IsAntiIon(const G4ParticleDefinition*);
     143   // return true if the particle is anti_ion
     144
    141145
    142146   const G4String&  GetIonName(G4int Z, G4int A, G4double E) const;
     
    194198   // Return 'true' if the ion exists
    195199
    196    void                  Insert(G4ParticleDefinition* particle);
    197    void                  Remove(G4ParticleDefinition* particle);
     200   void                  Insert(const G4ParticleDefinition* particle);
     201   void                  Remove(const G4ParticleDefinition* particle);
    198202   // Insert/Remove an ion in the table
    199203
     
    218222   
    219223   G4ParticleDefinition* GetLightIon(G4int Z, G4int A) const;
    220    
    221    
    222    G4bool                IsLightIon(G4ParticleDefinition*) const;
     224   G4ParticleDefinition* GetLightAntiIon(G4int Z, G4int A) const;
     225   
     226   G4bool                IsLightIon(const G4ParticleDefinition*) const;
     227   G4bool                IsLightAntiIon(const G4ParticleDefinition*) const;
    223228   // return true if the particle is pre-defined ion
    224229 
  • trunk/source/particles/management/include/G4KL3DecayChannel.hh

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4KL3DecayChannel.hh,v 1.5 2006/06/29 19:23:33 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4KL3DecayChannel.hh,v 1.6 2010/10/30 07:55:00 kurasige Exp $
     28// GEANT4 tag $Name: particles-V09-03-15 $
    2929//
    3030//
     
    9090     G4double   pLambda;
    9191     G4double   pXi0;
    92      G4double   pNormalization;
    9392
    9493  public:
  • trunk/source/particles/management/include/G4ParticleDefinition.hh

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4ParticleDefinition.hh,v 1.33 2008/11/14 16:26:30 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4ParticleDefinition.hh,v 1.34 2010/08/10 15:47:42 kurasige Exp $
     28// GEANT4 tag $Name: particles-V09-03-15 $
    2929//
    3030//
     
    161161
    162162  public:// With Description
    163       G4DecayTable* GetDecayTable();
     163      G4DecayTable* GetDecayTable() const;
    164164      void          SetDecayTable(G4DecayTable* aDecayTable);
    165165      // Set/Get Decay Table
     
    172172      //   !! Process Manager can be modified !! 
    173173
    174       G4ParticleTable* GetParticleTable();
     174      G4ParticleTable* GetParticleTable() const;
    175175      // get pointer to the particle table
    176176
  • trunk/source/particles/management/include/G4ParticleDefinition.icc

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4ParticleDefinition.icc,v 1.14 2009/03/27 20:33:50 gum Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4ParticleDefinition.icc,v 1.15 2010/08/10 15:47:42 kurasige Exp $
     28// GEANT4 tag $Name: particles-V09-03-15 $
    2929//
    3030
    3131inline
    32  G4ParticleTable* G4ParticleDefinition::GetParticleTable()
     32 G4ParticleTable* G4ParticleDefinition::GetParticleTable() const
    3333{
    3434  return theParticleTable;
     
    3636
    3737inline
    38  G4DecayTable* G4ParticleDefinition::GetDecayTable()
     38 G4DecayTable* G4ParticleDefinition::GetDecayTable() const
    3939{
    4040  return theDecayTable;
  • trunk/source/particles/management/include/G4ParticleTable.hh

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4ParticleTable.hh,v 1.21 2008/03/22 06:03:40 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4ParticleTable.hh,v 1.22 2010/10/30 07:55:00 kurasige Exp $
     28// GEANT4 tag $Name: particles-V09-03-15 $
    2929//
    3030//
     
    209209   G4PTblDicIterator* fIterator;
    210210   G4PTblEncodingDictionary* fEncodingDictionary;
    211    G4int DictionaryBucketSize;
    212211
    213212   static G4ParticleTable*  fgParticleTable;
  • trunk/source/particles/management/include/G4PrimaryParticle.hh

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4PrimaryParticle.hh,v 1.4 2006/09/28 14:29:43 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4PrimaryParticle.hh,v 1.8 2010/10/27 07:47:05 gcosmo Exp $
     28// GEANT4 tag $Name: particles-V09-03-15 $
    2929//
    3030//
     
    7777      G4PrimaryParticle(G4int Pcode,
    7878                        G4double px,G4double py,G4double pz,G4double E);
    79       G4PrimaryParticle(G4ParticleDefinition* Gcode);
    80       G4PrimaryParticle(G4ParticleDefinition* Gcode,
     79      G4PrimaryParticle(const G4ParticleDefinition* Gcode);
     80      G4PrimaryParticle(const G4ParticleDefinition* Gcode,
    8181                        G4double px,G4double py,G4double pz);
    82       G4PrimaryParticle(G4ParticleDefinition* Gcode,
     82      G4PrimaryParticle(const G4ParticleDefinition* Gcode,
    8383                        G4double px,G4double py,G4double pz,G4double E);
    8484      ~G4PrimaryParticle();
     
    9494  private:
    9595      G4int PDGcode;
    96       G4ParticleDefinition * G4code;
     96      const G4ParticleDefinition * G4code;
    9797      G4double Px;
    9898      G4double Py;
     
    130130      { return PDGcode; }
    131131      inline G4ParticleDefinition * GetG4code() const
     132      { return const_cast<G4ParticleDefinition*>(G4code); }
     133      inline const G4ParticleDefinition * GetParticleDefinition() const
    132134      { return G4code; }
    133135      inline G4ThreeVector GetMomentum() const
     
    162164      // Followings are available Set methods.
    163165      void SetPDGcode(G4int Pcode);
    164       void SetG4code(G4ParticleDefinition * Gcode);
     166      void SetG4code(const G4ParticleDefinition * Gcode);
     167      void SetParticleDefinition(const G4ParticleDefinition * pdef);
    165168      inline void SetMomentum(G4double px, G4double py, G4double pz)
    166169      {
  • trunk/source/particles/management/include/G4PrimaryVertex.hh

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4PrimaryVertex.hh,v 1.4 2006/07/20 15:14:43 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4PrimaryVertex.hh,v 1.6 2010/10/27 07:47:05 gcosmo Exp $
     28// GEANT4 tag $Name: particles-V09-03-15 $
    2929//
    3030//
  • trunk/source/particles/management/include/G4ShortLivedTable.hh

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4ShortLivedTable.hh,v 1.13 2008/03/20 02:23:31 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4ShortLivedTable.hh,v 1.14 2010/08/10 15:47:42 kurasige Exp $
     28// GEANT4 tag $Name: particles-V09-03-15 $
    2929//
    3030//
     
    5858 public:
    5959   // Use STL Vector as list of shortlives
    60    typedef std::vector<G4ParticleDefinition*>  G4ShortLivedList;
     60   typedef std::vector<const G4ParticleDefinition*>  G4ShortLivedList;
    6161
    6262 public:
     
    6969   virtual ~G4ShortLivedTable();
    7070
    71    G4bool                IsShortLived(G4ParticleDefinition*) const;
     71   G4bool                IsShortLived(const G4ParticleDefinition*) const;
    7272   // return true if the particle is shortlived particle
    7373 
     
    8181   // return true if the list contains the specified particle
    8282
    83    void                  Insert(G4ParticleDefinition* particle);
     83   void                  Insert(const G4ParticleDefinition* particle);
    8484   // add the particle in the list
    8585
    86    void                  Remove(G4ParticleDefinition* particle);
     86   void                  Remove(const G4ParticleDefinition* particle);
    8787   // remove the particle (not delete) from the list
    8888
     
    132132{
    133133  if ( (index >=0 ) && (index < Entries()) ) {
    134     return (*fShortLivedList)[index];
     134    return const_cast<G4ParticleDefinition*>( (*fShortLivedList)[index] );
    135135  } else {
    136136    return 0;
  • trunk/source/particles/management/include/G4VDecayChannel.hh

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4VDecayChannel.hh,v 1.12 2006/06/29 19:24:50 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4VDecayChannel.hh,v 1.13 2010/08/10 15:47:42 kurasige Exp $
     28// GEANT4 tag $Name: particles-V09-03-15 $
    2929//
    3030//
     
    8787  public: // With Description
    8888     //get kinematics name
    89      G4String  GetKinematicsName() const;
     89     const G4String&  GetKinematicsName() const;
    9090     //get branching ratio
    9191     G4double   GetBR() const;
     
    261261
    262262inline
    263  G4String G4VDecayChannel::GetKinematicsName() const { return kinematics_name; }
     263 const G4String& G4VDecayChannel::GetKinematicsName() const { return kinematics_name; }
    264264
    265265inline
  • trunk/source/particles/management/src/G4DecayProducts.cc

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4DecayProducts.cc,v 1.18 2010/05/20 01:01:07 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4DecayProducts.cc,v 1.19 2010/10/30 07:55:00 kurasige Exp $
     28// GEANT4 tag $Name: particles-V09-03-15 $
    2929//
    3030//
     
    5151                :numberOfProducts(0),theParentParticle(0)
    5252{
    53 
     53  //clear theProductVector
     54  for (size_t i=0;i<MaxNumberOfProducts; i+=1){
     55    theProductVector[i]=0;
     56  }
    5457}
    5558
    5659G4DecayProducts::G4DecayProducts(const G4DynamicParticle &aParticle)
    57                 :numberOfProducts(0),theParentParticle(0)
     60  :numberOfProducts(0),theParentParticle(0)
    5861{
    5962  theParentParticle = new G4DynamicParticle(aParticle);
     63  //clear theProductVector
     64  for (size_t i=0;i<MaxNumberOfProducts; i+=1){
     65    theProductVector[i]=0;
     66  }
    6067}
    6168
     
    6370                :numberOfProducts(0)
    6471{
     72  //clear theProductVector
     73  for (size_t i=0;i<MaxNumberOfProducts; i+=1){
     74    theProductVector[i]=0;
     75  }
     76
    6577  // copy parent (Deep Copy)
    6678  theParentParticle = new G4DynamicParticle(*right.theParentParticle);
  • trunk/source/particles/management/src/G4DynamicParticle.cc

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4DynamicParticle.cc,v 1.29 2010/05/20 01:01:07 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4DynamicParticle.cc,v 1.30 2010/08/10 15:47:42 kurasige Exp $
     28// GEANT4 tag $Name: particles-V09-03-15 $
    2929//
    3030//
     
    9494// -- constructors ----
    9595////////////////////
    96 G4DynamicParticle::G4DynamicParticle(G4ParticleDefinition * aParticleDefinition,
     96G4DynamicParticle::G4DynamicParticle(const G4ParticleDefinition * aParticleDefinition,
    9797                                     const G4ThreeVector& aMomentumDirection,
    9898                                     G4double aKineticEnergy):
     
    113113
    114114////////////////////
    115 G4DynamicParticle::G4DynamicParticle(G4ParticleDefinition * aParticleDefinition,
     115G4DynamicParticle::G4DynamicParticle(const G4ParticleDefinition * aParticleDefinition,
    116116                                     const G4ThreeVector& aParticleMomentum):
    117117                   theParticleDefinition(aParticleDefinition),
     
    134134
    135135////////////////////
    136 G4DynamicParticle::G4DynamicParticle(G4ParticleDefinition * aParticleDefinition,
     136G4DynamicParticle::G4DynamicParticle(const G4ParticleDefinition * aParticleDefinition,
    137137                                     const G4LorentzVector   &aParticleMomentum):
    138138                   theParticleDefinition(aParticleDefinition),
     
    154154}
    155155
    156 G4DynamicParticle::G4DynamicParticle(G4ParticleDefinition * aParticleDefinition,
     156G4DynamicParticle::G4DynamicParticle(const G4ParticleDefinition * aParticleDefinition,
    157157                                     G4double totalEnergy,
    158158                                     const G4ThreeVector &aParticleMomentum):
     
    267267
    268268////////////////////
    269 void G4DynamicParticle::SetDefinition(G4ParticleDefinition * aParticleDefinition)
     269void G4DynamicParticle::SetDefinition(const G4ParticleDefinition * aParticleDefinition)
    270270{
    271271  // remove preassigned decay
     
    318318void  G4DynamicParticle::AllocateElectronOccupancy()
    319319{
    320   G4ParticleDefinition* particle = GetDefinition();
     320  const G4ParticleDefinition* particle = GetDefinition();
    321321
    322322  if (G4IonTable::IsIon(particle)) {
  • trunk/source/particles/management/src/G4IonTable.cc

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4IonTable.cc,v 1.61 2010/05/20 01:01:07 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4IonTable.cc,v 1.65 2010/10/16 06:04:51 kurasige Exp $
     28// GEANT4 tag $Name: particles-V09-03-15 $
    2929//
    3030//
     
    367367  // Search ions with A, Z ,E
    368368  //  !! J is omitted now !!
    369   G4ParticleDefinition* ion=0;
     369  const G4ParticleDefinition* ion=0;
    370370  G4bool isFound = false;
    371371
     
    386386
    387387  if ( isFound ){
    388     return ion;
     388    return const_cast<G4ParticleDefinition*>(ion);
    389389  } else {
    390390    return 0;
     
    414414  // Search ions with A, Z ,E
    415415  //  !! J is omitted now !!
    416   G4ParticleDefinition* ion=0;
     416  const G4ParticleDefinition* ion=0;
    417417  G4bool isFound = false;
    418418
     
    435435
    436436  if ( isFound ){
    437     return ion;
     437    return const_cast<G4ParticleDefinition*>(ion);
    438438  } else {
    439439    return 0;
     
    599599
    600600  // neutron is not ion
    601   if ((particle->GetAtomicMass() >0) && (particle->GetAtomicNumber()>0)) return true;
     601  if ((particle->GetAtomicMass()>0)   &&
     602      (particle->GetAtomicNumber()>0) ){
     603   if (particle->GetBaryonNumber()>0)  return true;
     604   else return false;
     605  }
     606
    602607   
    603   //  particles derived from G4VIon and G4Ions
     608  //  particles derived from G4Ions
    604609  if (particle->GetParticleType() == nucleus) return true;
    605610
     
    611616
    612617/////////////////
     618G4bool G4IonTable::IsAntiIon(const G4ParticleDefinition* particle)
     619{
     620  // return true if the particle is ion
     621
     622  static G4String anti_nucleus("anti_nucleus");
     623  static G4String anti_proton("anti_proton");
     624
     625  // anti_neutron is not ion
     626  if ((particle->GetAtomicMass()>0)   &&
     627      (particle->GetAtomicNumber()>0) ){
     628   if (particle->GetBaryonNumber()<0)  return true;
     629   else return false;
     630  }
     631
     632  //  particles derived from G4Ions
     633  if (particle->GetParticleType() == anti_nucleus) return true;
     634
     635  // anti_proton (Anti_Hydrogen nucleus)
     636  if (particle->GetParticleName() == anti_proton) return true;
     637
     638  return false;
     639}
     640
     641/////////////////
    613642#include <algorithm>
    614643
    615 G4bool G4IonTable::IsLightIon(G4ParticleDefinition* particle) const
    616 {
    617   static const std::string names[] = { "proton", "neutron", "alpha", "deuteron",
    618                            "triton", "He3", "GenericIon"};
     644G4bool G4IonTable::IsLightIon(const G4ParticleDefinition* particle) const
     645{
     646  static const std::string names[] = { "proton", "alpha", "deuteron",
     647                           "triton", "He3"};
    619648
    620649   // return true if the particle is pre-defined ion
    621   return std::find(names, names+7, particle->GetParticleName())!=names+7;
     650  return std::find(names, names+5, particle->GetParticleName())!=names+5;
     651}
     652
     653G4bool G4IonTable::IsLightAntiIon(const G4ParticleDefinition* particle) const
     654{
     655  static const std::string names[] = { "anti_proton", "anti_alpha", "anti_deuteron",
     656                           "anti_triton", "anti_He3"};
     657
     658   // return true if the particle is pre-defined ion
     659  return std::find(names, names+5, particle->GetParticleName())!=names+5;
    622660}
    623661
     
    627665  // returns pointer to pre-defined ions
    628666  static G4bool isInitialized = false;
    629   static G4ParticleDefinition* p_proton=0;
    630   static G4ParticleDefinition* p_neutron=0;
    631   static G4ParticleDefinition* p_deuteron=0;
    632   static G4ParticleDefinition* p_triton=0;
    633   static G4ParticleDefinition* p_alpha=0;
    634   static G4ParticleDefinition* p_He3=0;
     667  static const G4ParticleDefinition* p_proton=0;
     668  static const G4ParticleDefinition* p_deuteron=0;
     669  static const G4ParticleDefinition* p_triton=0;
     670  static const G4ParticleDefinition* p_alpha=0;
     671  static const G4ParticleDefinition* p_He3=0;
    635672 
    636673  if (!isInitialized) {
    637674    p_proton   = G4ParticleTable::GetParticleTable()->FindParticle("proton"); // proton
    638     p_neutron  = G4ParticleTable::GetParticleTable()->FindParticle("neutron"); // neutron
    639675    p_deuteron = G4ParticleTable::GetParticleTable()->FindParticle("deuteron"); // deuteron
    640676    p_triton   = G4ParticleTable::GetParticleTable()->FindParticle("triton"); // tritoon
     
    644680  }
    645681
    646   G4ParticleDefinition* ion=0;
     682  const G4ParticleDefinition* ion=0;
    647683  if ( (Z<=2) ) {
    648684    if ( (Z==1)&&(A==1) ) {
    649685      ion = p_proton;
    650     } else if ( (Z==0)&&(A==1) ) {
    651       ion = p_neutron;
    652686    } else if ( (Z==1)&&(A==2) ) {
    653687      ion = p_deuteron;
     
    660694    }
    661695  }
    662   return ion;
    663 }
     696  return const_cast<G4ParticleDefinition*>(ion);
     697}
     698
     699/////////////////
     700G4ParticleDefinition* G4IonTable::GetLightAntiIon(G4int Z, G4int A) const
     701{
     702  // returns pointer to pre-defined ions
     703  static G4bool isInitialized = false;
     704  static const G4ParticleDefinition* p_proton=0;
     705  static const G4ParticleDefinition* p_deuteron=0;
     706  static const G4ParticleDefinition* p_triton=0;
     707  static const G4ParticleDefinition* p_alpha=0;
     708  static const G4ParticleDefinition* p_He3=0;
     709 
     710  if (!isInitialized) {
     711    p_proton   = G4ParticleTable::GetParticleTable()->FindParticle("anti_proton"); // proton
     712    p_deuteron = G4ParticleTable::GetParticleTable()->FindParticle("anti_deuteron"); // deuteron
     713    p_triton   = G4ParticleTable::GetParticleTable()->FindParticle("anti_triton"); // tritoon
     714    p_alpha    = G4ParticleTable::GetParticleTable()->FindParticle("anti_alpha"); // alpha
     715    p_He3      = G4ParticleTable::GetParticleTable()->FindParticle("anti_He3"); // He3
     716    isInitialized = true;
     717  }
     718
     719  const G4ParticleDefinition* ion=0;
     720  if ( (Z<=2) ) {
     721    if ( (Z==1)&&(A==1) ) {
     722      ion = p_proton;
     723    } else if ( (Z==1)&&(A==2) ) {
     724      ion = p_deuteron;
     725    } else if ( (Z==1)&&(A==3) ) {
     726      ion = p_triton;
     727    } else if ( (Z==2)&&(A==4) ) {
     728      ion = p_alpha;
     729    } else if ( (Z==2)&&(A==3) ) {
     730      ion = p_He3;
     731    }
     732  }
     733  return const_cast<G4ParticleDefinition*>(ion);
     734}
     735
    664736
    665737/////////////////
     
    683755  if (L == 0) {
    684756    // calculate nucleus mass
    685     G4ParticleDefinition* ion=GetLightIon(Z, A);
     757    const G4ParticleDefinition* ion=GetLightIon(Z, A);
    686758   
    687759    if (ion!=0) {
     
    708780// -- Methods for handling conatiner  ---
    709781/////////////////
    710 void G4IonTable::Insert(G4ParticleDefinition* particle)
     782void G4IonTable::Insert(const G4ParticleDefinition* particle)
    711783{
    712784  if (!IsIon(particle)) return;
     
    718790  G4int encoding=GetNucleusEncoding(Z, A, L);
    719791
    720   fIonList->insert( std::pair<G4int, G4ParticleDefinition*>(encoding, particle) );
    721 
    722 }
    723 
    724 /////////////////
    725 void G4IonTable::Remove(G4ParticleDefinition* particle)
     792  fIonList->insert( std::pair<const G4int, const G4ParticleDefinition*>(encoding, particle) );
     793
     794}
     795
     796/////////////////
     797void G4IonTable::Remove(const G4ParticleDefinition* particle)
    726798{
    727799  if (IsIon(particle)) {
     
    757829void G4IonTable::DumpTable(const G4String &particle_name) const
    758830{
    759   G4ParticleDefinition* ion;
     831  const G4ParticleDefinition* ion;
    760832  G4IonList::iterator idx;
    761833  for (idx = fIonList->begin(); idx!= fIonList->end(); ++idx) {
     
    905977    G4int counter = 0;
    906978    while( idx != fIonList->end() ){
    907       if ( counter == index ) return idx->second;
     979      if ( counter == index ) {
     980        return const_cast<G4ParticleDefinition*>(idx->second);
     981      }
    908982      counter++;
    909983      idx++;
  • trunk/source/particles/management/src/G4Ions.cc

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4Ions.cc,v 1.16 2009/08/06 15:53:42 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4Ions.cc,v 1.17 2010/10/09 10:36:02 kurasige Exp $
     28// GEANT4 tag $Name: particles-V09-03-15 $
    2929//
    3030//
     
    6767
    6868   if (GetAtomicNumber() == 0  ) {
    69      SetAtomicNumber( G4int(GetPDGCharge()/eplus) );
    70      SetAtomicMass( GetBaryonNumber() );
     69     // AtomicNumber/Mass is positve even for anti_nulceus
     70     SetAtomicNumber( abs(G4int(GetPDGCharge()/eplus)) );
     71     SetAtomicMass( abs(GetBaryonNumber()) );
    7172   }
    7273}
  • trunk/source/particles/management/src/G4KL3DecayChannel.cc

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4KL3DecayChannel.cc,v 1.9 2009/08/17 14:52:19 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4KL3DecayChannel.cc,v 1.10 2010/10/30 07:55:00 kurasige Exp $
     28// GEANT4 tag $Name: particles-V09-03-15 $
    2929//
    3030//
     
    6262  static const G4String E_plus("e+");
    6363  static const G4String E_minus("e-");
    64  
     64 
     65  massK = 0.0;
     66  daughterM[idPi] = 0.0;
     67  daughterM[idLepton] = 0.0;
     68  daughterM[idNutrino] = 0.0;
     69
    6570  // check modes
    6671  if ( ((theParentName == K_plus)&&(theLeptonName == E_plus)) ||
  • trunk/source/particles/management/src/G4MuonDecayChannelWithSpin.cc

    r824 r1340  
    4343
    4444#include "Randomize.hh"
     45
    4546#include "G4DecayProducts.hh"
    4647#include "G4LorentzVector.hh"
     
    5051                           : G4MuonDecayChannel(theParentName,theBR)
    5152{
     53  EMMU  = 0.*MeV;
     54  EMASS = 0.*MeV;
    5255}
    5356
  • trunk/source/particles/management/src/G4MuonRadiativeDecayChannelWithSpin.cc

    r1337 r1340  
    7474#endif
    7575  }
     76  EMMU  = 0.*MeV;
     77  EMASS = 0.*MeV;
    7678}
    7779
  • trunk/source/particles/management/src/G4NucleiProperties.cc

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4NucleiProperties.cc,v 1.22 2010/05/20 01:01:07 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4NucleiProperties.cc,v 1.23 2010/08/10 15:47:42 kurasige Exp $
     28// GEANT4 tag $Name: particles-V09-03-15 $
    2929//
    3030//
     
    7272{
    7373  if (mass_proton  <= 0.0 ) {
    74     G4ParticleDefinition * nucleus = 0;
     74    const G4ParticleDefinition * nucleus = 0;
    7575    nucleus = G4ParticleTable::GetParticleTable()->FindParticle("proton"); // proton
    7676    if (nucleus!=0) mass_proton = nucleus->GetPDGMass();
  • trunk/source/particles/management/src/G4NucleiPropertiesTableAME03.cc

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4NucleiPropertiesTableAME03.cc,v 1.3 2009/05/02 11:58:17 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4NucleiPropertiesTableAME03.cc,v 1.4 2010/10/30 07:55:00 kurasige Exp $
     28// GEANT4 tag $Name: particles-V09-03-15 $
    2929//
    3030// -------------------------------------------------------------------
     
    6464                "Illegal arguemnt",
    6565                EventMustBeAborted,"Nucleon number larger than 293!");
     66    return -1;
    6667  } else if(A<1) {
    6768    G4Exception("G4NucleiPropertiesTableAME03::GetIndex",
    6869                "Illegal arguemnt",
    6970                EventMustBeAborted," Nucleon number is negative!");
     71    return -1;
    7072  } else if(Z>A) {
    7173    G4Exception("G4NucleiPropertiesTableAME03::GetIndex",
    7274                "Illegal arguemnt",
    7375                EventMustBeAborted, "Nucleon number smaller than Z!");
     76    return -1;
    7477  }
    7578   
  • trunk/source/particles/management/src/G4PDGCodeChecker.cc

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4PDGCodeChecker.cc,v 1.12 2009/04/02 02:24:53 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4PDGCodeChecker.cc,v 1.15 2010/10/30 07:55:00 kurasige Exp $
     28// GEANT4 tag $Name: particles-V09-03-15 $
    2929//
    3030//
     
    4343/////////////
    4444G4PDGCodeChecker::G4PDGCodeChecker()
    45 {
    46   code = 0;
     45  :code(0),theParticleType(""),
     46   thePDGiSpin(0),higherSpin(0),
     47   exotic(0),radial(0),multiplet(0),
     48   quark1(0),quark2(0),quark3(0),spin(0)
     49{
    4750  verboseLevel = 1;
    48 }
    49 
    50 /////////////
    51 G4int  G4PDGCodeChecker::CheckPDGCode( G4int    PDGcode,
    52                                        G4String particleType)
    53 {
    54   code = PDGcode;
    55   theParticleType = particleType;
    56 
    5751  // clear QuarkContents
    5852  G4int flavor;
     
    6155    theAntiQuarkContent[flavor] =0;
    6256  }
     57}
     58
     59/////////////
     60G4int  G4PDGCodeChecker::CheckPDGCode( G4int    PDGcode,
     61                                       G4String particleType)
     62{
     63  code = PDGcode;
     64  theParticleType = particleType;
     65
     66  // clear QuarkContents
     67  G4int flavor;
     68  for (flavor=0; flavor<NumberOfQuarkFlavor; flavor++){
     69    theQuarkContent[flavor] =0;
     70    theAntiQuarkContent[flavor] =0;
     71  }
    6372
    6473  // check code for nuclei
    65   if (theParticleType == "nucleus"){
     74  if ((theParticleType == "nucleus")||(theParticleType == "anti_nucleus")) {
    6675    return CheckForNuclei();
    6776  }
     
    359368G4int G4PDGCodeChecker::CheckForNuclei()
    360369{
    361   G4int pcode = code;
     370  G4int pcode = abs(code);
    362371  if (pcode < 1000000000) {
    363     // anti particle   
     372    // non-nuclei   
    364373    return 0;
    365374  }
     
    388397
    389398  // Fill Quark contents
    390   theQuarkContent[0] = n_up;
    391   theQuarkContent[1] = n_down;
    392   theQuarkContent[2] = n_s;
    393 
     399  if (code>0) {
     400    theQuarkContent[0] = n_up;
     401    theQuarkContent[1] = n_down;
     402    theQuarkContent[2] = n_s;
     403   } else {
     404    // anti_nucleus
     405    theAntiQuarkContent[0] = n_up;
     406    theAntiQuarkContent[1] = n_down;
     407    theAntiQuarkContent[2] = n_s;
     408  }
    394409  return code;
    395410}
  • trunk/source/particles/management/src/G4ParticleDefinition.cc

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4ParticleDefinition.cc,v 1.36 2010/05/20 01:01:07 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4ParticleDefinition.cc,v 1.37 2010/10/11 03:33:56 kurasige Exp $
     28// GEANT4 tag $Name: particles-V09-03-15 $
    2929//
    3030//
     
    151151   }
    152152 
     153   if (theParticleTable->GetIonTable()->IsAntiIon(this)) {
     154     SetAtomicNumber( abs(G4int(GetPDGCharge()/eplus)) );
     155     SetAtomicMass( abs(GetBaryonNumber()) );
     156   }
    153157   
    154158   // check name and register this particle into ParticleTable
     
    284288  G4cout << " [" << theParticleSubType << "]" << G4endl;
    285289
     290  if (   (theParticleTable->GetIonTable()->IsIon(this))
     291      || (theParticleTable->GetIonTable()->IsAntiIon(this)) ) {
     292    G4cout << " Atomic Number : " << GetAtomicNumber();
     293    G4cout << "  Atomic Mass : " << GetAtomicMass()  << G4endl;
     294  }
    286295  if ( fShortLivedFlag ){
    287296    G4cout << " ShortLived : ON" << G4endl;
     
    316325  }
    317326}
    318 
    319 
    320 
    321 
    322 
    323 
    324 
    325 
    326 
    327 
    328 
    329 
    330 
  • trunk/source/particles/management/src/G4ParticlePropertyData.cc

    r1196 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4ParticlePropertyData.cc,v 1.4 2009/08/17 14:52:19 kurasige Exp $
     26// $Id: G4ParticlePropertyData.cc,v 1.5 2010/10/30 07:55:00 kurasige Exp $
    2727//
    2828// class G4ParticlePropertyData
     
    6161  thePDGEncoding(0),
    6262  theAntiPDGEncoding(0),
     63  thePDGLifeTime(-1.0),
    6364  fPDGMassModified(false),
    6465  fPDGWidthModified(false),
  • trunk/source/particles/management/src/G4ParticleTable.cc

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4ParticleTable.cc,v 1.36 2010/05/20 01:01:07 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4ParticleTable.cc,v 1.37 2010/10/30 07:55:00 kurasige Exp $
     28// GEANT4 tag $Name: particles-V09-03-15 $
    2929//
    3030// class G4ParticleTable
     
    116116////////////////////
    117117G4ParticleTable::G4ParticleTable(const G4ParticleTable &right)
     118  :verboseLevel(1),fParticleMessenger(0),
     119   noName(" "),
     120   readyToUse(false)
    118121{
    119122  G4Exception("G4ParticleTable::G4ParticleTable()",
  • trunk/source/particles/management/src/G4PrimaryParticle.cc

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4PrimaryParticle.cc,v 1.5 2007/10/06 06:49:29 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4PrimaryParticle.cc,v 1.7 2010/08/11 17:14:02 kurasige Exp $
     28// GEANT4 tag $Name: particles-V09-03-15 $
    2929//
    3030
     
    7474}
    7575
    76 G4PrimaryParticle::G4PrimaryParticle(G4ParticleDefinition* Gcode)
     76G4PrimaryParticle::G4PrimaryParticle(const G4ParticleDefinition* Gcode)
    7777:G4code(Gcode),Px(0.),Py(0.),Pz(0.),
    7878 nextParticle(0),daughterParticle(0),trackID(-1),
     
    8181{ PDGcode = Gcode->GetPDGEncoding(); }
    8282
    83 G4PrimaryParticle::G4PrimaryParticle(G4ParticleDefinition* Gcode,
     83G4PrimaryParticle::G4PrimaryParticle(const G4ParticleDefinition* Gcode,
    8484                        G4double px,G4double py,G4double pz)
    8585:G4code(Gcode),Px(px),Py(py),Pz(pz),
     
    8989{ PDGcode = Gcode->GetPDGEncoding(); }
    9090
    91 G4PrimaryParticle::G4PrimaryParticle(G4ParticleDefinition* Gcode,
     91G4PrimaryParticle::G4PrimaryParticle(const G4ParticleDefinition* Gcode,
    9292                        G4double px,G4double py,G4double pz,G4double E)
    9393:G4code(Gcode),Px(px),Py(py),Pz(pz),
     
    120120}
    121121
    122 void G4PrimaryParticle::SetG4code(G4ParticleDefinition* Gcode)
     122void G4PrimaryParticle::SetG4code(const G4ParticleDefinition* Gcode)
     123{
     124  SetParticleDefinition(Gcode);
     125}
     126
     127void G4PrimaryParticle::SetParticleDefinition(const G4ParticleDefinition* Gcode)
    123128{
    124129  G4code = Gcode;
  • trunk/source/particles/management/src/G4ShortLivedTable.cc

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4ShortLivedTable.cc,v 1.17 2009/08/17 14:52:19 kurasige Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4ShortLivedTable.cc,v 1.18 2010/08/10 15:47:43 kurasige Exp $
     28// GEANT4 tag $Name: particles-V09-03-15 $
    2929//
    3030//
     
    6464}
    6565
    66 G4bool G4ShortLivedTable::IsShortLived(G4ParticleDefinition* particle) const
     66G4bool G4ShortLivedTable::IsShortLived(const G4ParticleDefinition* particle) const
    6767{
    6868  return particle->IsShortLived();
    6969}
    7070
    71 void G4ShortLivedTable::Insert(G4ParticleDefinition* particle)
     71void G4ShortLivedTable::Insert(const G4ParticleDefinition* particle)
    7272{
    7373  if (IsShortLived(particle)) {
     
    7676}
    7777
    78 void G4ShortLivedTable::Remove(G4ParticleDefinition* particle)
     78void G4ShortLivedTable::Remove(const G4ParticleDefinition* particle)
    7979{
    8080  if (IsShortLived(particle)) {
     
    9999void G4ShortLivedTable::DumpTable(const G4String &particle_name) const
    100100{
    101   G4ParticleDefinition* particle;
     101  const G4ParticleDefinition* particle;
    102102
    103103  G4ShortLivedList::iterator idx;
Note: See TracChangeset for help on using the changeset viewer.