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: G4ExtDEDXTable.hh 67044 2013-01-30 08:50:06Z gcosmo $ 00027 // 00028 // =========================================================================== 00029 // GEANT4 class header file 00030 // 00031 // Class: G4ExtDEDXTable 00032 // 00033 // Base class: G4VIonDEDXTable 00034 // 00035 // Author: Anton Lechner (Anton.Lechner@cern.ch) 00036 // 00037 // First implementation: 29. 02. 2009 00038 // 00039 // Modifications: 00040 // 03.11.2009 A. Lechner: Added new methods BuildPhysicsVector according 00041 // to interface changes in base class G4VIonDEDXTable. 00042 // 00043 // 00044 // Class description: 00045 // Utility class for users to add their own electronic stopping powers 00046 // for ions. This class is dedicated for use with G4IonParametrisedLossModel 00047 // of the low-energy electromagnetic package. 00048 // 00049 // Comments: 00050 // 00051 // =========================================================================== 00052 // 00053 00054 #ifndef G4EXTDEDXTABLE_HH 00055 #define G4EXTDEDXTABLE_HH 00056 00057 #include "globals.hh" 00058 #include "G4VIonDEDXTable.hh" 00059 #include <utility> 00060 #include <vector> 00061 #include <map> 00062 00063 00064 class G4ExtDEDXTable : public G4VIonDEDXTable { 00065 00066 public: 00067 G4ExtDEDXTable(); 00068 virtual ~G4ExtDEDXTable(); 00069 00070 G4bool BuildPhysicsVector(G4int ionZ, 00071 const G4String& matName); 00072 00073 G4bool BuildPhysicsVector(G4int ionZ, 00074 G4int matZ); 00075 00076 // Function for checking the availability of stopping power tables 00077 // for a given ion-material couple, where the material consists of 00078 // a single element only. 00079 G4bool IsApplicable( 00080 G4int atomicNumberIon, // Atomic number of ion 00081 G4int atomicNumberElem // Atomic number of elemental material 00082 ); 00083 00084 // Function for checking the availability of stopping power tables 00085 // for given ion-material couples. 00086 G4bool IsApplicable( 00087 G4int atomicNumberIon, // Atomic number of ion 00088 const G4String& matIdentifier // Name or chemical formula of material 00089 ); 00090 00091 // Function returning the stopping power vector for given ion-material 00092 // couples, where the material consists of a single element only. 00093 G4PhysicsVector* GetPhysicsVector( 00094 G4int atomicNumberIon, // Atomic number of ion 00095 G4int atomicNumberElem // Atomic number of elemental material 00096 ); 00097 00098 // Function returning the stopping power vector for given ion-material 00099 // couples. 00100 G4PhysicsVector* GetPhysicsVector( 00101 G4int atomicNumberIon, // Atomic number of ion 00102 const G4String& matIdenfier // Name or chemical formula of material 00103 ); 00104 00105 // Function returning the stopping power value for given ion-material 00106 // couples, where the material consists of a single element only, and 00107 // given energy. 00108 G4double GetDEDX( 00109 G4double kinEnergyPerNucleon, // Kinetic energy per nucleon 00110 G4int atomicNumberIon, // Atomic number of ion 00111 G4int atomicNumberElem // Atomic number of elemental material 00112 ); 00113 00114 // Function returning the stopping power value for given ion-material 00115 // couples and given energy. 00116 G4double GetDEDX( 00117 G4double kinEnergyPerNucleon, // Kinetic energy per nucleon 00118 G4int atomicNumberIon, // Atomic number of ion 00119 const G4String& matIdenfier // Name or chemical formula of material 00120 ); 00121 00122 // Function for adding dE/dx vector for an elemental materials. The last 00123 // argument only applies to elemental materials. 00124 G4bool AddPhysicsVector( 00125 G4PhysicsVector* physicsVector, // Physics vector 00126 G4int atomicNumberIon, // Atomic number of ion 00127 const G4String& matIdenfier, // Name or chemical formula of material 00128 G4int atomicNumberElem = 0 // Atomic number of elemental material 00129 ); 00130 00131 // Function for removing dE/dx vector for a compound materials 00132 G4bool RemovePhysicsVector( 00133 G4int atomicNumberIon, // Atomic number of ion 00134 const G4String& matIdentifier // Name or chemical formula of material 00135 ); 00136 00137 // Function writing all stopping power vectors to file 00138 G4bool StorePhysicsTable( 00139 const G4String& fileName // File name 00140 ); 00141 00142 // Function retrieving all stopping power vectors from file 00143 G4bool RetrievePhysicsTable( 00144 const G4String& fileName // File name 00145 ); 00146 00147 // Function deleting all physics vectors and clearing the maps 00148 void ClearTable(); 00149 00150 // Function printing the ion-material pairs of available vectors to stdout 00151 void DumpMap(); 00152 00153 private: 00154 G4PhysicsVector* CreatePhysicsVector(G4int vectorType); 00155 00156 G4int FindAtomicNumberElement(G4PhysicsVector* physicsVector); 00157 00158 typedef std::pair<G4int, G4int> G4IonDEDXKeyElem; 00159 typedef std::pair<G4int, G4String> G4IonDEDXKeyMat; 00160 00161 typedef std::map<G4IonDEDXKeyElem, G4PhysicsVector*> G4IonDEDXMapElem; 00162 typedef std::map<G4IonDEDXKeyMat, G4PhysicsVector*> G4IonDEDXMapMat; 00163 00164 G4IonDEDXMapElem dedxMapElements; 00165 G4IonDEDXMapMat dedxMapMaterials; 00166 }; 00167 00168 #endif // G4EXTDEDXTABLE_HH