Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/materials/include/G4Material.hh

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 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/G4Material.hh (Version 11.3.0) and /materials/include/G4Material.hh (Version 2.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 //                                             << 
 28 // ClassName:   G4Material                     << 
 29 //                                             << 
 30 // Description: Contains material properties   << 
 31 //                                             << 
 32 // Class description:                          << 
 33 //                                             << 
 34 // Is used to define the material composition  << 
 35 // A G4Material is always made of G4Elements.  << 
 36 // the list of G4Elements, material density, m << 
 37 // pressure. Other parameters are optional and << 
 38 // or computed at initialisation.              << 
 39 //                                             << 
 40 // There is several ways to construct G4Materi << 
 41 //   - from single element;                    << 
 42 //   - from a list of components (elements or  << 
 43 //   - from internal Geant4 database of materi << 
 44 //                                                  7 //
 45 // A collection of constituent Elements/Materi <<   8 // $Id: G4Material.hh,v 1.7 1999/12/16 18:11:09 maire Exp $
 46 // with specified weights by fractional mass o <<   9 // GEANT4 tag $Name: geant4-02-00 $
 47 //                                                 10 //
 48 // Quantities, with physical meaning or not, w <<  11 
                                                   >>  12 // class description
                                                   >>  13 //
                                                   >>  14 // Materials defined via the G4Material class are used to define the
                                                   >>  15 // composition of Geant volumes.
                                                   >>  16 // a Material is always made of Elements. It can be defined directly
                                                   >>  17 // from scratch (defined by a single element), specifying :
                                                   >>  18 //                                             its name,
                                                   >>  19 //                                             density,
                                                   >>  20 //                                             state informations,
                                                   >>  21 //                                            and Z,A of the underlying Element.
                                                   >>  22 //
                                                   >>  23 // or in terms of a collection of constituent Elements with specified weights
                                                   >>  24 // (composition specified either by fractional mass or atom counts).
                                                   >>  25 //
                                                   >>  26 // Quantities, with physical meaning or not, which are constant in a given 
 49 // material are computed and stored here as De     27 // material are computed and stored here as Derived data members.
 50 //                                                 28 //
 51 // The class contains as a private static memb     29 // The class contains as a private static member the Table of defined
 52 // materials (an ordered vector of materials).     30 // materials (an ordered vector of materials).
 53 //                                                 31 //
 54 // It is strongly not recommended to delete ma <<  32 
 55 // All materials will be deleted automatically <<  33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
 56 //                                             <<  34 
 57 // 10-07-96, new data members added by L.Urban     35 // 10-07-96, new data members added by L.Urban
 58 // 12-12-96, new data members added by L.Urban     36 // 12-12-96, new data members added by L.Urban
 59 // 20-01-97, aesthetic rearrangement. RadLengt     37 // 20-01-97, aesthetic rearrangement. RadLength calculation modified
 60 //           Data members Zeff and Aeff REMOVE     38 //           Data members Zeff and Aeff REMOVED (i.e. passed to the Elements).
 61 //           (local definition of Zeff in Dens     39 //           (local definition of Zeff in DensityEffect and FluctModel...)
 62 //           Vacuum defined as a G4State. Mixt <<  40 //           Vacuum defined as a G4State. Mixture flag removed, M.Maire  
 63 // 29-01-97, State=Vacuum automatically set de     41 // 29-01-97, State=Vacuum automatically set density=0 in the contructors.
 64 //           Subsequent protections have been  <<  42 //           Subsequent protections have been put in the calculation of 
 65 //           MeanExcEnergy, ShellCorrectionVec     43 //           MeanExcEnergy, ShellCorrectionVector, DensityEffect, M.Maire
 66 // 20-03-97, corrected initialization of point     44 // 20-03-97, corrected initialization of pointers, M.Maire
 67 // 10-06-97, new data member added by V.Grichi     45 // 10-06-97, new data member added by V.Grichine (fSandiaPhotoAbsCof)
 68 // 27-06-97, new function GetElement(int), M.M     46 // 27-06-97, new function GetElement(int), M.Maire
 69 // 24-02-98, fFractionVector become fMassFract     47 // 24-02-98, fFractionVector become fMassFractionVector
 70 // 28-05-98, kState=kVacuum removed:           <<  48 // 28-05-98, kState=kVacuum removed: 
 71 //           The vacuum is an ordinary gas vit     49 //           The vacuum is an ordinary gas vith very low density, M.Maire
 72 // 12-06-98, new method AddMaterial() allowing     50 // 12-06-98, new method AddMaterial() allowing mixture of materials, M.Maire
 73 // 09-07-98, Ionisation parameters removed fro     51 // 09-07-98, Ionisation parameters removed from the class, M.Maire
 74 // 04-08-98, new method GetMaterial(materialNa     52 // 04-08-98, new method GetMaterial(materialName), M.Maire
 75 // 05-10-98, change name: NumDensity -> NbOfAt     53 // 05-10-98, change name: NumDensity -> NbOfAtomsPerVolume
 76 // 18-11-98, SandiaTable interface modified.       54 // 18-11-98, SandiaTable interface modified.
 77 // 19-07-99, new data member (chemicalFormula)     55 // 19-07-99, new data member (chemicalFormula) added by V.Ivanchenko
 78 // 12-03-01, G4bool fImplicitElement (mma)     <<  56 
 79 // 30-03-01, suppression of the warning messag <<  57 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
 80 // 17-07-01, migration to STL. M. Verderi.     << 
 81 // 14-09-01, Suppression of the data member fI << 
 82 // 31-10-01, new function SetChemicalFormula() << 
 83 // 26-02-02, fIndexInTable renewed             << 
 84 // 06-08-02, remove constructors with Chemical << 
 85 // 15-11-05, GetMaterial(materialName, G4bool  << 
 86 // 13-04-12, std::map<G4Material*,G4double> fM << 
 87 // 21-04-12, fMassOfMolecule (mma)             << 
 88                                                    58 
 89 #ifndef G4MATERIAL_HH                              59 #ifndef G4MATERIAL_HH
 90 #define G4MATERIAL_HH 1                        <<  60 #define G4MATERIAL_HH
 91                                                    61 
                                                   >>  62 #include "G4ios.hh"
                                                   >>  63 #include "g4rw/tpvector.h"
                                                   >>  64 #include "g4rw/tpordvec.h"
                                                   >>  65 #include "globals.hh"
 92 #include "G4Element.hh"                            66 #include "G4Element.hh"
 93 #include "G4ElementVector.hh"                  << 
 94 #include "G4IonisParamMat.hh"                  << 
 95 #include "G4MaterialPropertiesTable.hh"            67 #include "G4MaterialPropertiesTable.hh"
 96 #include "G4MaterialTable.hh"                  <<  68 #include "G4IonisParamMat.hh"
 97 #include "G4SandiaTable.hh"                        69 #include "G4SandiaTable.hh"
 98 #include "G4ios.hh"                            << 
 99 #include "globals.hh"                          << 
100                                                    70 
101 #include <CLHEP/Units/PhysicalConstants.h>     <<  71 typedef G4RWTPtrVector<G4Element> G4ElementVector;
102                                                    72 
103 #include <map>                                 <<  73 class G4Material;              //forward declaration
104 #include <vector>                              <<  74 typedef G4RWTPtrOrderedVector<G4Material> G4MaterialTable;
105                                                    75 
106 enum G4State                                   <<  76 enum G4State { kStateUndefined, kStateSolid, kStateLiquid, kStateGas };
107 {                                              << 
108   kStateUndefined = 0,                         << 
109   kStateSolid,                                 << 
110   kStateLiquid,                                << 
111   kStateGas                                    << 
112 };                                             << 
113                                                    77 
114 static const G4double NTP_Temperature = 293.15 <<  78 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
115                                                    79 
116 class G4Material                                   80 class G4Material
117 {                                                  81 {
118  public:  // with description                  <<  82 public:  // with description
119   // Constructor to create a material from sin << 
120   G4Material(const G4String& name,  // its nam << 
121     G4double z,  // atomic number              << 
122     G4double a,  // mass of mole               << 
123     G4double density,  // density              << 
124     G4State state = kStateUndefined,  // solid << 
125     G4double temp = NTP_Temperature,  // tempe << 
126     G4double pressure = CLHEP::STP_Pressure);  << 
127                                                << 
128   // Constructor to create a material from a c << 
129   // and/or materials subsequently added via A << 
130   G4Material(const G4String& name,  // its nam << 
131     G4double density,  // density              << 
132     G4int nComponents,  // nbOfComponents      << 
133     G4State state = kStateUndefined,  // solid << 
134     G4double temp = NTP_Temperature,  // tempe << 
135     G4double pressure = CLHEP::STP_Pressure);  << 
136                                                << 
137   // Constructor to create a material from the << 
138   G4Material(const G4String& name,  // its nam << 
139     G4double density,  // density              << 
140     const G4Material* baseMaterial,  // base m << 
141     G4State state = kStateUndefined,  // solid << 
142     G4double temp = NTP_Temperature,  // tempe << 
143     G4double pressure = CLHEP::STP_Pressure);  << 
144                                                << 
145   virtual ~G4Material();                       << 
146                                                << 
147   // These methods allow customisation of corr << 
148   // computations. Free electron density above << 
149   // is a conductor. Computation of density ef << 
150   // may be more accurate but require extra co << 
151   void SetChemicalFormula(const G4String& chF) << 
152   void SetFreeElectronDensity(G4double val);   << 
153   void ComputeDensityEffectOnFly(G4bool val);  << 
154                                                << 
155   G4Material(const G4Material&) = delete;      << 
156   const G4Material& operator=(const G4Material << 
157                                                << 
158   // Add an element, giving number of atoms    << 
159   void AddElementByNumberOfAtoms(const G4Eleme << 
160   inline void AddElement(G4Element* elm, G4int << 
161                                                << 
162   // Add an element or material, giving fracti << 
163   void AddElementByMassFraction(const G4Elemen << 
164   inline void AddElement(G4Element* elm, G4dou << 
165                                                << 
166   void AddMaterial(G4Material* material, G4dou << 
167                                                << 
168   //                                           << 
169   // retrieval methods                         << 
170   //                                           << 
171   inline const G4String& GetName() const { ret << 
172   inline const G4String& GetChemicalFormula()  << 
173   inline G4double GetFreeElectronDensity() con << 
174   inline G4double GetDensity() const { return  << 
175   inline G4State GetState() const { return fSt << 
176   inline G4double GetTemperature() const { ret << 
177   inline G4double GetPressure() const { return << 
178                                                << 
179   // number of elements constituing this mater << 
180   inline std::size_t GetNumberOfElements() con << 
181                                                << 
182   // vector of pointers to elements constituin << 
183   inline const G4ElementVector* GetElementVect << 
184                                                << 
185   // vector of fractional mass of each element << 
186   inline const G4double* GetFractionVector() c << 
187                                                << 
188   // vector of atom count of each element:     << 
189   inline const G4int* GetAtomsVector() const { << 
190                                                << 
191   // return a pointer to an element, given its << 
192   inline const G4Element* GetElement(G4int iel << 
193                                                << 
194   // vector of nb of atoms per volume of each  << 
195   inline const G4double* GetVecNbOfAtomsPerVol << 
196   // total number of atoms per volume:         << 
197   inline G4double GetTotNbOfAtomsPerVolume() c << 
198   // total number of electrons per volume:     << 
199   inline G4double GetTotNbOfElectPerVolume() c << 
200                                                << 
201   // obsolete names (5-10-98) see the 2 functi << 
202   inline const G4double* GetAtomicNumDensityVe << 
203   inline G4double GetElectronDensity() const { << 
204                                                << 
205   // Radiation length:                         << 
206   inline G4double GetRadlen() const { return f << 
207                                                << 
208   // Nuclear interaction length                << 
209   inline G4double GetNuclearInterLength() cons << 
210                                                    83 
211   // ionisation parameters:                    <<  84     //
212   inline G4IonisParamMat* GetIonisation() cons <<  85     // Constructor to create a material from scratch.
213                                                <<  86     //
214   // Sandia table:                             <<  87     G4Material(const G4String& name,        //its name
215   inline G4SandiaTable* GetSandiaTable() const <<  88                      G4double  z,         //atomic number
216                                                <<  89                      G4double  a,       //mass of mole
217   // Base material:                            <<  90                      G4double  density,       //density
218   inline const G4Material* GetBaseMaterial() c <<  91                      G4State   state    = kStateUndefined,  //solid,liqid,gas
219                                                <<  92                      G4double  temp     = STP_Temperature,  //temperature
220   // material components:                      <<  93                      G4double  pressure = STP_Pressure);  //pressure
221   inline const std::map<G4Material*, G4double> <<  94 
222                                                <<  95     //
223   // for chemical compound                     <<  96     // Constructor to create a material from a combination of elements
224   inline G4double GetMassOfMolecule() const {  <<  97     // and/or materials subsequently added via AddElement and/or AddMaterial
225                                                <<  98     //
226   // meaningful only for single material:      <<  99     G4Material(const G4String& name,        //its name
227   G4double GetZ() const;                       << 100                      G4double  density,       //density
228   G4double GetA() const;                       << 101                      G4int     nComponents,     //nb of components 
229                                                << 102                      G4State   state    = kStateUndefined,  //solid,liquid,gas
230   // the MaterialPropertiesTable (if any) atta << 103                      G4double  temp     = STP_Temperature,  //temperature
231   void SetMaterialPropertiesTable(G4MaterialPr << 104                      G4double  pressure = STP_Pressure);  //pressure
232                                                << 105 
233   inline G4MaterialPropertiesTable* GetMateria << 106     //
234   {                                            << 107     // Constructor to create a material with chemical formula from scratch.
235     return fMaterialPropertiesTable;           << 108     //
236   }                                            << 109     G4Material(const G4String& name,        //its name
237                                                << 110          const G4String& chFormula,                       //chemical formula
238   // the index of this material in the Table:  << 111                      G4double  z,         //atomic number
239   inline std::size_t GetIndex() const { return << 112                      G4double  a,       //mass of mole
240                                                << 113                      G4double  density,       //density
241   // the static Table of Materials:            << 114                      G4State   state    = kStateUndefined,  //solid,liqid,gas
242   static G4MaterialTable* GetMaterialTable();  << 115                      G4double  temp     = STP_Temperature,  //temperature
243                                                << 116                      G4double  pressure = STP_Pressure);  //pressure
244   static std::size_t GetNumberOfMaterials();   << 117 
245                                                << 118     //
246   // return  pointer to a material, given its  << 119     // Constructor to create a material with chemical formula from a 
247   static G4Material* GetMaterial(const G4Strin << 120     // combination of elements and/or materials subsequently added via 
248                                                << 121     // AddElement and/or AddMaterial
249   // return  pointer to a simple material, giv << 122     //
250   static G4Material* GetMaterial(G4double z, G << 123     G4Material(const G4String& name,        //its name
251                                                << 124          const G4String& chFormula,                       //chemical formula
252   // return  pointer to a composit material, g << 125                      G4double  density,       //density
253   static G4Material* GetMaterial(std::size_t n << 126                      G4int     nComponents,     //nb of components 
254                                                << 127                      G4State   state    = kStateUndefined,  //solid,liquid,gas
255   // printing methods                          << 128                      G4double  temp     = STP_Temperature,  //temperature
256   friend std::ostream& operator<<(std::ostream << 129                      G4double  pressure = STP_Pressure);  //pressure
257   friend std::ostream& operator<<(std::ostream << 130 
258   friend std::ostream& operator<<(std::ostream << 131     //
259                                                << 132     // Add an element, giving number of atoms
260   inline void SetName(const G4String& name) {  << 133     //
261                                                << 134     void AddElement(G4Element* element,       //the element
262   virtual G4bool IsExtended() const;           << 135                     G4int      nAtoms);       //nb of atoms in a molecule
263                                                << 136 
264   // operators                                 << 137     //
265   G4bool operator==(const G4Material&) const = << 138     // Add an element or material, giving fraction of mass
266   G4bool operator!=(const G4Material&) const = << 139     //
267                                                << 140     void AddElement (G4Element* element ,     //the element
268  private:                                      << 141                      G4double   fraction);      //fraction of mass
269   void InitializePointers();                   << 142                      
270                                                << 143     void AddMaterial(G4Material* material,      //the material
271   // Header routine for all derived quantities << 144                      G4double   fraction);      //fraction of mass
272   void ComputeDerivedQuantities();             << 145                      
273                                                << 146                      
274   // Compute Radiation length                  << 147    ~G4Material();
275   void ComputeRadiationLength();               << 148                         
276                                                << 149     //
277   // Compute Nuclear interaction length        << 150     // retrieval methods
278   void ComputeNuclearInterLength();            << 151     // 
279                                                << 152     G4String GetName()            const {return fName;};
280   // Copy pointers of base material            << 153     G4String GetChemicalFormula() const {return fChemicalFormula;};
281   void CopyPointersOfBaseMaterial();           << 154     G4double GetDensity()         const {return fDensity;};
282                                                << 155 
283   void FillVectors();                          << 156     G4State  GetState()       const {return fState;};
284                                                << 157     G4double GetTemperature() const {return fTemp;};
285   G4bool IsLocked();                           << 158     G4double GetPressure()    const {return fPressure;};
286                                                << 159     
287   const G4Material* fBaseMaterial;  // Pointer << 160     //number of elements constituing this material:    
288   G4MaterialPropertiesTable* fMaterialProperti << 161     size_t GetNumberOfElements()         const {return fNumberOfElements;};
289                                                << 162     
290   //                                           << 163     //vector of pointers to elements constituing this material:          
291   // General atomic properties defined in cons << 164     const
292   // computed from the basic data members      << 165     G4ElementVector* GetElementVector()  const {return theElementVector;};
293   //                                           << 166     
294                                                << 167     //vector of fractional mass of each element:
295   G4ElementVector* theElementVector;  // vecto << 168     const  G4double* GetFractionVector() const {return fMassFractionVector;};
296   G4int* fAtomsVector;  // composition by atom << 169     
297   G4double* fMassFractionVector;  // compositi << 170     //vector of atom count of each element:
298   G4double* fVecNbOfAtomsPerVolume;  // number << 171     const  G4int*    GetAtomsVector()    const {return fAtomsVector;};
299                                                << 172 
300   G4IonisParamMat* fIonisation;  // ionisation << 173     //return a pointer to an element, given its index in the material:
301   G4SandiaTable* fSandiaTable;  // Sandia tabl << 174     const 
302                                                << 175     G4Element* GetElement(G4int iel) const {return (*theElementVector)[iel];};
303   G4double fDensity;  // Material density      << 176     
304   G4double fFreeElecDensity;  // Free electron << 177     //vector of nb of atoms per volume of each element in this material:
305   G4double fTemp;  // Temperature (defaults: S << 178     const
306   G4double fPressure;  // Pressure    (default << 179     G4double* GetVecNbOfAtomsPerVolume() const {return VecNbOfAtomsPerVolume;};
307                                                << 180     //total number of atoms per volume:
308   G4double fTotNbOfAtomsPerVolume;  // Total n << 181     G4double  GetTotNbOfAtomsPerVolume() const {return TotNbOfAtomsPerVolume;};
309   G4double fTotNbOfElectPerVolume;  // Total n << 182     //total number of electrons per volume:
310   G4double fRadlen;  // Radiation length       << 183     G4double  GetTotNbOfElectPerVolume() const {return TotNbOfElectPerVolume;};
311   G4double fNuclInterLen;  // Nuclear interact << 184 
312   G4double fMassOfMolecule;  // Correct for ma << 185     //obsolete names (5-10-98) see the 2 functions above
313                                                << 186     const
314   G4State fState;  // Material state           << 187     G4double* GetAtomicNumDensityVector() const {return VecNbOfAtomsPerVolume;};
315   std::size_t fIndexInTable;  // Index in the  << 188     G4double  GetElectronDensity()        const {return TotNbOfElectPerVolume;};
316   G4int fNumberOfElements;  // Number of G4Ele << 189     
317                                                << 190     // Radiation length:     
318   // Class members used only at initialisation << 191     G4double         GetRadlen()          const {return fRadlen;};
319   G4int fNbComponents;  // Number of component << 192     
320   G4int fIdxComponent;  // Index of a new comp << 193     // ionisation parameters:
321   G4bool fMassFraction;  // Flag of the method << 194     G4IonisParamMat* GetIonisation()      const {return fIonisation;};
                                                   >> 195     
                                                   >> 196     // Sandia table:
                                                   >> 197     G4SandiaTable*   GetSandiaTable()     const {return fSandiaTable;};
                                                   >> 198     
                                                   >> 199     //meaningful only for single material:
                                                   >> 200     G4double GetZ() const;
                                                   >> 201     G4double GetA() const;
                                                   >> 202     
                                                   >> 203     //the MaterialPropertiesTable (if any) attached to this material:
                                                   >> 204     void SetMaterialPropertiesTable(G4MaterialPropertiesTable* anMPT)
                                                   >> 205                                        {fMaterialPropertiesTable = anMPT;};
                                                   >> 206                    
                                                   >> 207     G4MaterialPropertiesTable* GetMaterialPropertiesTable() const
                                                   >> 208                                        {return fMaterialPropertiesTable;};
                                                   >> 209 
                                                   >> 210     //the (static) Table of Materials:
                                                   >> 211     static
                                                   >> 212     const G4MaterialTable* GetMaterialTable() {return &theMaterialTable;};    
                                                   >> 213     static
                                                   >> 214     size_t GetNumberOfMaterials()   {return theMaterialTable.length();};
                                                   >> 215     //the index of this material in the Table:    
                                                   >> 216     size_t GetIndex() const         {return fIndexInTable;};
                                                   >> 217     
                                                   >> 218     //return  pointer to a material, given its name:    
                                                   >> 219     static  G4Material* GetMaterial(G4String name);
                                                   >> 220     
                                                   >> 221     //
                                                   >> 222     //printing methods
                                                   >> 223     //
                                                   >> 224     friend G4std::ostream& operator<<(G4std::ostream&, G4Material*);    
                                                   >> 225     friend G4std::ostream& operator<<(G4std::ostream&, G4Material&);    
                                                   >> 226     friend G4std::ostream& operator<<(G4std::ostream&, G4MaterialTable);
                                                   >> 227     
                                                   >> 228 public:  // without description 
                                                   >> 229        
                                                   >> 230     G4int operator==(const G4Material&) const;
                                                   >> 231     G4int operator!=(const G4Material&) const;
                                                   >> 232 
                                                   >> 233 private:
                                                   >> 234 
                                                   >> 235     G4Material(const G4Material&);
                                                   >> 236     const G4Material& operator=(const G4Material&);
                                                   >> 237 
                                                   >> 238     void InitializePointers();
                                                   >> 239      
                                                   >> 240     // Header routine for all derived quantities
                                                   >> 241     void ComputeDerivedQuantities();
                                                   >> 242 
                                                   >> 243     // Compute Radiation length
                                                   >> 244     void ComputeRadiationLength();
                                                   >> 245 
                                                   >> 246 private:
                                                   >> 247 
                                                   >> 248 //
                                                   >> 249 // Basic data members ( To define a material)
                                                   >> 250 //
                                                   >> 251 
                                                   >> 252     G4String         fName;                 // Material name
                                                   >> 253     G4String         fChemicalFormula;      // Material chemical formula
                                                   >> 254     G4double         fDensity;              // Material density
                                                   >> 255    
                                                   >> 256     G4State          fState;                // Material state (defaults to undefined,  
                                                   >> 257                                             //   determined internally based on density)
                                                   >> 258     G4double         fTemp;                 // Temperature (defaults to STP)
                                                   >> 259     G4double         fPressure;             // Pressure    (defaults to STP)
                                                   >> 260 
                                                   >> 261     G4int            maxNbComponents;       // total number of components in the material 
                                                   >> 262     size_t           fNumberOfComponents;   // Number of components declared so far
                                                   >> 263 
                                                   >> 264     size_t           fNumberOfElements;     // Number of Elements in the material
                                                   >> 265     G4ElementVector* theElementVector;      // vector of constituent Elements
                                                   >> 266     G4double*        fMassFractionVector;   // composition by fractional mass
                                                   >> 267     G4int*           fAtomsVector;          // composition by atom count
                                                   >> 268 
                                                   >> 269     G4MaterialPropertiesTable* fMaterialPropertiesTable;
                                                   >> 270 
                                                   >> 271     static
                                                   >> 272     G4MaterialTable theMaterialTable;       // the material table
                                                   >> 273     size_t          fIndexInTable;          // Index of material in the material table
                                                   >> 274 
                                                   >> 275 //
                                                   >> 276 // Derived data members (computed from the basic data members)
                                                   >> 277 //
                                                   >> 278     // some general atomic properties
                                                   >> 279     
                                                   >> 280     G4double* VecNbOfAtomsPerVolume;      // vector of nb of atoms per volume
                                                   >> 281     G4double  TotNbOfAtomsPerVolume;      // total nb of atoms per volume 
                                                   >> 282     G4double  TotNbOfElectPerVolume;      // total nb of electrons per volume 
                                                   >> 283     G4double  fRadlen;                    // Radiation length  
                                                   >> 284     
                                                   >> 285     G4IonisParamMat* fIonisation;          // ionisation parameters
                                                   >> 286     G4SandiaTable*   fSandiaTable;         // Sandia table         
                                                   >> 287 };
322                                                   288 
323   // For composites built                      << 289 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
324   std::vector<G4int>* fAtoms = nullptr;        << 
325   std::vector<G4double>* fElmFrac = nullptr;   << 
326   std::vector<const G4Element*>* fElm = nullpt << 
327                                                   290 
328   // For composites built via AddMaterial()    << 291 inline
329   std::map<G4Material*, G4double> fMatComponen << 292 G4Material* G4Material::GetMaterial(G4String materialName)
                                                   >> 293 {  
                                                   >> 294   // search the material by its name 
                                                   >> 295   for (G4int J=0 ; J<theMaterialTable.length() ; J++)
                                                   >> 296    {
                                                   >> 297     if(theMaterialTable[J]->GetName() == materialName)
                                                   >> 298       return theMaterialTable[J];
                                                   >> 299    }
                                                   >> 300    
                                                   >> 301   G4cerr << "  Warning from GetMaterial(name). The material: " << materialName
                                                   >> 302          << "  does not exist in the MaterialTable.  Return NULL pointer \n";
                                                   >> 303   return NULL;          
                                                   >> 304 }
                                                   >> 305 
                                                   >> 306 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
                                                   >> 307 
                                                   >> 308 inline
                                                   >> 309 G4double G4Material::GetZ() const
                                                   >> 310 { 
                                                   >> 311   if (fNumberOfElements > 1) {
                                                   >> 312      G4cerr << "WARNING in GetZ. The material: " << fName << " is a mixture." << G4endl;
                                                   >> 313      G4Exception ( " the Atomic number is not well defined." );
                                                   >> 314   } 
                                                   >> 315   return (*theElementVector)(0)->GetZ();      
                                                   >> 316 }
                                                   >> 317 
                                                   >> 318 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
                                                   >> 319 
                                                   >> 320 
                                                   >> 321 inline
                                                   >> 322 G4double G4Material::GetA() const
                                                   >> 323 { 
                                                   >> 324   if (fNumberOfElements > 1) { 
                                                   >> 325      G4cerr << "WARNING in GetA. The material: " << fName << " is a mixture." << G4endl;
                                                   >> 326      G4Exception ( " the Atomic mass is not well defined." );
                                                   >> 327   } 
                                                   >> 328   return  (*theElementVector)(0)->GetA();      
                                                   >> 329 }
330                                                   330 
331   G4String fName;  // Material name            << 331 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
332   G4String fChemicalFormula;  // Material chem << 
333 };                                             << 
334                                                   332 
335 #endif                                            333 #endif
336                                                   334