Belle II Software  release-05-01-25
ARICHGeoMirrors.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2016 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Luka Santelj *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <arich/dbobjects/ARICHGeoMirrors.h>
12 #include <math.h>
13 #include <iostream>
14 #include <iomanip>
15 
16 using namespace std;
17 using namespace Belle2;
18 
19 
20 void ARICHGeoMirrors::initializeDefault()
21 {
22  double rmir = m_radius - m_plateThickness / 2.;
23  for (unsigned i = 0; i < m_nMirrors; i++) {
24  TVector3 norm(cos(i * 2.*M_PI / m_nMirrors + m_startAngle),
25  sin(i * 2.*M_PI / m_nMirrors + m_startAngle), 0);
26  m_normVector.push_back(norm);
27  m_point.push_back(rmir * norm);
28  m_installed.push_back(true);
29  }
30 }
31 
32 bool ARICHGeoMirrors::isConsistent() const
33 {
34  if (m_nMirrors == 0) { B2INFO("ARICHGeoMirrors: no mirrors will be placed"); return true;}
35 
36  if (m_radius <= 0) return false;
37  if (m_plateThickness <= 0 || m_plateWidth <= 0 || m_plateLength <= 0) return false;
38  if (m_plateWidth == 0) return false;
39  if (m_radius == 0) return false;
40  if (m_point.size() != m_nMirrors) return false;
41  if (m_normVector.size() != m_nMirrors) return false;
42  if (m_installed.size() != m_nMirrors) return false;
43  if (m_material.empty()) return false;
44  if (!m_surface.hasProperties())
45  B2INFO("ARICHGeoMirrors: no optical properties are specified for mirrors! (no photons will be reflected)");
46  return true;
47 }
48 
49 
50 void ARICHGeoMirrors::print(const std::string& title) const
51 {
52  ARICHGeoBase::print(title);
53  cout << " mirror plate:" << endl;
54  cout << " thickness: " << getPlateThickness() << " " << s_unitName << ", width: " << getPlateWidth() << " " << s_unitName <<
55  ", length: "
56  << getPlateLength() << " " << s_unitName << endl;
57  cout << " material: " << getMaterial() << endl;
58  cout << " number of plates: " << getNMirrors() << endl;
59  cout << " nominal phi angle of 1st plate: " << getStartAngle() << endl;
60  cout << " nominal radius at which plates are placed: " << getRadius() << " " << s_unitName << endl;
61  cout << " nominal Z position of plates: " << getZPosition() << " " << s_unitName << endl;
62 
63  cout << " installed plates " << endl;
64 
65  cout << " ID: ";
66  for (unsigned imir = 1; imir < getNMirrors() + 1; imir++) {
67  cout << setw(3) << imir << " ";
68  }
69  cout << endl;
70  cout << " flag: ";
71  for (unsigned imir = 1; imir < getNMirrors() + 1; imir++) {
72  cout << setw(3) << isInstalled(imir) << " ";
73  }
74  cout << endl;
75 
76  ARICHGeoBase::printSurface(m_surface);
77 }
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19