9 #include <arich/dbobjects/ARICHGeoAerogelPlane.h>
17 bool ARICHGeoAerogelPlane::isConsistent()
const
20 if (m_layers.size() == 0 || m_r.size() == 0 || m_dPhi.size() == 0)
return false;
21 if (m_tileGap < 0 || m_innerR < 0)
return false;
22 if (m_innerR > m_outerR)
return false;
23 if (m_thickness < 0 || m_wallThickness < 0 || m_wallHeight < 0)
return false;
25 if (abs(getWallHeight() - getLayerThickness(1) - getLayerThickness(2)) > 1.0e-10) {
26 cout <<
"getWallHeight() = " << getWallHeight() << endl
27 <<
"getLayerThickness(1) = " << getLayerThickness(1) << endl
28 <<
"getLayerThickness(2) = " << getLayerThickness(2) << endl;
29 cout <<
"getWallHeight() - getLayerThickness(1) - getLayerThickness(2) = "
30 << getWallHeight() - getLayerThickness(1) - getLayerThickness(2) << endl;
31 B2ERROR(
"Data of the ARICHGeoAerogelPlane is inconsisten : --> abs (getWallHeight() - getLayerThickness(1) - getLayerThickness(2)) > 1.0e-10");
34 if (getFullAerogelMaterialDescriptionKey() == 1) {
36 int nAeroSlotsPerRing[nn];
38 for (
int i = 0; i < nn; i++)
39 nAeroSlotsPerRing[i] = 0;
40 for (
unsigned i = 0; i < m_tiles.size(); i++)
41 if (m_tiles.at(i).layer == 0)
42 nAeroSlotsPerRing[m_tiles.at(i).ring - 1] += 1;
44 for (
unsigned i = 0; i < getNAeroSlotsIndividualRing().size(); i++) {
47 B2ASSERT(
"Data of the ARICHGeoAerogelPlane is inconsisten : --> getNAeroSlotsIndividualRing().at(i) != nAeroSlotsPerRing[i]",
48 getNAeroSlotsIndividualRing().at(i) == nAeroSlotsPerRing[i]);
55 void ARICHGeoAerogelPlane::print(
const std::string& title)
const
57 ARICHGeoBase::print(title);
59 cout <<
"Full aerogel material description key : " << getFullAerogelMaterialDescriptionKey() << endl;
61 cout <<
"Nume of aerogel rings and number of aerogel slots in individual ring " << endl;
63 cout << setw(5) <<
"Ring"
64 << setw(15) <<
"Aerogel slots" << endl;
65 for (
unsigned i = 0; i < getNAeroSlotsIndividualRing().size(); i++) {
66 cout << setw(5) << i + 1
67 << setw(15) << getNAeroSlotsIndividualRing().at(i) << endl;
70 cout <<
"Imaginary tube thikness just after aerogel layers : " << getImgTubeThickness() << endl;
71 cout <<
"Minimum thickness of the compensation volume with ARICH air : " << getCompensationARICHairVolumeThick_min() << endl;
73 cout <<
"Aerogel layers " << endl;
75 int nLayer = getNLayers();
76 for (
int iLayer = 1; iLayer < nLayer + 1; iLayer++) {
77 cout <<
" layer " << iLayer << endl;
78 cout <<
" thickness: " << getLayerThickness(iLayer) <<
" " << s_unitName <<
", ref. index: " << getLayerRefIndex(
79 iLayer) <<
", transm. length: " << getLayerTrLength(iLayer) <<
" " << s_unitName <<
", material: " << getLayerMaterial(
82 if (getFullAerogelMaterialDescriptionKey() == 1) {
83 cout <<
" Please note full aerogel material description key is set to 1 " << endl;
84 cout <<
" The name of each particular tile have this form : Aero1_serA090_rin4_col26 " << endl;
85 cout <<
" serialID = A090; ring = 4; column = 26; layer = up; " << endl;
86 cout <<
" The name of each particular tile have this form : Aero2_serB162_rin4_col14 " << endl;
87 cout <<
" serialID = B162; ring = 4 column = 15; layer = down; " << endl;
90 int nRing = getNRings();
91 cout <<
" Aluminum walls between tiles parameters" << endl;
92 cout <<
" thickness: " << getWallThickness() <<
" " << s_unitName << endl;
93 cout <<
" height: " << getWallHeight() <<
" " << s_unitName << endl;
94 for (
int iRing = 1; iRing < nRing + 1; iRing++) {
96 if (iRing < nRing) cout <<
" ring: " << iRing <<
" has inner radius of " << getRingRadius(iRing) <<
" " << s_unitName <<
" and "
97 <<
static_cast<int>(2 * M_PI / getRingDPhi(iRing) + 0.5) <<
" aerogel tile slots." << endl;
98 else cout <<
" ring: " << iRing <<
" has inner radius of " << getRingRadius(iRing) <<
" " << s_unitName <<
99 " (this is the outer ring)" << endl;
102 cout <<
" gap between tile and aluminum wall: " << getTileGap() <<
" " << s_unitName << endl;
103 cout <<
" inner radius of support plate: " << getSupportInnerR() <<
" " << s_unitName << endl;
104 cout <<
" outer radius of support plate: " << getSupportOuterR() <<
" " << s_unitName << endl;
105 cout <<
" thickness of support plate: " << getSupportThickness() <<
" " << s_unitName << endl;
106 cout <<
" material of support plate: " << getSupportMaterial() << endl;
108 cout <<
"Positioning parameters (in local ARICH frame)" << endl;
109 ARICHGeoBase::printPlacement(m_x, m_y, m_z, m_rx, m_ry, m_rz);
112 cout << endl <<
"Simple aerogel configuration is set!" << endl;
113 cout <<
" Parameters:" << endl;
114 cout <<
" xSize: " << m_simpleParams.at(0) <<
", ySize: " << m_simpleParams.at(1) <<
", xPos: " << m_simpleParams.at(
115 2) <<
", xPos: " << m_simpleParams.at(3) <<
", zRot: " << m_simpleParams.at(4) << endl;
120 unsigned ARICHGeoAerogelPlane::getAerogelTileID(
double x,
double y)
const
123 double r =
sqrt(x * x + y * y);
126 for (
unsigned iRing = 0; iRing < getNRings(); iRing++) {
127 if (r > m_r[iRing] + m_wallThickness + m_tileGap) {
128 if (iRing == 0)
continue;
129 nTile +=
static_cast<int>(2 * M_PI / m_dPhi[iRing - 1] + 0.5);
131 if (iRing == 0)
return 0;
132 if (r > m_r[iRing] - m_tileGap)
return 0;
133 double phi = atan2(y, x);
134 if (phi < 0) phi += 2 * M_PI;
135 int nphi =
static_cast<int>(phi / m_dPhi[iRing - 1]);
136 double gapPhi = (m_tileGap + m_wallThickness / 2.) / m_r[iRing];
137 if (phi < nphi * m_dPhi[iRing - 1] + gapPhi || phi > (nphi + 1)* m_dPhi[iRing - 1] - gapPhi)
return 0;
146 unsigned ARICHGeoAerogelPlane::getTileParameters(
int ring,
int column,
int layerN,
double& n,
double& transmL,
double& thick,
147 std::string& material)
const
152 material = (
char*)
"NULL";
153 for (
unsigned i = 0; i < m_tiles.size(); i++) {
154 if (m_tiles.at(i).ring == ring) {
155 if (m_tiles.at(i).column == column) {
156 if (m_tiles.at(i).layer == layerN) {
158 transmL = m_tiles.at(i).transmL;
159 thick = m_tiles.at(i).thick;
160 material = m_tiles.at(i).material;
166 B2WARNING(
"ARICHGeoAerogelPlane::getTileParameters --> tile position does not exist " << endl
167 <<
"ring = " << ring << endl
168 <<
"column = " << column << endl
169 <<
"layerN = " << layerN << endl);
170 B2ASSERT(
"ARICHGeoAerogelPlane::getTileParameters --> tile position does not exist",
false);
174 double ARICHGeoAerogelPlane::getTileThickness(
int ring,
int column,
int layerN)
const
176 for (
unsigned i = 0; i < m_tiles.size(); i++)
177 if (m_tiles.at(i).ring == ring)
178 if (m_tiles.at(i).column == column)
179 if (m_tiles.at(i).layer == layerN)
180 return m_tiles.at(i).thick;
181 B2WARNING(
"ARICHGeoAerogelPlane::getTileThickness --> tile position does not exist " << endl
182 <<
"ring = " << ring << endl
183 <<
"column = " << column << endl
184 <<
"layerN = " << layerN << endl);
185 B2ASSERT(
"ARICHGeoAerogelPlane::getTileParameters --> tile position does not exist",
false);
189 std::string ARICHGeoAerogelPlane::getTileMaterialName(
int ring,
int column,
int layerN)
const
191 for (
unsigned i = 0; i < m_tiles.size(); i++)
192 if (m_tiles.at(i).ring == ring)
193 if (m_tiles.at(i).column == column)
194 if (m_tiles.at(i).layer == layerN)
195 return m_tiles.at(i).material;
196 B2WARNING(
"ARICHGeoAerogelPlane::getTileThickness --> tile position does not exist " << endl
197 <<
"ring = " << ring << endl
198 <<
"column = " << column << endl
199 <<
"layerN = " << layerN << endl);
200 B2ASSERT(
"ARICHGeoAerogelPlane::getTileParameters --> tile position does not exist",
false);
204 double ARICHGeoAerogelPlane::getTotalTileThickness(
int ring,
int column)
const
210 std::string materialName;
211 getTileParameters(ring, column, 0, n, transmL, thickUp, materialName);
212 getTileParameters(ring, column, 1, n, transmL, thickDown, materialName);
218 return thickUp + thickDown;
221 double ARICHGeoAerogelPlane::getMaximumTotalTileThickness()
const
223 double maxThick = 0.0;
226 for (
unsigned iR = 0; iR < getNAeroSlotsIndividualRing().size(); iR++) {
228 for (
int iS = 0; iS < getNAeroSlotsIndividualRing().at(iR); iS++) {
229 double athick = getTotalTileThickness(iRi + 1, iS + 1);
230 if (maxThick < athick)
237 void ARICHGeoAerogelPlane::printTileParameters(
const std::string& title)
const
239 ARICHGeoBase::print(title);
240 cout << setw(5) <<
"i"
241 << setw(10) <<
"ring"
242 << setw(10) <<
"column"
243 << setw(10) <<
"layer"
245 << setw(12) <<
"transmL"
246 << setw(12) <<
"thick"
247 << setw(30) <<
"material" << endl;
248 for (
unsigned i = 0; i < m_tiles.size(); i++) {
250 << setw(10) << m_tiles.at(i).ring
251 << setw(10) << m_tiles.at(i).column
252 << setw(10) << m_tiles.at(i).layer
253 << setw(12) << m_tiles.at(i).n
254 << setw(12) << m_tiles.at(i).transmL
255 << setw(12) << m_tiles.at(i).thick
256 << setw(30) << m_tiles.at(i).material << endl;
260 void ARICHGeoAerogelPlane::printSingleTileParameters(
unsigned i)
const
262 cout <<
"ARICHGeoAerogelPlane::printSingleTileParameters" << endl;
263 B2ASSERT(
"Aerogel tile property entry does not exist i >= m_tiles.size() ", i < m_tiles.size());
264 cout << setw(5) <<
"i"
265 << setw(10) <<
"ring"
266 << setw(10) <<
"column"
267 << setw(10) <<
"layer"
269 << setw(12) <<
"transmL"
270 << setw(12) <<
"thick"
271 << setw(30) <<
"material" << endl;
273 << setw(10) << m_tiles.at(i).ring
274 << setw(10) << m_tiles.at(i).column
275 << setw(10) << m_tiles.at(i).layer
276 << setw(12) << m_tiles.at(i).n
277 << setw(12) << m_tiles.at(i).transmL
278 << setw(12) << m_tiles.at(i).thick
279 << setw(30) << m_tiles.at(i).material << endl;
282 void ARICHGeoAerogelPlane::testGetTileParametersFunction()
const
290 std::string materialName;
291 printSingleTileParameters(getTileParameters(ring, column, layerN, n, transmL, thick, materialName));
295 printSingleTileParameters(getTileParameters(ring, column, layerN, n, transmL, thick, materialName));
299 printSingleTileParameters(getTileParameters(ring, column, layerN, n, transmL, thick, materialName));
303 printSingleTileParameters(getTileParameters(ring, column, layerN, n, transmL, thick, materialName));
307 printSingleTileParameters(getTileParameters(ring, column, layerN, n, transmL, thick, materialName));
double sqrt(double a)
sqrt for double
Abstract base class for different kinds of events.