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] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /materials/include/G4MaterialPropertiesTable.hh (Version 11.3.0) and /materials/include/G4MaterialPropertiesTable.hh (Version 3.0)


                                                   >>   1 // This code implementation is the intellectual property of
                                                   >>   2 // the GEANT4 collaboration.
  1 //                                                  3 //
  2 // ******************************************* <<   4 // By copying, distributing or modifying the Program (or any work
  3 // * License and Disclaimer                    <<   5 // based on the Program) you indicate your acceptance of this statement,
  4 // *                                           <<   6 // and all its terms.
  5 // * The  Geant4 software  is  copyright of th << 
  6 // * the Geant4 Collaboration.  It is provided << 
  7 // * conditions of the Geant4 Software License << 
  8 // * LICENSE and available at  http://cern.ch/ << 
  9 // * include a list of copyright holders.      << 
 10 // *                                           << 
 11 // * Neither the authors of this software syst << 
 12 // * institutes,nor the agencies providing fin << 
 13 // * work  make  any representation or  warran << 
 14 // * regarding  this  software system or assum << 
 15 // * use.  Please see the license in the file  << 
 16 // * for the full disclaimer and the limitatio << 
 17 // *                                           << 
 18 // * This  code  implementation is the result  << 
 19 // * technical work of the GEANT4 collaboratio << 
 20 // * By using,  copying,  modifying or  distri << 
 21 // * any work based  on the software)  you  ag << 
 22 // * use  in  resulting  scientific  publicati << 
 23 // * acceptance of all terms of the Geant4 Sof << 
 24 // ******************************************* << 
 25                                                << 
 26 ////////////////////////////////////////////// << 
 27 //                                                  7 //
 28 // class G4MaterialPropertiesTable             <<   8 // $Id: G4MaterialPropertiesTable.hh,v 1.9 2000/03/03 10:21:00 maire Exp $
                                                   >>   9 // GEANT4 tag $Name: geant4-03-00 $
 29 //                                                 10 //
 30 // Class description:                          <<  11 // 
 31 //                                             <<  12 ////////////////////////////////////////////////////////////////////////
 32 // A Material properties table is a hash table <<  13 // G4MaterialPropertiesTable Definition
 33 // key = property name, and value either G4dou <<  14 ////////////////////////////////////////////////////////////////////////
 34 // G4MaterialPropertyVector                    << 
 35 //                                                 15 //
 36 // File:        G4MaterialPropertiesTable.hh       16 // File:        G4MaterialPropertiesTable.hh
                                                   >>  17 // Description: An Material properties table is a hash table, with 
                                                   >>  18 //    key = property name, and value = G4MaterialPropertyVector 
 37 // Version:     1.0                                19 // Version:     1.0
 38 // Created:     1996-02-08                         20 // Created:     1996-02-08
 39 // Author:      Juliet Armstrong                   21 // Author:      Juliet Armstrong
 40 // Updated:     2005-05-12 add SetGROUPVEL() b <<  22 // Updated:     1999-11-05 Migration from G4RWTPtrHashDictionary to STL
 41 //              2002-11-05 add named material  << 
 42 //              1999-11-05 Migration from G4RW << 
 43 //                         by John Allison         23 //                         by John Allison
 44 //              1999-10-29 add method and clas     24 //              1999-10-29 add method and class descriptors
 45 //              1997-03-25 by Peter Gumplinger     25 //              1997-03-25 by Peter Gumplinger
 46 //              > cosmetics (only)                 26 //              > cosmetics (only)
                                                   >>  27 // mail:        gum@triumf.ca
 47 //                                                 28 //
 48 //////////////////////////////////////////////     29 ////////////////////////////////////////////////////////////////////////
 49                                                    30 
 50 #ifndef G4MaterialPropertiesTable_h                31 #ifndef G4MaterialPropertiesTable_h
 51 #define G4MaterialPropertiesTable_h 1              32 #define G4MaterialPropertiesTable_h 1
 52                                                    33 
 53 #include "G4MaterialPropertiesIndex.hh"        <<  34 /////////////
 54 #include "G4MaterialPropertyVector.hh"         <<  35 // Includes
                                                   >>  36 /////////////
                                                   >>  37 
                                                   >>  38 #include <math.h>
                                                   >>  39 #include "g4std/map"
 55 #include "globals.hh"                              40 #include "globals.hh"
                                                   >>  41 #include "G4MaterialPropertyVector.hh"
                                                   >>  42 
                                                   >>  43 // Class Description:
                                                   >>  44 // An Material properties table is a hash table, with key = property
                                                   >>  45 // name, and value = G4MaterialPropertyVector.
                                                   >>  46 // Class Description - End:
                                                   >>  47 
                                                   >>  48 #define RefractionIndex "RINDEX"
                                                   >>  49 
                                                   >>  50 /////////////////////
                                                   >>  51 // Class Definition
                                                   >>  52 /////////////////////
                                                   >>  53 
                                                   >>  54 class G4MaterialPropertiesTable {
                                                   >>  55 
                                                   >>  56   //////////////
                                                   >>  57         // Operators
                                                   >>  58         //////////////
                                                   >>  59 
                                                   >>  60 private:
                                                   >>  61 
                                                   >>  62   G4MaterialPropertiesTable&
                                                   >>  63     operator =(const G4MaterialPropertiesTable &right);
                                                   >>  64     
                                                   >>  65   ////////////////
                                                   >>  66   // Constructor
                                                   >>  67   ////////////////
                                                   >>  68 
                                                   >>  69 public: // Without description
                                                   >>  70 
                                                   >>  71   G4MaterialPropertiesTable(); 
                                                   >>  72   
                                                   >>  73 private:
                                                   >>  74 
                                                   >>  75   G4MaterialPropertiesTable(const G4MaterialPropertiesTable &right);
                                                   >>  76 
                                                   >>  77 public: // Without description
                                                   >>  78 
                                                   >>  79   ///////////////
                                                   >>  80   // Destructor
                                                   >>  81   ///////////////
                                                   >>  82 
                                                   >>  83   ~G4MaterialPropertiesTable();
                                                   >>  84 
                                                   >>  85   ////////////
                                                   >>  86   // Methods
                                                   >>  87   ////////////
                                                   >>  88 
                                                   >>  89 public: // With description
                                                   >>  90 
                                                   >>  91   void AddProperty(const char     *key,
                                                   >>  92              G4double *PhotonMomenta,
                                                   >>  93              G4double *PropertyValues,
                                                   >>  94              G4int     NumEntries);
                                                   >>  95         // Add a new property to the table by giving a key-name and the
                                                   >>  96         // arrays x and y of size NumEntries.
                                                   >>  97 
                                                   >>  98   void AddProperty(const char *key, G4MaterialPropertyVector *opv);
                                                   >>  99         // Add a new property to the table by giving a key-name and an
                                                   >> 100         // already constructed G4MaterialPropertyVector.
                                                   >> 101 
                                                   >> 102   void RemoveProperty(const char *key);
                                                   >> 103         // Remove a property from the table.
                                                   >> 104 
                                                   >> 105   G4MaterialPropertyVector* GetProperty(const char *key);
                                                   >> 106         // Get the property from the table corresponding to the key-name.
                                                   >> 107 
                                                   >> 108   void AddEntry(const char *key, G4double aPhotonMomentum,
                                                   >> 109                                  G4double  aPropertyValue);
                                                   >> 110         // Add a new entry (pair of numbers) to the table for a given key.
                                                   >> 111 
                                                   >> 112   void RemoveEntry(const char *key, G4double  aPhotonMomentum);
                                                   >> 113         // Remove an entry from the table for a given key and x-value.
                                                   >> 114 
                                                   >> 115   void DumpTable();
 56                                                   116 
 57 #include <vector>                              << 117 private:
 58                                                   118 
 59 class G4MaterialPropertiesTable                << 119   /////////////////////////
 60 {                                              << 120   // Private Data members
 61  public:                                       << 121   /////////////////////////
 62   G4MaterialPropertiesTable();                 << 
 63   virtual ~G4MaterialPropertiesTable();        << 
 64                                                << 
 65   // Add a new property to the table by giving << 
 66   void AddConstProperty(const G4String& key, G << 
 67   void AddConstProperty(const char* key, G4dou << 
 68                                                << 
 69   // Add a new property to the table by giving << 
 70   // vectors of values                         << 
 71   G4MaterialPropertyVector* AddProperty(const  << 
 72     const std::vector<G4double>& photonEnergie << 
 73     G4bool createNewKey = false, G4bool spline << 
 74                                                << 
 75   // Add a new property to the table by giving << 
 76   // arrays x and y of size NumEntries.        << 
 77   G4MaterialPropertyVector* AddProperty(const  << 
 78     G4double* propertyValues, G4int numEntries << 
 79                                                << 
 80   // Add a new property to the table by giving << 
 81   // already constructed G4MaterialPropertyVec << 
 82   void AddProperty(const G4String& key, G4Mate << 
 83   void AddProperty(const char* key, G4Material << 
 84                                                << 
 85   // Add a new property to the table by giving << 
 86   // name. Properties are in namespace G4Optic << 
 87   // Not possible to create a new key with thi << 
 88   void AddProperty(const G4String& key, const  << 
 89                                                << 
 90   // Remove a constant property from the table << 
 91   void RemoveConstProperty(const G4String& key << 
 92   void RemoveConstProperty(const char* key);   << 
 93                                                << 
 94   // Remove a property from the table.         << 
 95   void RemoveProperty(const G4String& key);    << 
 96   void RemoveProperty(const char* key);        << 
 97                                                << 
 98   // Get a constant property from the table    << 
 99   // It is an error to ask for a const propert << 
100   //  Check if it has been defined with ConstP << 
101   G4double GetConstProperty(const G4String& ke << 
102   G4double GetConstProperty(const char* key) c << 
103   G4double GetConstProperty(const G4int index) << 
104                                                << 
105   // Return true if a const property has been  << 
106   // Despite the name, this returns false for  << 
107   //  GetMaterialConstPropertyNames() but not  << 
108   // Use this method before calling GetConstPr << 
109   G4bool ConstPropertyExists(const G4String& k << 
110   G4bool ConstPropertyExists(const char* key)  << 
111   G4bool ConstPropertyExists(const G4int index << 
112                                                << 
113   // Get the property from the table correspon << 
114   // nullptr is returned if the property has n << 
115   G4MaterialPropertyVector* GetProperty(const  << 
116   G4MaterialPropertyVector* GetProperty(const  << 
117   G4MaterialPropertyVector* GetProperty(const  << 
118                                                << 
119   // Add a new entry (pair of numbers) to the  << 
120   void AddEntry(const G4String& key, G4double  << 
121   void AddEntry(const char* key, G4double aPho << 
122                                                << 
123   // Get the constant property index from the  << 
124   // It is an error to request the index of a  << 
125   //  present in fMaterialConstPropertyNames() << 
126   G4int GetConstPropertyIndex(const G4String&  << 
127                                                << 
128   // Get the property index by the key-name.   << 
129   // It is an error to request the index of a  << 
130   //  present in GetMaterialPropertyNames()).  << 
131   G4int GetPropertyIndex(const G4String& key)  << 
132                                                << 
133   // print the material properties and materia << 
134   void DumpTable() const;                      << 
135                                                << 
136   // the next four methods are used in persist << 
137   const std::vector<G4String>& GetMaterialProp << 
138   const std::vector<G4String>& GetMaterialCons << 
139   // return references to the vectors of mater << 
140   const std::vector<G4MaterialPropertyVector*> << 
141   const std::vector<std::pair<G4double, G4bool << 
142                                                << 
143  private:                                      << 
144   // Calculate the group velocity based on RIN << 
145   G4MaterialPropertyVector* CalculateGROUPVEL( << 
146                                                << 
147   // Vector of pointer to material property ve << 
148   // All entries are initialized to nullptr.   << 
149   // Order of entries in MP defined by enum in << 
150   std::vector<G4MaterialPropertyVector*> fMP;  << 
151                                                << 
152   // Vector of energy-independent (i.e., "cons << 
153   // need to keep track if a property is defin << 
154   // is 'true' if the property is defined.     << 
155   // Order of entries in MCP defined by enum i << 
156   std::vector<std::pair<G4double, G4bool>> fMC << 
157                                                   122 
158   std::vector<G4String> fMatPropNames;  // vec << 123   G4std::map<G4String, G4MaterialPropertyVector*, G4std::less<G4String> > MPT;
159   std::vector<G4String> fMatConstPropNames;  / << 124   typedef G4std::map<G4String, G4MaterialPropertyVector*,
                                                   >> 125     G4std::less<G4String> >::iterator MPTiterator;
160 };                                                126 };
161                                                   127 
162 #endif /* G4MaterialPropertiesTable_h */          128 #endif /* G4MaterialPropertiesTable_h */
163                                                   129