OMSim
Geant4 for IceCube optical module studies
OMSimMaterialHandler Class Reference

Handles the creation and processing of materials from json files. More...

Collaboration diagram for OMSimMaterialHandler:
[legend]

Detailed Description

This class is responsible for extracting data from json files, creating new materials, processing optical surfaces, and handling special material types such as IceCube ice and scintillators.

Public Member Functions

 OMSimMaterialHandler (const G4String &filename)
 
void processMaterial ()
 Process the material defined in the input file.
 
G4OpticalSurface * processSurface ()
 Process and return an optical surface defined in the input file. More...
 
void processExtraProperties ()
 Process extra properties for an existing material. More...
 
void processSpecial (ProcessorFunction *processor)
 Process special material types using a provided function. More...
 
G4String GetName ()
 

Private Member Functions

void readJsonFile ()
 
void createMaterial ()
 Create a new Geant4 material based on the input data.
 
void processProperties ()
 Process the properties defined in the input file and add them to the material. More...
 
void processConstProperties ()
 Process constant properties defined in the input file and add them to the material. More...
 
void findMaterialPropertyTable (G4String p_name)
 Find the material property table for an existing material. More...
 
void addProperty (const G4String &key, G4double energyUnit, G4double valueUnit, bool invertX, const boost::property_tree::ptree &propertyTree)
 Add a property to the material properties table. More...
 
G4OpticalSurfaceFinish getOpticalSurfaceFinish (const std::string &finish)
 Get the G4OpticalSurfaceFinish enum value from a string. More...
 
G4OpticalSurfaceModel getOpticalSurfaceModel (const std::string &model)
 Get the G4OpticalSurfaceModel enum value from a string. More...
 
G4SurfaceType getSurfaceType (const std::string &type)
 Get the G4SurfaceType enum value from a string. More...
 
G4State getState (const std::string &type)
 Get the G4State enum value from a string. More...
 

Private Attributes

ParameterTablem_fileData
 
G4double m_hc_eVnm = h_Planck * c_light / nm
 
G4String m_filePath
 
G4String m_objectName
 
boost::property_tree::ptree m_jsonTree
 
G4Material * m_material
 
G4MaterialPropertiesTable * m_MPT
 
G4OpticalSurface * m_opticalSurface
 

Member Function Documentation

◆ addProperty()

void OMSimMaterialHandler::addProperty ( const G4String &  p_propertyName,
G4double  p_xUnit,
G4double  p_yUnit,
bool  p_invertX,
const boost::property_tree::ptree &  p_propertyTree 
)
private
Parameters
p_propertyNameName of the property.
p_xUnitUnit conversion factor for energy values.
p_yUnitUnit conversion factor for property values.
p_invertXWhether to invert the x-axis values.
p_propertyTreeProperty tree containing the property data.

◆ findMaterialPropertyTable()

void OMSimMaterialHandler::findMaterialPropertyTable ( G4String  p_name)
private
Parameters
p_nameName of the material whose property table is to be found.

◆ getOpticalSurfaceFinish()

G4OpticalSurfaceFinish OMSimMaterialHandler::getOpticalSurfaceFinish ( const std::string &  p_finish)
private
Parameters
finishString representation of the finish.

◆ getOpticalSurfaceModel()

G4OpticalSurfaceModel OMSimMaterialHandler::getOpticalSurfaceModel ( const std::string &  p_model)
private
Parameters
p_modelString representation of the model.

◆ getState()

G4State OMSimMaterialHandler::getState ( const std::string &  p_state)
private
Parameters
p_stateString representation of the state.

◆ getSurfaceType()

G4SurfaceType OMSimMaterialHandler::getSurfaceType ( const std::string &  p_type)
private
Parameters
p_typeString representation of the surface type.

◆ processConstProperties()

void OMSimMaterialHandler::processConstProperties ( )
private

The json files that contain a key "jConstProperties", will have a list of properties with a constant

◆ processExtraProperties()

void OMSimMaterialHandler::processExtraProperties ( )

This method is used to add additional properties to a material that has already been defined.

◆ processProperties()

void OMSimMaterialHandler::processProperties ( )
private

In the json file there is a jProperties key containing one ore more keys (which will be the name of the property in the material property table). Each of these keys contains two arrays, one in key jWavelength and the other in jValues.

◆ processSpecial()

void OMSimMaterialHandler::processSpecial ( ProcessorFunction *  p_processor)
Parameters
p_processorFunction pointer to the processor function.

This method is used for processing special material types like IceCube ice or scintillators, which require custom handling.

◆ processSurface()

G4OpticalSurface * OMSimMaterialHandler::processSurface ( )
Returns
Pointer to the created G4OpticalSurface.

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