Belle II Software development
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
14using namespace std;
15using namespace Belle2;
16
17float 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
29float 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
41float 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
53void 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
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}
void addMapping(int slot, int layer, float refractiveIndex, float transmissionLength, float thickness)
Add mapping entry.
float getThickness(int slot, int layer) const
Get transmission length of aerogel tile from slot number.
float getRefractiveIndex(int slot, int layer) const
Get refractive index of aerogel tile from slot number.
std::map< std::vector< int >, std::vector< float > > m_aeroPos2optical
map of tile slot (1-124) to optical properties and thickness
void print() const
Pring mapping.
float getTransmissionLength(int slot, int layer) const
Get transmission length of aerogel tile from slot number.
Abstract base class for different kinds of events.
STL namespace.