gsystem
Loading...
Searching...
No Matches
GMaterial Class Reference

Material definition belonging to a detector system. More...

#include <gmaterial.h>

Public Member Functions

 GMaterial (const std::string &system, std::vector< std::string > pars, const std::shared_ptr< GLogger > &logger)
 Construct a material from a serialized parameter list.
 
virtual std::unique_ptr< GMaterialclone () const
 Clone the material (polymorphic deep-copy).
 
virtual ~GMaterial ()=default
 Virtual destructor (safe deletion through base pointers).
 
bool isChemicalFormula () const
 Heuristic: return true if the composition looks like a chemical formula.
 
Identity and description
std::string getName () const
 
std::string getDescription () const
 
double getDensity () const
 
std::vector< std::string > getComponents () const
 
std::vector< double > getAmounts () const
 
- Public Member Functions inherited from GBase< GMaterial >
 GBase (const std::shared_ptr< GOptions > &gopt, std::string logger_name="")
 
 GBase (const std::shared_ptr< GLogger > &logger)
 
 GBase (const GBase &)=default
 
 GBase (GBase &&) noexcept=default
 
virtual ~GBase ()
 
GBaseoperator= (const GBase &)=default
 
GBaseoperator= (GBase &&) noexcept=default
 

Friends

std::ostream & operator<< (std::ostream &stream, const GMaterial &)
 Stream operator used for logging material summaries.
 

Optical properties

std::vector< double > getPhotonEnergy () const
 
std::vector< double > getIndexOfRefraction () const
 
std::vector< double > getAbsorptionLength () const
 
std::vector< double > getReflectivity () const
 
std::vector< double > getEfficiency () const
 

Scintillation properties

std::vector< double > getFastcomponent () const
 
std::vector< double > getSlowcomponent () const
 
double getScintillationyield () const
 
double getResolutionscale () const
 
double getFasttimeconstant () const
 
double getSlowtimeconstant () const
 
double getYieldratio () const
 
double getBirksConstant () const
 

Additional optical properties

std::vector< double > getRayleigh () const
 

Additional Inherited Members

- Protected Attributes inherited from GBase< GMaterial >
std::shared_ptr< GLoggerlog
 

Detailed Description

A GMaterial is constructed from a serialized list of parameters (typically read from a database row or ASCII file) and stores:

  • bulk density;
  • composition (components + amounts);
  • optional optical properties (refractive index, absorption length, etc.);
  • optional scintillation properties (yield, time constants, spectra, etc.).

The module treats materials as system-local definitions: a system (GSystem) loads its own materials and associates them to volumes by name.

Definition at line 28 of file gmaterial.h.

Constructor & Destructor Documentation

◆ GMaterial()

GMaterial::GMaterial ( const std::string & system,
std::vector< std::string > pars,
const std::shared_ptr< GLogger > & logger )
Parameters
systemSystem name that owns this material (used for provenance/logging).
parsSerialized material parameters (must match GMATERIALNUMBEROFPARS).
loggerLogger used for diagnostics and error reporting.

The constructor validates pars length against GMATERIALNUMBEROFPARS and then parses the fields. Optical/scintillation properties may be "unset" (typically UNINITIALIZEDSTRINGQUANTITY) and are skipped.

Definition at line 21 of file gmaterial.cc.

◆ ~GMaterial()

virtual GMaterial::~GMaterial ( )
virtualdefault

Member Function Documentation

◆ clone()

virtual std::unique_ptr< GMaterial > GMaterial::clone ( ) const
inlinevirtual
Returns
A heap-allocated copy of this material.

Definition at line 50 of file gmaterial.h.

◆ getAbsorptionLength()

std::vector< double > GMaterial::getAbsorptionLength ( ) const
inline

Definition at line 180 of file gmaterial.h.

◆ getAmounts()

std::vector< double > GMaterial::getAmounts ( ) const
inline

Definition at line 173 of file gmaterial.h.

◆ getBirksConstant()

double GMaterial::getBirksConstant ( ) const
inline

Definition at line 194 of file gmaterial.h.

◆ getComponents()

std::vector< std::string > GMaterial::getComponents ( ) const
inline

Definition at line 172 of file gmaterial.h.

◆ getDensity()

double GMaterial::getDensity ( ) const
inline

Definition at line 171 of file gmaterial.h.

◆ getDescription()

std::string GMaterial::getDescription ( ) const
inline

Definition at line 170 of file gmaterial.h.

◆ getEfficiency()

std::vector< double > GMaterial::getEfficiency ( ) const
inline

Definition at line 182 of file gmaterial.h.

◆ getFastcomponent()

std::vector< double > GMaterial::getFastcomponent ( ) const
inline

Definition at line 187 of file gmaterial.h.

◆ getFasttimeconstant()

double GMaterial::getFasttimeconstant ( ) const
inline

Definition at line 191 of file gmaterial.h.

◆ getIndexOfRefraction()

std::vector< double > GMaterial::getIndexOfRefraction ( ) const
inline

Definition at line 179 of file gmaterial.h.

◆ getName()

std::string GMaterial::getName ( ) const
inline

Definition at line 169 of file gmaterial.h.

◆ getPhotonEnergy()

std::vector< double > GMaterial::getPhotonEnergy ( ) const
inline

Definition at line 178 of file gmaterial.h.

◆ getRayleigh()

std::vector< double > GMaterial::getRayleigh ( ) const
inline

Definition at line 199 of file gmaterial.h.

◆ getReflectivity()

std::vector< double > GMaterial::getReflectivity ( ) const
inline

Definition at line 181 of file gmaterial.h.

◆ getResolutionscale()

double GMaterial::getResolutionscale ( ) const
inline

Definition at line 190 of file gmaterial.h.

◆ getScintillationyield()

double GMaterial::getScintillationyield ( ) const
inline

Definition at line 189 of file gmaterial.h.

◆ getSlowcomponent()

std::vector< double > GMaterial::getSlowcomponent ( ) const
inline

Definition at line 188 of file gmaterial.h.

◆ getSlowtimeconstant()

double GMaterial::getSlowtimeconstant ( ) const
inline

Definition at line 192 of file gmaterial.h.

◆ getYieldratio()

double GMaterial::getYieldratio ( ) const
inline

Definition at line 193 of file gmaterial.h.

◆ isChemicalFormula()

bool GMaterial::isChemicalFormula ( ) const
inline

The module uses a simple heuristic: when the sum of amounts is > 1.0, the values are likely atom counts rather than fractional masses.

Returns
true if the composition likely represents a formula, false otherwise.

Definition at line 210 of file gmaterial.h.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & stream,
const GMaterial & gMat )
friend

Definition at line 66 of file gmaterial.cc.


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