source: trunk/source/materials/include/G4ExtDEDXTable.hh @ 1347

Last change on this file since 1347 was 1347, checked in by garnier, 13 years ago

geant4 tag 9.4

File size: 6.6 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26// $Id: G4ExtDEDXTable.hh,v 1.3 2010/10/25 08:35:26 vnivanch Exp $
27// GEANT4 tag $Name: geant4-09-04-ref-00 $
28//
29// ===========================================================================
30// GEANT4 class header file
31//
32// Class:                G4ExtDEDXTable
33//
34// Base class:           G4VIonDEDXTable
35//
36// Author:               Anton Lechner (Anton.Lechner@cern.ch)
37//
38// First implementation: 29. 02. 2009
39//
40// Modifications:
41// 03.11.2009 A. Lechner:  Added new methods BuildPhysicsVector according
42//            to interface changes in base class G4VIonDEDXTable.
43//
44//
45// Class description:
46//    Utility class for users to add their own electronic stopping powers
47//    for ions. This class is dedicated for use with G4IonParametrisedLossModel
48//    of the low-energy electromagnetic package.
49//
50// Comments:
51//
52// ===========================================================================
53//
54
55#ifndef G4EXTDEDXTABLE_HH
56#define G4EXTDEDXTABLE_HH
57
58#include "globals.hh"
59#include "G4VIonDEDXTable.hh"
60#include <utility>
61#include <vector>
62#include <map>
63
64
65class G4ExtDEDXTable : public G4VIonDEDXTable {
66
67 public:
68   G4ExtDEDXTable();
69   virtual ~G4ExtDEDXTable();
70
71   G4bool BuildPhysicsVector(G4int ionZ, 
72                             const G4String& matName);
73
74   G4bool BuildPhysicsVector(G4int ionZ, 
75                             G4int matZ);
76
77   // Function for checking the availability of stopping power tables
78   // for a given ion-material couple, where the material consists of
79   // a single element only.
80   G4bool IsApplicable(
81        G4int atomicNumberIon,          // Atomic number of ion
82        G4int atomicNumberElem          // Atomic number of elemental material
83                       );
84
85   // Function for checking the availability of stopping power tables
86   // for given ion-material couples.
87   G4bool IsApplicable(
88        G4int atomicNumberIon,          // Atomic number of ion
89        const G4String& matIdentifier   // Name or chemical formula of material
90                       );
91
92   // Function returning the stopping power vector for given ion-material
93   // couples, where the material consists of a single element only.
94   G4PhysicsVector* GetPhysicsVector(
95        G4int atomicNumberIon,          // Atomic number of ion
96        G4int atomicNumberElem          // Atomic number of elemental material
97                                     );
98
99   // Function returning the stopping power vector for given ion-material
100   // couples.
101   G4PhysicsVector* GetPhysicsVector(
102        G4int atomicNumberIon,          // Atomic number of ion
103        const G4String& matIdenfier     // Name or chemical formula of material
104                                     );
105
106   // Function returning the stopping power value for given ion-material
107   // couples, where the material consists of a single element only, and
108   // given energy.
109   G4double GetDEDX(
110        G4double kinEnergyPerNucleon,   // Kinetic energy per nucleon
111        G4int atomicNumberIon,          // Atomic number of ion
112        G4int atomicNumberElem          // Atomic number of elemental material
113                                     );
114
115   // Function returning the stopping power value for given ion-material
116   // couples and given energy.
117   G4double GetDEDX(
118        G4double kinEnergyPerNucleon,   // Kinetic energy per nucleon
119        G4int atomicNumberIon,          // Atomic number of ion
120        const G4String& matIdenfier     // Name or chemical formula of material
121                                     );
122
123   // Function for adding dE/dx vector for an elemental materials. The last
124   // argument only applies to elemental materials.
125   G4bool AddPhysicsVector(
126        G4PhysicsVector* physicsVector, // Physics vector
127        G4int atomicNumberIon,          // Atomic number of ion
128        const G4String& matIdenfier,    // Name or chemical formula of material
129        G4int atomicNumberElem = 0      // Atomic number of elemental material
130                         );
131
132   // Function for removing dE/dx vector for a compound materials
133   G4bool RemovePhysicsVector(
134        G4int atomicNumberIon,          // Atomic number of ion
135        const G4String& matIdentifier   // Name or chemical formula of material
136                            );
137
138   // Function writing all stopping power vectors to file
139   G4bool StorePhysicsTable(
140        const G4String& fileName        // File name
141                             );
142
143   // Function retrieving all stopping power vectors from file
144   G4bool RetrievePhysicsTable(
145        const G4String& fileName       // File name
146                               );
147
148   // Function deleting all physics vectors and clearing the maps
149   void ClearTable();
150
151   // Function printing the ion-material pairs of available vectors to stdout
152   void DumpMap();
153
154 private:
155   G4PhysicsVector* CreatePhysicsVector(G4int vectorType); 
156
157   G4int FindAtomicNumberElement(G4PhysicsVector* physicsVector);
158
159   typedef std::pair<G4int, G4int> G4IonDEDXKeyElem;
160   typedef std::pair<G4int, G4String> G4IonDEDXKeyMat;
161 
162   typedef std::map<G4IonDEDXKeyElem, G4PhysicsVector*> G4IonDEDXMapElem;
163   typedef std::map<G4IonDEDXKeyMat, G4PhysicsVector*> G4IonDEDXMapMat;
164
165   G4IonDEDXMapElem dedxMapElements; 
166   G4IonDEDXMapMat dedxMapMaterials;
167};
168
169#endif // G4EXTDEDXTABLE_HH
Note: See TracBrowser for help on using the repository browser.