Belle II Software development
ARICHGeoHAPD.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#include <arich/dbobjects/ARICHGeoHAPD.h>
10#include <iostream>
11
12using namespace std;
13using namespace Belle2;
14
15void ARICHGeoHAPD::getXYChannelPos(int chX, int chY, double& x, double& y) const
16{
17
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.;
20
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.;
23
24}
25
26
27void ARICHGeoHAPD::getXYChannel(double x, double y, int& chX, int& chY) const
28{
29
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;}
33
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;}
37
38 if (chX + 1 > int(m_nPadX) || chY + 1 > int(m_nPadY) || chX < 0 || chY < 0) {
39 chX = -1; chY = -1;
40 }
41
42}
43
44
45unsigned ARICHGeoHAPD::getChipID(double x, double y) const
46{
47 if (x > 0) {
48 if (y > 0) return 0;
49 return 1;
50 }
51 if (y > 0) return 2;
52 return 3;
53}
54
55
57{
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;
74
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;
80
81 return true;
82}
83
84
85void ARICHGeoHAPD::print(const std::string& title) const
86{
88
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 <<
96 endl;
97 cout << " FEB dimensions: " << getFEBSizeX() << " X " << getFEBSizeY() << " X " << getFEBSizeZ() << " " << s_unitName <<
98 endl;
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;
106
107 // add material names!
109}
virtual void printSurface(const GeoOpticalSurface &surface) const
Print the content of optical surface.
Definition: ARICHGeoBase.cc:32
virtual void print(const std::string &title) const
Print the content of the class.
Definition: ARICHGeoBase.cc:20
static std::string s_unitName
conversion unit name
Definition: ARICHGeoBase.h:84
double m_moduleSizeZ
HAPD module Z size (HAPD + FEB height)
Definition: ARICHGeoHAPD.h:369
double getSizeZ() const
Returns HAPD size in z.
Definition: ARICHGeoHAPD.h:174
const std::string & getFEBMaterial() const
Returns FEB material name.
Definition: ARICHGeoHAPD.h:289
double m_APDSizeY
APD Y size.
Definition: ARICHGeoHAPD.h:364
double getChipGap() const
Returns gap between APD chips.
Definition: ARICHGeoHAPD.h:246
bool isConsistent() const override
Check consistency of geometry parameters.
Definition: ARICHGeoHAPD.cc:56
std::string m_febMaterial
material of FEB
Definition: ARICHGeoHAPD.h:351
double m_padSize
pad size
Definition: ARICHGeoHAPD.h:358
void print(const std::string &title="HAPD module geometry parameters") const override
Print the content of the class.
Definition: ARICHGeoHAPD.cc:85
double getPadSize() const
Returns APD pad size.
Definition: ARICHGeoHAPD.h:240
double m_chipGap
gap between APD chips
Definition: ARICHGeoHAPD.h:359
std::string m_wallMaterial
material of HAPD side walls
Definition: ARICHGeoHAPD.h:348
double m_HAPDSizeZ
HAPD Z size.
Definition: ARICHGeoHAPD.h:355
std::string m_fillMaterial
material that fills the HAPD
Definition: ARICHGeoHAPD.h:352
unsigned getNumPadsY() const
Returns number of Y pads.
Definition: ARICHGeoHAPD.h:258
double m_FEBSizeZ
FEB Z size.
Definition: ARICHGeoHAPD.h:368
unsigned m_nPadX
number of pads in X
Definition: ARICHGeoHAPD.h:360
unsigned getChipID(double x, double y) const
Returns APD chip ID from from local x,y position.
Definition: ARICHGeoHAPD.cc:45
double getAPDSizeZ() const
Returns APD size in z.
Definition: ARICHGeoHAPD.h:204
std::string m_winMaterial
material of HAPD window
Definition: ARICHGeoHAPD.h:349
double getWinRefIndex() const
Returns window refractive index.
Definition: ARICHGeoHAPD.h:234
double getWinThickness() const
Returns window thickness.
Definition: ARICHGeoHAPD.h:186
const std::string & getAPDMaterial() const
Returns APD material name.
Definition: ARICHGeoHAPD.h:283
double m_winRefIndex
window refractive index
Definition: ARICHGeoHAPD.h:362
void getXYChannel(double x, double y, int &chX, int &chY) const
Returns X and Y channel number from local x,y position.
Definition: ARICHGeoHAPD.cc:27
double m_APDSizeX
APD X size.
Definition: ARICHGeoHAPD.h:363
double m_FEBSizeX
FEB X size.
Definition: ARICHGeoHAPD.h:366
const std::string & getWallMaterial() const
Returns wall (casing) material name.
Definition: ARICHGeoHAPD.h:265
const std::string & getFillMaterial() const
Returns fill (inside) material name.
Definition: ARICHGeoHAPD.h:271
unsigned getNumPadsX() const
Returns number of X pads.
Definition: ARICHGeoHAPD.h:252
double getSizeX() const
Returns HAPD size in x.
Definition: ARICHGeoHAPD.h:162
double getSizeY() const
Returns HAPD size in y.
Definition: ARICHGeoHAPD.h:168
double getFEBSizeY() const
Returns FEB size in y.
Definition: ARICHGeoHAPD.h:216
double getWallThickness() const
Returns wall thickness.
Definition: ARICHGeoHAPD.h:180
double getFEBSizeZ() const
Returns FEB size in z.
Definition: ARICHGeoHAPD.h:222
double m_wallThickness
HAPD side wall thickness.
Definition: ARICHGeoHAPD.h:356
GeoOpticalSurface m_apdSurface
optical surface of APD (for reflectivity)
Definition: ARICHGeoHAPD.h:370
double m_HAPDSizeX
HAPD X size.
Definition: ARICHGeoHAPD.h:353
const std::string & getWinMaterial() const
Returns window material name.
Definition: ARICHGeoHAPD.h:277
std::string m_apdMaterial
material of APD chips
Definition: ARICHGeoHAPD.h:350
double getModuleSizeZ() const
Returns module size in z (HAPD + FEB height)
Definition: ARICHGeoHAPD.h:228
double m_FEBSizeY
FEB Y size.
Definition: ARICHGeoHAPD.h:367
double getAPDSizeY() const
Returns APD size in y.
Definition: ARICHGeoHAPD.h:198
double getFEBSizeX() const
Returns FEB size in x.
Definition: ARICHGeoHAPD.h:210
void getXYChannelPos(int chX, int chY, double &x, double &y) const
Returns local x,y position from channel X,Y numbers.
Definition: ARICHGeoHAPD.cc:15
double getAPDSizeX() const
Returns APD size in x.
Definition: ARICHGeoHAPD.h:192
double m_HAPDSizeY
HAPD Y size.
Definition: ARICHGeoHAPD.h:354
double m_APDSizeZ
APD Z size.
Definition: ARICHGeoHAPD.h:365
unsigned m_nPadY
number of pads in Y
Definition: ARICHGeoHAPD.h:361
double m_winThickness
HAPD window thickness.
Definition: ARICHGeoHAPD.h:357
Abstract base class for different kinds of events.
STL namespace.