Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:06

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 //---------------------------------------------------------------------------
0027 //
0028 // GEANT4 Class file
0029 //
0030 // Description: Data on density effect
0031 //
0032 // Authors:   A.Bagulya, A.Ivanchenko 28.10.2009
0033 //
0034 //----------------------------------------------------------------------------
0035 //
0036 //  Data are taken from:
0037 //  R.M. Sternheimer et al. Density Effect for the Ionization Loss of Charged
0038 //  Particles in Various Substances. Atom. Data Nucl. Data Tabl. 30 (1984) 261-271.
0039 
0040 #ifndef DensityEffectData_h
0041 #define DensityEffectData_h 1
0042 
0043 #include "G4Material.hh"
0044 #include "globals.hh"
0045 
0046 #include <vector>
0047 
0048 const G4int NDENSDATA = 278;
0049 const G4int NDENSARRAY = 10;
0050 const G4int NDENSELEM = 98;
0051 
0052 class G4DensityEffectData
0053 {
0054  public:
0055   G4DensityEffectData();
0056 
0057   ~G4DensityEffectData() = default;
0058 
0059   // Assignment operator and copy constructor
0060   G4DensityEffectData& operator=(const G4DensityEffectData& right) = delete;
0061   G4DensityEffectData(const G4DensityEffectData&) = delete;
0062 
0063   // return index by Z, -1 if material is not in the table
0064   G4int GetElementIndex(G4int Z, G4State st = kStateUndefined) const;
0065 
0066   // return index by material name, -1 if material is not in the table
0067   G4int GetIndex(const G4String& matName) const;
0068 
0069   // printout data for material
0070   void PrintData(const G4String& matName) const;
0071 
0072   // printout all data
0073   void DumpData() const;
0074 
0075   // Access to the data via index
0076   inline G4double GetPlasmaEnergy(G4int idx) const;
0077   inline G4double GetAdjustmentFactor(G4int idx) const;
0078   inline G4double GetCdensity(G4int idx) const;
0079   inline G4double GetX0density(G4int idx) const;
0080   inline G4double GetX1density(G4int idx) const;
0081   inline G4double GetAdensity(G4int idx) const;
0082   inline G4double GetMdensity(G4int idx) const;
0083   inline G4double GetDelta0density(G4int idx) const;
0084   inline G4double GetErrorDensity(G4int idx) const;
0085   inline G4double GetMeanIonisationPotential(G4int idx) const;
0086 
0087  private:
0088   void Initialize();
0089 
0090   void AddMaterial(G4double* val, const G4String& matName);
0091 
0092   G4double data[NDENSDATA][NDENSARRAY];
0093   std::vector<G4String> names;
0094 
0095   // indexes defined only for pure materials
0096   G4int indexZ[NDENSELEM];
0097   G4State state[NDENSELEM];
0098 
0099   G4int index{0};
0100 };
0101 
0102 inline G4double G4DensityEffectData::GetPlasmaEnergy(G4int idx) const
0103 {
0104   return (idx >= 0 && idx < NDENSDATA) ? data[idx][0] : DBL_MAX;
0105 }
0106 
0107 inline G4double G4DensityEffectData::GetAdjustmentFactor(G4int idx) const
0108 {
0109   return (idx >= 0 && idx < NDENSDATA) ? data[idx][1] : DBL_MAX;
0110 }
0111 
0112 inline G4double G4DensityEffectData::GetCdensity(G4int idx) const
0113 {
0114   return (idx >= 0 && idx < NDENSDATA) ? data[idx][2] : DBL_MAX;
0115 }
0116 
0117 inline G4double G4DensityEffectData::GetX0density(G4int idx) const
0118 {
0119   return (idx >= 0 && idx < NDENSDATA) ? data[idx][3] : DBL_MAX;
0120 }
0121 
0122 inline G4double G4DensityEffectData::GetX1density(G4int idx) const
0123 {
0124   return (idx >= 0 && idx < NDENSDATA) ? data[idx][4] : DBL_MAX;
0125 }
0126 
0127 inline G4double G4DensityEffectData::GetAdensity(G4int idx) const
0128 {
0129   return (idx >= 0 && idx < NDENSDATA) ? data[idx][5] : DBL_MAX;
0130 }
0131 
0132 inline G4double G4DensityEffectData::GetMdensity(G4int idx) const
0133 {
0134   return (idx >= 0 && idx < NDENSDATA) ? data[idx][6] : DBL_MAX;
0135 }
0136 
0137 inline G4double G4DensityEffectData::GetDelta0density(G4int idx) const
0138 {
0139   return (idx >= 0 && idx < NDENSDATA) ? data[idx][7] : DBL_MAX;
0140 }
0141 
0142 inline G4double G4DensityEffectData::GetErrorDensity(G4int idx) const
0143 {
0144   return (idx >= 0 && idx < NDENSDATA) ? data[idx][8] : DBL_MAX;
0145 }
0146 
0147 inline G4double G4DensityEffectData::GetMeanIonisationPotential(G4int idx) const
0148 {
0149   return (idx >= 0 && idx < NDENSDATA) ? data[idx][9] : DBL_MAX;
0150 }
0151 
0152 #endif