Belle II Software development
ARICHGeoBase.cc
1
2/**************************************************************************
3 * basf2 (Belle II Analysis Software Framework) *
4 * Author: The Belle II Collaboration *
5 * *
6 * See git log for contributors and copyright holders. *
7 * This file is licensed under LGPL-3.0, see LICENSE.md. *
8 **************************************************************************/
9
10#include <arich/dbobjects/ARICHGeoBase.h>
11#include <framework/gearbox/Unit.h>
12#include <iostream>
13
14using namespace std;
15using namespace Belle2;
16
18std::string ARICHGeoBase::s_unitName("cm");
19
20void ARICHGeoBase::print(const std::string& title) const
21{
22 cout << title << ":" << endl;
23}
24
25void ARICHGeoBase::printPlacement(double x, double y, double z, double rx, double ry, double rz) const
26{
27// cout << "Volume positioning information (inside local ARICH frame)" << endl;
28 cout << " Center position; x: " << x << " " << s_unitName << ", y: " << y << " " << s_unitName << ", z: " << z << " " << s_unitName
29 << endl;
30 cout << " Rotations; x-axis: " << rx << " y-axis: " << ry << " z-axis: " << rz << " (in rad)" << endl;
31}
33{
34 cout << " Optical surface: ";
35 if (surface.getName().empty() and !surface.hasProperties()) {
36 cout << "not defined" << endl;
37 return;
38 }
39 cout << surface.getName();
40 cout << ", model: " << surface.getModel();
41 cout << ", finish: " << surface.getFinish();
42 cout << ", type: " << surface.getType();
43 cout << ", value: " << surface.getValue();
44 cout << endl;
45 if (surface.hasProperties()) {
46 for (const auto& property : surface.getProperties()) {
47 cout << " - property: ";
48 cout << property.getName() << " [";
49 for (const auto& value : property.getValues()) cout << value << ", ";
50 cout << "], @[";
51 for (const auto& value : property.getEnergies()) cout << value / Unit::eV << ", ";
52 cout << "] eV" << endl;
53 }
54 } else {
55 cout << " - properties: None" << endl;
56 }
57
58}
59
static double s_unit
conversion unit for length
Definition: ARICHGeoBase.h:83
virtual void printPlacement(double x, double y, double z, double rx, double ry, double rz) const
Print volume positioning parameters.
Definition: ARICHGeoBase.cc:25
virtual void printSurface(const GeoOpticalSurface &surface) const
Print the content of optical surface.
Definition: ARICHGeoBase.cc:32
virtual void print(const std::string &title) const
Print the content of the class.
Definition: ARICHGeoBase.cc:20
static std::string s_unitName
conversion unit name
Definition: ARICHGeoBase.h:84
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
static const double eV
[electronvolt]
Definition: Unit.h:112
static const double cm
Standard units with the value = 1.
Definition: Unit.h:47
Abstract base class for different kinds of events.
STL namespace.