Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4Ions.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id: G4Ions.hh 98732 2016-08-09 10:50:57Z gcosmo $
28 //
29 //
30 // ------------------------------------------------------------
31 // GEANT 4 class header file
32 //
33 // History: first implementation, based on object model of
34 // Hisaya Kurashige, 27 June 1998
35 // ----------------------------------------------------------------
36 // Add excitation energy 17 Aug. 1999 H.Kurashige
37 // Add isomer level 30 Apr. H.Kurashige
38 
39 
40 #ifndef G4Ions_h
41 #define G4Ions_h 1
42 
43 #include "globals.hh"
44 #include "G4ios.hh"
45 #include "G4ParticleDefinition.hh"
46 
47 // ######################################################################
48 // ### Ions ###
49 // ######################################################################
50 
52 {
53  // Class Description
54  // This is the base class for all nuclei including pre-defined
55  // light nuclei such as deuteron, alpha, and proton (Hydrogen)
56  // All nuclei/ions created on the fly are objects of this class
57  // Atomic number and atomic mass are vaild only for particles derived
58  // from this class. This class has Excitation Energy in addition to
59  // the normal particle properties.
60 
61  protected:
62  G4Ions(){};
63 
64 
65  public: //With Description
66  G4Ions(
67  const G4String& aName, G4double mass,
68  G4double width, G4double charge,
69  G4int iSpin, G4int iParity,
70  G4int iConjugation, G4int iIsospin,
71  G4int iIsospin3, G4int gParity,
72  const G4String& pType, G4int lepton,
74  G4bool stable, G4double lifetime,
75  G4DecayTable *decaytable, G4bool shortlived,
76  const G4String& subType ="",
77  G4int anti_encoding =0,
78  G4double excitation = 0.0,
79  G4int isomer = 0
80  );
81 
82  public:
83  virtual ~G4Ions();
85  G4Ions* Ions();
86 
87  public: //With Description
88  // Get excitation energy of nucleus
89  G4double GetExcitationEnergy() const ;
90 
91  // Get Isomer level (=0 for ground state)
92  G4int GetIsomerLevel() const;
93 
94  // enumerator for floating level base
95  enum class G4FloatLevelBase
96  { no_Float=0,
99  };
100  static G4Ions::G4FloatLevelBase FloatLevelBase(char flbChar);
103 
104  // set/get methods for floating level base
108  void SetFloatLevelBase(char flbChar);
109  void SetFloatLevelBase(G4int flbIdx);
110 
111  private:
112  G4double theExcitationEnergy;
113  G4int theIsomerLevel;
114  G4FloatLevelBase floatLevelBase;
115 
116 };
117 
118 #define noFloat G4Ions::G4FloatLevelBase::no_Float
119 #define plusU G4Ions::G4FloatLevelBase::plus_U
120 #define plusV G4Ions::G4FloatLevelBase::plus_V
121 #define plusW G4Ions::G4FloatLevelBase::plus_W
122 #define plusX G4Ions::G4FloatLevelBase::plus_X
123 #define plusY G4Ions::G4FloatLevelBase::plus_Y
124 #define plusZ G4Ions::G4FloatLevelBase::plus_Z
125 #define plusR G4Ions::G4FloatLevelBase::plus_R
126 #define plusS G4Ions::G4FloatLevelBase::plus_S
127 #define plusT G4Ions::G4FloatLevelBase::plus_T
128 #define plusA G4Ions::G4FloatLevelBase::plus_A
129 #define plusB G4Ions::G4FloatLevelBase::plus_B
130 #define plusC G4Ions::G4FloatLevelBase::plus_C
131 #define plusD G4Ions::G4FloatLevelBase::plus_D
132 #define plusE G4Ions::G4FloatLevelBase::plus_E
133 
134 inline
136 {
137  return this;
138 }
139 
140 inline
142 {
143  return this;
144 }
145 
146 inline
148 {
149  return theExcitationEnergy;
150 }
151 
152 inline
154 {
155  return theIsomerLevel;
156 }
157 
158 inline
160 {
161  return floatLevelBase;
162 }
163 
164 inline
166 {
167  return static_cast<G4int>(floatLevelBase);
168 }
169 
170 inline
172 {
173  floatLevelBase = flb;
174 }
175 
176 inline
177  void G4Ions::SetFloatLevelBase(char flbChar)
178 {
179  floatLevelBase = FloatLevelBase(flbChar);
180 }
181 
182 inline
184 {
185  floatLevelBase = FloatLevelBase(flbIdx);
186 }
187 
188 inline
190 {
192  switch(flbChar)
193  {
194  case 'x': case 'X':
195  flb = plusX;
196  break;
197  case 'y': case 'Y':
198  flb = plusY;
199  break;
200  case 'z': case 'Z':
201  flb = plusZ;
202  break;
203  case 'u': case 'U':
204  flb = plusU;
205  break;
206  case 'v': case 'V':
207  flb = plusV;
208  break;
209  case 'w': case 'W':
210  flb = plusW;
211  break;
212  case 'r': case 'R':
213  flb = plusR;
214  break;
215  case 's': case 'S':
216  flb = plusS;
217  break;
218  case 't': case 'T':
219  flb = plusT;
220  break;
221  case 'a': case 'A':
222  flb = plusA;
223  break;
224  case 'b': case 'B':
225  flb = plusB;
226  break;
227  case 'c': case 'C':
228  flb = plusC;
229  break;
230  case 'd': case 'D':
231  flb = plusD;
232  break;
233  case 'e': case 'E':
234  flb = plusE;
235  break;
236  case '\0': default:
237  break;
238  }
239  return flb;
240 }
241 
242 inline
244 {
245  static G4Ions::G4FloatLevelBase flb[] =
246  { noFloat,
249  return flb[flbIdx];
250 }
251 
252 inline
254 {
255  static char flbChar[] = {'\0','X','Y','Z','U','V','W',
256  'R','S','T','A','B','C','D','E'};
257  return flbChar[static_cast<G4int>(flb)];
258 }
259 
260 #endif
261 
262 
263 
264 
265 
266 
267 
268 
static char FloatLevelBaseChar(G4Ions::G4FloatLevelBase flb)
Definition: G4Ions.hh:253
#define plusU
Definition: G4Ions.hh:119
G4int GetIsomerLevel() const
Definition: G4Ions.hh:153
#define plusT
Definition: G4Ions.hh:127
G4Ions()
Definition: G4Ions.hh:62
G4Ions * IonsDefinition()
Definition: G4Ions.hh:135
G4double GetExcitationEnergy() const
Definition: G4Ions.hh:147
#define plusW
Definition: G4Ions.hh:121
#define plusY
Definition: G4Ions.hh:123
G4Ions * Ions()
Definition: G4Ions.hh:141
#define width
void SetFloatLevelBase(G4Ions::G4FloatLevelBase flb)
Definition: G4Ions.hh:171
int G4int
Definition: G4Types.hh:78
#define plusV
Definition: G4Ions.hh:120
#define plusB
Definition: G4Ions.hh:129
#define plusS
Definition: G4Ions.hh:126
#define plusZ
Definition: G4Ions.hh:124
static G4Ions::G4FloatLevelBase FloatLevelBase(char flbChar)
Definition: G4Ions.hh:189
Definition: G4Ions.hh:51
bool G4bool
Definition: G4Types.hh:79
#define plusC
Definition: G4Ions.hh:130
#define plusD
Definition: G4Ions.hh:131
G4int GetFloatLevelBaseIndex() const
Definition: G4Ions.hh:165
virtual ~G4Ions()
Definition: G4Ions.cc:99
#define plusX
Definition: G4Ions.hh:122
double G4double
Definition: G4Types.hh:76
G4Ions::G4FloatLevelBase GetFloatLevelBase() const
Definition: G4Ions.hh:159
#define plusE
Definition: G4Ions.hh:132
#define plusA
Definition: G4Ions.hh:128
#define noFloat
Definition: G4Ions.hh:118
G4FloatLevelBase
Definition: G4Ions.hh:95
#define plusR
Definition: G4Ions.hh:125