Belle II Software development
ARICHGeoAerogelPlane.h
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#pragma once
10#include <framework/logging/Logger.h>
11
12#include <arich/dbobjects/ARICHGeoBase.h>
13#include <string>
14#include <Math/Vector3D.h>
15#include <Math/Rotation3D.h>
16#include <Math/RotationX.h>
17#include <Math/RotationY.h>
18#include <Math/RotationZ.h>
19
20namespace Belle2 {
30
31 public:
32
37 {}
38
43 struct layer {
44
46 double thickness;
47
49 double refIndex;
50
52 double trLength;
53
55 std::string material;
56
57 };
58
64 struct tilestr {
65
67 int ring;
68
70 int column;
71
73 int layer;
74
76 double n;
77
79 double transmL;
80
82 double thick;
83
85 std::string material;
86
87 };
88
93 bool isConsistent() const override;
94
99 void print(const std::string& title = "Aerogel plane parameters:") const override;
100
110 void setPlacement(double x, double y, double z, double rx, double ry, double rz) {m_x = x; m_y = y; m_z = z; m_rx = rx; m_ry = ry; m_rz = rz;}
111
119 void addSupportPlate(double inR, double outR, double thick, const std::string& material)
120 {
121 m_innerR = inR;
122 m_outerR = outR;
123 m_thickness = thick;
124 m_supportMaterial = material;
125 };
126
131 void setWallThickness(double thick) {m_wallThickness = thick;}
132
137 void setWallHeight(double height) {m_wallHeight = height;}
138
143 void setTileGap(double gap) {m_tileGap = gap;}
144
169 void addTileParameters(int ring, int column, int layerN, double n, double transmL, double thick, const std::string& material)
170 {
171 m_tiles.push_back({ ring, column, layerN, n, transmL, thick, material });
172 }
173
178 ROOT::Math::XYZVector getPosition() const {return ROOT::Math::XYZVector(m_x / s_unit, m_y / s_unit, m_z / s_unit);}
179
184 ROOT::Math::Rotation3D getRotation() const
185 {
186 ROOT::Math::Rotation3D rot;
187 ROOT::Math::RotationX rotX(m_rx);
188 ROOT::Math::RotationY rotY(m_ry);
189 ROOT::Math::RotationZ rotZ(m_rz);
190 rot *= rotZ * rotY * rotX;
191 return rot;
192 }
193
198 double getRotationX() const {return m_rx;}
199
204 double getRotationY() const {return m_ry;}
205
210 double getRotationZ() const {return m_rz;}
211
216 double getSupportInnerR() const {return m_innerR / s_unit;};
217
222 double getSupportOuterR() const {return m_outerR / s_unit;};
223
228 double getSupportThickness() const {return m_thickness / s_unit;};
229
234 double getWallThickness() const {return m_wallThickness / s_unit;};
235
240 double getWallHeight() const {return m_wallHeight / s_unit;};
241
246 double getTileGap() const {return m_tileGap / s_unit;};
247
252 const std::string& getSupportMaterial() const {return m_supportMaterial;}
253
261 void setWallRadius(std::vector<double>& rs) { m_r = rs; m_rSize = rs.size();}
262
268 void setWallDPhi(std::vector<double>& dphi) { m_dPhi = dphi; m_dPhiSize = dphi.size();}
269
288 void setAerogelLayer(unsigned ilayer, double thick, double rIndex, double trLen, const std::string& material)
289 {
290 if (ilayer == m_nLayers + 1) {
291 m_layers.push_back({thick, rIndex, trLen, material});
292 m_nLayers++;
293 } else if (ilayer < m_nLayers + 1) {
294 m_layers[ilayer - 1] = {thick, rIndex, trLen, material};
295 } else B2ERROR("ARICHGeoAerogelPlane::setAerogelLayer: please set aerogel layers in consecutive order!");
296 }
297
304 void setNAeroSlotsIndividualRing(const std::vector<int>& nAeroSlotsIndividualRing) { m_nAeroSlotsIndividualRing = nAeroSlotsIndividualRing; }
305
310 unsigned getNLayers() const {return m_nLayers;}
311
316 unsigned getNRings() const {return m_rSize;}
317
324 double getRingRadius(unsigned iRing) const { if (iRing > m_rSize || iRing == 0) B2ERROR("ARICHGeoAerogelPlane: invalid ring number!"); return m_r[iRing - 1] / s_unit;}
325
332 double getRingDPhi(unsigned iRing) const { if (iRing > m_rSize || iRing == 0) B2ERROR("ARICHGeoAerogelPlane: invalid ring number!"); return m_dPhi[iRing - 1];}
333
339 double getLayerThickness(unsigned iLayer) const {if (iLayer > m_nLayers || iLayer == 0) B2ERROR("ARICHGeoAerogelPlane: invalid aerogel layer number!"); return m_layers[iLayer - 1].thickness / s_unit;}
340
346 double getLayerRefIndex(unsigned iLayer) const { if (iLayer > m_nLayers || iLayer == 0) B2ERROR("ARICHGeoAerogelPlane: invalid aerogel layer number!"); return m_layers[iLayer - 1].refIndex;}
347
353 double getLayerTrLength(unsigned iLayer) const { if (iLayer > m_nLayers || iLayer == 0) B2ERROR("ARICHGeoAerogelPlane: invalid aerogel layer number!"); return m_layers[iLayer - 1].trLength / s_unit;}
354
360 const std::string& getLayerMaterial(unsigned iLayer) const { if (iLayer > m_nLayers || iLayer == 0) B2ERROR("ARICHGeoAerogelPlane: invalid aerogel layer number!"); return m_layers[iLayer - 1].material;}
361
369 unsigned getAerogelTileID(double x, double y) const;
370
377 void setSimple(std::vector<double>& params)
378 {
379 if (params.size() != 5) B2ERROR("ARICHGeoAerogelPlane:setSimple: 5 parameters are needed for simple configuration!");
380 m_simple = true;
381 m_simpleParams = params;
382 }
383
388 bool isSimple() const
389 {
390 return m_simple;
391 }
392
397 const std::vector<double>& getSimpleParams() const
398 {
399 return m_simpleParams;
400 }
401
406 const std::vector<int>& getNAeroSlotsIndividualRing() const
407 {
409 }
410
415 double getAerogelZPosition() const
416 {
417 return m_z / s_unit - (m_wallHeight / s_unit - m_thickness / s_unit) / 2.;
418 }
419
429 void setFullAerogelMaterialDescriptionKey(int fullAerogelMaterialDescriptionKey)
430 {
431 m_fullAerogelMaterialDescriptionKey = fullAerogelMaterialDescriptionKey;
432 }
433
442 {
444 }
445
472 unsigned getTileParameters(int ring, int column, int layerN, double& n, double& transmL, double& thick,
473 std::string& material) const;
474
489 double getTileThickness(int ring, int column, int layerN) const;
490
505 std::string getTileMaterialName(int ring, int column, int layerN) const;
506
514 double getTotalTileThickness(int ring, int column) const;
515
522 double getMaximumTotalTileThickness() const;
523
529 void setImgTubeThickness(double imgTubeThickness)
530 {
531 m_imgTubeThickness = imgTubeThickness;
532 }
533
539 double getImgTubeThickness() const
540 {
541 return m_imgTubeThickness;
542 }
543
550 void setCompensationARICHairVolumeThick_min(double compensationARICHairVolumeThick_min)
551 {
552 m_compensationARICHairVolumeThick_min = compensationARICHairVolumeThick_min;
553 }
554
560 {
562 }
563
570 void printTileParameters(const std::string& title = "Aerogel tiles parameters:") const;
571
578 void printSingleTileParameters(unsigned i) const;
579
584
585 private:
586
587 // position in local ARICH volume
588 double m_x = 0;
589 double m_y = 0;
590 double m_z = 0;
591 // rotations in local ARICH volume
592 double m_rx = 0;
593 double m_ry = 0;
594 double m_rz = 0;
596 std::vector<double> m_r;
597 std::vector<double> m_dPhi;
598 std::vector<int> m_nAeroSlotsIndividualRing;
600 std::vector<layer> m_layers;
601 std::vector<tilestr> m_tiles;
603 double m_tileGap = 0;
605 // support structure parameters
606 std::string m_supportMaterial;
607 double m_innerR = 0;
608 double m_outerR = 0;
609 double m_thickness = 0;
610 double m_wallThickness = 0;
611 double m_wallHeight = 0;
613 unsigned m_rSize = 0;
614 unsigned m_dPhiSize = 0;
615 unsigned m_nLayers = 0;
617 bool m_simple = 0;
618 std::vector<double> m_simpleParams;
621 0;
624 0.0;
630 };
631
633} // end namespace Belle2
Geometry parameters of HAPD.
void setTileGap(double gap)
Set gap between aerogel tile and aluminum wall.
double getAerogelZPosition() const
Get starting Z position of first aerogel layer.
std::vector< double > m_r
"r" aluminum wall radiuses
double m_tileGap
gap between aerogel tiles and aluminum walls
bool isConsistent() const override
Consistency check of geometry parameters.
const std::vector< double > & getSimpleParams() const
Get parameters of simple aerogel configuration.
bool isSimple() const
Use simple aerogel configuration.
std::vector< int > m_nAeroSlotsIndividualRing
Number of aerogel slots in individual ring.
double getLayerThickness(unsigned iLayer) const
Get thickness of tiles in i-th aerogel layer.
ClassDefOverride(ARICHGeoAerogelPlane, 3)
ClassDef.
void setNAeroSlotsIndividualRing(const std::vector< int > &nAeroSlotsIndividualRing)
Set vector of numbers of aerogel slots in individual ring.
double m_innerR
inner radius of support plate
double getSupportThickness() const
Get support-plate thickness.
unsigned getNRings() const
Get number of aluminum wall rings (should be number of tile rings + 1).
double getSupportOuterR() const
Get support-plate outer radius.
std::vector< tilestr > m_tiles
parameters of the individual aerogel tiles
double getCompensationARICHairVolumeThick_min() const
Get minimum thickness of the compensation volume with ARICH air.
void setWallHeight(double height)
Set height of aluminum walls between aerogel tiles.
void printSingleTileParameters(unsigned i) const
Print the content of the single tilestr structure.
std::vector< double > m_dPhi
"phi" aluminum wall distances in tile ring
double getImgTubeThickness() const
Get imaginary tube thikness just after aerogel layers used as volume to which tracks are extrapolated...
double getWallHeight() const
Get height of aluminum walls between aerogel tiles.
std::vector< double > m_simpleParams
vector of simple parameters
double m_ry
rotation around y-axis
void print(const std::string &title="Aerogel plane parameters:") const override
Print the content of the class.
std::string m_supportMaterial
material of support plate
double getLayerTrLength(unsigned iLayer) const
Get transmission length of tiles in i-th aerogel layer.
void addSupportPlate(double inR, double outR, double thick, const std::string &material)
Set parameters of aerogel support plate.
double getTotalTileThickness(int ring, int column) const
Get total thickness of the aerogel tiles tile_up + tile_down for a given slot.
void setWallThickness(double thick)
Set thickness of aluminum walls between aerogel tiles.
double getRingDPhi(unsigned iRing) const
Get phi (angle) distance between "phi" aluminum wall between aerogel tiles in i-th tile ring.
ROOT::Math::Rotation3D getRotation() const
Get rotation matrix of aerogel plane in ARICH local frame.
double getRotationY() const
Get angle of rotation around Y axis.
unsigned m_dPhiSize
size of m_dPhi vector
void setWallRadius(std::vector< double > &rs)
Set radiuses at which "r" aluminum walls between tiles are placed (+inner+outter aluminum ring).
double getRotationZ() const
Get angle of rotation around Z axis.
void printTileParameters(const std::string &title="Aerogel tiles parameters:") const
Print the content of the m_tiles vector of tilestr structure.
ARICHGeoAerogelPlane()
Default constructor.
double m_thickness
thickness of support plate
double getTileThickness(int ring, int column, int layerN) const
Get thickness of individual tile.
double m_wallHeight
height (z) of aluminum walls between aerogel tiles
bool m_simple
switch to simple mode
void setAerogelLayer(unsigned ilayer, double thick, double rIndex, double trLen, const std::string &material)
Set parameters of i-th aerogel layer.
void addTileParameters(int ring, int column, int layerN, double n, double transmL, double thick, const std::string &material)
Add parameters of individual tile.
const std::string & getLayerMaterial(unsigned iLayer) const
Get material name of tiles in i-th aerogel layer.
void setCompensationARICHairVolumeThick_min(double compensationARICHairVolumeThick_min)
Set minimum thickness of the compensation volume with ARICH air.
int m_fullAerogelMaterialDescriptionKey
Full aerogel material description key : 1 - use material explicitly for each aerogel tile,...
void setImgTubeThickness(double imgTubeThickness)
Set imaginary tube thikness just after aerogel layers used as volume to which tracks are extrapolated...
const std::string & getSupportMaterial() const
Get material of support plate.
unsigned m_nLayers
number of aerogel tile layers
std::vector< layer > m_layers
parameters averaged properties of the aerogel tiles/layers (up and down)
double getLayerRefIndex(unsigned iLayer) const
Get refractive index of tiles in i-th aerogel layer.
void testGetTileParametersFunction() const
This function tests the getTileParameters function.
double getWallThickness() const
Get thickness of aluminum walls between aerogel tiles.
void setFullAerogelMaterialDescriptionKey(int fullAerogelMaterialDescriptionKey)
Set full aerogel material description key.
double getRingRadius(unsigned iRing) const
Get radius of i-th aluminum ring between aerogel tiles (inner radius of ring).
double m_imgTubeThickness
imaginary tube thikness just after aerogel layers used as volume to which tracks are extrapolated
double m_outerR
outer radius of support plate
double m_wallThickness
thickness of aluminum walls between aerogel tiles
unsigned getNLayers() const
Get number of aerogel layers.
ROOT::Math::XYZVector getPosition() const
Get position vector of aerogel plane in ARICH local frame.
double getSupportInnerR() const
Get support-plate inner radius.
void setPlacement(double x, double y, double z, double rx, double ry, double rz)
Set aerogel plane positioning within ARICH local volume.
double m_rz
rotation around z-axis
void setWallDPhi(std::vector< double > &dphi)
Set phi (angle) distance between "phi" aluminum walls between aerogel tiles for all aerogel tile ring...
double m_compensationARICHairVolumeThick_min
Minimum thickness of the compensation volume with ARICH air.
int getFullAerogelMaterialDescriptionKey() const
Get full aerogel material description key.
unsigned getAerogelTileID(double x, double y) const
Get ID of aerogel tile containing point (x,y) (actually this is tile slot ID, as it is the same for a...
unsigned m_rSize
size of m_r vector
const std::vector< int > & getNAeroSlotsIndividualRing() const
Get vector of numbers of aerogel slots in individual ring.
void setSimple(std::vector< double > &params)
Set to use simple aerogel plane (single square aerogel tile (2 layers), for cosmic test for example).
std::string getTileMaterialName(int ring, int column, int layerN) const
Get material name of individual tile.
double getMaximumTotalTileThickness() const
Get maximum total thickness of the aerogel tiles tile_up + tile_down for all the slots.
double m_rx
rotation around x-axis
double getTileGap() const
Get gap between aerogel tile and aluminum wall.
unsigned getTileParameters(int ring, int column, int layerN, double &n, double &transmL, double &thick, std::string &material) const
Get parameters of individual tile.
double getRotationX() const
Get angle of rotation around X axis.
Base class for geometry parameters.
Definition: ARICHGeoBase.h:24
static double s_unit
conversion unit for length
Definition: ARICHGeoBase.h:83
Abstract base class for different kinds of events.
Struct to hold aerogel layer parameters.
double trLength
Transmission length.
Struct to hold individual aerogel tile parameters.