Belle II Software  release-08-01-10
ARICHAeroTilesInfo.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 <framework/logging/Logger.h>
10 
11 #include <arich/dbobjects/ARICHAeroTilesInfo.h>
12 #include <iostream>
13 
14 using namespace std;
15 using namespace Belle2;
16 
17 float ARICHAeroTilesInfo::getRefractiveIndex(int slot, int layer) const
18 {
19 
20  if (slot > 124 || slot < 1) { B2WARNING("ARICHAeroTilesInfo::getTransmissionLength: Slot number " << slot << " not valid!"); return 0.;}
21  if (layer > 1 || layer < 0) { B2WARNING("ARICHAeroTilesInfo::getTransmissionLength: Layer number " << layer << " not valid!"); return 0.;}
22 
23  std::vector<int> slotID{slot, layer};
24  std::vector<float> opticalProperties = m_aeroPos2optical.find(slotID)->second;
25 
26  return opticalProperties[0];
27 }
28 
29 float ARICHAeroTilesInfo::getTransmissionLength(int slot, int layer) const
30 {
31 
32  if (slot > 124 || slot < 1) { B2WARNING("ARICHAeroTilesInfo::getTransmissionLength: Slot number " << slot << " not valid!"); return 0.;}
33  if (layer > 1 || layer < 0) { B2WARNING("ARICHAeroTilesInfo::getTransmissionLength: Layer number " << layer << " not valid!"); return 0.;}
34 
35  std::vector<int> slotID{slot, layer};
36  std::vector<float> opticalProperties = m_aeroPos2optical.find(slotID)->second;
37 
38  return opticalProperties[1];
39 }
40 
41 float ARICHAeroTilesInfo::getThickness(int slot, int layer) const
42 {
43 
44  if (slot > 124 || slot < 1) { B2WARNING("ARICHAeroTilesInfo::getThickness: Slot number " << slot << " not valid!"); return 0.;}
45  if (layer > 1 || layer < 0) { B2WARNING("ARICHAeroTilesInfo::getThickness: Layer number " << layer << " not valid!"); return 0.;}
46 
47  std::vector<int> slotID{slot, layer};
48  std::vector<float> opticalProperties = m_aeroPos2optical.find(slotID)->second;
49 
50  return opticalProperties[2];
51 }
52 
53 void ARICHAeroTilesInfo::addMapping(int slot, int layer, float refractiveIndex, float transmissionLength, float thickness)
54 {
55 
56  if (slot > 124 || slot < 1) { B2WARNING("ARICHAeroTilesInfo::getTransmissionLength: Slot number " << slot << " not valid!"); }
57  if (layer > 1 || layer < 0) { B2WARNING("ARICHAeroTilesInfo::getTransmissionLength: Layer number " << layer << " not valid!"); }
58 
59  std::vector<int> slotID{slot, layer};
60  std::vector<float> opticalProperties{refractiveIndex, transmissionLength, thickness};
61  m_aeroPos2optical.insert(std::pair<std::vector<int>, std::vector<float>>(slotID, opticalProperties));
62 }
63 
64 void ARICHAeroTilesInfo::print() const
65 {
66  B2INFO("AEROGEL SLOT MAPPING with optical properties of tiles");
67  for (int tile = 1; tile < N_TILES + 1; tile++) {
68  B2INFO("Slot number: " << tile << "\n"
69  << " downstream tile : refIndex = " << getRefractiveIndex(tile, 0) << "\n"
70  << " transLength = " << getTransmissionLength(tile, 0) << "\n"
71  << " thickness = " << getThickness(tile, 0) << "\n"
72  << " upstream tile : refIndex = " << getRefractiveIndex(tile, 1) << "\n"
73  << " transLength = " << getTransmissionLength(tile, 1) << "\n"
74  << " thickness = " << getThickness(tile, 1) << "\n");
75  //B2INFO("Slot number: " << tile << "\n"
76  // << " downstream tile : refIndex = " << getRefractiveIndex(tile, 0) << "\n"
77  // << " transLength = " << getTransmissionLength(tile, 0) << "\n"
78  // << " upstream tile : refIndex = " << getRefractiveIndex(tile, 1) << "\n"
79  // << " transLength = " << getTransmissionLength(tile, 1) << "\n");
80  }
81 }
Abstract base class for different kinds of events.