9 #include <arich/dbobjects/ARICHGeoHAPD.h>
15 void ARICHGeoHAPD::getXYChannelPos(
int chX,
int chY,
double& x,
double& y)
const
18 if (chX < m_nPadX / 2.) x = -m_chipGap / 2. + (chX - m_nPadX / 2.) * m_padSize + m_padSize / 2.;
19 else x = m_chipGap / 2. + (chX - m_nPadX / 2.) * m_padSize + m_padSize / 2.;
21 if (chY < m_nPadY / 2.) y = -m_chipGap / 2. + (chY - m_nPadY / 2.) * m_padSize + m_padSize / 2.;
22 else y = m_chipGap / 2. + (chY - m_nPadY / 2.) * m_padSize + m_padSize / 2.;
27 void ARICHGeoHAPD::getXYChannel(
double x,
double y,
int& chX,
int& chY)
const
30 if (x < - m_chipGap / 2.) chX = int((x + m_chipGap / 2.) / m_padSize) + m_nPadX / 2. - 1;
31 else if (x > m_chipGap / 2.) chX = (x - m_chipGap / 2.) / m_padSize + m_nPadX / 2.;
32 else {chX = -1; chY = -1;
return;}
34 if (y < - m_chipGap / 2.) chY = int((y + m_chipGap / 2.) / m_padSize) + m_nPadY / 2. - 1;
35 else if (y > m_chipGap / 2.) chY = (y - m_chipGap / 2.) / m_padSize + m_nPadY / 2.;
36 else {chX = -1; chY = -1;
return;}
38 if (chX + 1 >
int(m_nPadX) || chY + 1 > int(m_nPadY) || chX < 0 || chY < 0) {
45 unsigned ARICHGeoHAPD::getChipID(
double x,
double y)
const
56 bool ARICHGeoHAPD::isConsistent()
const
58 if (m_HAPDSizeX <= 0)
return false;
59 if (m_HAPDSizeY <= 0)
return false;
60 if (m_HAPDSizeZ <= 0)
return false;
61 if (m_wallThickness <= 0)
return false;
62 if (m_winThickness <= 0)
return false;
63 if (m_padSize <= 0)
return false;
64 if (m_nPadX == 0)
return false;
65 if (m_nPadY == 0)
return false;
66 if (m_APDSizeZ <= 0)
return false;
67 if (m_APDSizeX <= 0)
return false;
68 if (m_APDSizeY <= 0)
return false;
69 if (m_FEBSizeX <= 0)
return false;
70 if (m_FEBSizeY <= 0)
return false;
71 if (m_FEBSizeZ <= 0)
return false;
72 if (m_moduleSizeZ <= 0)
return false;
73 if (m_winRefIndex < 1.)
return false;
75 if (m_wallMaterial.empty())
return false;
76 if (m_winMaterial.empty())
return false;
77 if (m_apdMaterial.empty())
return false;
78 if (m_febMaterial.empty())
return false;
79 if (m_fillMaterial.empty())
return false;
85 void ARICHGeoHAPD::print(
const std::string& title)
const
87 ARICHGeoBase::print(title);
89 cout <<
" outer HAPD dimensions: " << getSizeX() <<
" X " << getSizeY() <<
" X " << getSizeZ() <<
" " << s_unitName << endl;
90 cout <<
" wall thickness: " << getWallThickness() <<
" " << s_unitName << endl;
91 cout <<
" window thickness: " << getWinThickness() <<
" " << s_unitName << endl;
92 cout <<
" pad size: " << getPadSize() <<
" " << s_unitName << endl;
93 cout <<
" number of pixels: " << getNumPadsX() <<
" X " << getNumPadsY() << endl;
94 cout <<
" gap between APD chips: " << getChipGap() <<
" " << s_unitName << endl;
95 cout <<
" APD dimensions: " << getAPDSizeX() <<
" X " << getAPDSizeY() <<
" X " << getAPDSizeZ() <<
" " << s_unitName <<
97 cout <<
" FEB dimensions: " << getFEBSizeX() <<
" X " << getFEBSizeY() <<
" X " << getFEBSizeZ() <<
" " << s_unitName <<
99 cout <<
" window ref. index: " << getWinRefIndex() << endl;
100 cout <<
" module height (Z): " << getModuleSizeZ() <<
" " << s_unitName << endl;
101 cout <<
" wall material: " << getWallMaterial() << endl;
102 cout <<
" window material: " << getWinMaterial() << endl;
103 cout <<
" HAPD fill material: " << getFillMaterial() << endl;
104 cout <<
" FEB material: " << getFEBMaterial() << endl;
105 cout <<
" APD material: " << getAPDMaterial() << endl;
108 printSurface(m_apdSurface);
Abstract base class for different kinds of events.