Ignore:
Timestamp:
May 29, 2009, 3:55:14 PM (15 years ago)
Author:
garnier
Message:

file release beta

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/materials/include/G4IronStoppingICRU73.hh

    r986 r1058  
    2424// ********************************************************************
    2525//
    26 // $Id: G4IronStoppingICRU73.hh,v 1.3 2008/11/02 12:22:19 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     26// $Id: G4IronStoppingICRU73.hh,v 1.4 2009/03/18 10:14:48 alechner Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828
    2929#ifndef G4IronStoppingICRU73_h
     
    5151
    5252#include "globals.hh"
     53#include "G4VIonDEDXTable.hh"
    5354#include "G4LPhysicsFreeVector.hh"
    5455#include <vector>
    5556
    56 class G4IronStoppingICRU73
     57
     58class G4IronStoppingICRU73 : public G4VIonDEDXTable
    5759{
    5860public:
     
    6264  ~G4IronStoppingICRU73();
    6365
    64   G4double GetDEDX(G4int idxMaterial, G4double kinEnergy);
     66  G4bool IsApplicable(G4int ionZ, 
     67                      G4int matZ);
    6568
    66   inline G4double GetDEDX(const G4String& NameMaterial, G4double kinEnergy);
     69  G4bool IsApplicable(G4int ionZ,
     70                      const G4String& matName);
    6771
    68   inline G4int GetMaterialIndex(const G4String& NameMaterial);
     72  G4PhysicsVector* GetPhysicsVector(G4int ionZ,
     73                                    G4int matZ);
    6974
    70   // Function returns an unique index (>=0) for each ion-material couple (the
    71   // return value is -1 if the couple is not found):
    72   inline G4int GetIonMaterialCoupleIndex(
    73                         G4int atomicNumber,            // Atomic number of ion
    74                         const G4String& materialName); // Material name
     75  G4PhysicsVector* GetPhysicsVector(G4int ionZ,
     76                                    const G4String& matName);
    7577
    76   inline G4double GetDensity(G4int idx);
     78  G4double GetDEDX(G4double kinEnergyPerNucleon,
     79                   G4int ionZ,
     80                   const G4String& matName);
    7781
    78   inline G4String GetMaterialName(G4int idx);
    79 
    80   inline G4PhysicsVector* GetPhysicsVector(G4int idx);
    81 
    82   inline G4PhysicsVector* GetPhysicsVector(const G4String& NameMaterial);
    83 
    84   inline G4double GetLowerEnergyBoundary();
    85 
    86   inline G4double GetUpperEnergyBoundary();
     82  G4double GetDEDX(G4double kinEnergyPerNucleon,
     83                   G4int ionZ,
     84                   G4int matZ);
    8785
    8886private:
     87  // Function for creating a physics vector
     88  G4PhysicsVector* CreatePhysicsVector(G4double* energy,
     89                                       G4double* stoppower,
     90                                       G4double factor);
    8991
    90   void AddData(G4double* energy, G4double* stoppower, G4double factor);
     92  // Assignment operator and copy constructor
     93  G4IronStoppingICRU73 & operator=(const G4IronStoppingICRU73 &right);
     94  G4IronStoppingICRU73(const G4IronStoppingICRU73&);
    9195
    92   void Initialise();
     96  // Flag indicating the use of spline interpolation for dE/dx vectors
     97  G4bool spline;
    9398
    94   // hide assignment operator
    95   G4IronStoppingICRU73 & operator=(const  G4IronStoppingICRU73 &right);
    96   G4IronStoppingICRU73(const  G4IronStoppingICRU73&);
     99  // Vectors containing the atomic numbers and names of the materials
     100  std::vector<G4int> atomicNumbersMat;
     101  std::vector<G4String> namesMat;
    97102
    98   G4bool spline;
    99   G4String MatName[16];
    100   G4double Density[16];
     103  // Keys (material names) corresponding to created dE/dx vectors
     104  std::vector<G4String> dedxKeys;
    101105
    102   // Lower and upper energy boundaries for dE/dx vectors:
    103   G4double lowerEnergyBoundary;
    104   G4double upperEnergyBoundary;
     106  // Vector of dE/dx vectors
     107  std::vector<G4PhysicsVector*>  dedx;
     108};
    105109
    106   std::vector<G4LPhysicsFreeVector*>  dedx;
    107 };
     110
    108111
    109112//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    110113
    111 inline G4double G4IronStoppingICRU73::GetDEDX(const G4String& NameMaterial,
    112                                               G4double kinEnergy)
    113 {
    114   return GetDEDX(GetMaterialIndex(NameMaterial), kinEnergy);
    115 }
    116 
    117 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    118 
    119 inline G4int
    120 G4IronStoppingICRU73::GetMaterialIndex(const G4String& NameMaterial)
    121 {
    122   G4int idx = -1;
    123   for (G4int idxMaterial=0; idxMaterial<16; idxMaterial++){
    124     if(MatName[idxMaterial] == NameMaterial) {
    125       idx = idxMaterial;
    126       break;
    127     }
    128   }
    129   return idx;
    130 }
    131 
    132 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    133 
    134 inline G4int
    135 G4IronStoppingICRU73::GetIonMaterialCoupleIndex(G4int atomicNumber,
    136                                                 const G4String& materialName)
    137 {
    138   G4int idx = -1;
    139   if(atomicNumber == 26) idx = GetMaterialIndex(materialName);
    140   return idx;
    141 }
    142 
    143 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    144 
    145 inline G4double G4IronStoppingICRU73::GetDensity(G4int idxMaterial)
    146 {
    147   G4double d = 0.0;
    148   if( idxMaterial >= 0 && idxMaterial <= 15) d = Density[idxMaterial];
    149   return d;
    150 }
    151 
    152 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    153 
    154 inline G4String G4IronStoppingICRU73::GetMaterialName(G4int idxMaterial)
    155 {
    156   G4String s = "";
    157   if( idxMaterial >= 0 && idxMaterial <= 15) s = MatName[idxMaterial];
    158   return s;
    159 }
    160 
    161 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    162 
    163 inline
    164 G4PhysicsVector* G4IronStoppingICRU73::GetPhysicsVector(G4int idxMaterial)
    165 {
    166   G4PhysicsVector* v = 0;
    167   if(idxMaterial >= 0 && idxMaterial <= 15) v = dedx[idxMaterial];
    168   return v;
    169 }
    170 
    171 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    172 
    173 inline G4PhysicsVector*
    174 G4IronStoppingICRU73::GetPhysicsVector(const G4String& NameMaterial)
    175 {
    176   return GetPhysicsVector(GetMaterialIndex(NameMaterial));
    177 }
    178 
    179 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    180 
    181 inline G4double
    182 G4IronStoppingICRU73::GetLowerEnergyBoundary() {
    183 
    184   return lowerEnergyBoundary;
    185 }
    186 
    187 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    188 
    189 inline G4double
    190 G4IronStoppingICRU73::GetUpperEnergyBoundary() {
    191 
    192   return upperEnergyBoundary;
    193 }
    194 
    195 
    196114#endif
    197115 
Note: See TracChangeset for help on using the changeset viewer.