ATLAS Offline Software
Loading...
Searching...
No Matches
RAL.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "LArGeoRAL/RAL.h"
7
9#include "LArGeoRAL/RALEmb.h"
10#include "LArGeoRAL/RALEmec.h"
11#include "LArGeoRAL/RALHec.h"
12
13#include "GaudiKernel/MsgStream.h"
15
16#include <cstdlib>
17#include <iostream>
18#include <stdexcept>
19#include <string>
20
21namespace LArGeo {
22
23 double RAL::GetValue(const std::string& a_name,
24 const int a0,
25 const int a1,
26 const int a2,
27 const int a3,
28 const int a4 ) const
29 {
30
31 // Call the appropriate GetValue() based on the contents of the
32 // string in a_name.
33
34 // Note: "npos" is defined in the <string> header. If it's the
35 // result of a find() method, then the sub-string was not found.
36
37 if ( a_name.find("ExpHall") != std::string::npos )
38 return m_ExpHall.GetValue(a_name,a0,a1,a2,a3,a4);
39
40 if ( a_name.find("EMEC") != std::string::npos )
41 return m_Emec.GetValue(a_name,a0,a1,a2,a3,a4);
42
43 if ( a_name.find("EMB") != std::string::npos )
44 return m_Emb.GetValue(a_name,a0,a1,a2,a3,a4);
45
46 if ( a_name.find("HEC") != std::string::npos )
47 return m_Hec.GetValue(a_name,a0,a1,a2,a3,a4);
48
49
50 // We didn't find a match. Throw an exception
51 MsgStream log(Athena::getMessageSvc(),"RAL");
52 std::string errMessage = "RAL::GetValue: could not find a match for the key '" + a_name;
53 log << MSG::FATAL << errMessage << endmsg;
54 throw std::runtime_error(errMessage);
55
56 // Unreached.
57 }
58
59} // namespace LArGeo
#define endmsg
RALExperimentalHall m_ExpHall
Definition RAL.h:31
RALEmec m_Emec
Definition RAL.h:32
RALEmb m_Emb
Definition RAL.h:33
virtual double GetValue(const std::string &, const int i0=INT_MIN, const int i1=INT_MIN, const int i2=INT_MIN, const int i3=INT_MIN, const int i4=INT_MIN) const override
Definition RAL.cxx:23
RALHec m_Hec
Definition RAL.h:34
singleton-like access to IMessageSvc via open function and helper
double a0
Definition globals.cxx:27
IMessageSvc * getMessageSvc(bool quiet=false)