Geant4-11
Public Member Functions | Protected Member Functions | Protected Attributes | Friends
G4tgrMaterialMixture Class Reference

#include <G4tgrMaterialMixture.hh>

Inheritance diagram for G4tgrMaterialMixture:
G4tgrMaterial

Public Member Functions

 G4tgrMaterialMixture ()
 
 G4tgrMaterialMixture (const G4String &matType, const std::vector< G4String > &wl)
 
G4double GetA () const
 
const G4String & GetComponent (G4int i) const
 
G4double GetDensity () const
 
G4double GetFraction (G4int i)
 
G4double GetIonisationMeanExcitationEnergy () const
 
const G4String & GetName () const
 
G4int GetNumberOfComponents () const
 
G4double GetPressure () const
 
const G4State & GetState () const
 
G4double GetTemperature () const
 
const G4String & GetType () const
 
G4double GetZ () const
 
void SetIonisationMeanExcitationEnergy (G4double mee)
 
void SetPressure (G4double val)
 
void SetState (const G4String &val)
 
void SetTemperature (G4double val)
 
 ~G4tgrMaterialMixture ()
 

Protected Member Functions

void TransformToFractionsByWeight ()
 

Protected Attributes

std::vector< G4String > theComponents
 
G4double theDensity = 0.0
 
std::vector< G4double > theFractions
 
G4double theIonisationMeanExcitationEnergy = -1.0
 
G4String theMateType = "Material"
 
G4String theName = "Material"
 
G4int theNoComponents = 0
 
G4double thePressure = 0.0
 
G4State theState = kStateUndefined
 
G4double theTemperature = 0.0
 

Friends

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

Detailed Description

Definition at line 43 of file G4tgrMaterialMixture.hh.

Constructor & Destructor Documentation

◆ G4tgrMaterialMixture() [1/2]

G4tgrMaterialMixture::G4tgrMaterialMixture ( )

Definition at line 38 of file G4tgrMaterialMixture.cc.

39{
40}

◆ ~G4tgrMaterialMixture()

G4tgrMaterialMixture::~G4tgrMaterialMixture ( )

Definition at line 43 of file G4tgrMaterialMixture.cc.

44{
45}

◆ G4tgrMaterialMixture() [2/2]

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

Definition at line 48 of file G4tgrMaterialMixture.cc.

50{
51 //---------- Check for miminum number of words read
53 "G4tgrMaterialMixture::G4tgrMaterialMixture");
54
55 theMateType = matType;
56
57 //---------- Fill private data
59 theDensity = std::fabs(G4tgrUtils::GetDouble(wl[2], g / cm3));
61
63 "G4tgrMaterialMixture::G4tgrMaterialMixture");
64 for(G4int ii = 0; ii < theNoComponents; ++ii)
65 {
66#ifdef G4VERBOSE
68 {
69 G4cout << " G4tgrMaterialMixture::G4tgrMaterialMixture() -"
70 << " adding component: " << wl[ii * 2 + 4]
71 << " Fraction= " << G4tgrUtils::GetDouble(wl[ii * 2 + 1 + 4])
72 << G4endl;
73 }
74#endif
75 theComponents.push_back(G4tgrUtils::GetString(wl[ii * 2 + 4]));
76 theFractions.push_back(G4tgrUtils::GetDouble(wl[ii * 2 + 1 + 4]));
77 }
78
79#ifdef G4VERBOSE
81 {
82 G4cout << " Created " << *this << G4endl;
83 }
84#endif
85}
static constexpr double cm3
Definition: G4SIunits.hh:101
static constexpr double g
Definition: G4SIunits.hh:168
int G4int
Definition: G4Types.hh:85
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
@ WLSIZE_GE
Definition: G4tgrUtils.hh:51
std::vector< G4double > theFractions
std::vector< G4String > theComponents
G4double theDensity
G4String theMateType
G4String theName
G4int theNoComponents
static G4int GetVerboseLevel()
static G4String GetString(const G4String &str)
Definition: G4tgrUtils.cc:173
static void CheckWLsize(const std::vector< G4String > &wl, unsigned int nWCheck, WLSIZEtype st, const G4String &methodName)
Definition: G4tgrUtils.cc:490
static G4int GetInt(const G4String &str)
Definition: G4tgrUtils.cc:447
static G4double GetDouble(const G4String &str, G4double unitval=1.)
Definition: G4tgrUtils.cc:198

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

Member Function Documentation

◆ GetA()

G4double G4tgrMaterialMixture::GetA ( ) const
inlinevirtual

Implements G4tgrMaterial.

Definition at line 58 of file G4tgrMaterialMixture.hh.

58{ return 0.; }

◆ GetComponent()

const G4String & G4tgrMaterialMixture::GetComponent ( G4int  i) const
inlinevirtual

Implements G4tgrMaterial.

Definition at line 60 of file G4tgrMaterialMixture.hh.

60{ return theComponents[i]; }

References theComponents.

◆ GetDensity()

G4double G4tgrMaterial::GetDensity ( ) const
inlineinherited

◆ GetFraction()

G4double G4tgrMaterialMixture::GetFraction ( G4int  i)
inlinevirtual

Implements G4tgrMaterial.

Definition at line 61 of file G4tgrMaterialMixture.hh.

61{ return theFractions[i]; }

References theFractions.

◆ GetIonisationMeanExcitationEnergy()

G4double G4tgrMaterial::GetIonisationMeanExcitationEnergy ( ) const
inlineinherited

◆ GetName()

const G4String & G4tgrMaterial::GetName ( ) const
inlineinherited

◆ GetNumberOfComponents()

G4int G4tgrMaterial::GetNumberOfComponents ( ) const
inlineinherited

◆ GetPressure()

G4double G4tgrMaterial::GetPressure ( ) const
inlineinherited

◆ GetState()

const G4State & G4tgrMaterial::GetState ( ) const
inlineinherited

◆ GetTemperature()

G4double G4tgrMaterial::GetTemperature ( ) const
inlineinherited

◆ GetType()

const G4String & G4tgrMaterial::GetType ( ) const
inlineinherited

◆ GetZ()

G4double G4tgrMaterialMixture::GetZ ( ) const
inlinevirtual

Implements G4tgrMaterial.

Definition at line 59 of file G4tgrMaterialMixture.hh.

59{ return 0.; }

◆ SetIonisationMeanExcitationEnergy()

void G4tgrMaterial::SetIonisationMeanExcitationEnergy ( G4double  mee)
inlineinherited

◆ SetPressure()

void G4tgrMaterial::SetPressure ( G4double  val)
inlineinherited

Definition at line 79 of file G4tgrMaterial.hh.

79{ thePressure = val; }

References G4tgrMaterial::thePressure.

Referenced by G4tgrLineProcessor::ProcessLine().

◆ SetState()

void G4tgrMaterial::SetState ( const G4String &  val)
inherited

Definition at line 47 of file G4tgrMaterial.cc.

48{
49 if(val == "Undefined")
50 {
52 }
53 else if(val == "Solid")
54 {
56 }
57 else if(val == "Liquid")
58 {
60 }
61 else if(val == "Gas")
62 {
64 }
65 else
66 {
67 G4Exception("G4tgrMaterial::SetState", "Wrong state", FatalErrorInArgument,
68 "Only possible states are Undefined/Solid/Liquid/Gas!");
69 }
70}
@ FatalErrorInArgument
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
@ kStateSolid
Definition: G4Material.hh:111
@ kStateLiquid
Definition: G4Material.hh:111
@ kStateGas
Definition: G4Material.hh:111
@ kStateUndefined
Definition: G4Material.hh:111

References FatalErrorInArgument, G4Exception(), kStateGas, kStateLiquid, kStateSolid, kStateUndefined, and G4tgrMaterial::theState.

Referenced by G4tgrLineProcessor::ProcessLine().

◆ SetTemperature()

void G4tgrMaterial::SetTemperature ( G4double  val)
inlineinherited

Definition at line 76 of file G4tgrMaterial.hh.

76{ theTemperature = val; }

References G4tgrMaterial::theTemperature.

Referenced by G4tgrLineProcessor::ProcessLine().

◆ TransformToFractionsByWeight()

void G4tgrMaterialMixture::TransformToFractionsByWeight ( )
inlineprotected

Definition at line 65 of file G4tgrMaterialMixture.hh.

65{}

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 88 of file G4tgrMaterialMixture.cc.

89{
90 os << "G4tgrMaterialMixture=: " << mate.theName << G4endl
91 << "density= " << mate.theDensity / g * cm3
92 << " g/cm3. Number of Components: " << mate.theNoComponents << G4endl;
93 for(G4int ii = 0; ii < mate.theNoComponents; ii++)
94 {
95 os << '\t' << mate.theComponents[ii] << '\t' << mate.theFractions[ii]
96 << G4endl;
97 }
98 return os;
99}

Field Documentation

◆ theComponents

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

Definition at line 69 of file G4tgrMaterialMixture.hh.

Referenced by G4tgrMaterialMixture(), and GetComponent().

◆ theDensity

G4double G4tgrMaterial::theDensity = 0.0
protectedinherited

◆ theFractions

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

Definition at line 70 of file G4tgrMaterialMixture.hh.

Referenced by G4tgrMaterialMixture(), and GetFraction().

◆ theIonisationMeanExcitationEnergy

G4double G4tgrMaterial::theIonisationMeanExcitationEnergy = -1.0
protectedinherited

◆ theMateType

G4String G4tgrMaterial::theMateType = "Material"
protectedinherited

◆ theName

G4String G4tgrMaterial::theName = "Material"
protectedinherited

◆ theNoComponents

G4int G4tgrMaterial::theNoComponents = 0
protectedinherited

◆ thePressure

G4double G4tgrMaterial::thePressure = 0.0
protectedinherited

Definition at line 90 of file G4tgrMaterial.hh.

Referenced by G4tgrMaterial::GetPressure(), and G4tgrMaterial::SetPressure().

◆ theState

G4State G4tgrMaterial::theState = kStateUndefined
protectedinherited

Definition at line 88 of file G4tgrMaterial.hh.

Referenced by G4tgrMaterial::GetState(), and G4tgrMaterial::SetState().

◆ theTemperature

G4double G4tgrMaterial::theTemperature = 0.0
protectedinherited

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