Belle II Software  release-05-01-25
GeoMaterial.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Martin Ritter *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <TObject.h>
14 #include <vector>
15 #include <geometry/dbobjects/GeoMaterialProperty.h>
16 #include <geometry/dbobjects/GeoMaterialComponent.h>
17 
18 namespace Belle2 {
24  class GeoMaterial: public TObject {
25  public:
27  GeoMaterial() = default;
29  void setName(const std::string& name) { m_name = name; }
31  void setState(int state) { m_state = state; }
33  void setDensity(double density) { m_density = density; }
35  void setTemperature(double temperature) { m_temperature = temperature; }
37  void setPressure(double pressure) { m_pressure = pressure; }
39  void addComponent(const GeoMaterialComponent& component) { m_components.emplace_back(component); }
41  void addProperty(const GeoMaterialProperty& property) { m_properties.emplace_back(property); }
43  const std::string& getName() const { return m_name; }
45  int getState() const { return m_state; }
47  double getDensity() const { return m_density; }
49  double getTemperature() const { return m_temperature; }
51  double getPressure() const { return m_pressure; }
53  std::vector<GeoMaterialComponent>& getComponents() { return m_components; }
55  const std::vector<GeoMaterialComponent>& getComponents() const { return m_components; }
57  const std::vector<GeoMaterialProperty>& getProperties() const { return m_properties; }
60  bool hasProperties() const { return m_properties.size() > 0; }
61  private:
63  std::string m_name{""};
65  int m_state{0};
67  double m_density{0};
69  double m_temperature{0};
71  double m_pressure{0};
73  std::vector<GeoMaterialComponent> m_components;
75  std::vector<GeoMaterialProperty> m_properties;
78  };
80 } //Belle2 namespace
Belle2::GeoMaterial::addComponent
void addComponent(const GeoMaterialComponent &component)
add a component to the material.
Definition: GeoMaterial.h:47
Belle2::GeoMaterial::m_components
std::vector< GeoMaterialComponent > m_components
components of this material
Definition: GeoMaterial.h:81
Belle2::GeoMaterial::setName
void setName(const std::string &name)
set the name of the material
Definition: GeoMaterial.h:37
Belle2::GeoMaterial::m_temperature
double m_temperature
temperature of the material
Definition: GeoMaterial.h:77
Belle2::GeoMaterial
Class to represent a material informaion in the Database.
Definition: GeoMaterial.h:32
Belle2::GeoMaterial::setTemperature
void setTemperature(double temperature)
set the temperature of the material (in default framework units
Definition: GeoMaterial.h:43
Belle2::GeoMaterial::getState
int getState() const
get the state of the material
Definition: GeoMaterial.h:53
Belle2::GeoMaterial::m_density
double m_density
density of the material
Definition: GeoMaterial.h:75
Belle2::GeoMaterial::addProperty
void addProperty(const GeoMaterialProperty &property)
add a property to the material
Definition: GeoMaterial.h:49
Belle2::GeoMaterial::m_state
int m_state
Geant4 state of the material.
Definition: GeoMaterial.h:73
Belle2::GeoMaterial::m_name
std::string m_name
name of the material
Definition: GeoMaterial.h:71
Belle2::GeoMaterialComponent
Component of a material.
Definition: GeoMaterialComponent.h:29
Belle2::GeoMaterialProperty
Property of a material.
Definition: GeoMaterialProperty.h:29
Belle2::GeoMaterial::m_properties
std::vector< GeoMaterialProperty > m_properties
properties of this material
Definition: GeoMaterial.h:83
Belle2::GeoMaterial::setState
void setState(int state)
set the state of the material
Definition: GeoMaterial.h:39
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::GeoMaterial::getProperties
const std::vector< GeoMaterialProperty > & getProperties() const
get all properties
Definition: GeoMaterial.h:65
Belle2::GeoMaterial::setPressure
void setPressure(double pressure)
set the pressure of the material (in default framework units
Definition: GeoMaterial.h:45
Belle2::GeoMaterial::getName
const std::string & getName() const
get the name of the material
Definition: GeoMaterial.h:51
Belle2::GeoMaterial::getDensity
double getDensity() const
get the density of the material (in default framework units
Definition: GeoMaterial.h:55
Belle2::GeoMaterial::m_pressure
double m_pressure
pressure of the material
Definition: GeoMaterial.h:79
Belle2::GeoMaterial::getComponents
std::vector< GeoMaterialComponent > & getComponents()
get all components
Definition: GeoMaterial.h:61
Belle2::GeoMaterial::getPressure
double getPressure() const
get the pressure of the material (in default framework units
Definition: GeoMaterial.h:59
Belle2::GeoMaterial::getTemperature
double getTemperature() const
get the temperature of the material (in default framework units
Definition: GeoMaterial.h:57
Belle2::GeoMaterial::GeoMaterial
GeoMaterial()=default
default constructor
Belle2::GeoMaterial::setDensity
void setDensity(double density)
set the density of the material (in default framework units
Definition: GeoMaterial.h:41
Belle2::GeoMaterial::ClassDef
ClassDef(GeoMaterial, 1)
reflection info for ROOT
Belle2::GeoMaterial::hasProperties
bool hasProperties() const
check if the material has at least one property
Definition: GeoMaterial.h:68