G4SandiaTable.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id: G4SandiaTable.hh 67044 2013-01-30 08:50:06Z gcosmo $
00028 
00029 // class description
00030 //
00031 // This class is an interface to G4StaticSandiaData.
00032 // it provides - Sandia coeff for an element, given its Z
00033 //             - sandia coeff for a material, given a pointer to it
00034 //
00035 
00036 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
00037 //
00038 // History:
00039 //
00040 // 10.06.97 created. V. Grichine
00041 // 18.11.98 simplified public interface; new methods for materials.  mma
00042 // 30.01.01 major bug in the computation of AoverAvo and in the units (/g!)
00043 //          in GetSandiaCofPerAtom(). mma
00044 // 03.04.01 fnulcof[4] added; returned if energy < emin
00045 // 05.03.04 V.Grichine, new methods for old sorting algorithm for PAI model
00046 //
00047 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
00048 
00049 #ifndef G4SANDIATABLE_HH
00050 #define G4SANDIATABLE_HH
00051 
00052 #include <assert.h>
00053 
00054 #include "G4OrderedTable.hh"      
00055 #include "G4ios.hh"
00056 #include "globals.hh"
00057 
00058 #include <CLHEP/Units/PhysicalConstants.h>
00059 
00060 class G4Material;
00061 
00062 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
00063 
00064 class G4SandiaTable
00065 {
00066 public:  // with description
00067 
00068   G4SandiaTable(G4Material*);            
00069                  
00070   ~G4SandiaTable();
00071 
00072   //main computation per atom:
00073   static G4double* GetSandiaCofPerAtom(G4int Z, G4double energy);
00074   static G4double GetZtoA(G4int Z);
00075 
00076   //per volume of a material:
00077   G4int GetMatNbOfIntervals();
00078   G4double  GetSandiaCofForMaterial(G4int,G4int);
00079   G4double* GetSandiaCofForMaterial(G4double energy);
00080   G4double  GetSandiaMatTable(G4int,G4int);
00081 
00082   G4double  GetSandiaCofForMaterialPAI(G4int,G4int);
00083   G4double* GetSandiaCofForMaterialPAI(G4double energy);
00084   G4double  GetSandiaMatTablePAI(G4int,G4int);
00085   G4OrderedTable*  GetSandiaMatrixPAI();
00086 
00087   void SetVerbose(G4int ver){fVerbose = ver;};
00088 
00089 public:  // without description
00090 
00091   G4SandiaTable(__void__&);
00092   // Fake default constructor for usage restricted to direct object
00093   // persistency for clients requiring preallocation of memory for
00094   // persistifiable objects.
00095 
00096 private:
00097 
00098   void ComputeMatSandiaMatrix();
00099   void ComputeMatSandiaMatrixPAI();
00100 
00101   // methods per atom
00102   G4int     GetNbOfIntervals   (G4int Z);
00103   G4double  GetSandiaCofPerAtom(G4int Z, G4int, G4int);
00104   G4double  GetIonizationPot   (G4int Z);
00105 
00106   // static members of the class
00107   static const G4int      fNumberOfElements;
00108   static const G4int      fIntervalLimit;
00109   static const G4int      fNumberOfIntervals;
00110 
00111   static const G4double   fSandiaTable[981][5];
00112   static const G4int      fNbOfIntervals[101];
00113   static const G4double   fZtoAratio[101];
00114   static const G4double   fIonizationPotentials[101];
00115   static const G4double   funitc[5];
00116                
00117   static       G4int      fCumulInterval[101];
00118   static       G4double   fSandiaCofPerAtom[4];
00119   
00120   // members of the class
00121   G4Material*     fMaterial;
00122   G4int           fMatNbOfIntervals;
00123   G4OrderedTable* fMatSandiaMatrix;
00124   G4OrderedTable* fMatSandiaMatrixPAI;
00125   
00126   G4double        fnulcof[4];
00127                    
00129 //
00130 // Methods for old implementation of PAI model
00131 // Will be removed for the next major release
00132 
00133 public:  // without description
00134 
00135   G4SandiaTable(G4int);          
00136 
00137   inline void SandiaSwap( G4double** da,
00138                           G4int i,
00139                           G4int j );
00140 
00141   void SandiaSort( G4double** da,
00142                    G4int sz );
00143 
00144   G4int SandiaIntervals( G4int Z[],
00145                          G4int el );
00146 
00147   G4int SandiaMixing(       G4int Z[],
00148                             const G4double* fractionW,
00149                             G4int el,
00150                             G4int mi );
00151 
00152   inline G4double GetPhotoAbsorpCof(G4int i , G4int j) const;
00153 
00154   inline G4int GetMaxInterval() const; 
00155 
00156   inline G4double** GetPointerToCof(); 
00157 
00158 private:
00159 
00160   void ComputeMatTable();
00161 
00162   // copy constructor and hide assignment operator
00163   G4SandiaTable(G4SandiaTable &);
00164   G4SandiaTable & operator=(const G4SandiaTable &right);
00165 
00167 //
00168 // data members for PAI model
00169 
00170 private:
00171                 
00172   G4double** fPhotoAbsorptionCof ;      // SandiaTable  for mixture
00173 
00174   G4int fMaxInterval ;
00175   G4int fVerbose;
00176   
00177 
00178 //
00179 //
00181   
00182 };
00183     
00185 //
00186 // Inline methods for PAI model, will be removed in next major release
00187 
00188 inline G4int 
00189 G4SandiaTable::GetMaxInterval() const { 
00190   return fMaxInterval;
00191 }
00192 
00193 inline G4double** 
00194 G4SandiaTable::GetPointerToCof() 
00195 { 
00196   if(!fPhotoAbsorptionCof) { ComputeMatTable(); }
00197   return fPhotoAbsorptionCof;
00198 }
00199 
00200 inline void
00201 G4SandiaTable::SandiaSwap( G4double** da ,
00202                            G4int i,
00203                            G4int j )
00204 {
00205   G4double tmp = da[i][0] ;
00206   da[i][0] = da[j][0] ;
00207   da[j][0] = tmp ;
00208 }
00209 
00210 inline
00211 G4double G4SandiaTable::GetPhotoAbsorpCof(G4int i, G4int j) const
00212 {
00213   return  fPhotoAbsorptionCof[i][j]*funitc[j];
00214 }
00215 
00216 //
00217 //
00219 
00220 
00221 #endif 

Generated on Mon May 27 17:49:47 2013 for Geant4 by  doxygen 1.4.7