10 #include <top/dbobjects/TOPGeoBase.h>
11 #include <framework/gearbox/Unit.h>
12 #include <framework/logging/Logger.h>
24 double TOPGeoBase::s_unit = Unit::cm;
25 std::string TOPGeoBase::s_unitName(
"cm");
28 void TOPGeoBase::print(
const std::string& title)
const
30 cout << title <<
":" << endl;
31 cout <<
" name: " << m_name << endl;
35 void TOPGeoBase::printUnderlined(
const std::string& title)
const
37 cout << title <<
":" << endl;
38 for (
size_t i = 0; i <= title.length(); i++) cout <<
"-";
40 cout <<
" name: " << m_name << endl;
46 cout <<
" Optical surface: ";
48 cout <<
"not defined" << endl;
52 cout <<
", model: " << surface.
getModel();
53 cout <<
", finish: " << surface.
getFinish();
54 cout <<
", type: " << surface.
getType();
55 cout <<
", value: " << surface.
getValue();
59 cout <<
" - property: ";
60 cout <<
property.getName() <<
" [";
61 for (
const auto& value : property.getValues()) cout << value <<
", ";
63 for (
const auto& value : property.getEnergies()) cout << value / Unit::eV <<
", ";
64 cout <<
"] eV" << endl;
67 cout <<
" - properties: None" << endl;
77 if (property.getName() ==
"REFLECTIVITY") {
78 auto energies =
property.getEnergies();
79 auto values =
property.getValues();
80 if (energies.size() < 2)
return 0;
81 if (energy < energies[0] or energy > energies.back()) {
82 B2WARNING(
"TOPGeoBase::getReflectivity: photon energy out of range - return value not reliable");
84 auto spline = TSpline3(
"tmp", energies.data(), values.data(), energies.size());
85 return spline.Eval(energy);
90 B2ERROR(
"Optical surface " << surface.
getName() <<
" has no property REFLECTIVITY");
Represent an optical finish of a surface.
int getFinish() const
get finish of the surface
const std::string & getName() const
get name of the optical surface
double getValue() const
get value for the surface condition
const std::vector< GeoMaterialProperty > & getProperties() const
get all properties
int getType() const
get type of the surface
bool hasProperties() const
check if the material has at least one property
int getModel() const
get model for the surface
Abstract base class for different kinds of events.