G4CrossSectionDataStore.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 // $Id: $
00027 // GEANT4 tag $Name: not supported by cvs2svn $
00028 //
00029 // -------------------------------------------------------------------
00030 // File name:     G4CrossSectionDataStore
00031 //
00032 // Modifications:
00033 // 23.01.2009 V.Ivanchenko move constructor and destructor to source,
00034 //                         use STL vector instead of C-array
00035 //
00036 // August 2011  Re-designed
00037 //              by G. Folger, V. Ivantchenko, T. Koi and D.H. Wright
00038 
00039 // Class Description
00040 // This is the class to which cross section data sets may be registered. 
00041 // An instance of it is contained in each hadronic process, allowing
00042 // the use of the AddDataSet() method to tailor the cross sections to
00043 // your application.
00044 // Class Description - End
00045 
00046 #ifndef G4CrossSectionDataStore_h
00047 #define G4CrossSectionDataStore_h 1
00048 
00049 #include "globals.hh"
00050 #include "G4VCrossSectionDataSet.hh"
00051 #include <vector>
00052 
00053 class G4Nucleus;
00054 class G4DynamicParticle;
00055 class G4ParticleDefinition;
00056 class G4Isotope;
00057 class G4Element;
00058 class G4Material;
00059 class G4NistManager;
00060 
00061 class G4CrossSectionDataStore
00062 {
00063 public:
00064 
00065   G4CrossSectionDataStore();
00066 
00067   ~G4CrossSectionDataStore();
00068 
00069   // Cross section per unit volume is computed (inverse mean free path)
00070   G4double GetCrossSection(const G4DynamicParticle*, const G4Material*);
00071 
00072   // Cross section per element is computed
00073   G4double GetCrossSection(const G4DynamicParticle*, 
00074                            const G4Element*, const G4Material*);
00075 
00076   // Cross section per isotope is computed
00077   G4double GetCrossSection(const G4DynamicParticle*, G4int Z, G4int A,
00078                            const G4Isotope*,
00079                            const G4Element*, const G4Material*);
00080 
00081   // Sample Z and A of a target nucleus and upload into G4Nucleus
00082   G4Element* SampleZandA(const G4DynamicParticle*, const G4Material*,
00083                          G4Nucleus& target);
00084 
00085   // Initialisation before run
00086   void BuildPhysicsTable(const G4ParticleDefinition&);
00087 
00088   // Dump store to G4cout
00089   void DumpPhysicsTable(const G4ParticleDefinition&);
00090 
00091   // Dump store as html
00092   void DumpHtml(const G4ParticleDefinition&, std::ofstream&);
00093 
00094   inline void AddDataSet(G4VCrossSectionDataSet*);
00095 
00096   inline void SetVerboseLevel(G4int value);
00097 
00098 private:
00099 
00100   G4double GetIsoCrossSection(const G4DynamicParticle*, G4int Z, G4int A,
00101                               const G4Isotope*,
00102                               const G4Element*, const G4Material* aMaterial,
00103                               G4int index);
00104 
00105   G4CrossSectionDataStore & operator=(const G4CrossSectionDataStore &right);
00106   G4CrossSectionDataStore(const G4CrossSectionDataStore&);
00107 
00108   G4NistManager* nist;
00109 
00110   std::vector<G4VCrossSectionDataSet*> dataSetList;
00111   std::vector<G4double> xsecelm;
00112   std::vector<G4double> xseciso;
00113 
00114   const G4Material* currentMaterial;
00115   const G4ParticleDefinition* matParticle;
00116   G4double matKinEnergy;
00117   G4double matCrossSection;
00118 
00119   const G4Material* elmMaterial;
00120   const G4Element* currentElement;
00121   const G4ParticleDefinition* elmParticle;
00122   G4double elmKinEnergy;
00123   G4double elmCrossSection;
00124 
00125   G4int nDataSetList;
00126   G4int verboseLevel;
00127 };
00128 
00129 inline void G4CrossSectionDataStore::AddDataSet(G4VCrossSectionDataSet* p)
00130 {
00131   dataSetList.push_back(p);
00132   ++nDataSetList;
00133 }
00134 
00135 inline void G4CrossSectionDataStore::SetVerboseLevel(G4int value)
00136 {
00137   verboseLevel = value;
00138 }
00139 
00140 #endif

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