![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
32 msg(MSG::INFO) <<
"GeometryDBSvc Initialized" <<
endmsg;
39 msg(MSG::INFO) <<
"Parameters from text file:" <<
endmsg;
43 bool printedUnnamed =
false;
44 for (std::vector<std::string>::const_iterator iter =
m_sections.begin(); iter !=
m_sections.end(); ++iter) {
45 msg(MSG::INFO) <<
"Parameters from text file from section: " << *iter <<
endmsg;
52 msg(MSG::INFO) <<
" Section not present. Parameters from text file from unnamed section already printed above." <<
endmsg;
54 msg(MSG::INFO) <<
" Section not present. Parameters from text file from unnamed section will be printed." <<
endmsg;
56 printedUnnamed =
true;
62 return StatusCode::SUCCESS;
73 msg(MSG::INFO) <<
"The following parameters were not used:" <<
endmsg;
77 bool printedUnnamed =
false;
78 for (std::vector<std::string>::const_iterator iter =
m_sections.begin(); iter !=
m_sections.end(); ++iter) {
79 msg(MSG::INFO) <<
"The following parameters were not used from section: " << *iter <<
endmsg;
86 msg(MSG::INFO) <<
" Section not present. Parameters from text file from unnamed section already printed above." <<
endmsg;
88 msg(MSG::INFO) <<
" Section not present. Parameters from text file from unnamed section will be printed." <<
endmsg;
90 printedUnnamed =
true;
96 return StatusCode::SUCCESS;
111 return Service::queryInterface(riid, ppvInterface);
114 return StatusCode::SUCCESS;
122 msg(MSG::WARNING) <<
"Overriding from a text file is NOT recommended for production use." <<
endmsg;
136 std::ostringstream ostr;
137 if (!recordSetName.empty()) {
138 ostr << recordSetName <<
"#" <<
index <<
":" <<
name;
150 std::string recordSetName = recordSet->nodeName();
154 if (
index >= (
int)recordSet->size()) {
157 tmpPar = (*recordSet)[
index]->getDouble(
name);
182 std::string recordSetName = recordSet->nodeName();
186 if (
index >= (
int)recordSet->size()) {
189 tmpPar = (*recordSet)[
index]->getInt(
name);
214 std::string recordSetName = recordSet->nodeName();
218 if (
index >= (
int)recordSet->size()) {
221 tmpPar = (*recordSet)[
index]->getString(
name);
246 if (recordSetName.empty() &&
index) {
247 msg(MSG::WARNING) <<
"Non zero index for parameter with empry record set. Index will be ignored: " <<
index <<
endmsg;
253 if (!
result && !recordSetName.empty()) {
255 std::ostringstream keyalt;
256 keyalt << recordSetName <<
"#ALL:" <<
name;
270 std::istringstream istr(
result);
288 std::istringstream istr(
result);
302 std::string recordSetName = recordSet->nodeName();
309 std::string recordSetName = recordSet->nodeName();
315 if (
index < (
int)recordSet->size()) {
319 catch(std::runtime_error& ex) {
344 unsigned int tmpParUnsigned = 0;
345 std::string recordSetName = recordSet->nodeName();
349 msg(MSG::ERROR) <<
"Table " << recordSetName <<
" size from text file is negative: " << tmpPar <<
endmsg;
354 tmpParUnsigned =
static_cast<unsigned int>(tmpPar);
357 tmpParUnsigned = recordSet->size();
360 return tmpParUnsigned;
367 unsigned int tmpParUnsigned = 0;
371 msg(MSG::ERROR) <<
"Table " << recordSetName <<
" size from text file is negative: " << tmpPar <<
endmsg;
376 tmpParUnsigned =
static_cast<unsigned int>(tmpPar);
378 msg(MSG::ERROR) <<
"getTableSize: Table " << recordSetName <<
" does not exist in text file." <<
endmsg;
380 return tmpParUnsigned;
391 std::ostringstream
key;
392 key <<
"TableSize:" << recordSetName;
395 std::istringstream istr(
result);
398 msg(MSG::ERROR) <<
"Error retrieving parameter TableSize:" << recordSetName <<
" as an int: " <<
result <<
endmsg;
virtual bool testField(IRDBRecordset_ptr recordSet, const std::string &name, int index=0) const
virtual std::string getString(IRDBRecordset_ptr recordSet, const std::string &name, int index=0) const
virtual void printParameters(const std::string §ion="") const
Print paramaters read in from text file. If section is supplied only consider the parameters in that ...
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvInterface)
bool getTableSizeFromTextFile(const std::string &recordSetName, int &var) const
void printNotUsed(const std::string §ion="") const
virtual StatusCode finalize()
Service finalize.
virtual StatusCode initialize()
Service init.
TextFileDBReader * m_textParameters
bool msgLvl(const MSG::Level lvl) const
virtual bool testFieldTxt(IRDBRecordset_ptr recordSet, const std::string &name, int index=0) const
virtual void printNotUsed(const std::string §ion="") const
Print paramaters from text file which are not used. If section is supplied only consider the paramete...
bool sectionPresent(const std::string §ion) const
bool getValue(const std::string &recordSetName, const std::string &name, int index, std::string &var) const
virtual double getDouble(IRDBRecordset_ptr recordSet, const std::string &name, int index=0) const
The following methods will first look in the text file if provided and then look in the database.
Class to read in a text file and allow easy retrieval of parameters.
std::string parameterKey(const std::string &recordSetName, const std::string &name, int index) const
virtual int getInt(IRDBRecordset_ptr recordSet, const std::string &name, int index=0) const
::StatusCode StatusCode
StatusCode definition for legacy code.
void setParameterFileName(const std::string &filename)
static const InterfaceID & interfaceID()
reimplemented from IInterface
GeometryDBSvc(const std::string &name, ISvcLocator *sl)
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
bool find(const std::string &key, std::string &result) const
std::string m_textFileName
std::vector< std::string > m_sections
Definition of the abstract IRDBRecord interface.
virtual unsigned int getTableSize(IRDBRecordset_ptr recordSet) const
Definition of the abstract IRDBRecordset interface.
bool readFile(const std::string &filename)
void printParameters(const std::string §ion="") const