ATLAS Offline Software
ALFA_RDBAccess.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
8 
10 {
11 }
12 
14 {
15 }
16 
18  const std::string& element,
19  const std::string& tag,
20  const std::string& node)
21 {
22  bool bRes = false;
23 
24  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_RDBAaccess::ReadGeometry");
25 
26  SmartIF<IRDBAccessSvc> iAccessSvc(Gaudi::svcLocator()->service("RDBAccessSvc"));
27 
28  if (!iAccessSvc)
29  {
30  LogStream << MSG::FATAL << " Could not initialize RDBAccessSvc! ((RP no."<<eRPName<<", Fiber type "<<eFType<<")"<< endmsg;
31 
32  throw GaudiException(" Could not initalize RDBAccessSvc ", "ALFA_RDBAccess::ReadGeometry", StatusCode::FAILURE);
33  }
34 
35 
36 
37  bRes=ReadFiberGeometry(iAccessSvc, element, tag, node);
38 
39  return bRes;
40 }
41 
42 bool ALFA_RDBAccess::ReadFiberGeometry(IRDBAccessSvc* iAccessSvc, const std::string& element, const std::string& tag, const std::string& node)
43 {
44  bool bRes = false;
45 
46  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_RDBAaccess::ReadFiberGeometry");
47 
48  std::list<FIBERDATA> listFData;
49  listFData.clear();
50 
51  m_fiberGeometry = iAccessSvc->getRecordsetPtr(element, tag, node);
52 
53  if (!m_fiberGeometry->size())
54  {
55  bRes = false;
56  LogStream << MSG::FATAL << " ERROR: Unable to retrieve " << element <<" data from database" << endmsg;
57  }
58  else
59  {
60  FIBERDATA FiberData;
61  IRDBRecordset::const_iterator AccessSvc_iter;
62 
63  for(AccessSvc_iter = m_fiberGeometry->begin(); AccessSvc_iter != m_fiberGeometry->end(); ++AccessSvc_iter)
64  {
65  FiberData.nPotID = (*AccessSvc_iter)->getInt("POTID");
66  FiberData.nLayerID = (*AccessSvc_iter)->getInt("COORDID");
67  FiberData.nFiberID = (*AccessSvc_iter)->getInt("FIBREID");
68  FiberData.fSlope = (*AccessSvc_iter)->getDouble("SLOPE");
69  FiberData.fOffset = (*AccessSvc_iter)->getDouble("OFFSET");
70  FiberData.fZPos = (*AccessSvc_iter)->getDouble("ZL");
71 
72  listFData.push_back(FiberData);
73  }
74 
75  if (!listFData.empty())
76  {
77  m_ListFiberData=listFData;
78  bRes = true;
79  }
80  }
81 
82  listFData.clear();
83 
84  return bRes;
85 }
86 
87 
88 
89 
90 
91 
eFiberType
eFiberType
Definition: ALFA_GeometryReader.h:25
_FIBERDATA::fZPos
double fZPos
Definition: ALFA_RDBAccess.h:36
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
IRDBAccessSvc::getRecordsetPtr
virtual IRDBRecordset_ptr getRecordsetPtr(const std::string &node, const std::string &tag, const std::string &tag2node="", const std::string &connName="ATLASDD")=0
Provides access to the Recordset object containing HVS-tagged data.
_FIBERDATA::nPotID
int nPotID
Definition: ALFA_RDBAccess.h:30
ALFA_RDBAccess::~ALFA_RDBAccess
~ALFA_RDBAccess()
Definition: ALFA_RDBAccess.cxx:13
ALFA_RDBAccess::ReadGeometry
bool ReadGeometry(const eRPotName eRPName, eFiberType eFType, const std::string &element, const std::string &tag, const std::string &node)
Definition: ALFA_RDBAccess.cxx:17
eRPotName
eRPotName
Definition: ALFA_GeometryReader.h:27
ALFA_GeometryReader.h
_FIBERDATA::nFiberID
int nFiberID
Definition: ALFA_RDBAccess.h:32
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
ALFA_RDBAccess::m_ListFiberData
std::list< FIBERDATA > m_ListFiberData
Definition: ALFA_RDBAccess.h:59
IRDBAccessSvc
IRDBAccessSvc is an abstract interface to the athena service that provides the following functionalit...
Definition: IRDBAccessSvc.h:42
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ALFA_RDBAccess::ReadFiberGeometry
bool ReadFiberGeometry(IRDBAccessSvc *iAccessSvc, const std::string &element, const std::string &tag, const std::string &node)
Definition: ALFA_RDBAccess.cxx:42
_FIBERDATA::fSlope
double fSlope
Definition: ALFA_RDBAccess.h:34
ALFA_RDBAccess.h
ALFA_RDBAccess::ALFA_RDBAccess
ALFA_RDBAccess()
Definition: ALFA_RDBAccess.cxx:9
_FIBERDATA
Definition: ALFA_RDBAccess.h:29
ALFA_RDBAccess::m_fiberGeometry
IRDBRecordset_ptr m_fiberGeometry
Definition: ALFA_RDBAccess.h:56
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
_FIBERDATA::fOffset
double fOffset
Definition: ALFA_RDBAccess.h:35
_FIBERDATA::nLayerID
int nLayerID
Definition: ALFA_RDBAccess.h:31
node
Definition: memory_hooks-stdcmalloc.h:74
IRDBRecordset::const_iterator
RecordsVector::const_iterator const_iterator
Definition: IRDBRecordset.h:52