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

file release beta

Location:
trunk/source/materials/include
Files:
2 added
8 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 
  • trunk/source/materials/include/G4MPVEntry.hh

    r986 r1058  
    2525//
    2626//
    27 // $Id: G4MPVEntry.hh,v 1.7 2008/06/05 23:36:56 gum Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4MPVEntry.hh,v 1.8 2009/04/21 15:35:45 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
    3131////////////////////////////////////////////////////////////////////////
    32 // G4MPVEntry Class Definition
    33 ////////////////////////////////////////////////////////////////////////
    3432//
    35 // File:        G4MPVEntry.hh   
    36 // Description: A G4MPVEntry is an MaterialPropertyVector Entry. 
    37 //              One Material Property Vector contains many MPVEntries 
    38 // Version:     1.0
    39 // Created:     1996-02-08     
    40 // Author:      Juliet Armstrong
     33// Class G4MPVEntry
     34//
     35// Class description:
     36//
     37// A G4MPVEntry is a MaterialPropertyVector Entry. 
     38// One Material Property Vector contains many MPVEntries.
     39
     40// File:        G4MPVEntry.hh
     41// Version:     1.0
     42// Created:     1996-02-08 
     43// Author:      Juliet Armstrong
    4144// Updated:     1999-10-29 add method and class descriptors
    4245//              1997-03-25 by Peter Gumplinger
    43 //              > cosmetics (only)
     46//              > cosmetics (only)
    4447// mail:        gum@triumf.ca
    4548//
     
    5659#include "globals.hh"
    5760
    58 // Class Description:
    59 // A G4MPVEntry is an MaterialPropertyVector Entry.
    60 // One Material Property Vector contains many MPVEntries.
    61 // Class Description - End:
    62 
    6361/////////////////////
    6462// Class Definition
    6563/////////////////////
    6664
    67 class G4MPVEntry {
     65class G4MPVEntry
     66{
     67  public: // Without description
    6868
    69 public: // Without description
     69    //////////////
     70    // Operators
     71    //////////////
    7072
    71         //////////////
    72         // Operators
    73         //////////////G4MPVEntry.hh
    74                
    75         // Well defined semantics for these operators
    76         // required by G4RWTPtrSortedVector
     73    // Well defined semantics for these operators
     74    // required by G4RWTPtrSortedVector
     75    //
     76    G4bool operator <(const G4MPVEntry &right) const; 
     77    G4bool operator ==(const G4MPVEntry &right) const;
     78    G4MPVEntry& operator =(const G4MPVEntry &right);
    7779
    78         G4bool operator <(const G4MPVEntry &right) const;       
    79         G4bool operator ==(const G4MPVEntry &right) const;
    80         G4MPVEntry& operator =(const G4MPVEntry &right);
     80    ///////////////////////////////
     81    // Constructors and Destructor
     82    ///////////////////////////////
    8183
    82         ///////////////////////////////
    83         // Constructor and Destructor
    84         ///////////////////////////////
     84    G4MPVEntry(G4double aPhotonEnergy, G4double aPropertyValue);
     85    G4MPVEntry(const G4MPVEntry &right);
     86   ~G4MPVEntry();
    8587
    86         G4MPVEntry(G4double aPhotonEnergy, G4double aPropertyValue);
     88    ////////////
     89    // Methods
     90    ////////////
    8791
    88         G4MPVEntry(const G4MPVEntry &right);
     92    G4double GetPhotonEnergy();
     93    G4double GetProperty();
     94 
     95    //////////
     96    // Tests
     97    //////////
    8998
    90         ~G4MPVEntry();
     99    void DumpEntry();
    91100
    92         ////////////
    93         // Methods
    94         ////////////
     101  private:
    95102
    96         G4double GetPhotonEnergy();
     103    /////////////////////////
     104    // Private Data members
     105    /////////////////////////
    97106
    98         G4double GetProperty();
    99        
    100         //////////
    101         // Tests
    102         //////////
    103 
    104         void DumpEntry();
    105 
    106 private:
    107 
    108         /////////////////////////
    109         // Private Data members
    110         /////////////////////////
    111 
    112         G4double thePhotonEnergy;
    113         G4double theProperty;
     107    G4double thePhotonEnergy;
     108    G4double theProperty;
    114109};
    115110
     
    125120G4double G4MPVEntry::GetPhotonEnergy()
    126121{
    127         return thePhotonEnergy;
     122  return thePhotonEnergy;
    128123}
    129124
     
    135130G4double G4MPVEntry::GetProperty()
    136131{
    137         return theProperty;
     132  return theProperty;
    138133}
    139134
  • trunk/source/materials/include/G4MaterialPropertiesTable.hh

    r986 r1058  
    2525//
    2626//
    27 // $Id: G4MaterialPropertiesTable.hh,v 1.19 2008/06/05 23:38:03 gum Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4MaterialPropertiesTable.hh,v 1.20 2009/04/21 15:35:45 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    30 //
    31 ////////////////////////////////////////////////////////////////////////
    32 // G4MaterialPropertiesTable Definition
    3330////////////////////////////////////////////////////////////////////////
    3431//
     32// class G4MaterialPropertiesTable
     33//
     34// Class description:
     35//
     36// A Material properties table is a hash table, with
     37// key = property name, and value either G4double or
     38// G4MaterialPropertyVector
     39
    3540// File:        G4MaterialPropertiesTable.hh
    36 // Description: An Material properties table is a hash table, with
    37 //              key = property name, and value either G4double or
    38 //              G4MaterialPropertyVector
    3941// Version:     1.0
    4042// Created:     1996-02-08
     
    6365#include "G4MaterialPropertyVector.hh"
    6466
    65 // Class Description:
    66 // An Material properties table is a hash table, with key = property
    67 // name, and value either G4double or G4MaterialPropertyVector.
    68 // Class Description - End:
    69 
    7067/////////////////////
    7168// Class Definition
    7269/////////////////////
    7370
    74 class G4MaterialPropertiesTable {
     71class G4MaterialPropertiesTable
     72{
     73  public: // Without description
    7574
    76         ////////////////
    77         // Constructor
    78         ////////////////
     75    G4MaterialPropertiesTable();
     76   ~G4MaterialPropertiesTable();
    7977
    80 public: // Without description
     78  public: // With description
    8179
    82         G4MaterialPropertiesTable();
    83        
    84         ///////////////
    85         // Destructor
    86         ///////////////
     80    inline void AddConstProperty(const char     *key,
     81                                 G4double PropertyValue);
     82    // Add a new property to the table by giving a key-name and value
    8783
    88 public: // Without description
     84    inline void AddProperty(const char     *key,
     85                            G4double *PhotonEnergies,
     86                            G4double *PropertyValues,
     87                            G4int     NumEntries);
     88    // Add a new property to the table by giving a key-name and the
     89    // arrays x and y of size NumEntries.
    8990
    90         ~G4MaterialPropertiesTable();
     91    inline void AddProperty(const char *key, G4MaterialPropertyVector *opv);
     92    // Add a new property to the table by giving a key-name and an
     93    // already constructed G4MaterialPropertyVector.
    9194
    92         ////////////
    93         // Methods
    94         ////////////
     95    inline void RemoveConstProperty(const char *key);
     96    // Remove a constant property from the table.
    9597
    96 public: // With description
     98    inline void RemoveProperty(const char *key);
     99    // Remove a property from the table.
    97100
    98         void AddConstProperty(const char     *key,
    99                               G4double PropertyValue);
    100         // Add a new property to the table by giving a key-name and value
     101    inline G4double GetConstProperty(const char *key);
     102    // Get the constant property from the table corresponding to the key-name
    101103
    102         void AddProperty(const char     *key,
    103                          G4double *PhotonEnergies,
    104                          G4double *PropertyValues,
    105                          G4int     NumEntries);
    106         // Add a new property to the table by giving a key-name and the
    107         // arrays x and y of size NumEntries.
     104    inline G4bool ConstPropertyExists(const char *key);
     105    // Return true if a const property 'key' exists.
    108106
    109         void AddProperty(const char *key, G4MaterialPropertyVector *opv);
    110         // Add a new property to the table by giving a key-name and an
    111         // already constructed G4MaterialPropertyVector.
     107    inline G4MaterialPropertyVector* GetProperty(const char *key);
     108    // Get the property from the table corresponding to the key-name.
    112109
    113         void RemoveConstProperty(const char *key);
    114         // Remove a constant property from the table.
     110    inline void AddEntry(const char *key, G4double aPhotonEnergy,
     111                                          G4double aPropertyValue);
     112    // Add a new entry (pair of numbers) to the table for a given key.
    115113
    116         void RemoveProperty(const char *key);
    117         // Remove a property from the table.
     114    inline void RemoveEntry(const char *key, G4double  aPhotonEnergy);
     115    // Remove an entry from the table for a given key and x-value.
    118116
    119         G4double GetConstProperty(const char *key);
    120         // Get the constant property from the table corresponding to the key-name
     117    void DumpTable();
    121118
    122         G4bool ConstPropertyExists(const char *key);
    123         // Return true if a const property 'key' exists.
     119  public:  // without description
    124120
    125         G4MaterialPropertyVector* GetProperty(const char *key);
    126         // Get the property from the table corresponding to the key-name.
     121    const std::map< G4String, G4MaterialPropertyVector*, std::less<G4String> >*
     122    GetPropertiesMap() const { return &MPT; }
     123    const std::map< G4String, G4double, std::less<G4String> >*
     124    GetPropertiesCMap() const { return &MPTC; }
     125    // Accessors required for persistency purposes
    127126
    128         void AddEntry(const char *key, G4double aPhotonEnergy,
    129                                  G4double  aPropertyValue);
    130         // Add a new entry (pair of numbers) to the table for a given key.
     127  private:
    131128
    132         void RemoveEntry(const char *key, G4double  aPhotonEnergy);
    133         // Remove an entry from the table for a given key and x-value.
     129    G4MaterialPropertyVector* SetGROUPVEL();
    134130
    135         void DumpTable();
     131  private:
    136132
    137 private:
     133    std::map<G4String, G4MaterialPropertyVector*, std::less<G4String> > MPT;
     134    typedef std::map< G4String, G4MaterialPropertyVector*,
     135                      std::less<G4String> >::iterator MPTiterator;
    138136
    139         /////////////////////////
    140         // Private Data members
    141         /////////////////////////
    142 
    143         std::map<G4String, G4MaterialPropertyVector*, std::less<G4String> > MPT;
    144         typedef std::map<G4String, G4MaterialPropertyVector*,
    145           std::less<G4String> >::iterator MPTiterator;
    146 
    147         std::map< G4String, G4double, std::less<G4String> > MPTC;
    148         typedef std::map< G4String, G4double,
    149           std::less<G4String> >::iterator MPTCiterator;
    150 
    151         G4MaterialPropertyVector* SetGROUPVEL();
    152 
     137    std::map< G4String, G4double, std::less<G4String> > MPTC;
     138    typedef std::map< G4String, G4double,
     139                      std::less<G4String> >::iterator MPTCiterator;
    153140};
    154141
     142/////////////////////
     143// Inline definitions
     144/////////////////////
     145
     146#include "G4MaterialPropertiesTable.icc"
     147
    155148#endif /* G4MaterialPropertiesTable_h */
  • trunk/source/materials/include/G4MaterialPropertyVector.hh

    r986 r1058  
    2525//
    2626//
    27 // $Id: G4MaterialPropertyVector.hh,v 1.11 2008/06/05 23:37:37 gum Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4MaterialPropertyVector.hh,v 1.14 2009/04/24 09:35:14 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
    3131////////////////////////////////////////////////////////////////////////
    32 // G4MaterialPropertyVector Class Definition
    33 ////////////////////////////////////////////////////////////////////////
    3432//
     33// class G4MaterialPropertyVector
     34//
     35// Class description:
     36//
     37// A one-to-one mapping from Photon Energy to some optical property
     38
    3539// File:        G4MaterialPropertyVector.hh
    3640//
    37 // Description: A one-to-one mapping from Photon Energy to some
    38 //              optical property
    3941// Version:     1.0
    4042// Created:     1996-02-08
     
    5860#include <functional>
    5961
    60 // Class Description:
    61 // A one-to-one mapping from Photon Energy to some optical property.
    62 // Class Description - End:
    63 
    6462/////////////////////
    6563// Class Definition
    6664/////////////////////
    6765
    68 class G4MaterialPropertyVector {
     66class G4MaterialPropertyVector
     67{
     68  struct MPVEntry_less
     69    : public std::binary_function<G4MPVEntry*, G4MPVEntry*, G4bool>
     70  {
     71    G4bool operator()(G4MPVEntry* x, G4MPVEntry* y) { return *x < *y; }
     72  };
    6973
    70         struct MPVEntry_less
    71           : public std::binary_function<G4MPVEntry*, G4MPVEntry*, G4bool>
    72         {
    73           G4bool operator()(G4MPVEntry* x, G4MPVEntry* y) { return *x < *y; }
    74         };
     74  public: // Without description
    7575
    76 public: // Without description
     76    //////////////
     77    // Operators
     78    //////////////
    7779
    78         //////////////
    79         // Operators
    80         //////////////
     80    inline G4bool operator ++();
     81    G4MaterialPropertyVector& operator =(const G4MaterialPropertyVector &right);
    8182
    82         G4bool operator ++();
    83         G4MaterialPropertyVector&
    84                    operator =(const G4MaterialPropertyVector &right);
     83    /////////////////
     84    // Constructors
     85    /////////////////
    8586
    86         /////////////////
    87         // Constructors
    88         /////////////////
     87    G4MaterialPropertyVector() : MPV(0)
     88    {
     89      CurrentEntry = -1;
     90      NumEntries   = 0;
     91    };
    8992
    90         G4MaterialPropertyVector() : MPV(0)
    91         {
    92                 CurrentEntry = -1;
    93                 NumEntries   = 0;
    94         };
     93  public: // With description
     94 
     95    G4MaterialPropertyVector(G4double *PhotonEnergies,
     96                             G4double *PropertyValues,
     97                             G4int     NumElements);
     98      // Constructor of G4MaterialPropertyVector object.
    9599
    96 public: // With description
    97        
    98         G4MaterialPropertyVector(G4double *PhotonEnergies,
    99                                  G4double *PropertyValues,
    100                                  G4int     NumElements);
    101         // Constructor of G4MaterialPropertyVector object.
     100    inline void ResetIterator();
     101    inline G4int Entries() const;
    102102
    103 public: // Without description
     103    inline void AddElement(G4double aPhotonEnergy, G4double aPropertyValue);
     104      // Add a new element (pair of numbers) to the G4MaterialPropertyVector.
     105    void RemoveElement(G4double aPhotonEnergy);
     106      // Remove the element with given x-value.
    104107
    105         G4MaterialPropertyVector(const G4MaterialPropertyVector &right);
     108    G4double GetProperty(G4double aPhotonEnergy) const;
     109      // Returns the y-value for given x-value (with interpolation).
     110    G4double GetPhotonEnergy(G4double aProperty) const;
     111      // Returns the x-value for given y-value (with interpolation).
     112      // NOTE: Assumes that the y-value is an increasing function of
     113      //       the x-value. Returns the x-value corresponding to the
     114      //       y-value passed in. If several x-values correspond to
     115      //       the y-value passed in, the method returns the first
     116      //       x-value in the vector that corresponds to that value.
     117      // For use with G4MaterialPropertyVector iterator: return
     118      // property (or Photon Energy) at current point of iterator.
    106119
    107         ///////////////
    108         // Destructor
    109         ///////////////
     120    inline G4double GetProperty() const;
     121    inline G4double GetPhotonEnergy() const;
     122    inline G4double GetMaxProperty() const;
     123    inline G4double GetMinProperty() const;
     124    inline G4double GetMaxPhotonEnergy() const;
     125    inline G4double GetMinPhotonEnergy() const;
     126   
     127  public: // Without description
    110128
    111         ~G4MaterialPropertyVector();
     129    G4MaterialPropertyVector(const G4MaterialPropertyVector &right);
     130   ~G4MaterialPropertyVector();
    112131
    113         ////////////
    114         // Methods
    115         ////////////
     132    //////////
     133    // Tests
     134    //////////
    116135
    117 public: // With description
     136    void DumpVector();
    118137
    119         void ResetIterator();
     138    /////////////////////
     139    // Helper Functions
     140    /////////////////////
    120141
    121         void AddElement(G4double aPhotonEnergy,
    122                         G4double aPropertyValue);
    123         // Add a new element (pair of numbers) to the G4MaterialPropertyVector.
    124         void RemoveElement(G4double aPhotonEnergy);
    125         // Remove the element with given x-value.
     142    inline G4MPVEntry GetEntry(G4int i) const;
    126143
    127         G4double GetProperty(G4double aPhotonEnergy) const;
    128         // Returns the y-value for given x-value (with interpolation).
    129         G4double GetPhotonEnergy(G4double aProperty) const;
    130         // Returns the x-value for given y-value (with interpolation).
    131         // NOTE: Assumes that the y-value is an increasing function of
    132         //       the x-value. Returns the x-value corresponding to the
    133         //       y-value passed in. If several x-values correspond to
    134         //       the y-value passed in, the method returns the first
    135         //       x-value in the vector that corresponds to that value.
    136         // For use with G4MaterialPropertyVector iterator: return
    137         // property (or Photon Energy) at current point of iterator.
     144  private:
    138145
    139         G4double GetProperty() const;
    140         G4double GetPhotonEnergy() const;
     146    void GetAdjacentBins(G4double aPhotonEnergy,
     147                         G4int *left, G4int *right) const;
    141148
    142         G4double GetMaxProperty() const;
    143         G4double GetMinProperty() const;
    144         G4double GetMaxPhotonEnergy() const;
    145         G4double GetMinPhotonEnergy() const;
    146                
    147         //////////
    148         // Tests
    149         //////////
     149  private:
    150150
    151         void DumpVector();     
     151    /////////////////////////
     152    // Private Data Members
     153    /////////////////////////
    152154
    153 private:
    154 
    155         /////////////////////
    156         // Helper Functions
    157         /////////////////////
    158 
    159         G4MPVEntry GetEntry(G4int i) const;
    160 
    161         void GetAdjacentBins(G4double aPhotonEnergy,
    162                              G4int *left,G4int *right) const;
    163 
    164         /////////////////////////
    165         // Private Data Members
    166         /////////////////////////
    167 
    168         std::vector<G4MPVEntry*> MPV;
    169         G4int NumEntries;
    170         G4int CurrentEntry;
     155    std::vector<G4MPVEntry*> MPV;
     156    G4int NumEntries;
     157    G4int CurrentEntry;
    171158};
    172159
     
    175162///////////////////
    176163
    177 inline
    178 G4double G4MaterialPropertyVector::GetMaxProperty() const
    179 {
    180   return MPV.back()->GetProperty();
    181 }
    182 
    183 inline
    184 G4double G4MaterialPropertyVector::GetMinProperty() const
    185 {
    186   return MPV.front()->GetProperty();
    187 }
    188 
    189 inline
    190 G4double G4MaterialPropertyVector::GetMaxPhotonEnergy() const
    191 {
    192   return MPV.back()->GetPhotonEnergy();
    193 }
    194 
    195 inline
    196 G4double G4MaterialPropertyVector::GetMinPhotonEnergy() const
    197 {
    198   return MPV.front()->GetPhotonEnergy();
    199 }
     164#include "G4MaterialPropertyVector.icc"
    200165
    201166#endif /* G4MaterialPropertyVector_h */
  • trunk/source/materials/include/G4MaterialStoppingICRU73.hh

    r986 r1058  
    2424// ********************************************************************
    2525//
    26 // $Id: G4MaterialStoppingICRU73.hh,v 1.4 2009/02/19 11:09:22 antoni Exp $
    27 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     26// $Id: G4MaterialStoppingICRU73.hh,v 1.5 2009/03/18 10:14:49 alechner Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828
    2929#ifndef G4MaterialStoppingICRU73_h
     
    5151
    5252#include "globals.hh"
     53#include "G4VIonDEDXTable.hh"
    5354#include "G4LPhysicsFreeVector.hh"
    5455#include <vector>
    5556
    56 class G4MaterialStoppingICRU73
     57
     58class G4MaterialStoppingICRU73 : public G4VIonDEDXTable
    5759{
    5860public:
     
    6264  ~G4MaterialStoppingICRU73();
    6365
    64   G4double GetDEDX(G4int ionZ, G4int idxMaterial, G4double kinEnergy);
     66  G4bool IsApplicable(G4int ionZ,
     67                      const G4String& matName);
    6568
    66   inline G4double GetDEDX(G4int ionZ, const G4String& NameMaterial,
    67                           G4double kinEnergy);
     69  G4bool IsApplicable(G4int ionZ,
     70                      G4int matZ);
    6871
    69   inline G4int GetMaterialIndex(const G4String& NameMaterial);
     72  G4PhysicsVector* GetPhysicsVector(G4int ionZ,
     73                                    const G4String& matName);
    7074
    71   // Function returns an unique index (>=0) for each ion-material couple (the
    72   // return value is -1 if the couple is not found):
    73   inline G4int GetIonMaterialCoupleIndex(
    74                         G4int atomicNumber,            // Atomic number of ion
    75                         const G4String& materialName); // Material name
     75  G4PhysicsVector* GetPhysicsVector(G4int ionZ,
     76                                    G4int matZ);
    7677
    77   inline G4double GetDensity(G4int idxMaterial);
     78  G4double GetDEDX(G4double kinEnergyPerNucleon,
     79                   G4int ionZ,
     80                   const G4String& matName);
    7881
    79   inline G4String GetMaterialName(G4int idxMaterial);
    80 
    81   inline G4PhysicsVector* GetPhysicsVector(G4int ionZ, G4int idxMaterial);
    82 
    83   inline G4PhysicsVector* GetPhysicsVector(G4int ionZ,
    84                                            const G4String& NameMaterial);
    85 
    86   inline G4double GetLowerEnergyBoundary();
    87 
    88   inline G4double GetUpperEnergyBoundary();
     82  G4double GetDEDX(G4double kinEnergyPerNucleon,
     83                   G4int ionZ,
     84                   G4int matZ);
    8985
    9086private:
     87  // Function for creating a physics vector
     88  G4PhysicsVector* CreatePhysicsVector(G4double* energy,
     89                                       G4double* stoppower,
     90                                       G4double factor);
    9191
    92   void Initialise();
    93 
    94   void AddData(G4double* energy, G4double* stoppower, G4double factor);
    95 
    96   // hide assignment operator
    97   G4MaterialStoppingICRU73 & operator=(const G4MaterialStoppingICRU73 &right);
     92  // Assignment operator and copy constructor
     93  G4MaterialStoppingICRU73 &
     94                       operator=(const G4MaterialStoppingICRU73 &right);
    9895  G4MaterialStoppingICRU73(const G4MaterialStoppingICRU73&);
    9996
    100   G4bool   spline;
    101   G4int    Z[16];
    102   G4double A[16];
    103   G4String MatName[31];
    104   G4double Density[31];
     97  // Flag indicating the use of spline interpolation for dE/dx vectors
     98  G4bool spline;
    10599
    106   // Lower and upper energy boundaries for dE/dx vectors:
    107   G4double lowerEnergyBoundary;
    108   G4double upperEnergyBoundary;
     100  // Minimum and maximum atomic number
     101  G4int minIonAtomicNmb;
     102  G4int maxIonAtomicNmb;
    109103
    110   std::vector<G4LPhysicsFreeVector*>  dedx;
     104  // Vector containing the names of the materials
     105  std::vector<G4String> namesMat;
     106
     107  // Keys (ion atomic number and material names) corresponding to created
     108  // dE/dx vectors
     109  typedef std::pair<G4int, G4String> DEDXKey;
     110  std::vector<DEDXKey> dedxKeys;
     111
     112  // Vector of dE/dx vectors
     113  std::vector<G4PhysicsVector*> dedx;
    111114};
     115
    112116
    113117//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    114118
    115 inline G4double
    116 G4MaterialStoppingICRU73::GetDEDX(G4int ionZ, const G4String& NameMaterial,
    117                                   G4double kinEnergy)
    118 {
    119   return GetDEDX(ionZ, GetMaterialIndex(NameMaterial), kinEnergy);
    120 }
    121 
    122 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    123 
    124 inline G4int
    125 G4MaterialStoppingICRU73::GetMaterialIndex(const G4String& NameMaterial)
    126 {
    127   G4int idx = -1;
    128   for (G4int i=0; i<31; i++){
    129     if(MatName[i] == NameMaterial) {
    130       idx = i;
    131       break;
    132     }
    133   }
    134   return idx;
    135 }
    136 
    137 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    138 
    139 inline G4int
    140 G4MaterialStoppingICRU73::GetIonMaterialCoupleIndex(
    141                        G4int atomicNumber,             
    142                        const G4String& materialName)
    143 {
    144   G4int idx = -1;
    145   if(atomicNumber >= 3 && atomicNumber <= 18) {
    146 
    147     G4int materialIndex = GetMaterialIndex(materialName);
    148     if(materialIndex >= 0) idx = materialIndex * 16 + atomicNumber - 3;
    149   }
    150 
    151   return idx;
    152 }
    153 
    154 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    155 
    156 inline G4double
    157 G4MaterialStoppingICRU73::GetDensity(G4int idxMaterial)
    158 {
    159   G4double d = 0.0;
    160   if( idxMaterial >= 0 && idxMaterial <= 30) d = Density[idxMaterial];
    161   return d;
    162 }
    163 
    164 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    165 
    166 inline
    167 G4String G4MaterialStoppingICRU73::GetMaterialName(G4int idxMaterial)
    168 {
    169   G4String s = "";
    170   if( idxMaterial >= 0 && idxMaterial <= 30) s = MatName[idxMaterial];
    171   return s;
    172 }
    173 
    174 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    175 
    176 inline G4PhysicsVector*
    177 G4MaterialStoppingICRU73::GetPhysicsVector(G4int ionZ, G4int idxMaterial)
    178 {
    179   G4PhysicsVector* v = 0;
    180   if(ionZ >= 3 && ionZ <= 18 && idxMaterial >= 0 && idxMaterial <= 30) { 
    181     v = dedx[idxMaterial*16 + ionZ - 3];
    182   }
    183   return v;
    184 }
    185 
    186 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    187 
    188 inline G4PhysicsVector*
    189 G4MaterialStoppingICRU73::GetPhysicsVector(G4int ionZ,
    190                                            const G4String& NameMaterial)
    191 {
    192   return GetPhysicsVector(ionZ, GetMaterialIndex(NameMaterial));
    193 }
    194 
    195 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    196 
    197 inline G4double
    198 G4MaterialStoppingICRU73::GetLowerEnergyBoundary() {
    199 
    200   return lowerEnergyBoundary;
    201 }
    202 
    203 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    204 
    205 inline G4double
    206 G4MaterialStoppingICRU73::GetUpperEnergyBoundary() {
    207 
    208   return upperEnergyBoundary;
    209 }
    210 
    211119#endif
  • trunk/source/materials/include/G4OpticalSurface.hh

    r986 r1058  
    2525//
    2626//
    27 // $Id: G4OpticalSurface.hh,v 1.11 2008/12/11 10:23:54 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4OpticalSurface.hh,v 1.12 2009/04/21 15:35:45 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
     
    8383class G4OpticalSurface : public G4SurfaceProperty
    8484{
     85  public: // With description
    8586
    86 public: // With description
     87    ////////////////////////////////
     88    // Constructor
     89    ////////////////////////////////
    8790
    88         ////////////////////////////////
    89         // Constructor
    90         ////////////////////////////////
     91    G4OpticalSurface(const G4String& name,
     92                     G4OpticalSurfaceModel model = glisur,
     93                     G4OpticalSurfaceFinish finish = polished,
     94                     G4SurfaceType type = dielectric_dielectric,
     95                     G4double value = 1.0);
     96    // Constructor of an optical surface object.
    9197
    92         G4OpticalSurface(const G4String& name,
    93                          G4OpticalSurfaceModel model = glisur,
    94                          G4OpticalSurfaceFinish finish = polished,
    95                          G4SurfaceType type = dielectric_dielectric,
    96                          G4double value = 1.0);
    97         // Constructor of an optical surface object.
     98  public: // Without description
    9899
    99 public: // Without description
     100    //////////////
     101    // Constructors and destructor
     102    //////////////
    100103
    101         //////////////
    102         // Constructors and destructor
    103         //////////////
     104    G4OpticalSurface();
     105    virtual ~G4OpticalSurface();
     106    G4OpticalSurface(const G4OpticalSurface &right);
     107 
     108    //////////////
     109    // Operators
     110    //////////////
     111 
     112    const G4OpticalSurface & operator=(const G4OpticalSurface &right);
     113 
     114    G4int operator==(const G4OpticalSurface &right) const;
     115    G4int operator!=(const G4OpticalSurface &right) const;
    104116
    105         G4OpticalSurface();
    106         virtual ~G4OpticalSurface();
    107         G4OpticalSurface(const G4OpticalSurface &right);
    108  
    109         //////////////
    110         // Operators
    111         //////////////
    112  
    113         const G4OpticalSurface & operator=(const G4OpticalSurface &right);
    114  
    115         G4int operator==(const G4OpticalSurface &right) const;
    116         G4int operator!=(const G4OpticalSurface &right) const;
     117    ////////////
     118    // Methods
     119    ////////////
    117120
    118         ////////////
    119         // Methods
    120         ////////////
     121  public: // With description
    121122
    122 public: // With description
     123    const G4OpticalSurfaceFinish& GetFinish() const { return theFinish; }
     124    // Returns the optical surface finish.
     125    void SetFinish(const G4OpticalSurfaceFinish& finish) { theFinish = finish; }
     126    // Sets the optical surface finish.
    123127
    124         G4OpticalSurfaceFinish GetFinish() const {return theFinish;};
    125         // Returns the optical surface finish.
    126         void         SetFinish(const G4OpticalSurfaceFinish finish)
    127                                                  {theFinish = finish;};
    128         // Sets the optical surface finish.
     128    const G4OpticalSurfaceModel& GetModel() const { return theModel; }
     129    // Returns the optical surface model used.
     130    void SetModel(const G4OpticalSurfaceModel& model) { theModel = model; }
     131    // Sets the optical surface model to be followed.
    129132
    130         G4OpticalSurfaceModel GetModel() const {return theModel;};
    131         // Returns the optical surface model used.
    132         void           SetModel(const G4OpticalSurfaceModel model)
    133                                                    {theModel = model;};
    134         // Sets the optical surface model to be followed.
     133    G4double GetSigmaAlpha() const { return sigma_alpha; }
     134    // Returns an unified model surface parameter.
     135    void     SetSigmaAlpha(const G4double s_a) { sigma_alpha = s_a; }
     136    // Sets an unified model surface parameter.
    135137
    136         G4double GetSigmaAlpha() const {return sigma_alpha;};
    137         // Returns an unified model surface parameter.
    138         void     SetSigmaAlpha(const G4double s_a)
    139                                         {sigma_alpha = s_a;};
    140         // Sets an unified model surface parameter.
     138    G4double GetPolish() const { return polish; }
     139    // Returns the optical surface polish type.
     140    void     SetPolish(const G4double plsh) { polish=plsh; }
     141    // Sets the optical surface polish type.
    141142
    142         G4double GetPolish() const {return polish;};
    143         // Returns the optical surface polish type.
    144         void     SetPolish(const G4double plsh) {polish=plsh;};
    145         // Sets the optical surface polish type.
     143    G4MaterialPropertiesTable* GetMaterialPropertiesTable() const
     144                                   { return theMaterialPropertiesTable; }
     145    // Retrieves the pointer of the G4MaterialPropertiesTable
     146    // attached to optical surface.
    146147
    147         G4MaterialPropertiesTable* GetMaterialPropertiesTable() const
    148                                        { return theMaterialPropertiesTable;};
    149         // Retrieves the pointer of the G4MaterialPropertiesTable
    150         // attached to optical surface.
     148    void SetMaterialPropertiesTable(G4MaterialPropertiesTable *anMPT)
     149                                   { theMaterialPropertiesTable = anMPT; }
     150    // Attaches a G4MaterialPropertiesTable to the optical surface.
    151151
    152         void SetMaterialPropertiesTable(G4MaterialPropertiesTable *anMPT)
    153                                     { theMaterialPropertiesTable = anMPT;};
    154         // Attaches a G4MaterialPropertiesTable to the optical surface.
     152    void DumpInfo() const;
     153    // Prints information about the optical surface.
    155154
    156         void DumpInfo() const;
    157         // Prints information about the optical surface.
     155  private:
    158156
    159 private:
     157    // ------------------
     158    // Basic data members ( To define an optical surface)
     159    // ------------------
    160160
    161 // ------------------
    162 // Basic data members ( To define an optical surface)
    163 // ------------------
     161    G4OpticalSurfaceModel theModel;          // Surface model
     162    G4OpticalSurfaceFinish theFinish;        // Surface finish
    164163
    165         G4OpticalSurfaceModel theModel;         // Surface model
    166         G4OpticalSurfaceFinish theFinish;       // Surface finish
     164    G4double sigma_alpha;           // The sigma of micro-facet polar angle
     165    G4double polish;                // Polish parameter in glisur model
    167166
    168         G4double sigma_alpha;           // The sigma of micro-facet polar angle
    169         G4double polish;                // Polish parameter in glisur model
    170 
    171         G4MaterialPropertiesTable* theMaterialPropertiesTable;
    172 
     167    G4MaterialPropertiesTable* theMaterialPropertiesTable;
    173168};
    174169
    175 ////////////////////
    176 // Inline methods
    177 ////////////////////
    178 
    179170#endif /* G4OpticalSurface_h */
  • trunk/source/materials/include/G4SimpleMaterialStoppingICRU73.hh

    r986 r1058  
    2424// ********************************************************************
    2525//
    26 // $Id: G4SimpleMaterialStoppingICRU73.hh,v 1.5 2009/02/19 12:19:53 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     26// $Id: G4SimpleMaterialStoppingICRU73.hh,v 1.6 2009/03/18 10:14:49 alechner Exp $
     27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2828
    2929#ifndef G4SimpleMaterialStoppingICRU73_h
     
    5151
    5252#include "globals.hh"
     53#include "G4VIonDEDXTable.hh"
    5354#include "G4LPhysicsFreeVector.hh"
    5455#include <vector>
     56#include <utility>
     57#include <map>
    5558
    56 class G4SimpleMaterialStoppingICRU73
     59
     60class G4SimpleMaterialStoppingICRU73 : public G4VIonDEDXTable
    5761{
    5862public:
     
    6266  ~G4SimpleMaterialStoppingICRU73();
    6367
    64   G4double GetDEDX(G4int ionZ, G4int idxMaterial, G4double kinEnergy);
     68  G4bool IsApplicable(G4int ionZ, 
     69                      G4int matZ);
    6570
    66   inline G4double GetDEDX(G4int ionZ, const G4String& NameMaterial,
    67                           G4double kinEnergy);
     71  G4bool IsApplicable(G4int ionZ,
     72                      const G4String& matName);
    6873
    69   inline G4int GetMaterialIndex(const G4String& NameMaterial);
     74  G4PhysicsVector* GetPhysicsVector(G4int ionZ,
     75                                    G4int matZ);
    7076
    71   // Function returns an unique index (>=0) for each ion-material couple (the
    72   // return value is -1 if the couple is not found):
    73   inline G4int GetIonMaterialCoupleIndex(
    74                         G4int atomicNumber,            // Atomic number of ion
    75                         const G4String& materialName); // Material name
     77  G4PhysicsVector* GetPhysicsVector(G4int ionZ,
     78                                    const G4String& matName);
    7679
    77   inline G4double GetDensity(G4int idxMaterial);
     80  G4double GetDEDX(G4double kinEnergyPerNucleon,
     81                   G4int ionZ,
     82                   const G4String& matName);
    7883
    79   inline G4String GetMaterialName(G4int idxMaterial);
    80 
    81   inline G4PhysicsVector* GetPhysicsVector(G4int ionZ, G4int idxMaterial);
    82 
    83   inline G4PhysicsVector* GetPhysicsVector(G4int ionZ,
    84                                            const G4String& NameMaterial);
    85 
    86   inline G4double GetLowerEnergyBoundary();
    87 
    88   inline G4double GetUpperEnergyBoundary();
     84  G4double GetDEDX(G4double kinEnergyPerNucleon,
     85                   G4int ionZ,
     86                   G4int matZ);
    8987
    9088private:
     89  // Function for creating a physics vector
     90  G4PhysicsVector* CreatePhysicsVector(G4double* energy,
     91                                       G4double* stoppower,
     92                                       G4double factor);
    9193
    92   void Initialise();
    93 
    94   void AddData(G4double* energy, G4double* stoppower, G4double factor);
    95 
    96   // hide assignment operator
    97   G4SimpleMaterialStoppingICRU73 & operator=(const G4SimpleMaterialStoppingICRU73 &right);
     94  // Assignment operator and copy constructor
     95  G4SimpleMaterialStoppingICRU73 &
     96                       operator=(const G4SimpleMaterialStoppingICRU73 &right);
    9897  G4SimpleMaterialStoppingICRU73(const G4SimpleMaterialStoppingICRU73&);
    9998
    100   G4bool   spline;
    101   G4int    Z[16];
    102   G4double A[16];
    103   G4String MatName[25];
    104   G4double Density[25];
     99  // Flag indicating the use of spline interpolation for dE/dx vectors
     100  G4bool spline;
    105101
    106   // Lower and upper energy boundaries for dE/dx vectors:
    107   G4double lowerEnergyBoundary;
    108   G4double upperEnergyBoundary;
     102  // Minimum and maximum atomic number
     103  G4int minIonAtomicNmb;
     104  G4int maxIonAtomicNmb;
    109105
    110   std::vector<G4LPhysicsFreeVector*>  dedx;
     106  // Vectors containing the atomic numbers and names of the materials
     107  std::vector<G4int> atomicNumbersMat;
     108  std::vector<G4String> namesMat;
     109
     110  // Keys (ion atomic number and material names) corresponding to created
     111  // dE/dx vectors
     112  typedef std::pair<G4int, G4String> DEDXKey;
     113  std::vector<DEDXKey> dedxKeys;
     114
     115  // Vector of dE/dx vectors
     116  std::vector<G4PhysicsVector*>  dedx;
    111117};
     118
    112119
    113120//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    114121
    115 inline G4double
    116 G4SimpleMaterialStoppingICRU73::GetDEDX(G4int ionZ, const G4String& NameMaterial,
    117                                         G4double kinEnergy)
    118 {
    119   return GetDEDX(ionZ, GetMaterialIndex(NameMaterial), kinEnergy);
    120 }
    121 
    122 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    123 
    124 inline G4int
    125 G4SimpleMaterialStoppingICRU73::GetMaterialIndex(const G4String& NameMaterial)
    126 {
    127   G4int idx = -1;
    128   for (G4int i=0; i<25; i++){
    129     if(MatName[i] == NameMaterial) {
    130       idx = i;
    131       break;
    132     }
    133   }
    134   return idx;
    135 }
    136 
    137 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    138 
    139 inline G4int
    140 G4SimpleMaterialStoppingICRU73::GetIonMaterialCoupleIndex(
    141                        G4int atomicNumber,             
    142                        const G4String& materialName)
    143 {
    144   G4int idx = -1;
    145   if(atomicNumber >= 3 && atomicNumber <= 18) {
    146 
    147     G4int materialIndex = GetMaterialIndex(materialName);
    148     if(materialIndex >= 0) idx = materialIndex * 16 + atomicNumber - 3;
    149   }
    150 
    151   return idx;
    152 }
    153 
    154 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    155 
    156 inline G4double
    157 G4SimpleMaterialStoppingICRU73::GetDensity(G4int idxMaterial)
    158 {
    159   G4double d = 0.0;
    160   if( idxMaterial >= 0 && idxMaterial <= 24) d = Density[idxMaterial];
    161   return d;
    162 }
    163 
    164 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    165 
    166 inline
    167 G4String G4SimpleMaterialStoppingICRU73::GetMaterialName(G4int idxMaterial)
    168 {
    169   G4String s = "";
    170   if( idxMaterial >= 0 && idxMaterial <= 24) s = MatName[idxMaterial];
    171   return s;
    172 }
    173 
    174 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    175 
    176 inline G4PhysicsVector*
    177 G4SimpleMaterialStoppingICRU73::GetPhysicsVector(G4int ionZ, G4int idxMaterial)
    178 {
    179   G4PhysicsVector* v = 0;
    180   if(ionZ >= 3 && ionZ <= 18 && idxMaterial >= 0 && idxMaterial <= 24) { 
    181     v = dedx[idxMaterial*16 + ionZ - 3];
    182   }
    183   return v;
    184 }
    185 
    186 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    187 
    188 inline G4PhysicsVector*
    189 G4SimpleMaterialStoppingICRU73::GetPhysicsVector(G4int ionZ,
    190                                                  const G4String& NameMaterial)
    191 {
    192   return GetPhysicsVector(ionZ, GetMaterialIndex(NameMaterial));
    193 }
    194 
    195 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    196 
    197 inline G4double
    198 G4SimpleMaterialStoppingICRU73::GetLowerEnergyBoundary() {
    199 
    200   return lowerEnergyBoundary;
    201 }
    202 
    203 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    204 
    205 inline G4double
    206 G4SimpleMaterialStoppingICRU73::GetUpperEnergyBoundary() {
    207 
    208   return upperEnergyBoundary;
    209 }
    210 
    211 
    212122#endif
  • trunk/source/materials/include/G4SurfaceProperty.hh

    r986 r1058  
    2525//
    2626//
    27 // $Id: G4SurfaceProperty.hh,v 1.8 2008/12/11 10:23:54 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     27// $Id: G4SurfaceProperty.hh,v 1.9 2009/04/21 15:35:45 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
    2929//
    3030//
     
    7878class G4SurfaceProperty
    7979{
     80  public: // Without description
    8081
    81 public: // Without description
     82     //////////////
     83     // Operators
     84     //////////////
    8285
    83         //////////////
    84         // Operators
    85         //////////////
     86    // G4SurfaceProperty(const G4SurfaceProperty &right);
     87    // const G4SurfaceProperty & operator=(const G4SurfaceProperty &right);
    8688
    87   //    G4SurfaceProperty(const G4SurfaceProperty &right);
    88   //    const G4SurfaceProperty & operator=(const G4SurfaceProperty &right);
     89    // G4int operator==(const G4SurfaceProperty &right) const;
     90    // G4int operator!=(const G4SurfaceProperty &right) const;
    8991
    90   //    G4int operator==(const G4SurfaceProperty &right) const;
    91   //    G4int operator!=(const G4SurfaceProperty &right) const;
     92  public: // With description
    9293
    93 public: // With description
     94    ////////////////////////////////
     95    // Constructors and Destructor
     96    ////////////////////////////////
    9497
    95         ////////////////////////////////
    96         // Constructors and Destructor
    97         ////////////////////////////////
     98    G4SurfaceProperty(const G4String& name, G4SurfaceType type = x_ray);
     99    // Constructor of a X-ray optical surface object.
    98100
    99         G4SurfaceProperty(const G4String& name, G4SurfaceType type = x_ray);
    100         // Constructor of a X-ray optical surface object.
     101  public: // Without description
    101102
    102 public: // Without description
     103    G4SurfaceProperty();
     104    virtual ~G4SurfaceProperty();
    103105
    104         G4SurfaceProperty();
    105         virtual ~G4SurfaceProperty();
     106    ////////////
     107    // Methods
     108    ////////////
    106109
    107         ////////////
    108         // Methods
    109         ////////////
     110  public: // With description
    110111
    111         // public methods
     112    const G4String& GetName() const { return theName; }
     113    // Returns the surface name.
     114    void     SetName(const G4String& name) { theName = name; }
     115    // Sets the surface name.
    112116
    113 public: // With description
     117    const G4SurfaceType& GetType() const { return theType; }
     118    // Returns the surface type.
     119    void     SetType(const G4SurfaceType& type) { theType = type; }
     120    // Sets the surface type.       
    114121
    115         G4String GetName() const { return theName; };
    116         // Returns the surface name.
    117         void     SetName(const G4String& name){theName = name;};
    118         // Sets the surface name.
     122    static void CleanSurfacePropertyTable();
     123    static const G4SurfacePropertyTable* GetSurfacePropertyTable();
     124    static size_t GetNumberOfSurfaceProperties();
     125    static void DumpTableInfo();
     126    // To handle the table of surface properties.
    119127
    120         G4SurfaceType GetType() const {return theType;};
    121         // Returns the surface type.
    122         void         SetType(const G4SurfaceType type){theType = type;};
    123         // Sets the surface type.       
     128  protected:
    124129
    125         static void CleanSurfacePropertyTable();
    126         static const G4SurfacePropertyTable* GetSurfacePropertyTable();
    127         static size_t GetNumberOfSurfaceProperties();
    128         static void DumpTableInfo();
    129         // To handle the table of surface properties.
     130    // ------------------
     131    // Basic data members ( To define surface property)
     132    // ------------------
    130133
    131 protected:
     134    G4String theName;                // Surface name
    132135
    133 // ------------------
    134 // Basic data members ( To define surface property)
    135 // ------------------
     136    G4SurfaceType theType;           // Surface type
    136137
    137         G4String theName;               // Surface name
    138 
    139         G4SurfaceType theType;          // Surface type
    140 
    141         static G4SurfacePropertyTable theSurfacePropertyTable;
    142         // The static Table of SurfaceProperties.
     138    static G4SurfacePropertyTable theSurfacePropertyTable;
     139    // The static Table of SurfaceProperties.
    143140};
    144141
    145 ////////////////////
    146 // Inline methods
    147 ////////////////////
    148 
    149142#endif /* G4SurfaceProperty_h */
Note: See TracChangeset for help on using the changeset viewer.