G4tgrMaterialMixture Class Reference

#include <G4tgrMaterialMixture.hh>

Inheritance diagram for G4tgrMaterialMixture:

G4tgrMaterial

Public Member Functions

 G4tgrMaterialMixture (const G4String &matType, const std::vector< G4String > &wl)
G4double GetA () const
G4double GetZ () const
const G4StringGetComponent (G4int i) const
G4double GetFraction (G4int i)
G4tgrMaterialMixture operator= (const G4tgrMaterialMixture &)
 G4tgrMaterialMixture ()
 ~G4tgrMaterialMixture ()

Protected Member Functions

void TransformToFractionsByWeight ()

Protected Attributes

std::vector< G4StringtheComponents
std::vector< G4doubletheFractions

Friends

std::ostream & operator<< (std::ostream &, const G4tgrMaterialMixture &)

Detailed Description

Definition at line 50 of file G4tgrMaterialMixture.hh.


Constructor & Destructor Documentation

G4tgrMaterialMixture::G4tgrMaterialMixture ( const G4String matType,
const std::vector< G4String > &  wl 
)

Definition at line 55 of file G4tgrMaterialMixture.cc.

References G4tgrUtils::CheckWLsize(), G4cout, G4endl, G4tgrUtils::GetDouble(), G4tgrUtils::GetInt(), G4tgrUtils::GetString(), G4tgrMessenger::GetVerboseLevel(), theComponents, G4tgrMaterial::theDensity, theFractions, G4tgrMaterial::theMateType, G4tgrMaterial::theName, G4tgrMaterial::theNoComponents, and WLSIZE_GE.

00057 {
00058   //---------- Check for miminum number of words read 
00059   G4tgrUtils::CheckWLsize( wl, 6, WLSIZE_GE,
00060                            "G4tgrMaterialMixture::G4tgrMaterialMixture" );
00061 
00062   theMateType = matType;
00063   
00064   //---------- Fill private data 
00065   theName = G4tgrUtils::GetString( wl[1] );
00066   theDensity = std::fabs(G4tgrUtils::GetDouble( wl[2], g/cm3 ) );
00067   theNoComponents = G4tgrUtils::GetInt( wl[3] );
00068 
00069   G4tgrUtils::CheckWLsize( wl, 4+theNoComponents*2, WLSIZE_GE,
00070                            "G4tgrMaterialMixture::G4tgrMaterialMixture" );
00071   for(G4int ii=0; ii<theNoComponents; ii++)
00072   {
00073 #ifdef G4VERBOSE
00074     if( G4tgrMessenger::GetVerboseLevel() >= 3 )
00075     {
00076          G4cout << " G4tgrMaterialMixture::G4tgrMaterialMixture() -"
00077                 << " adding component: " << wl[ii*2+4] << " Fraction= "
00078                 << G4tgrUtils::GetDouble(wl[ii*2+1+4]) << G4endl;
00079     }
00080 #endif
00081     theComponents.push_back(  G4tgrUtils::GetString( wl[ii*2+4] ) );
00082     theFractions.push_back( G4tgrUtils::GetDouble(wl[ii*2+1+4]) );
00083   }
00084 
00085 #ifdef G4VERBOSE
00086   if( G4tgrMessenger::GetVerboseLevel() >= 1 )
00087   {
00088      G4cout << " Created " << *this << G4endl;
00089   }
00090 #endif
00091 }

G4tgrMaterialMixture::G4tgrMaterialMixture (  ) 

Definition at line 43 of file G4tgrMaterialMixture.cc.

00044 {
00045 }

G4tgrMaterialMixture::~G4tgrMaterialMixture (  ) 

Definition at line 49 of file G4tgrMaterialMixture.cc.

00050 {
00051 }


Member Function Documentation

G4double G4tgrMaterialMixture::GetA (  )  const [inline, virtual]

Implements G4tgrMaterial.

Definition at line 62 of file G4tgrMaterialMixture.hh.

00062 { return 0.; }

const G4String& G4tgrMaterialMixture::GetComponent ( G4int  i  )  const [inline, virtual]

Implements G4tgrMaterial.

Definition at line 64 of file G4tgrMaterialMixture.hh.

References theComponents.

00064 { return theComponents[i]; } 

G4double G4tgrMaterialMixture::GetFraction ( G4int  i  )  [inline, virtual]

Implements G4tgrMaterial.

Definition at line 65 of file G4tgrMaterialMixture.hh.

References theFractions.

00065 { return theFractions[i]; } 

G4double G4tgrMaterialMixture::GetZ (  )  const [inline, virtual]

Implements G4tgrMaterial.

Definition at line 63 of file G4tgrMaterialMixture.hh.

00063 { return 0.; }

G4tgrMaterialMixture G4tgrMaterialMixture::operator= ( const G4tgrMaterialMixture  ) 

void G4tgrMaterialMixture::TransformToFractionsByWeight (  )  [inline, protected]

Definition at line 76 of file G4tgrMaterialMixture.hh.

00076 {};


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const G4tgrMaterialMixture mate 
) [friend]

Definition at line 95 of file G4tgrMaterialMixture.cc.

00096 {
00097   os << "G4tgrMaterialMixture=: " << mate.theName << G4endl
00098      << "density= " << mate.theDensity/g*cm3
00099      << " g/cm3. Number of Components: " << mate.theNoComponents << G4endl;
00100   for (G4int ii=0; ii<mate.theNoComponents; ii++)
00101   {
00102     os << '\t' << mate.theComponents[ii]
00103        << '\t' << mate.theFractions[ii] << G4endl;
00104   }
00105   return os;
00106 }


Field Documentation

std::vector<G4String> G4tgrMaterialMixture::theComponents [protected]

Definition at line 76 of file G4tgrMaterialMixture.hh.

Referenced by G4tgrMaterialMixture(), GetComponent(), and operator<<().

std::vector<G4double> G4tgrMaterialMixture::theFractions [protected]

Definition at line 81 of file G4tgrMaterialMixture.hh.

Referenced by G4tgrMaterialMixture(), GetFraction(), and operator<<().


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