G4MaterialPropertiesTable Class Reference

#include <G4MaterialPropertiesTable.hh>


Public Member Functions

 G4MaterialPropertiesTable ()
 ~G4MaterialPropertiesTable ()
void AddConstProperty (const char *key, G4double PropertyValue)
G4MaterialPropertyVectorAddProperty (const char *key, G4double *PhotonEnergies, G4double *PropertyValues, G4int NumEntries)
void AddProperty (const char *key, G4MaterialPropertyVector *opv)
void RemoveConstProperty (const char *key)
void RemoveProperty (const char *key)
G4double GetConstProperty (const char *key)
G4bool ConstPropertyExists (const char *key)
G4MaterialPropertyVectorGetProperty (const char *key)
void AddEntry (const char *key, G4double aPhotonEnergy, G4double aPropertyValue)
void DumpTable ()
const std::map< G4String,
G4MaterialPropertyVector *,
std::less< G4String > > * 
GetPropertiesMap () const
const std::map< G4String,
G4double, std::less< G4String > > * 
GetPropertiesCMap () const


Detailed Description

Definition at line 70 of file G4MaterialPropertiesTable.hh.


Constructor & Destructor Documentation

G4MaterialPropertiesTable::G4MaterialPropertiesTable (  ) 

Definition at line 57 of file G4MaterialPropertiesTable.cc.

00058 {
00059 }

G4MaterialPropertiesTable::~G4MaterialPropertiesTable (  ) 

Definition at line 65 of file G4MaterialPropertiesTable.cc.

00066 {
00067   MPTiterator i;
00068   for (i = MPT.begin(); i != MPT.end(); ++i)
00069   {
00070     delete (*i).second;
00071   }
00072   MPT.clear();
00073   MPTC.clear();
00074 }


Member Function Documentation

void G4MaterialPropertiesTable::AddConstProperty ( const char *  key,
G4double  PropertyValue 
) [inline]

Definition at line 43 of file G4MaterialPropertiesTable.icc.

Referenced by G4GDMLReadMaterials::PropertyRead().

00045 {
00046   // Provides a way of adding a constant property to the Material Properties
00047   // Table given a key
00048 
00049   MPTC [G4String(key)] = PropertyValue;
00050 }

void G4MaterialPropertiesTable::AddEntry ( const char *  key,
G4double  aPhotonEnergy,
G4double  aPropertyValue 
) [inline]

Definition at line 128 of file G4MaterialPropertiesTable.icc.

References FatalException, G4Exception(), and G4PhysicsOrderedFreeVector::InsertValues().

00131 {
00132   // Allows to add an entry pair directly to the Material Property Vector
00133   // given a key
00134 
00135   G4MaterialPropertyVector *targetVector=MPT [G4String(key)];
00136   if (targetVector != 0)
00137   {
00138     targetVector->InsertValues(aPhotonEnergy, aPropertyValue);
00139   }
00140   else
00141   {
00142     G4Exception("G4MaterialPropertiesTable::AddEntry()", "mat203",
00143                 FatalException, "Material Property Vector not found.");
00144   }
00145 }

void G4MaterialPropertiesTable::AddProperty ( const char *  key,
G4MaterialPropertyVector opv 
) [inline]

Definition at line 71 of file G4MaterialPropertiesTable.icc.

00072 {
00073   //  Provides a way of adding a property to the Material Properties
00074   //  Table given an G4MaterialPropertyVector Reference and a key
00075 
00076   MPT [G4String(key)] = mpv;
00077 } 

G4MaterialPropertyVector * G4MaterialPropertiesTable::AddProperty ( const char *  key,
G4double PhotonEnergies,
G4double PropertyValues,
G4int  NumEntries 
) [inline]

Definition at line 53 of file G4MaterialPropertiesTable.icc.

Referenced by G4GDMLReadMaterials::PropertyRead().

00058 {
00059   // Provides a way of adding a property to the Material Properties
00060   // Table given a pair of numbers and a key
00061 
00062   G4MaterialPropertyVector *mpv = new G4MaterialPropertyVector(PhotonEnergies, 
00063                                                    PropertyValues, NumEntries);
00064   MPT [G4String(key)] = mpv;
00065 
00066   return mpv;
00067 }

G4bool G4MaterialPropertiesTable::ConstPropertyExists ( const char *  key  )  [inline]

Definition at line 105 of file G4MaterialPropertiesTable.icc.

Referenced by G4OpWLS::PostStepDoIt().

00106 {
00107   // Returns true if a const property 'key' exists
00108 
00109   MPTCiterator j;
00110   j = MPTC.find(G4String(key));
00111   if ( j != MPTC.end() ) return true;
00112   return false;
00113 }

void G4MaterialPropertiesTable::DumpTable (  ) 

Definition at line 80 of file G4MaterialPropertiesTable.cc.

References G4cout, G4endl, G4Exception(), and JustWarning.

00081 {
00082   MPTiterator i;
00083   for (i = MPT.begin(); i != MPT.end(); ++i)
00084   {
00085     G4cout << (*i).first << G4endl;
00086     if ( (*i).second != 0 )
00087     {
00088       (*i).second->DumpValues();
00089     }
00090     else
00091     {
00092       G4Exception("G4MaterialPropertiesTable::DumpTable()", "mat204",
00093                   JustWarning, "NULL Material Property Vector Pointer.");
00094     }
00095   }
00096   MPTCiterator j;
00097   for (j = MPTC.begin(); j != MPTC.end(); ++j)
00098   {
00099     G4cout << j->first << G4endl;
00100     if ( j->second != 0 )
00101     {
00102       G4cout << j->second << G4endl;
00103     }
00104     else
00105     {
00106       G4Exception("G4MaterialPropertiesTable::DumpTable()", "mat202",
00107                   JustWarning, "No Material Constant Property.");
00108     }
00109   }
00110 }

G4double G4MaterialPropertiesTable::GetConstProperty ( const char *  key  )  [inline]

Definition at line 92 of file G4MaterialPropertiesTable.icc.

References FatalException, and G4Exception().

Referenced by G4OpMieHG::PostStepDoIt().

00093 {
00094   // Returns the constant material property corresponding to a key
00095 
00096   MPTCiterator j;
00097   j = MPTC.find(G4String(key));
00098   if ( j != MPTC.end() ) return j->second;
00099   G4Exception("G4MaterialPropertiesTable::GetConstProperty()","mat202",
00100               FatalException, "Constant Material Property not found.");
00101   return 0.;
00102 }

const std::map< G4String, G4double, std::less<G4String> >* G4MaterialPropertiesTable::GetPropertiesCMap (  )  const [inline]

Definition at line 120 of file G4MaterialPropertiesTable.hh.

Referenced by G4GDMLWriteMaterials::PropertyWrite().

00120 { return &MPTC; }

const std::map< G4String, G4MaterialPropertyVector*, std::less<G4String> >* G4MaterialPropertiesTable::GetPropertiesMap (  )  const [inline]

Definition at line 118 of file G4MaterialPropertiesTable.hh.

Referenced by G4GDMLWriteMaterials::PropertyWrite().

00118 { return &MPT; }

G4MaterialPropertyVector * G4MaterialPropertiesTable::GetProperty ( const char *  key  )  [inline]

Definition at line 116 of file G4MaterialPropertiesTable.icc.

Referenced by G4Scintillation::BuildThePhysicsTable(), G4Track::CalculateVelocityForOpticalPhoton(), G4OpRayleigh::GetMeanFreePath(), G4OpMieHG::GetMeanFreePath(), G4Scintillation::PostStepDoIt(), G4OpWLS::PostStepDoIt(), G4OpBoundaryProcess::PostStepDoIt(), G4Cerenkov::PostStepDoIt(), and G4Cerenkov::PostStepGetPhysicalInteractionLength().

00117 {
00118   // Returns a Material Property Vector corresponding to a key
00119 
00120   MPTiterator i;
00121   i = MPT.find(G4String(key));
00122   if ( i != MPT.end() ) return i->second;
00123   if (G4String(key) == "GROUPVEL") return SetGROUPVEL();
00124   return NULL;
00125 }

void G4MaterialPropertiesTable::RemoveConstProperty ( const char *  key  )  [inline]

Definition at line 80 of file G4MaterialPropertiesTable.icc.

00081 {
00082   MPTC.erase(G4String(key));
00083 }

void G4MaterialPropertiesTable::RemoveProperty ( const char *  key  )  [inline]

Definition at line 86 of file G4MaterialPropertiesTable.icc.

00087 {
00088   MPT.erase(G4String(key));
00089 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:52:28 2013 for Geant4 by  doxygen 1.4.7