11 #include <arich/dbobjects/ARICHGeoAerogelPlane.h>
19 bool ARICHGeoAerogelPlane::isConsistent()
const
22 if (m_layers.size() == 0 || m_r.size() == 0 || m_dPhi.size() == 0)
return false;
23 if (m_tileGap < 0 || m_innerR < 0)
return false;
24 if (m_innerR > m_outerR)
return false;
25 if (m_thickness < 0 || m_wallThickness < 0 || m_wallHeight < 0)
return false;
27 if (abs(getWallHeight() - getLayerThickness(1) - getLayerThickness(2)) > 1.0e-10) {
28 cout <<
"getWallHeight() = " << getWallHeight() << endl
29 <<
"getLayerThickness(1) = " << getLayerThickness(1) << endl
30 <<
"getLayerThickness(2) = " << getLayerThickness(2) << endl;
31 cout <<
"getWallHeight() - getLayerThickness(1) - getLayerThickness(2) = "
32 << getWallHeight() - getLayerThickness(1) - getLayerThickness(2) << endl;
33 B2ERROR(
"Data of the ARICHGeoAerogelPlane is inconsisten : --> abs (getWallHeight() - getLayerThickness(1) - getLayerThickness(2)) > 1.0e-10");
36 if (getFullAerogelMaterialDescriptionKey() == 1) {
38 int nAeroSlotsPerRing[nn];
40 for (
int i = 0; i < nn; i++)
41 nAeroSlotsPerRing[i] = 0;
42 for (
unsigned i = 0; i < m_tiles.size(); i++)
43 if (m_tiles.at(i).layer == 0)
44 nAeroSlotsPerRing[m_tiles.at(i).ring - 1] += 1;
46 for (
unsigned i = 0; i < getNAeroSlotsIndividualRing().size(); i++) {
49 B2ASSERT(
"Data of the ARICHGeoAerogelPlane is inconsisten : --> getNAeroSlotsIndividualRing().at(i) != nAeroSlotsPerRing[i]",
50 getNAeroSlotsIndividualRing().at(i) == nAeroSlotsPerRing[i]);
57 void ARICHGeoAerogelPlane::print(
const std::string& title)
const
59 ARICHGeoBase::print(title);
61 cout <<
"Full aerogel material description key : " << getFullAerogelMaterialDescriptionKey() << endl;
63 cout <<
"Nume of aerogel rings and number of aerogel slots in individual ring " << endl;
65 cout << setw(5) <<
"Ring"
66 << setw(15) <<
"Aerogel slots" << endl;
67 for (
unsigned i = 0; i < getNAeroSlotsIndividualRing().size(); i++) {
68 cout << setw(5) << i + 1
69 << setw(15) << getNAeroSlotsIndividualRing().at(i) << endl;
72 cout <<
"Imaginary tube thikness just after aerogel layers : " << getImgTubeThickness() << endl;
73 cout <<
"Minimum thickness of the compensation volume with ARICH air : " << getCompensationARICHairVolumeThick_min() << endl;
75 cout <<
"Aerogel layers " << endl;
77 int nLayer = getNLayers();
78 for (
int iLayer = 1; iLayer < nLayer + 1; iLayer++) {
79 cout <<
" layer " << iLayer << endl;
80 cout <<
" thickness: " << getLayerThickness(iLayer) <<
" " << s_unitName <<
", ref. index: " << getLayerRefIndex(
81 iLayer) <<
", transm. length: " << getLayerTrLength(iLayer) <<
" " << s_unitName <<
", material: " << getLayerMaterial(
84 if (getFullAerogelMaterialDescriptionKey() == 1) {
85 cout <<
" Please note full aerogel material description key is set to 1 " << endl;
86 cout <<
" The name of each particular tile have this form : Aero1_serA090_rin4_col26 " << endl;
87 cout <<
" serialID = A090; ring = 4; column = 26; layer = up; " << endl;
88 cout <<
" The name of each particular tile have this form : Aero2_serB162_rin4_col14 " << endl;
89 cout <<
" serialID = B162; ring = 4 column = 15; layer = down; " << endl;
92 int nRing = getNRings();
93 cout <<
" Aluminum walls between tiles parameters" << endl;
94 cout <<
" thickness: " << getWallThickness() <<
" " << s_unitName << endl;
95 cout <<
" height: " << getWallHeight() <<
" " << s_unitName << endl;
96 for (
int iRing = 1; iRing < nRing + 1; iRing++) {
98 if (iRing < nRing) cout <<
" ring: " << iRing <<
" has inner radius of " << getRingRadius(iRing) <<
" " << s_unitName <<
" and "
99 <<
static_cast<int>(2 * M_PI / getRingDPhi(iRing) + 0.5) <<
" aerogel tile slots." << endl;
100 else cout <<
" ring: " << iRing <<
" has inner radius of " << getRingRadius(iRing) <<
" " << s_unitName <<
101 " (this is the outer ring)" << endl;
104 cout <<
" gap between tile and aluminum wall: " << getTileGap() <<
" " << s_unitName << endl;
105 cout <<
" inner radius of support plate: " << getSupportInnerR() <<
" " << s_unitName << endl;
106 cout <<
" outer radius of support plate: " << getSupportOuterR() <<
" " << s_unitName << endl;
107 cout <<
" thickness of support plate: " << getSupportThickness() <<
" " << s_unitName << endl;
108 cout <<
" material of support plate: " << getSupportMaterial() << endl;
110 cout <<
"Positioning parameters (in local ARICH frame)" << endl;
111 ARICHGeoBase::printPlacement(m_x, m_y, m_z, m_rx, m_ry, m_rz);
114 cout << endl <<
"Simple aerogel configuration is set!" << endl;
115 cout <<
" Parameters:" << endl;
116 cout <<
" xSize: " << m_simpleParams.at(0) <<
", ySize: " << m_simpleParams.at(1) <<
", xPos: " << m_simpleParams.at(
117 2) <<
", xPos: " << m_simpleParams.at(3) <<
", zRot: " << m_simpleParams.at(4) << endl;
122 unsigned ARICHGeoAerogelPlane::getAerogelTileID(
double x,
double y)
const
125 double r = sqrt(x * x + y * y);
128 for (
unsigned iRing = 0; iRing < getNRings(); iRing++) {
129 if (r > m_r[iRing] + m_wallThickness + m_tileGap) {
130 if (iRing == 0)
continue;
131 nTile +=
static_cast<int>(2 * M_PI / m_dPhi[iRing - 1] + 0.5);
133 if (iRing == 0)
return 0;
134 if (r > m_r[iRing] - m_tileGap)
return 0;
135 double phi = atan2(y, x);
136 if (phi < 0) phi += 2 * M_PI;
137 int nphi =
static_cast<int>(phi / m_dPhi[iRing - 1]);
138 double gapPhi = (m_tileGap + m_wallThickness / 2.) / m_r[iRing];
139 if (phi < nphi * m_dPhi[iRing - 1] + gapPhi || phi > (nphi + 1)* m_dPhi[iRing - 1] - gapPhi)
return 0;
148 unsigned ARICHGeoAerogelPlane::getTileParameters(
int ring,
int column,
int layerN,
double& n,
double& transmL,
double& thick,
149 std::string& material)
const
154 material = (
char*)
"NULL";
155 for (
unsigned i = 0; i < m_tiles.size(); i++) {
156 if (m_tiles.at(i).ring == ring) {
157 if (m_tiles.at(i).column == column) {
158 if (m_tiles.at(i).layer == layerN) {
160 transmL = m_tiles.at(i).transmL;
161 thick = m_tiles.at(i).thick;
162 material = m_tiles.at(i).material;
168 B2WARNING(
"ARICHGeoAerogelPlane::getTileParameters --> tile position does not exist " << endl
169 <<
"ring = " << ring << endl
170 <<
"column = " << column << endl
171 <<
"layerN = " << layerN << endl);
172 B2ASSERT(
"ARICHGeoAerogelPlane::getTileParameters --> tile position does not exist",
false);
176 double ARICHGeoAerogelPlane::getTileThickness(
int ring,
int column,
int layerN)
const
178 for (
unsigned i = 0; i < m_tiles.size(); i++)
179 if (m_tiles.at(i).ring == ring)
180 if (m_tiles.at(i).column == column)
181 if (m_tiles.at(i).layer == layerN)
182 return m_tiles.at(i).thick;
183 B2WARNING(
"ARICHGeoAerogelPlane::getTileThickness --> tile position does not exist " << endl
184 <<
"ring = " << ring << endl
185 <<
"column = " << column << endl
186 <<
"layerN = " << layerN << endl);
187 B2ASSERT(
"ARICHGeoAerogelPlane::getTileParameters --> tile position does not exist",
false);
191 std::string ARICHGeoAerogelPlane::getTileMaterialName(
int ring,
int column,
int layerN)
const
193 for (
unsigned i = 0; i < m_tiles.size(); i++)
194 if (m_tiles.at(i).ring == ring)
195 if (m_tiles.at(i).column == column)
196 if (m_tiles.at(i).layer == layerN)
197 return m_tiles.at(i).material;
198 B2WARNING(
"ARICHGeoAerogelPlane::getTileThickness --> tile position does not exist " << endl
199 <<
"ring = " << ring << endl
200 <<
"column = " << column << endl
201 <<
"layerN = " << layerN << endl);
202 B2ASSERT(
"ARICHGeoAerogelPlane::getTileParameters --> tile position does not exist",
false);
206 double ARICHGeoAerogelPlane::getTotalTileThickness(
int ring,
int column)
const
212 std::string materialName;
213 getTileParameters(ring, column, 0, n, transmL, thickUp, materialName);
214 getTileParameters(ring, column, 1, n, transmL, thickDown, materialName);
220 return thickUp + thickDown;
223 double ARICHGeoAerogelPlane::getMaximumTotalTileThickness()
const
225 double maxThick = 0.0;
228 for (
unsigned iR = 0; iR < getNAeroSlotsIndividualRing().size(); iR++) {
230 for (
int iS = 0; iS < getNAeroSlotsIndividualRing().at(iR); iS++) {
231 double athick = getTotalTileThickness(iRi + 1, iS + 1);
232 if (maxThick < athick)
239 void ARICHGeoAerogelPlane::printTileParameters(
const std::string& title)
const
241 ARICHGeoBase::print(title);
242 cout << setw(5) <<
"i"
243 << setw(10) <<
"ring"
244 << setw(10) <<
"column"
245 << setw(10) <<
"layer"
247 << setw(12) <<
"transmL"
248 << setw(12) <<
"thick"
249 << setw(30) <<
"material" << endl;
250 for (
unsigned i = 0; i < m_tiles.size(); i++) {
252 << setw(10) << m_tiles.at(i).ring
253 << setw(10) << m_tiles.at(i).column
254 << setw(10) << m_tiles.at(i).layer
255 << setw(12) << m_tiles.at(i).n
256 << setw(12) << m_tiles.at(i).transmL
257 << setw(12) << m_tiles.at(i).thick
258 << setw(30) << m_tiles.at(i).material << endl;
262 void ARICHGeoAerogelPlane::printSingleTileParameters(
unsigned i)
const
264 cout <<
"ARICHGeoAerogelPlane::printSingleTileParameters" << endl;
265 B2ASSERT(
"Aerogel tile property entry does not exist i >= m_tiles.size() ", i < m_tiles.size());
266 cout << setw(5) <<
"i"
267 << setw(10) <<
"ring"
268 << setw(10) <<
"column"
269 << setw(10) <<
"layer"
271 << setw(12) <<
"transmL"
272 << setw(12) <<
"thick"
273 << setw(30) <<
"material" << endl;
275 << setw(10) << m_tiles.at(i).ring
276 << setw(10) << m_tiles.at(i).column
277 << setw(10) << m_tiles.at(i).layer
278 << setw(12) << m_tiles.at(i).n
279 << setw(12) << m_tiles.at(i).transmL
280 << setw(12) << m_tiles.at(i).thick
281 << setw(30) << m_tiles.at(i).material << endl;
284 void ARICHGeoAerogelPlane::testGetTileParametersFunction()
const
292 std::string materialName;
293 printSingleTileParameters(getTileParameters(ring, column, layerN, n, transmL, thick, materialName));
297 printSingleTileParameters(getTileParameters(ring, column, layerN, n, transmL, thick, materialName));
301 printSingleTileParameters(getTileParameters(ring, column, layerN, n, transmL, thick, materialName));
305 printSingleTileParameters(getTileParameters(ring, column, layerN, n, transmL, thick, materialName));
309 printSingleTileParameters(getTileParameters(ring, column, layerN, n, transmL, thick, materialName));