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="")
virtual ~GBase ()
GBaseoperator= (const GBase &)=default

Friends

std::ostream & operator<< (std::ostream &stream, const GMaterial &gMat)
 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
bool hasScintillationYield () const
bool hasResolutionScale () const
bool hasFasttimeConstant () const
bool hasSlowtimeConstant () const
bool hasYieldratio () const
bool hasBirksConstant () 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
inlinenodiscardvirtual
Returns
A heap-allocated copy of this material.

Definition at line 49 of file gmaterial.h.

◆ getAbsorptionLength()

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

Definition at line 186 of file gmaterial.h.

◆ getAmounts()

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

Definition at line 179 of file gmaterial.h.

◆ getBirksConstant()

double GMaterial::getBirksConstant ( ) const
inlinenodiscard

Definition at line 200 of file gmaterial.h.

◆ getComponents()

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

Definition at line 178 of file gmaterial.h.

◆ getDensity()

double GMaterial::getDensity ( ) const
inlinenodiscard

Definition at line 177 of file gmaterial.h.

◆ getDescription()

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

Definition at line 176 of file gmaterial.h.

◆ getEfficiency()

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

Definition at line 188 of file gmaterial.h.

◆ getFastComponent()

std::vector< double > GMaterial::getFastComponent ( ) const
inlinenodiscard

Definition at line 193 of file gmaterial.h.

◆ getFasttimeConstant()

double GMaterial::getFasttimeConstant ( ) const
inlinenodiscard

Definition at line 197 of file gmaterial.h.

◆ getIndexOfRefraction()

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

Definition at line 185 of file gmaterial.h.

◆ getName()

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

Definition at line 175 of file gmaterial.h.

◆ getPhotonEnergy()

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

Definition at line 184 of file gmaterial.h.

◆ getRayleigh()

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

Definition at line 211 of file gmaterial.h.

◆ getReflectivity()

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

Definition at line 187 of file gmaterial.h.

◆ getResolutionScale()

double GMaterial::getResolutionScale ( ) const
inlinenodiscard

Definition at line 196 of file gmaterial.h.

◆ getScintillationYield()

double GMaterial::getScintillationYield ( ) const
inlinenodiscard

Definition at line 195 of file gmaterial.h.

◆ getSlowComponent()

std::vector< double > GMaterial::getSlowComponent ( ) const
inlinenodiscard

Definition at line 194 of file gmaterial.h.

◆ getSlowtimeConstant()

double GMaterial::getSlowtimeConstant ( ) const
inlinenodiscard

Definition at line 198 of file gmaterial.h.

◆ getYieldratio()

double GMaterial::getYieldratio ( ) const
inlinenodiscard

Definition at line 199 of file gmaterial.h.

◆ hasBirksConstant()

bool GMaterial::hasBirksConstant ( ) const
inlinenodiscard

Definition at line 206 of file gmaterial.h.

◆ hasFasttimeConstant()

bool GMaterial::hasFasttimeConstant ( ) const
inlinenodiscard

Definition at line 203 of file gmaterial.h.

◆ hasResolutionScale()

bool GMaterial::hasResolutionScale ( ) const
inlinenodiscard

Definition at line 202 of file gmaterial.h.

◆ hasScintillationYield()

bool GMaterial::hasScintillationYield ( ) const
inlinenodiscard

Definition at line 201 of file gmaterial.h.

◆ hasSlowtimeConstant()

bool GMaterial::hasSlowtimeConstant ( ) const
inlinenodiscard

Definition at line 204 of file gmaterial.h.

◆ hasYieldratio()

bool GMaterial::hasYieldratio ( ) const
inlinenodiscard

Definition at line 205 of file gmaterial.h.

◆ isChemicalFormula()

bool GMaterial::isChemicalFormula ( ) const
inlinenodiscard

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 222 of file gmaterial.h.

◆ 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: