Geant4  10.02.p03
G4MaterialPropertiesTable Class Reference

#include <G4MaterialPropertiesTable.hh>

Inheritance diagram for G4MaterialPropertiesTable:
Collaboration diagram for G4MaterialPropertiesTable:

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
 

Private Types

typedef std::map< G4String, G4MaterialPropertyVector *, std::less< G4String > >::iterator MPTiterator
 
typedef std::map< G4String, G4double, std::less< G4String > >::iterator MPTCiterator
 

Private Member Functions

G4MaterialPropertyVectorSetGROUPVEL ()
 

Private Attributes

std::map< G4String, G4MaterialPropertyVector *, std::less< G4String > > MPT
 
std::map< G4String, G4double, std::less< G4String > > MPTC
 

Detailed Description

Definition at line 70 of file G4MaterialPropertiesTable.hh.

Member Typedef Documentation

◆ MPTCiterator

typedef std::map< G4String, G4double, std::less<G4String> >::iterator G4MaterialPropertiesTable::MPTCiterator
private

Definition at line 135 of file G4MaterialPropertiesTable.hh.

◆ MPTiterator

typedef std::map< G4String, G4MaterialPropertyVector*, std::less<G4String> >::iterator G4MaterialPropertiesTable::MPTiterator
private

Definition at line 131 of file G4MaterialPropertiesTable.hh.

Constructor & Destructor Documentation

◆ G4MaterialPropertiesTable()

G4MaterialPropertiesTable::G4MaterialPropertiesTable ( )

Definition at line 57 of file G4MaterialPropertiesTable.cc.

58 {
59 }

◆ ~G4MaterialPropertiesTable()

G4MaterialPropertiesTable::~G4MaterialPropertiesTable ( )

Definition at line 65 of file G4MaterialPropertiesTable.cc.

66 {
67  MPTiterator i;
68  for (i = MPT.begin(); i != MPT.end(); ++i)
69  {
70  delete (*i).second;
71  }
72  MPT.clear();
73  MPTC.clear();
74 }
std::map< G4String, G4MaterialPropertyVector *, std::less< G4String > >::iterator MPTiterator
std::map< G4String, G4double, std::less< G4String > > MPTC
std::map< G4String, G4MaterialPropertyVector *, std::less< G4String > > MPT

Member Function Documentation

◆ AddConstProperty()

void G4MaterialPropertiesTable::AddConstProperty ( const char *  key,
G4double  PropertyValue 
)
inline
Here is the caller graph for this function:

◆ AddEntry()

void G4MaterialPropertiesTable::AddEntry ( const char *  key,
G4double  aPhotonEnergy,
G4double  aPropertyValue 
)
inline
Here is the caller graph for this function:

◆ AddProperty() [1/2]

G4MaterialPropertyVector* G4MaterialPropertiesTable::AddProperty ( const char *  key,
G4double PhotonEnergies,
G4double PropertyValues,
G4int  NumEntries 
)
inline
Here is the caller graph for this function:

◆ AddProperty() [2/2]

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

◆ ConstPropertyExists()

G4bool G4MaterialPropertiesTable::ConstPropertyExists ( const char *  key)
inline
Here is the caller graph for this function:

◆ DumpTable()

void G4MaterialPropertiesTable::DumpTable ( )

Definition at line 80 of file G4MaterialPropertiesTable.cc.

81 {
82  MPTiterator i;
83  for (i = MPT.begin(); i != MPT.end(); ++i)
84  {
85  G4cout << (*i).first << G4endl;
86  if ( (*i).second != 0 )
87  {
88  (*i).second->DumpValues();
89  }
90  else
91  {
92  G4Exception("G4MaterialPropertiesTable::DumpTable()", "mat204",
93  JustWarning, "NULL Material Property Vector Pointer.");
94  }
95  }
96  MPTCiterator j;
97  for (j = MPTC.begin(); j != MPTC.end(); ++j)
98  {
99  G4cout << j->first << G4endl;
100  if ( j->second != 0 )
101  {
102  G4cout << j->second << G4endl;
103  }
104  else
105  {
106  G4Exception("G4MaterialPropertiesTable::DumpTable()", "mat202",
107  JustWarning, "No Material Constant Property.");
108  }
109  }
110 }
std::map< G4String, G4double, std::less< G4String > >::iterator MPTCiterator
G4GLOB_DLL std::ostream G4cout
std::map< G4String, G4MaterialPropertyVector *, std::less< G4String > >::iterator MPTiterator
std::map< G4String, G4double, std::less< G4String > > MPTC
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61
std::map< G4String, G4MaterialPropertyVector *, std::less< G4String > > MPT
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetConstProperty()

G4double G4MaterialPropertiesTable::GetConstProperty ( const char *  key)
inline
Here is the caller graph for this function:

◆ GetPropertiesCMap()

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

Definition at line 120 of file G4MaterialPropertiesTable.hh.

120 { return &MPTC; }
std::map< G4String, G4double, std::less< G4String > > MPTC
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPropertiesMap()

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

Definition at line 118 of file G4MaterialPropertiesTable.hh.

118 { return &MPT; }
std::map< G4String, G4MaterialPropertyVector *, std::less< G4String > > MPT
Here is the caller graph for this function:

◆ GetProperty()

G4MaterialPropertyVector* G4MaterialPropertiesTable::GetProperty ( const char *  key)
inline
Here is the caller graph for this function:

◆ RemoveConstProperty()

void G4MaterialPropertiesTable::RemoveConstProperty ( const char *  key)
inline
Here is the caller graph for this function:

◆ RemoveProperty()

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

◆ SetGROUPVEL()

G4MaterialPropertyVector * G4MaterialPropertiesTable::SetGROUPVEL ( )
private

Definition at line 119 of file G4MaterialPropertiesTable.cc.

120 {
121 #ifdef G4MULTITHREADED
122  G4AutoLock mptm(&materialPropertyTableMutex);
123 #endif
124 
125  // check if "GROUPVEL" already exists
126  MPTiterator itr;
127  itr = MPT.find("GROUPVEL");
128  if(itr != MPT.end()) return itr->second;
129 
130  // fetch RINDEX data, give up if unavailable
131  //
132  G4MaterialPropertyVector *rindex = this->GetProperty("RINDEX");
133  if (rindex==0) { return 0; }
134 
135  // RINDEX exists but has no entries, give up
136  //
137  if ( rindex->GetVectorLength() == 0 ) { return 0; }
138 
139  // add GROUPVEL vector
140  //
142 
143  // fill GROUPVEL vector using RINDEX values
144  // rindex built-in "iterator" was advanced to first entry above
145  //
146  G4double E0 = rindex->Energy(0);
147  G4double n0 = (*rindex)[0];
148 
149  if (E0 <= 0.)
150  {
151  G4Exception("G4MaterialPropertiesTable::SetGROUPVEL()", "mat205",
152  FatalException, "Optical Photon Energy <= 0");
153  }
154 
155  if ( rindex->GetVectorLength() >= 2 )
156  {
157  // good, we have at least two entries in RINDEX
158  // get next energy/value pair
159 
160  G4double E1 = rindex->Energy(1);
161  G4double n1 = (*rindex)[1];
162 
163  if (E1 <= 0.)
164  {
165  G4Exception("G4MaterialPropertiesTable::SetGROUPVEL()", "mat205",
166  FatalException, "Optical Photon Energy <= 0");
167  }
168 
169  G4double vg;
170 
171  // add entry at first photon energy
172  //
173  vg = c_light/(n0+(n1-n0)/std::log(E1/E0));
174 
175  // allow only for 'normal dispersion' -> dn/d(logE) > 0
176  //
177  if((vg<0) || (vg>c_light/n0)) { vg = c_light/n0; }
178 
179  groupvel->InsertValues( E0, vg );
180 
181  // add entries at midpoints between remaining photon energies
182  //
183 
184  for (size_t i = 2; i < rindex->GetVectorLength(); i++)
185  {
186  vg = c_light/( 0.5*(n0+n1)+(n1-n0)/std::log(E1/E0));
187 
188  // allow only for 'normal dispersion' -> dn/d(logE) > 0
189  //
190  if((vg<0) || (vg>c_light/(0.5*(n0+n1)))) { vg = c_light/(0.5*(n0+n1)); }
191  groupvel->InsertValues( 0.5*(E0+E1), vg );
192 
193  // get next energy/value pair, or exit loop
194  //
195  E0 = E1;
196  n0 = n1;
197  E1 = rindex->Energy(i);
198  n1 = (*rindex)[i];
199 
200  if (E1 <= 0.)
201  {
202  G4Exception("G4MaterialPropertiesTable::SetGROUPVEL()", "mat205",
203  FatalException, "Optical Photon Energy <= 0");
204  }
205  }
206 
207  // add entry at last photon energy
208  //
209  vg = c_light/(n1+(n1-n0)/std::log(E1/E0));
210 
211  // allow only for 'normal dispersion' -> dn/d(logE) > 0
212  //
213  if((vg<0) || (vg>c_light/n1)) { vg = c_light/n1; }
214  groupvel->InsertValues( E1, vg );
215  }
216  else // only one entry in RINDEX -- weird!
217  {
218  groupvel->InsertValues( E0, c_light/n0 );
219  }
220 
221  this->AddProperty( "GROUPVEL", groupvel );
222 
223  return groupvel;
224 }
void InsertValues(G4double energy, G4double value)
G4MaterialPropertyVector * AddProperty(const char *key, G4double *PhotonEnergies, G4double *PropertyValues, G4int NumEntries)
G4PhysicsOrderedFreeVector G4MaterialPropertyVector
std::map< G4String, G4MaterialPropertyVector *, std::less< G4String > >::iterator MPTiterator
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
std::map< G4String, G4MaterialPropertyVector *, std::less< G4String > > MPT
double G4double
Definition: G4Types.hh:76
float c_light
Definition: hepunit.py:257
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ MPT

std::map<G4String, G4MaterialPropertyVector*, std::less<G4String> > G4MaterialPropertiesTable::MPT
private

Definition at line 129 of file G4MaterialPropertiesTable.hh.

◆ MPTC

std::map< G4String, G4double, std::less<G4String> > G4MaterialPropertiesTable::MPTC
private

Definition at line 133 of file G4MaterialPropertiesTable.hh.


The documentation for this class was generated from the following files: