ATLAS Offline Software
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 
21 namespace 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
LArGeo::RAL::m_ExpHall
RALExperimentalHall m_ExpHall
Definition: RAL.h:31
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
LArGeo
Definition: LArDetectorFactory.h:26
RALEmec.h
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
RAL.h
LArGeo::RAL::m_Emb
RALEmb m_Emb
Definition: RAL.h:33
RALHec.h
LArGeo::RALEmec::GetValue
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: RALEmec.cxx:102
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
a0
double a0
Definition: globals.cxx:27
LArGeo::RAL::m_Hec
RALHec m_Hec
Definition: RAL.h:34
RALEmb.h
VDetectorParameters.h
LArGeo::RAL::m_Emec
RALEmec m_Emec
Definition: RAL.h:32
LArGeo::RALHec::GetValue
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: RALHec.cxx:92
LArGeo::RAL::GetValue
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
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
RALExperimentalHall.h
LArGeo::RALExperimentalHall::GetValue
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: RALExperimentalHall.cxx:81
LArGeo::RALEmb::GetValue
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: RALEmb.cxx:147