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[ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /particles/management/include/G4ParticleDefinition.icc (Version 11.3.0) and /particles/management/include/G4ParticleDefinition.icc (Version 10.2.p1)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 // G4ParticleDefinition inline methods impleme << 
 27 //                                                 26 //
 28 // Authors: G.Cosmo, 2 December 1995 - Design, <<  27 // $Id: G4ParticleDefinition.icc 92918 2015-09-21 15:04:01Z gcosmo $
 29 //          M.Asai, 29 January 1996 - First im <<  28 //
 30 // ------------------------------------------- << 
 31                                                    29 
 32 inline G4int G4ParticleDefinition::GetInstance <<  30 inline 
 33 {                                              <<  31  G4int G4ParticleDefinition::GetInstanceID() const
 34   return g4particleDefinitionInstanceID;       <<  32 { 
                                                   >>  33   return g4particleDefinitionInstanceID; 
 35 }                                                  34 }
 36                                                    35 
 37 inline G4bool G4ParticleDefinition::GetPDGStab <<  36 inline
                                                   >>  37  G4bool G4ParticleDefinition::GetPDGStable() const
 38 {                                                  38 {
 39   if (IsGeneralIon()) {                        <<  39   if(IsGeneralIon())
 40     return (GetIonLifeTime() < 0.);            <<  40   { return (GetIonLifeTime()<0.); }
 41   }                                            <<  41   else
 42                                                <<  42   { return thePDGStable; }
 43   return thePDGStable;                         << 
 44 }                                                  43 }
 45                                                    44 
 46 inline G4double G4ParticleDefinition::GetPDGLi <<  45 inline
 47 {                                              <<  46  G4double G4ParticleDefinition::GetPDGLifeTime() const
 48   return thePDGLifeTime;                       <<  47 { return thePDGLifeTime; }
 49 }                                              << 
 50                                                    48 
 51 inline G4double G4ParticleDefinition::GetIonLi <<  49 inline 
 52 {                                              <<  50  G4double G4ParticleDefinition::GetIonLifeTime() const
 53   //-- No longer needed to access to G4IonTabl <<  51 { return thePDGLifeTime; }
 54   //-- Method GetIonLifeTime() itself is kept  << 
 55                                                    52 
 56   return thePDGLifeTime;                       <<  53 //-- No longer needed to access to G4IonTable.
                                                   >>  54 //-- Method GetIonLifeTime() itself is kept for compatibility
                                                   >>  55 //-- but moved to icc file as an inlined method.
                                                   >>  56 //inline
                                                   >>  57 // G4double G4ParticleDefinition::GetPDGLifeTime() const
                                                   >>  58 //{
                                                   >>  59 //  if(IsGeneralIon())
                                                   >>  60 //  { return GetIonLifeTime(); }
                                                   >>  61 //  else
                                                   >>  62 //  { return thePDGLifeTime; }
                                                   >>  63 //}
                                                   >>  64 
                                                   >>  65 inline 
                                                   >>  66  G4ParticleTable* G4ParticleDefinition::GetParticleTable() const
                                                   >>  67 { 
                                                   >>  68   return theParticleTable; 
 57 }                                                  69 }
 58                                                    70 
 59 inline G4ParticleTable* G4ParticleDefinition:: <<  71 inline
 60 {                                              <<  72  G4DecayTable* G4ParticleDefinition::GetDecayTable() const
 61   return theParticleTable;                     <<  73 { 
                                                   >>  74   return theDecayTable; 
 62 }                                                  75 }
 63                                                    76 
 64 inline G4DecayTable* G4ParticleDefinition::Get <<  77 inline
 65 {                                              <<  78  void G4ParticleDefinition::SetDecayTable(G4DecayTable* aDecayTable) 
 66   return theDecayTable;                        <<  79 { 
                                                   >>  80   theDecayTable = aDecayTable; 
 67 }                                                  81 }
 68                                                    82 
 69 inline void G4ParticleDefinition::SetDecayTabl <<  83 inline 
                                                   >>  84  void G4ParticleDefinition::SetVerboseLevel(G4int value)
 70 {                                                  85 {
 71   theDecayTable = aDecayTable;                 <<  86    verboseLevel = value;
 72 }                                                  87 }
 73                                                    88 
 74 inline void G4ParticleDefinition::SetVerboseLe <<  89 inline 
                                                   >>  90  G4int G4ParticleDefinition::GetVerboseLevel() const
 75 {                                                  91 {
 76   verboseLevel = value;                        <<  92    return verboseLevel;
 77 }                                                  93 }
 78                                                    94 
 79 inline G4int G4ParticleDefinition::GetVerboseL <<  95 inline
                                                   >>  96  G4ProcessManager* G4ParticleDefinition::GetProcessManager() const
 80 {                                                  97 {
 81   return verboseLevel;                         <<  98     if(g4particleDefinitionInstanceID<0) return 0;
                                                   >>  99     return G4MT_pmanager;
 82 }                                                 100 }
 83                                                   101 
 84 inline G4ProcessManager* G4ParticleDefinition: << 102 inline
                                                   >> 103  G4ProcessManager* G4ParticleDefinition::GetMasterProcessManager() const
 85 {                                                 104 {
 86   return theProcessManagerShadow;              << 105     return theProcessManagerShadow;
 87 }                                                 106 }
 88                                                   107 
 89 inline void G4ParticleDefinition::SetMasterPro << 108 inline
                                                   >> 109   void G4ParticleDefinition::SetMasterProcessManager( G4ProcessManager* aNewPM )
 90 {                                                 110 {
 91   theProcessManagerShadow = aNewPM;            << 111    theProcessManagerShadow = aNewPM;
 92 }                                                 112 }
 93                                                   113 
 94 inline G4int G4ParticleDefinition::GetQuarkCon << 114 inline
                                                   >> 115  G4int G4ParticleDefinition::GetQuarkContent(G4int flavor) const 
 95 {                                                 116 {
 96   G4int content = 0;                           << 117   G4int content = 0; 
 97   if ((flavor > 0) && (flavor <= NumberOfQuark << 118   if ((flavor>0) && (flavor<=NumberOfQuarkFlavor))
 98     content = theQuarkContent[flavor - 1];     << 119   {
                                                   >> 120     content = theQuarkContent[flavor-1];
 99   }                                               121   }
100   else {                                       << 122   else
                                                   >> 123   {
101 #ifdef G4VERBOSE                                  124 #ifdef G4VERBOSE
102     if (verboseLevel > 0) {                    << 125     if (verboseLevel >0)
                                                   >> 126     {
103       std::ostringstream message;                 127       std::ostringstream message;
104       message << "Invalid Quark Flavor: " << f    128       message << "Invalid Quark Flavor: " << flavor;
105       G4Exception("G4ParticleDefinition::GetQu << 129       G4Exception("G4ParticleDefinition::GetQuarkContent()",
106     }                                          << 130                   "InvalidFlavor", JustWarning, message);
107 #endif                                         << 131     } 
                                                   >> 132 #endif  
108   }                                               133   }
109   return content;                              << 134   return content;  
110 }                                                 135 }
111                                                   136 
112 inline G4int G4ParticleDefinition::GetAntiQuar << 137 inline
                                                   >> 138  G4int G4ParticleDefinition::GetAntiQuarkContent(G4int flavor) const 
113 {                                                 139 {
114   G4int content = 0;                              140   G4int content = 0;
115   if ((flavor > 0) && (flavor <= NumberOfQuark << 141   if ((flavor>0) && (flavor<=NumberOfQuarkFlavor))
116     content = theAntiQuarkContent[flavor - 1]; << 142   {
                                                   >> 143     content = theAntiQuarkContent[flavor-1];
117   }                                               144   }
118   else {                                       << 145   else
                                                   >> 146   {
119 #ifdef G4VERBOSE                                  147 #ifdef G4VERBOSE
120     if (verboseLevel > 0) {                    << 148     if (verboseLevel >0)
                                                   >> 149     {
121       std::ostringstream message;                 150       std::ostringstream message;
122       message << "Invalid Quark Flavor: " << f    151       message << "Invalid Quark Flavor: " << flavor;
123       G4Exception("G4ParticleDefinition::GetAn << 152       G4Exception("G4ParticleDefinition::GetAntiQuarkContent()",
124                   message);                    << 153                   "InvalidFlavor", JustWarning, message);
125     }                                             154     }
126 #endif                                            155 #endif
127   }                                            << 156   }  
128   return content;                                 157   return content;
129 }                                                 158 }
130                                                   159 
131 inline void G4ParticleDefinition::SetParticleS << 160 inline 
                                                   >> 161  void G4ParticleDefinition::SetParticleSubType(const G4String& subtype)
132 {                                                 162 {
133   theParticleSubType = subtype;                   163   theParticleSubType = subtype;
134 }                                                 164 }
135                                                << 165  
136 inline void G4ParticleDefinition::SetAntiPDGEn << 166 inline 
137 {                                              << 167  void             G4ParticleDefinition::SetAntiPDGEncoding(G4int aEncoding)
138   theAntiPDGEncoding = aEncoding;              << 168 { 
                                                   >> 169   theAntiPDGEncoding = aEncoding; 
139 }                                                 170 }
140                                                   171 
141 inline G4bool G4ParticleDefinition::GetApplyCu << 172 inline 
                                                   >> 173 G4bool G4ParticleDefinition::GetApplyCutsFlag() const
142 {                                                 174 {
143   return fApplyCutsFlag;                          175   return fApplyCutsFlag;
144 }                                                 176 }
145                                                   177 
146 inline void G4ParticleDefinition::SetAtomicNum << 178 inline
                                                   >> 179  void G4ParticleDefinition::SetAtomicNumber(G4int i)
147 {                                                 180 {
148   theAtomicNumber = i;                            181   theAtomicNumber = i;
149 }                                                 182 }
150                                                   183 
151 inline G4int G4ParticleDefinition::GetAtomicNu << 184 inline
                                                   >> 185  G4int G4ParticleDefinition::GetAtomicNumber() const
152 {                                                 186 {
153   return theAtomicNumber;                         187   return theAtomicNumber;
154 }                                                 188 }
155                                                   189 
156 inline void G4ParticleDefinition::SetAtomicMas << 190 inline
                                                   >> 191  void G4ParticleDefinition::SetAtomicMass(G4int i)
157 {                                                 192 {
158   theAtomicMass = i;                              193   theAtomicMass = i;
159 }                                                 194 }
160                                                   195 
161 inline G4int G4ParticleDefinition::GetAtomicMa << 196 inline
                                                   >> 197  G4int G4ParticleDefinition::GetAtomicMass() const
162 {                                                 198 {
163   return theAtomicMass;                           199   return theAtomicMass;
164 }                                                 200 }
165                                                   201 
166 inline void G4ParticleDefinition::SetPDGMagnet << 202 inline 
                                                   >> 203   void  G4ParticleDefinition::SetPDGMagneticMoment(G4double magneticMoment)
167 {                                                 204 {
168   thePDGMagneticMoment = magneticMoment;       << 205    thePDGMagneticMoment = magneticMoment;
169 }                                                 206 }
170                                                   207 
171 inline G4bool G4ParticleDefinition::IsGeneralI << 208 inline      
                                                   >> 209   G4bool G4ParticleDefinition::IsGeneralIon() const
172 {                                                 210 {
173   return isGeneralIon;                            211   return isGeneralIon;
174 }                                                 212 }
175                                                   213 
176 inline G4bool G4ParticleDefinition::IsMuonicAt << 214 inline
                                                   >> 215   G4int G4ParticleDefinition::GetParticleDefinitionID() const
177 {                                                 216 {
178   return isMuonicAtom;                         << 217   return g4particleDefinitionInstanceID; 
179 }                                                 218 }
180                                                   219 
181 inline G4int G4ParticleDefinition::GetParticle << 
182 {                                              << 
183   return g4particleDefinitionInstanceID;       << 
184 }                                              << 
185                                                << 
186 inline G4bool G4ParticleDefinition::IsHypernuc << 
187 {                                              << 
188   return GetNumberOfLambdasInHypernucleus() >  << 
189 }                                              << 
190                                                << 
191 inline G4int G4ParticleDefinition::GetNumberOf << 
192 {                                              << 
193   G4int numberOfLambdas = 0;                   << 
194   // PDG code of hypernuclei: 10LZZZAAAI       << 
195   if (thePDGEncoding > 0 && thePDGEncoding / 1 << 
196     numberOfLambdas = (thePDGEncoding / 100000 << 
197   }                                            << 
198   return numberOfLambdas;                      << 
199 }                                              << 
200                                                << 
201 inline G4bool G4ParticleDefinition::IsAntiHype << 
202 {                                              << 
203   return GetNumberOfAntiLambdasInAntiHypernucl << 
204 }                                              << 
205                                                << 
206 inline G4int G4ParticleDefinition::GetNumberOf << 
207 {                                              << 
208   G4int numberOfAntiLambdas = 0;               << 
209   // PDG code of anti-hypernuclei: -10LZZZAAAI << 
210   if (thePDGEncoding < 0 && thePDGEncoding / 1 << 
211     numberOfAntiLambdas = (std::abs(thePDGEnco << 
212   }                                            << 
213   return numberOfAntiLambdas;                  << 
214 }                                              << 
215                                                   220