Belle II Software development
GeoMaterial.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#include <TObject.h>
12#include <vector>
13#include <geometry/dbobjects/GeoMaterialProperty.h>
14#include <geometry/dbobjects/GeoMaterialComponent.h>
15
16namespace Belle2 {
22 class GeoMaterial: public TObject {
23 public:
25 GeoMaterial() = default;
27 void setName(const std::string& name) { m_name = name; }
29 void setState(int state) { m_state = state; }
31 void setDensity(double density) { m_density = density; }
33 void setTemperature(double temperature) { m_temperature = temperature; }
35 void setPressure(double pressure) { m_pressure = pressure; }
37 void addComponent(const GeoMaterialComponent& component) { m_components.emplace_back(component); }
39 void addProperty(const GeoMaterialProperty& property) { m_properties.emplace_back(property); }
41 const std::string& getName() const { return m_name; }
43 int getState() const { return m_state; }
45 double getDensity() const { return m_density; }
47 double getTemperature() const { return m_temperature; }
49 double getPressure() const { return m_pressure; }
51 std::vector<GeoMaterialComponent>& getComponents() { return m_components; }
53 const std::vector<GeoMaterialComponent>& getComponents() const { return m_components; }
55 const std::vector<GeoMaterialProperty>& getProperties() const { return m_properties; }
58 bool hasProperties() const { return m_properties.size() > 0; }
59 private:
61 std::string m_name{""};
63 int m_state{0};
65 double m_density{0};
67 double m_temperature{0};
69 double m_pressure{0};
71 std::vector<GeoMaterialComponent> m_components;
73 std::vector<GeoMaterialProperty> m_properties;
76 };
78} //Belle2 namespace
Component of a material.
Property of a material.
Class to represent a material informaion in the Database.
Definition: GeoMaterial.h:22
void setPressure(double pressure)
set the pressure of the material (in default framework units
Definition: GeoMaterial.h:35
double m_density
density of the material
Definition: GeoMaterial.h:65
double getPressure() const
get the pressure of the material (in default framework units
Definition: GeoMaterial.h:49
void setState(int state)
set the state of the material
Definition: GeoMaterial.h:29
double m_pressure
pressure of the material
Definition: GeoMaterial.h:69
void addComponent(const GeoMaterialComponent &component)
add a component to the material.
Definition: GeoMaterial.h:37
const std::string & getName() const
get the name of the material
Definition: GeoMaterial.h:41
double getDensity() const
get the density of the material (in default framework units
Definition: GeoMaterial.h:45
const std::vector< GeoMaterialComponent > & getComponents() const
get all components
Definition: GeoMaterial.h:53
ClassDef(GeoMaterial, 1)
reflection info for ROOT
std::vector< GeoMaterialProperty > m_properties
properties of this material
Definition: GeoMaterial.h:73
void setName(const std::string &name)
set the name of the material
Definition: GeoMaterial.h:27
void addProperty(const GeoMaterialProperty &property)
add a property to the material
Definition: GeoMaterial.h:39
void setTemperature(double temperature)
set the temperature of the material (in default framework units
Definition: GeoMaterial.h:33
const std::vector< GeoMaterialProperty > & getProperties() const
get all properties
Definition: GeoMaterial.h:55
int getState() const
get the state of the material
Definition: GeoMaterial.h:43
GeoMaterial()=default
default constructor
int m_state
Geant4 state of the material.
Definition: GeoMaterial.h:63
double getTemperature() const
get the temperature of the material (in default framework units
Definition: GeoMaterial.h:47
bool hasProperties() const
check if the material has at least one property
Definition: GeoMaterial.h:58
void setDensity(double density)
set the density of the material (in default framework units
Definition: GeoMaterial.h:31
std::string m_name
name of the material
Definition: GeoMaterial.h:61
std::vector< GeoMaterialComponent > m_components
components of this material
Definition: GeoMaterial.h:71
std::vector< GeoMaterialComponent > & getComponents()
get all components
Definition: GeoMaterial.h:51
double m_temperature
temperature of the material
Definition: GeoMaterial.h:67
Abstract base class for different kinds of events.