Geant4 Cross Reference |
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 // G4Ions << 27 // 26 // 28 // Class Description: << 29 // 27 // 30 // This is the base class for all nuclei inclu << 28 // 31 // light nuclei such as deuteron, alpha, and p << 29 // ------------------------------------------------------------ 32 // All nuclei/ions created on the fly are obje << 30 // GEANT 4 class header file 33 // Atomic number and atomic mass are valid onl << 31 // 34 // from this class. This class has Excitation << 32 // History: first implementation, based on object model of 35 // the normal particle properties. << 33 // Hisaya Kurashige, 27 June 1998 36 << 34 // ---------------------------------------------------------------- 37 // Authors: G.Cosmo, 4 April 1996 - Design bas << 35 // Add excitation energy 17 Aug. 1999 H.Kurashige 38 // H.Kurashige, 27 June 1998 - First << 36 // Add isomer level 30 Apr. H.Kurashige 39 // ------------------------------------------- << 37 40 #ifndef G4Ions_hh << 38 41 #define G4Ions_hh 1 << 39 #ifndef G4Ions_h >> 40 #define G4Ions_h 1 42 41 43 #include "G4ParticleDefinition.hh" << 44 #include "G4ios.hh" << 45 #include "globals.hh" 42 #include "globals.hh" >> 43 #include "G4ios.hh" >> 44 #include "G4ParticleDefinition.hh" >> 45 >> 46 // ###################################################################### >> 47 // ### Ions ### >> 48 // ###################################################################### 46 49 47 class G4Ions : public G4ParticleDefinition 50 class G4Ions : public G4ParticleDefinition 48 { 51 { 49 public: << 52 // Class Description 50 // clang-format off << 53 // This is the base class for all nuclei including pre-defined 51 G4Ions( << 54 // light nuclei such as deuteron, alpha, and proton (Hydrogen) >> 55 // All nuclei/ions created on the fly are objects of this class >> 56 // Atomic number and atomic mass are vaild only for particles derived >> 57 // from this class. This class has Excitation Energy in addition to >> 58 // the normal particle properties. >> 59 >> 60 protected: >> 61 G4Ions(){}; >> 62 >> 63 >> 64 public: //With Description >> 65 G4Ions( 52 const G4String& aName, G4dou 66 const G4String& aName, G4double mass, 53 G4double width, G4dou 67 G4double width, G4double charge, 54 G4int iSpin, G4int 68 G4int iSpin, G4int iParity, 55 G4int iConjugation, G4int 69 G4int iConjugation, G4int iIsospin, 56 G4int iIsospin3, G4int 70 G4int iIsospin3, G4int gParity, 57 const G4String& pType, G4int 71 const G4String& pType, G4int lepton, 58 G4int baryon, G4int 72 G4int baryon, G4int encoding, 59 G4bool stable, G4dou 73 G4bool stable, G4double lifetime, 60 G4DecayTable* decaytable, G4boo << 74 G4DecayTable *decaytable, G4bool shortlived, 61 const G4String& subType ="", 75 const G4String& subType ="", 62 G4int anti_encoding =0, 76 G4int anti_encoding =0, 63 G4double excitation = 0.0, 77 G4double excitation = 0.0, 64 G4int isomer = 0 78 G4int isomer = 0 65 ); << 79 ); 66 // clang-format on << 67 << 68 ~G4Ions() override = default; << 69 80 70 inline G4Ions* IonsDefinition(); << 81 public: 71 inline G4Ions* Ions(); << 82 virtual ~G4Ions(); >> 83 G4Ions* IonsDefinition(); >> 84 G4Ions* Ions(); >> 85 >> 86 public: //With Description >> 87 // Get excitation energy of nucleus >> 88 G4double GetExcitationEnergy() const ; >> 89 >> 90 // Get Isomer level (=0 for ground state) >> 91 G4int GetIsomerLevel() const; >> 92 >> 93 // enumerator for floating level base >> 94 enum class G4FloatLevelBase >> 95 { no_Float=0, >> 96 plus_X, plus_Y, plus_Z, plus_U, plus_V, plus_W, >> 97 plus_R, plus_S, plus_T, plus_A, plus_B, plus_C, plus_D, plus_E >> 98 }; >> 99 static G4Ions::G4FloatLevelBase FloatLevelBase(char flbChar); >> 100 static G4Ions::G4FloatLevelBase FloatLevelBase(G4int flbIdx); >> 101 static char FloatLevelBaseChar(G4Ions::G4FloatLevelBase flb); >> 102 >> 103 // set/get methods for floating level base >> 104 G4Ions::G4FloatLevelBase GetFloatLevelBase() const; >> 105 G4int GetFloatLevelBaseIndex() const; >> 106 void SetFloatLevelBase(G4Ions::G4FloatLevelBase flb); >> 107 void SetFloatLevelBase(char flbChar); >> 108 void SetFloatLevelBase(G4int flbIdx); >> 109 >> 110 private: >> 111 G4double theExcitationEnergy; >> 112 G4int theIsomerLevel; >> 113 G4FloatLevelBase floatLevelBase; 72 114 73 // Get excitation energy of nucleus << 74 inline G4double GetExcitationEnergy() cons << 75 << 76 // Get Isomer level (=0 for ground state) << 77 inline G4int GetIsomerLevel() const; << 78 << 79 enum class G4FloatLevelBase // enumerator << 80 { << 81 no_Float = 0, << 82 plus_X, << 83 plus_Y, << 84 plus_Z, << 85 plus_U, << 86 plus_V, << 87 plus_W, << 88 plus_R, << 89 plus_S, << 90 plus_T, << 91 plus_A, << 92 plus_B, << 93 plus_C, << 94 plus_D, << 95 plus_E << 96 }; << 97 << 98 static G4Ions::G4FloatLevelBase FloatLevel << 99 static G4Ions::G4FloatLevelBase FloatLevel << 100 static char FloatLevelBaseChar(G4Ions::G4F << 101 << 102 // Set/Get methods for floating level base << 103 // << 104 inline G4Ions::G4FloatLevelBase GetFloatLe << 105 inline G4int GetFloatLevelBaseIndex() cons << 106 inline void SetFloatLevelBase(G4Ions::G4Fl << 107 inline void SetFloatLevelBase(char flbChar << 108 inline void SetFloatLevelBase(G4int flbIdx << 109 << 110 protected: << 111 G4Ions() = default; << 112 << 113 private: << 114 G4double theExcitationEnergy = 0.0; << 115 G4int theIsomerLevel = 0; << 116 G4FloatLevelBase floatLevelBase = G4FloatL << 117 }; 115 }; 118 116 119 #define noFloat G4Ions::G4FloatLevelBase::no_F 117 #define noFloat G4Ions::G4FloatLevelBase::no_Float 120 #define plusU G4Ions::G4FloatLevelBase::plus_U << 118 #define plusU G4Ions::G4FloatLevelBase::plus_U 121 #define plusV G4Ions::G4FloatLevelBase::plus_V << 119 #define plusV G4Ions::G4FloatLevelBase::plus_V 122 #define plusW G4Ions::G4FloatLevelBase::plus_W << 120 #define plusW G4Ions::G4FloatLevelBase::plus_W 123 #define plusX G4Ions::G4FloatLevelBase::plus_X 121 #define plusX G4Ions::G4FloatLevelBase::plus_X 124 #define plusY G4Ions::G4FloatLevelBase::plus_Y << 122 #define plusY G4Ions::G4FloatLevelBase::plus_Y 125 #define plusZ G4Ions::G4FloatLevelBase::plus_Z << 123 #define plusZ G4Ions::G4FloatLevelBase::plus_Z 126 #define plusR G4Ions::G4FloatLevelBase::plus_R << 124 #define plusR G4Ions::G4FloatLevelBase::plus_R 127 #define plusS G4Ions::G4FloatLevelBase::plus_S << 125 #define plusS G4Ions::G4FloatLevelBase::plus_S 128 #define plusT G4Ions::G4FloatLevelBase::plus_T << 126 #define plusT G4Ions::G4FloatLevelBase::plus_T 129 #define plusA G4Ions::G4FloatLevelBase::plus_A 127 #define plusA G4Ions::G4FloatLevelBase::plus_A 130 #define plusB G4Ions::G4FloatLevelBase::plus_B << 128 #define plusB G4Ions::G4FloatLevelBase::plus_B 131 #define plusC G4Ions::G4FloatLevelBase::plus_C << 129 #define plusC G4Ions::G4FloatLevelBase::plus_C 132 #define plusD G4Ions::G4FloatLevelBase::plus_D << 130 #define plusD G4Ions::G4FloatLevelBase::plus_D 133 #define plusE G4Ions::G4FloatLevelBase::plus_E << 131 #define plusE G4Ions::G4FloatLevelBase::plus_E 134 << 135 // ------------------------ << 136 // Inline methods << 137 // ------------------------ << 138 132 139 inline G4Ions* G4Ions::IonsDefinition() << 133 inline >> 134 G4Ions* G4Ions::IonsDefinition() 140 { 135 { 141 return this; 136 return this; 142 } 137 } 143 138 144 inline G4Ions* G4Ions::Ions() << 139 inline >> 140 G4Ions* G4Ions::Ions() 145 { 141 { 146 return this; 142 return this; 147 } 143 } 148 144 149 inline G4double G4Ions::GetExcitationEnergy() << 145 inline >> 146 G4double G4Ions::GetExcitationEnergy() const 150 { 147 { 151 return theExcitationEnergy; 148 return theExcitationEnergy; 152 } 149 } 153 150 154 inline G4int G4Ions::GetIsomerLevel() const << 151 inline >> 152 G4int G4Ions::GetIsomerLevel() const 155 { 153 { 156 return theIsomerLevel; 154 return theIsomerLevel; 157 } 155 } 158 << 156 159 inline G4Ions::G4FloatLevelBase G4Ions::GetFlo << 157 inline >> 158 G4Ions::G4FloatLevelBase G4Ions::GetFloatLevelBase() const 160 { 159 { 161 return floatLevelBase; 160 return floatLevelBase; 162 } 161 } 163 162 164 inline G4int G4Ions::GetFloatLevelBaseIndex() << 163 inline >> 164 G4int G4Ions::GetFloatLevelBaseIndex() const 165 { 165 { 166 return static_cast<G4int>(floatLevelBase); 166 return static_cast<G4int>(floatLevelBase); 167 } 167 } 168 168 169 inline void G4Ions::SetFloatLevelBase(G4Ions:: << 169 inline >> 170 void G4Ions::SetFloatLevelBase(G4Ions::G4FloatLevelBase flb) 170 { 171 { 171 floatLevelBase = flb; 172 floatLevelBase = flb; 172 } 173 } 173 174 174 inline void G4Ions::SetFloatLevelBase(char flb << 175 inline >> 176 void G4Ions::SetFloatLevelBase(char flbChar) 175 { 177 { 176 floatLevelBase = FloatLevelBase(flbChar); 178 floatLevelBase = FloatLevelBase(flbChar); 177 } 179 } 178 180 179 inline void G4Ions::SetFloatLevelBase(G4int fl << 181 inline >> 182 void G4Ions::SetFloatLevelBase(G4int flbIdx) 180 { 183 { 181 floatLevelBase = FloatLevelBase(flbIdx); 184 floatLevelBase = FloatLevelBase(flbIdx); 182 } 185 } 183 186 >> 187 inline >> 188 G4Ions::G4FloatLevelBase G4Ions::FloatLevelBase(char flbChar) >> 189 { >> 190 G4Ions::G4FloatLevelBase flb = noFloat; >> 191 switch(flbChar) >> 192 { >> 193 case 'x': case 'X': >> 194 flb = plusX; >> 195 break; >> 196 case 'y': case 'Y': >> 197 flb = plusY; >> 198 break; >> 199 case 'z': case 'Z': >> 200 flb = plusZ; >> 201 break; >> 202 case 'u': case 'U': >> 203 flb = plusU; >> 204 break; >> 205 case 'v': case 'V': >> 206 flb = plusV; >> 207 break; >> 208 case 'w': case 'W': >> 209 flb = plusW; >> 210 break; >> 211 case 'r': case 'R': >> 212 flb = plusR; >> 213 break; >> 214 case 's': case 'S': >> 215 flb = plusS; >> 216 break; >> 217 case 't': case 'T': >> 218 flb = plusT; >> 219 break; >> 220 case 'a': case 'A': >> 221 flb = plusA; >> 222 break; >> 223 case 'b': case 'B': >> 224 flb = plusB; >> 225 break; >> 226 case 'c': case 'C': >> 227 flb = plusC; >> 228 break; >> 229 case 'd': case 'D': >> 230 flb = plusD; >> 231 break; >> 232 case 'e': case 'E': >> 233 flb = plusE; >> 234 break; >> 235 case '\0': default: >> 236 break; >> 237 } >> 238 return flb; >> 239 } >> 240 >> 241 inline >> 242 G4Ions::G4FloatLevelBase G4Ions::FloatLevelBase(G4int flbIdx) >> 243 { >> 244 static G4Ions::G4FloatLevelBase flb[] = >> 245 { noFloat, >> 246 plusX, plusY, plusZ, plusU, plusV, plusW, >> 247 plusR, plusS, plusT, plusA, plusB, plusC, plusD, plusE }; >> 248 return flb[flbIdx]; >> 249 } >> 250 >> 251 inline >> 252 char G4Ions::FloatLevelBaseChar(G4Ions::G4FloatLevelBase flb) >> 253 { >> 254 static char flbChar[] = {'\0','X','Y','Z','U','V','W', >> 255 'R','S','T','A','B','C','D','E'}; >> 256 return flbChar[static_cast<G4int>(flb)]; >> 257 } >> 258 184 #endif 259 #endif >> 260 >> 261 >> 262 >> 263 >> 264 >> 265 >> 266 >> 267 185 268