Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Geant4/G4Ions.hh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // G4Ions
0027 //
0028 // Class Description:
0029 //
0030 // This is the base class for all nuclei including pre-defined
0031 // light nuclei such as deuteron, alpha, and proton (Hydrogen).
0032 // All nuclei/ions created on the fly are objects of this class.
0033 // Atomic number and atomic mass are valid only for particles derived
0034 // from this class. This class has Excitation Energy in addition to
0035 // the normal particle properties.
0036 
0037 // Authors: G.Cosmo, 4 April 1996 - Design based on object model
0038 //          H.Kurashige, 27 June 1998 - First implementation
0039 // --------------------------------------------------------------------
0040 #ifndef G4Ions_hh
0041 #define G4Ions_hh 1
0042 
0043 #include "G4ParticleDefinition.hh"
0044 #include "G4ios.hh"
0045 #include "globals.hh"
0046 
0047 class G4Ions : public G4ParticleDefinition
0048 {
0049   public:
0050     // clang-format off
0051     G4Ions(
0052        const G4String&     aName,        G4double            mass,
0053        G4double            width,        G4double            charge,   
0054        G4int               iSpin,        G4int               iParity,    
0055        G4int               iConjugation, G4int               iIsospin,   
0056        G4int               iIsospin3,    G4int               gParity,
0057        const G4String&     pType,        G4int               lepton,      
0058        G4int               baryon,       G4int               encoding,
0059        G4bool              stable,       G4double            lifetime,
0060        G4DecayTable*       decaytable,   G4bool              shortlived,
0061        const G4String&     subType ="",
0062        G4int               anti_encoding =0,
0063        G4double            excitation = 0.0, 
0064        G4int               isomer = 0
0065     );
0066     // clang-format on
0067 
0068     ~G4Ions() override = default;
0069 
0070     inline G4Ions* IonsDefinition();
0071     inline G4Ions* Ions();
0072 
0073     // Get excitation energy of nucleus
0074     inline G4double GetExcitationEnergy() const;
0075 
0076     // Get Isomer level (=0 for ground state)
0077     inline G4int GetIsomerLevel() const;
0078 
0079     enum class G4FloatLevelBase  // enumerator for floating level base
0080     {
0081       no_Float = 0,
0082       plus_X,
0083       plus_Y,
0084       plus_Z,
0085       plus_U,
0086       plus_V,
0087       plus_W,
0088       plus_R,
0089       plus_S,
0090       plus_T,
0091       plus_A,
0092       plus_B,
0093       plus_C,
0094       plus_D,
0095       plus_E
0096     };
0097 
0098     static G4Ions::G4FloatLevelBase FloatLevelBase(char flbChar);
0099     static G4Ions::G4FloatLevelBase FloatLevelBase(G4int flbIdx);
0100     static char FloatLevelBaseChar(G4Ions::G4FloatLevelBase flb);
0101 
0102     // Set/Get methods for floating level base
0103     //
0104     inline G4Ions::G4FloatLevelBase GetFloatLevelBase() const;
0105     inline G4int GetFloatLevelBaseIndex() const;
0106     inline void SetFloatLevelBase(G4Ions::G4FloatLevelBase flb);
0107     inline void SetFloatLevelBase(char flbChar);
0108     inline void SetFloatLevelBase(G4int flbIdx);
0109 
0110   protected:
0111     G4Ions() = default;
0112 
0113   private:
0114     G4double theExcitationEnergy = 0.0;
0115     G4int theIsomerLevel = 0;
0116     G4FloatLevelBase floatLevelBase = G4FloatLevelBase::no_Float;
0117 };
0118 
0119 #define noFloat G4Ions::G4FloatLevelBase::no_Float
0120 #define plusU G4Ions::G4FloatLevelBase::plus_U
0121 #define plusV G4Ions::G4FloatLevelBase::plus_V
0122 #define plusW G4Ions::G4FloatLevelBase::plus_W
0123 #define plusX G4Ions::G4FloatLevelBase::plus_X
0124 #define plusY G4Ions::G4FloatLevelBase::plus_Y
0125 #define plusZ G4Ions::G4FloatLevelBase::plus_Z
0126 #define plusR G4Ions::G4FloatLevelBase::plus_R
0127 #define plusS G4Ions::G4FloatLevelBase::plus_S
0128 #define plusT G4Ions::G4FloatLevelBase::plus_T
0129 #define plusA G4Ions::G4FloatLevelBase::plus_A
0130 #define plusB G4Ions::G4FloatLevelBase::plus_B
0131 #define plusC G4Ions::G4FloatLevelBase::plus_C
0132 #define plusD G4Ions::G4FloatLevelBase::plus_D
0133 #define plusE G4Ions::G4FloatLevelBase::plus_E
0134 
0135 // ------------------------
0136 // Inline methods
0137 // ------------------------
0138 
0139 inline G4Ions* G4Ions::IonsDefinition()
0140 {
0141   return this;
0142 }
0143 
0144 inline G4Ions* G4Ions::Ions()
0145 {
0146   return this;
0147 }
0148 
0149 inline G4double G4Ions::GetExcitationEnergy() const
0150 {
0151   return theExcitationEnergy;
0152 }
0153 
0154 inline G4int G4Ions::GetIsomerLevel() const
0155 {
0156   return theIsomerLevel;
0157 }
0158 
0159 inline G4Ions::G4FloatLevelBase G4Ions::GetFloatLevelBase() const
0160 {
0161   return floatLevelBase;
0162 }
0163 
0164 inline G4int G4Ions::GetFloatLevelBaseIndex() const
0165 {
0166   return static_cast<G4int>(floatLevelBase);
0167 }
0168 
0169 inline void G4Ions::SetFloatLevelBase(G4Ions::G4FloatLevelBase flb)
0170 {
0171   floatLevelBase = flb;
0172 }
0173 
0174 inline void G4Ions::SetFloatLevelBase(char flbChar)
0175 {
0176   floatLevelBase = FloatLevelBase(flbChar);
0177 }
0178 
0179 inline void G4Ions::SetFloatLevelBase(G4int flbIdx)
0180 {
0181   floatLevelBase = FloatLevelBase(flbIdx);
0182 }
0183 
0184 #endif