Belle II Software  release-08-01-10
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 <TVector3.h>
15 #include <TRotation.h>
16 
17 namespace Belle2 {
28  public:
29 
34  {}
35 
40  struct layer {
41  double thickness;
42  double refIndex;
43  double trLength;
44  std::string material;
45  };
46 
52  struct tilestr {
53  int ring;
54  int column;
55  int layer;
56  double n;
57  double transmL;
58  double thick;
59  std::string material;
60  };
61 
66  bool isConsistent() const override;
67 
72  void print(const std::string& title = "Aerogel plane parameters:") const override;
73 
83  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;}
84 
92  void addSupportPlate(double inR, double outR, double thick, const std::string& material)
93  {
94  m_innerR = inR;
95  m_outerR = outR;
96  m_thickness = thick;
97  m_supportMaterial = material;
98  };
99 
104  void setWallThickness(double thick) {m_wallThickness = thick;}
105 
110  void setWallHeight(double height) {m_wallHeight = height;}
111 
116  void setTileGap(double gap) {m_tileGap = gap;}
117 
128  void addTileParameters(int ring, int column, int layerN, double n, double transmL, double thick, const std::string& material)
129  {
130  m_tiles.push_back({ ring, column, layerN, n, transmL, thick, material });
131  }
132 
137  TVector3 getPosition() const {return TVector3(m_x / s_unit, m_y / s_unit, m_z / s_unit);}
138 
143  TRotation getRotation() const
144  {
145  TRotation rot;
146  rot.RotateX(m_rx).RotateY(m_ry).RotateZ(m_rz);
147  return rot;
148  }
149 
154  double getRotationX() const {return m_rx;}
155 
160  double getRotationY() const {return m_ry;}
161 
166  double getRotationZ() const {return m_rz;}
167 
172  double getSupportInnerR() const {return m_innerR / s_unit;};
173 
178  double getSupportOuterR() const {return m_outerR / s_unit;};
179 
184  double getSupportThickness() const {return m_thickness / s_unit;};
185 
190  double getWallThickness() const {return m_wallThickness / s_unit;};
191 
196  double getWallHeight() const {return m_wallHeight / s_unit;};
197 
202  double getTileGap() const {return m_tileGap / s_unit;};
203 
208  const std::string& getSupportMaterial() const {return m_supportMaterial;}
209 
214  void setWallRadius(std::vector<double>& rs) { m_r = rs; m_rSize = rs.size();}
215 
220  void setWallDPhi(std::vector<double>& dphi) { m_dPhi = dphi; m_dPhiSize = dphi.size();}
221 
230  void setAerogelLayer(unsigned ilayer, double thick, double rIndex, double trLen, const std::string& material)
231  {
232  if (ilayer == m_nLayers + 1) {
233  m_layers.push_back({thick, rIndex, trLen, material});
234  m_nLayers++;
235  } else if (ilayer < m_nLayers + 1) {
236  m_layers[ilayer - 1] = {thick, rIndex, trLen, material};
237  } else B2ERROR("ARICHGeoAerogelPlane::setAerogelLayer: please set aerogel layers in consecutive order!");
238  }
239 
244  void setNAeroSlotsIndividualRing(const std::vector<int>& nAeroSlotsIndividualRing) { m_nAeroSlotsIndividualRing = nAeroSlotsIndividualRing; }
245 
250  unsigned getNLayers() const {return m_nLayers;}
251 
256  unsigned getNRings() const {return m_rSize;}
257 
263  double getRingRadius(unsigned iRing) const { if (iRing > m_rSize || iRing == 0) B2ERROR("ARICHGeoAerogelPlane: invalid ring number!"); return m_r[iRing - 1] / s_unit;}
264 
270  double getRingDPhi(unsigned iRing) const { if (iRing > m_rSize || iRing == 0) B2ERROR("ARICHGeoAerogelPlane: invalid ring number!"); return m_dPhi[iRing - 1];}
271 
277  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;}
278 
284  double getLayerRefIndex(unsigned iLayer) const { if (iLayer > m_nLayers || iLayer == 0) B2ERROR("ARICHGeoAerogelPlane: invalid aerogel layer number!"); return m_layers[iLayer - 1].refIndex;}
285 
291  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;}
292 
298  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;}
299 
306  unsigned getAerogelTileID(double x, double y) const;
307 
313  void setSimple(std::vector<double>& params)
314  {
315  if (params.size() != 5) B2ERROR("ARICHGeoAerogelPlane:setSimple: 5 parameters are needed for simple configuration!");
316  m_simple = true;
317  m_simpleParams = params;
318  }
319 
324  bool isSimple() const
325  {
326  return m_simple;
327  }
328 
333  const std::vector<double>& getSimpleParams() const
334  {
335  return m_simpleParams;
336  }
337 
342  const std::vector<int>& getNAeroSlotsIndividualRing() const
343  {
345  }
346 
351  double getAerogelZPosition() const
352  {
353  return m_z / s_unit - (m_wallHeight / s_unit - m_thickness / s_unit) / 2.;
354  }
355 
362  void setFullAerogelMaterialDescriptionKey(int fullAerogelMaterialDescriptionKey)
363  {
364  m_fullAerogelMaterialDescriptionKey = fullAerogelMaterialDescriptionKey;
365  }
366 
374  {
376  }
377 
389  unsigned getTileParameters(int ring, int column, int layerN, double& n, double& transmL, double& thick,
390  std::string& material) const;
391 
399  double getTileThickness(int ring, int column, int layerN) const;
400 
408  std::string getTileMaterialName(int ring, int column, int layerN) const;
409 
416  double getTotalTileThickness(int ring, int column) const;
417 
422  double getMaximumTotalTileThickness() const;
423 
429  void setImgTubeThickness(double imgTubeThickness)
430  {
431  m_imgTubeThickness = imgTubeThickness;
432  }
433 
439  double getImgTubeThickness() const
440  {
441  return m_imgTubeThickness;
442  }
443 
448  void setCompensationARICHairVolumeThick_min(double compensationARICHairVolumeThick_min)
449  {
450  m_compensationARICHairVolumeThick_min = compensationARICHairVolumeThick_min;
451  }
452 
458  {
460  }
461 
467  void printTileParameters(const std::string& title = "Aerogel tiles parameters:") const;
468 
474  void printSingleTileParameters(unsigned i) const;
475 
479  void testGetTileParametersFunction() const;
480 
481  private:
482 
483  // position in local ARICH volume
484  double m_x = 0;
485  double m_y = 0;
486  double m_z = 0;
487  // rotations in local ARICH volume
488  double m_rx = 0;
489  double m_ry = 0;
490  double m_rz = 0;
492  std::vector<double> m_r;
493  std::vector<double> m_dPhi;
494  std::vector<int> m_nAeroSlotsIndividualRing;
496  std::vector<layer> m_layers;
497  std::vector<tilestr> m_tiles;
499  double m_tileGap = 0;
501  // support structure parameters
502  std::string m_supportMaterial;
503  double m_innerR = 0;
504  double m_outerR = 0;
505  double m_thickness = 0;
506  double m_wallThickness = 0;
507  double m_wallHeight = 0;
509  unsigned m_rSize = 0;
510  unsigned m_dPhiSize = 0;
511  unsigned m_nLayers = 0;
513  bool m_simple = 0;
514  std::vector<double> m_simpleParams;
515 
517  0;
520  0.0;
526  };
527 
529 } // 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.
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 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 it contains position of the tile its refractive ind...
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.
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 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.
TRotation getRotation() const
get rotation matrix of aerogel plane in ARICH local frame
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.
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)
const std::string & getLayerMaterial(unsigned iLayer) const
Get material name of tiles i-th aerogel layer.
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 it contains position of the tile its ref...
ARICHGeoAerogelPlane()
Default constructor.
double m_thickness
thickness of support plate
const std::string & getSupportMaterial() const
Get material 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
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.
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...
unsigned m_nLayers
number of aerogel tile layers
std::vector< layer > m_layers
parameters averaged properties of the aerogel tiles/layers (up and down)
TVector3 getPosition() const
get position vector of aerogel plane in ARICH local frame
double getLayerRefIndex(unsigned iLayer) const
Get refractive index of tiles 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.
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
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.
const std::vector< int > & getNAeroSlotsIndividualRing() const
Get vector of numbers of aerogel slots in individual ring.
const std::vector< double > & getSimpleParams() const
Get parameters of simple aerogel configuration.
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 Only for averaged properties of the aerogel tiles/layers.
Struct to hold individual aerogel tile parameters layer : 0 - up layer : 1 - down.