Belle II Software development
ARICHAerogelInfo.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 <arich/dbobjects/ARICHAerogelInfo.h>
10#include <framework/logging/Logger.h>
11
12using namespace Belle2;
13using namespace std;
14
16{
17 if (lambda < c_lambdaMin || lambda > c_lambdaMax) {
18 B2INFO("lambda not in right interval!");
19 return -1;
20 }
21 int index = (int) round((lambda - c_lambdaMin) / c_lambdaStep);
22 return m_transmittance[index];
23}
24
25
26void ARICHAerogelInfo::setAerogelTransmittanceElement(int lambda, float transmittance)
27{
28 if (lambda < c_lambdaMin || lambda > c_lambdaMax) {
29 B2INFO("lambda not in right interval!");
30 }
31 int index = (int) round((lambda - c_lambdaMin) / c_lambdaStep);
32 m_transmittance[index] = transmittance;
33}
34
35
36void ARICHAerogelInfo::setAerogelTransmittance(std::vector<float> transmittance)
37{
38 for (unsigned int i = 0; i < transmittance.size(); i++) m_transmittance.push_back(transmittance[i]);
39}
40
41
43{
44 for (unsigned int i = 0; i < lambda.size(); i++) m_lambda.push_back(lambda[i]);
45}
46
47
float c_lambdaMin
Min value of lambda.
float c_lambdaStep
Lambda - steps.
float getAerogelTransmittanceElement(int lambda) const
Get aerogel transmittance at lambda.
std::vector< int > m_lambda
Lambda for transmittance.
std::vector< float > m_transmittance
Transmittance of aerogel.
float c_lambdaMax
Max value of lambda.
void setAerogelTransmittanceLambda(std::vector< float > lambda)
Set lambda for aerogel transmittance.
void setAerogelTransmittance(std::vector< float > transmittance)
Set aerogel transmittance.
void setAerogelTransmittanceElement(int lambda, float transmittance)
Set aerogel transmittance at lambda.
Abstract base class for different kinds of events.
STL namespace.