9 #include <top/dbobjects/TOPGeoPMT.h>
21 unsigned TOPGeoPMT::getPixelColumn(
double x)
const
24 if (fabs(x) >= m_sensSizeX / 2)
return 0;
25 return m_numColumns - int((x + m_sensSizeX / 2) / m_sensSizeX * m_numColumns);
29 unsigned TOPGeoPMT::getPixelRow(
double y)
const
32 if (fabs(y) >= m_sensSizeY / 2)
return 0;
33 return int((y + m_sensSizeY / 2) / m_sensSizeY * m_numRows) + 1;
36 unsigned TOPGeoPMT::getPixelID(
double x,
double y)
const
38 auto col = getPixelColumn(x);
39 if (col == 0)
return 0;
40 auto row = getPixelRow(y);
41 if (row == 0)
return 0;
43 return (row - 1) * m_numColumns + col;
47 double TOPGeoPMT::getX(
unsigned col)
const
49 return (
int)(m_numColumns + 1 - 2 * col) / 2.0 * getDx();
52 double TOPGeoPMT::getY(
unsigned row)
const
54 return (
int)(2 * row - m_numRows - 1) / 2.0 * getDy();
58 bool TOPGeoPMT::isConsistent()
const
60 if (m_sizeX <= 0)
return false;
61 if (m_sizeY <= 0)
return false;
62 if (m_sizeZ <= 0)
return false;
63 if (m_wallThickness <= 0)
return false;
65 if (m_sensSizeX <= 0)
return false;
66 if (m_sensSizeY <= 0)
return false;
67 if (m_sensThickness <= 0)
return false;
68 if (m_numColumns == 0)
return false;
69 if (m_numRows == 0)
return false;
70 if (m_sensMaterial.empty())
return false;
72 if (m_winThickness <= 0)
return false;
73 if (m_winMaterial.empty())
return false;
75 if (m_botThickness <= 0)
return false;
76 if (m_botMaterial.empty())
return false;
78 if (m_reflEdgeWidth <= 0)
return false;
79 if (m_reflEdgeThickness <= 0)
return false;
85 void TOPGeoPMT::print(
const std::string& title)
const
87 TOPGeoBase::print(title);
89 cout <<
" outer dimensions: " << getSizeX() <<
" X " << getSizeY()
90 <<
" X " << getSizeZ() <<
" " << s_unitName << endl;
91 cout <<
" wall thickness: " << getWallThickness() <<
" " << s_unitName << endl;
92 cout <<
" window thickness: " << getWinThickness() <<
" " << s_unitName << endl;
93 cout <<
" bottom thickness: " << getBotThickness() <<
" " << s_unitName << endl;
94 cout <<
" sensitive area: " << getSensSizeX() <<
" X " << getSensSizeY()
96 cout <<
", thickness: " << getSensThickness() <<
" " << s_unitName << endl;
97 cout <<
" number of pixels: " << getNumColumns() <<
" X " << getNumRows() << endl;
98 cout <<
" casing material: " << getWallMaterial() << endl;
99 cout <<
" inner material: " << getFillMaterial() << endl;
100 cout <<
" window material: " << getWinMaterial() << endl;
101 cout <<
" bottom material: " << getBotMaterial() << endl;
102 cout <<
" sensitive material: " << getSensMaterial() << endl;
103 cout <<
" reflective edge: " << endl;
104 cout <<
" - width: " << getReflEdgeWidth() <<
" " << s_unitName;
105 cout <<
", thickness: " << getReflEdgeThickness() <<
" " << s_unitName << endl;
107 printSurface(m_reflEdgeSurface);
Abstract base class for different kinds of events.