Belle II Software  release-05-01-25
ARICHGeoBase.cc
1 
2 /**************************************************************************
3  * BASF2 (Belle Analysis Framework 2) *
4  * Copyright(C) 2016 - Belle II Collaboration *
5  * *
6  * Author: The Belle II Collaboration *
7  * Contributors: Luka Santelj *
8  * *
9  * This software is provided "as is" without any warranty. *
10  **************************************************************************/
11 
12 #include <arich/dbobjects/ARICHGeoBase.h>
13 #include <framework/gearbox/Unit.h>
14 #include <iostream>
15 
16 using namespace std;
17 using namespace Belle2;
18 
19 double ARICHGeoBase::s_unit = Unit::cm;
20 std::string ARICHGeoBase::s_unitName("cm");
21 
22 void ARICHGeoBase::print(const std::string& title) const
23 {
24  cout << title << ":" << endl;
25 }
26 
27 void ARICHGeoBase::printPlacement(double x, double y, double z, double rx, double ry, double rz) const
28 {
29 // cout << "Volume positioning information (inside local ARICH frame)" << endl;
30  cout << " Center position; x: " << x << " " << s_unitName << ", y: " << y << " " << s_unitName << ", z: " << z << " " << s_unitName
31  << endl;
32  cout << " Rotations; x-axis: " << rx << " y-axis: " << ry << " z-axis: " << rz << " (in rad)" << endl;
33 }
34 void ARICHGeoBase::printSurface(const GeoOpticalSurface& surface) const
35 {
36  cout << " Optical surface: ";
37  if (surface.getName().empty() and !surface.hasProperties()) {
38  cout << "not defined" << endl;
39  return;
40  }
41  cout << surface.getName();
42  cout << ", model: " << surface.getModel();
43  cout << ", finish: " << surface.getFinish();
44  cout << ", type: " << surface.getType();
45  cout << ", value: " << surface.getValue();
46  cout << endl;
47  if (surface.hasProperties()) {
48  for (const auto& property : surface.getProperties()) {
49  cout << " - property: ";
50  cout << property.getName() << " [";
51  for (const auto& value : property.getValues()) cout << value << ", ";
52  cout << "], @[";
53  for (const auto& value : property.getEnergies()) cout << value / Unit::eV << ", ";
54  cout << "] eV" << endl;
55  }
56  } else {
57  cout << " - properties: None" << endl;
58  }
59 
60 }
61 
Belle2::GeoOpticalSurface::getProperties
const std::vector< GeoMaterialProperty > & getProperties() const
get all properties
Definition: GeoOpticalSurface.h:61
Belle2::GeoOpticalSurface::getName
const std::string & getName() const
get name of the optical surface
Definition: GeoOpticalSurface.h:51
Belle2::GeoOpticalSurface::hasProperties
bool hasProperties() const
check if the material has at least one property
Definition: GeoOpticalSurface.h:64
Belle2::GeoOpticalSurface
Represent an optical finish of a surface.
Definition: GeoOpticalSurface.h:31
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::GeoOpticalSurface::getValue
double getValue() const
get value for the surface condition
Definition: GeoOpticalSurface.h:59
Belle2::GeoOpticalSurface::getModel
int getModel() const
get model for the surface
Definition: GeoOpticalSurface.h:53
Belle2::GeoOpticalSurface::getFinish
int getFinish() const
get finish of the surface
Definition: GeoOpticalSurface.h:55
Belle2::GeoOpticalSurface::getType
int getType() const
get type of the surface
Definition: GeoOpticalSurface.h:57