10#include <top/dbobjects/TOPGeoBase.h>
11#include <framework/gearbox/Unit.h>
12#include <framework/logging/Logger.h>
30 cout << title <<
":" << endl;
31 cout <<
" name: " <<
m_name << endl;
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.
const std::string & getName() const
get name of the optical surface
int getFinish() const
get finish of the surface
const std::vector< GeoMaterialProperty > & getProperties() const
get all properties
double getValue() const
get value for the surface condition
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
std::string m_name
geometry object name
static const double eV
[electronvolt]
static const double cm
Standard units with the value = 1.
static double s_unit
conversion unit for length
void printUnderlined(const std::string &title) const
Print the content of the class.
double getReflectivity(const GeoOpticalSurface &surface, double energy) const
Returns reflectivity of optical surface at given photon energy.
virtual void printSurface(const GeoOpticalSurface &surface) const
Print the content of optical surface.
virtual void print(const std::string &title) const
Print the content of the class.
static std::string s_unitName
conversion unit name
Abstract base class for different kinds of events.