G4VCrossSectionHandler.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$
00028 //
00029 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
00030 //
00031 // History:
00032 // -----------
00033 // 16 Sep 2001   MGP                Created
00034 // 26 Sep 2001   V.Ivanchenko       Hide copy constructor and assignement operator
00035 // 18 Apr 2002   V.Ivanchenko       Move member function ValueForMaterial to public
00036 // 21 Jan 2003   V.Ivanchenko       Cut per region
00037 // 15 Jul 2009   N.A.Karakatsanis   New methods added for loading logarithmic data
00038 //                                  to enhance computing performance of interpolation
00039 //
00040 // -------------------------------------------------------------------
00041 
00042 // Class description:
00043 // Low Energy Electromagnetic Physics
00044 // Base class for cross section manager for an electromagnetic physics process
00045 
00046 // -------------------------------------------------------------------
00047 
00048 #ifndef G4VCROSSSECTIONHANDLER_HH
00049 #define G4VCROSSSECTIONHANDLER_HH 1
00050 
00051 #include <map>
00052 #include <vector>
00053 #include <CLHEP/Units/SystemOfUnits.h>
00054 
00055 #include "globals.hh"
00056 #include "G4DataVector.hh"
00057 #include "G4MaterialCutsCouple.hh"
00058 
00059 class G4VDataSetAlgorithm;
00060 class G4VEMDataSet;
00061 class G4Material;
00062 class G4Element;
00063 
00064 class G4VCrossSectionHandler {
00065 
00066 public:
00067 
00068   G4VCrossSectionHandler();
00069 
00070   G4VCrossSectionHandler(G4VDataSetAlgorithm* interpolation,
00071                          G4double minE = 250*CLHEP::eV,
00072                          G4double maxE = 100*CLHEP::GeV,
00073                          G4int nBins = 200,
00074                          G4double unitE = CLHEP::MeV,
00075                          G4double unitData = CLHEP::barn,
00076                          G4int minZ = 1, G4int maxZ = 99);
00077 
00078   virtual ~G4VCrossSectionHandler();
00079 
00080   void Initialise(G4VDataSetAlgorithm* interpolation = 0,
00081                   G4double minE = 250*CLHEP::eV,
00082                   G4double maxE = 100*CLHEP::GeV,
00083                   G4int numberOfBins = 200,
00084                   G4double unitE = CLHEP::MeV,
00085                   G4double unitData = CLHEP::barn,
00086                   G4int minZ = 1, G4int maxZ = 99);
00087 
00088   G4int SelectRandomAtom(const G4MaterialCutsCouple* couple, G4double e) const;
00089 
00090   const G4Element* SelectRandomElement(const G4MaterialCutsCouple* material,
00091                                              G4double e) const;
00092 
00093   G4int SelectRandomShell(G4int Z, G4double e) const;
00094 
00095   G4VEMDataSet* BuildMeanFreePathForMaterials(const G4DataVector* energyCuts = 0);
00096 
00097   G4double FindValue(G4int Z, G4double e) const;
00098 
00099   G4double FindValue(G4int Z, G4double e, G4int shellIndex) const;
00100 
00101   G4double ValueForMaterial(const G4Material* material, G4double e) const;
00102 
00103   void LoadData(const G4String& dataFile);
00104 
00105   void LoadNonLogData(const G4String& dataFile);
00106 
00107   void LoadShellData(const G4String& dataFile);
00108 
00109   void PrintData() const;
00110 
00111   void Clear();
00112 
00113 protected:
00114 
00115   G4int NumberOfComponents(G4int Z) const;
00116 
00117   void ActiveElements();
00118 
00119   // Factory method
00120   virtual std::vector<G4VEMDataSet*>* BuildCrossSectionsForMaterials(const G4DataVector& energyVector,
00121                                                                        const G4DataVector* energyCuts = 0) = 0;
00122 
00123   // Factory method
00124   virtual G4VDataSetAlgorithm* CreateInterpolation();
00125 
00126   const G4VDataSetAlgorithm* GetInterpolation() const { return interpolation; }
00127 
00128 
00129 private:
00130 
00131   // Hide copy constructor and assignment operator
00132   G4VCrossSectionHandler(const G4VCrossSectionHandler&);
00133   G4VCrossSectionHandler & operator=(const G4VCrossSectionHandler &right);
00134 
00135   G4VDataSetAlgorithm* interpolation;
00136 
00137   G4double eMin;
00138   G4double eMax;
00139   G4int nBins;
00140 
00141   G4double unit1;
00142   G4double unit2;
00143 
00144   G4int zMin;
00145   G4int zMax;
00146 
00147   G4DataVector activeZ;
00148 
00149   std::map<G4int,G4VEMDataSet*,std::less<G4int> > dataMap;
00150 
00151   std::vector<G4VEMDataSet*>* crossSections;
00152 };
00153 
00154 #endif
00155 
00156 
00157 
00158 
00159 
00160 
00161 
00162 
00163 
00164 
00165 

Generated on Mon May 27 17:50:10 2013 for Geant4 by  doxygen 1.4.7