ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArGeoModel
LArGeoRAL
src
RALExperimentalHall.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// RALExperimentalHall
6
// Sep 5 JFB
7
8
// Fetch parameters from a NOVA database structure.
9
10
#include "
LArGeoRAL/RALExperimentalHall.h
"
11
#include "
LArGeoCode/VDetectorParameters.h
"
12
13
// Athena Service classes
14
#include "GaudiKernel/Bootstrap.h"
15
#include "GaudiKernel/ISvcLocator.h"
16
#include "
StoreGate/StoreGateSvc.h
"
17
18
#include "CLHEP/Units/PhysicalConstants.h"
19
20
#include "
RDBAccessSvc/IRDBAccessSvc.h
"
21
#include "
RDBAccessSvc/IRDBRecord.h
"
22
#include "
RDBAccessSvc/IRDBRecordset.h
"
23
#include "
GeoModelInterfaces/IGeoModelSvc.h
"
24
#include "
GeoModelInterfaces/IGeoDbTagSvc.h
"
25
26
#include <cstdlib>
27
#include <iostream>
28
#include <stdexcept>
29
#include <string>
30
31
class
LArGeo::RALExperimentalHall::Clockwork
{
32
33
public
:
34
35
Clockwork
()=
default
;
36
~Clockwork
()=
default
;
37
38
IRDBRecordset_ptr
atlasMother
;
39
40
};
41
42
43
LArGeo::RALExperimentalHall::RALExperimentalHall
():
44
m_c
(new
Clockwork
())
45
{
46
// First, fetch the Athena services.
47
ISvcLocator* svcLocator = Gaudi::svcLocator();
48
49
SmartIF<IGeoDbTagSvc> geoDbTagSvc{svcLocator->service(
"GeoDbTagSvc"
)};
50
if
(!geoDbTagSvc.isValid()) {
51
throw
std::runtime_error (
"Cannot locate GeoDBTagSvc"
);
52
}
53
54
SmartIF<IRDBAccessSvc> pAccessSvc{svcLocator->service(geoDbTagSvc->getParamSvcName())};
55
if
(!pAccessSvc.isValid()) {
56
throw
std::runtime_error (
"Cannot locate "
+ geoDbTagSvc->getParamSvcName());
57
}
58
59
std::string AtlasVersion;
60
61
if
(geoDbTagSvc->getSqliteReader()==
nullptr
) {
62
// The geometry DB is used
63
SmartIF<IGeoModelSvc> geoModel{svcLocator->service(
"GeoModelSvc"
)};
64
if
(!geoModel.isValid()) {
65
throw
std::runtime_error (
"Cannot locate GeoModelSvc"
);
66
}
67
68
AtlasVersion = geoModel->atlasVersion();
69
}
70
71
m_c
->atlasMother = pAccessSvc->getRecordsetPtr(
"AtlasMother"
,AtlasVersion,
"ATLAS"
);
72
}
73
74
75
LArGeo::RALExperimentalHall::~RALExperimentalHall
()
76
{
77
delete
m_c
;
78
}
79
80
81
double
LArGeo::RALExperimentalHall::GetValue
(std::string_view a_name,
82
const
int
/*a0*/
,
83
const
int
/*a1*/
,
84
const
int
/*a2*/
,
85
const
int
/*a3*/
,
86
const
int
/*a4*/
)
const
87
{
88
89
if
( a_name ==
"LArExpHallOutOfTimeCut"
)
return
2.5*CLHEP::ns;
90
if
( a_name ==
"LArExpHallInnerRadius"
)
return
(*
m_c
->atlasMother)[1]->getDouble(
"RMIN"
)*CLHEP::cm;
91
if
( a_name ==
"LArExpHallOuterRadius"
)
return
(*
m_c
->atlasMother)[1]->getDouble(
"RMAX"
)*CLHEP::cm;
92
if
( a_name ==
"LArExpHallZmax"
)
return
(*
m_c
->atlasMother)[1]->getDouble(
"ZMAX"
)*CLHEP::cm;
93
94
// We didn't find a match.
95
std::string errMessage =
"RALExperimentalHall::GetValue: could not find a match for the key '"
;
96
errMessage.append( a_name);
97
std::cerr << errMessage << std::endl;
98
throw
std::runtime_error (errMessage.c_str());
99
100
// Unreached
101
}
IGeoDbTagSvc.h
IGeoModelSvc.h
IRDBAccessSvc.h
Definition of the abstract IRDBAccessSvc interface.
IRDBRecordset_ptr
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition
IRDBAccessSvc.h:30
IRDBRecord.h
Definition of the abstract IRDBRecord interface.
IRDBRecordset.h
Definition of the abstract IRDBRecordset interface.
RALExperimentalHall.h
StoreGateSvc.h
VDetectorParameters.h
LArGeo::RALExperimentalHall::Clockwork
Definition
RALExperimentalHall.cxx:31
LArGeo::RALExperimentalHall::Clockwork::Clockwork
Clockwork()=default
LArGeo::RALExperimentalHall::Clockwork::~Clockwork
~Clockwork()=default
LArGeo::RALExperimentalHall::Clockwork::atlasMother
IRDBRecordset_ptr atlasMother
Definition
RALExperimentalHall.cxx:38
LArGeo::RALExperimentalHall::~RALExperimentalHall
virtual ~RALExperimentalHall()
Definition
RALExperimentalHall.cxx:75
LArGeo::RALExperimentalHall::RALExperimentalHall
RALExperimentalHall()
Definition
RALExperimentalHall.cxx:43
LArGeo::RALExperimentalHall::GetValue
virtual double GetValue(std::string_view, 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::RALExperimentalHall::m_c
Clockwork * m_c
Definition
RALExperimentalHall.h:35
Generated on
for ATLAS Offline Software by
1.17.0