Belle II Software  release-05-01-25
TOPGeoMirrorSegment.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2016 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Marko Staric *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <top/dbobjects/TOPGeoMirrorSegment.h>
12 #include <math.h>
13 #include <iostream>
14 
15 using namespace std;
16 
17 namespace Belle2 {
23  double TOPGeoMirrorSegment::getZc() const
24  {
25  double dx = fabs(getXc()) - getWidth() / 2;
26  double dy = fabs(getYc()) - getThickness() / 2;
27  double z = getOuterRadius();
28  if (dx > 0) z = sqrt(z * z - dx * dx);
29  if (dy > 0) z = sqrt(z * z - dy * dy);
30 
31  return getFullLength() / 2 - z;
32  }
33 
34 
35  bool TOPGeoMirrorSegment::isConsistent() const
36  {
37  if (m_radius <= 0) return false;
38  if (m_coatingThickness <= 0) return false;
39  if (m_coatingMaterial.empty()) return false;
40  if (m_coatingSurface.getName().empty() and !m_coatingSurface.hasProperties()) return false;
41  if (!TOPGeoBarSegment::isConsistent()) return false;
42  return true;
43  }
44 
45 
46  void TOPGeoMirrorSegment::print(const std::string& title) const
47  {
48  TOPGeoBarSegment::print(title);
49  cout << " Radius of curvature: " << getRadius() << " " << s_unitName << endl;
50  cout << " Center of curvature: (" << getXc() << ", " << getYc()
51  << ") " << s_unitName << endl;
52  cout << " Reflective coating: " << getCoatingMaterial() << ", thickness: " <<
53  getCoatingThickness() << " " << s_unitName << endl;
54  printSurface(m_coatingSurface);
55 
56  }
57 
59 } // end Belle2 namespace
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19