Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:04

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 // class description
0027 //
0028 // This class is an interface to G4StaticSandiaData.
0029 // it provides - Sandia coeff for an element, given its Z
0030 //             - sandia coeff for a material, given a pointer to it
0031 //
0032 // History:
0033 //
0034 // 10.06.97 created. V. Grichine
0035 // 18.11.98 simplified public interface; new methods for materials.  mma
0036 // 30.01.01 major bug in the computation of AoverAvo and in the units (/g!)
0037 //          in GetSandiaCofPerAtom(). mma
0038 // 03.04.01 fnulcof[4] added; returned if energy < emin
0039 // 05.03.04 V.Grichine, new methods for old sorting algorithm for PAI model
0040 // 21.21.13 V.Ivanchenko, changed signature of methods, reduced number of
0041 //                        static variables, methods
0042 //
0043 
0044 #ifndef G4SANDIATABLE_HH
0045 #define G4SANDIATABLE_HH
0046 
0047 #include "G4OrderedTable.hh"
0048 #include "G4ios.hh"
0049 #include "globals.hh"
0050 
0051 #include <CLHEP/Units/PhysicalConstants.h>
0052 #include <assert.h>
0053 
0054 #include <vector>
0055 
0056 class G4Material;
0057 
0058 class G4SandiaTable
0059 {
0060  public:  // with description
0061   G4SandiaTable();
0062   G4SandiaTable(const G4Material*);
0063   G4SandiaTable(G4int matIndex);
0064   ~G4SandiaTable();
0065 
0066   G4SandiaTable(G4SandiaTable&) = delete;
0067   G4SandiaTable& operator=(const G4SandiaTable& right) = delete;
0068 
0069   // main computation per atom:
0070   void GetSandiaCofPerAtom(G4int Z, G4double energy, std::vector<G4double>& coeff) const;
0071 
0072   void GetSandiaCofWater(G4double energy, std::vector<G4double>& coeff) const;
0073 
0074   G4double GetWaterEnergyLimit() const;
0075   G4double GetWaterCofForMaterial(G4int, G4int) const;
0076 
0077   static G4double GetZtoA(G4int Z);
0078 
0079   // per volume of a material:
0080   G4int GetMatNbOfIntervals() const;
0081   G4double GetSandiaCofForMaterial(G4int, G4int) const;
0082   G4double GetSandiaMatTable(G4int, G4int) const;
0083   const G4double* GetSandiaCofForMaterial(G4double energy) const;
0084 
0085   G4double GetSandiaMatTablePAI(G4int, G4int) const;
0086   const G4double* GetSandiaCofForMaterialPAI(G4double energy) const;
0087 
0088   inline void SetVerbose(G4int ver) { fVerbose = ver; };
0089 
0090   /////////////////////////////////////////////////////////////////////
0091   //
0092   // Methods for implementation of PAI model
0093   //
0094   /////////////////////////////////////////////////////////////////////
0095 
0096   void Initialize(const G4Material*);
0097 
0098   G4int SandiaIntervals(G4int Z[], G4int el);
0099 
0100   G4int SandiaMixing(G4int Z[], const G4double* fractionW, G4int el, G4int mi);
0101 
0102   G4double GetPhotoAbsorpCof(G4int i, G4int j) const;
0103 
0104   G4int GetMaxInterval() const;
0105 
0106   inline G4bool GetLowerI1() { return fLowerI1; };
0107   inline void SetLowerI1(G4bool flag) { fLowerI1 = flag; };
0108 
0109   // operators
0110   G4bool operator==(const G4SandiaTable&) const = delete;
0111   G4bool operator!=(const G4SandiaTable&) const = delete;
0112 
0113  private:
0114   void ComputeMatSandiaMatrix();
0115   void ComputeMatSandiaMatrixPAI();
0116 
0117   // methods per atom
0118   G4double GetSandiaPerAtom(G4int Z, G4int, G4int) const;
0119 
0120 #ifdef G4VERBOSE
0121   static G4int PrintErrorZ(G4int Z, const G4String&);
0122   static void PrintErrorV(const G4String&);
0123 #endif
0124 
0125   void ComputeMatTable();
0126 
0127   void SandiaSwap(G4double** da, G4int i, G4int j);
0128 
0129   void SandiaSort(G4double** da, G4int sz);
0130 
0131   G4double** GetPointerToCof();
0132 
0133   // computed once
0134   static G4int fCumulInterval[101];
0135   static const G4double funitc[5];
0136 
0137   // used at initialisation
0138   std::vector<G4double> fSandiaCofPerAtom;
0139 
0140   // members of the class
0141   const G4Material* fMaterial;
0142   G4int fMatNbOfIntervals;
0143   G4OrderedTable* fMatSandiaMatrix;
0144   G4OrderedTable* fMatSandiaMatrixPAI;
0145 
0146   static const G4double fSandiaTable[981][5];
0147   static const G4int fNumberOfElements;
0148   static const G4int fIntervalLimit;
0149   static const G4int fNumberOfIntervals;
0150   static const G4int fH2OlowerInt;
0151 
0152   // data members for PAI model
0153   G4double** fPhotoAbsorptionCof;  // SandiaTable  for mixture
0154 
0155   G4int fMaxInterval;
0156   G4int fVerbose;
0157   G4bool fLowerI1;
0158 };
0159 
0160 #endif