Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
nutools
old
IFDatabase
DBI_service.cc
Go to the documentation of this file.
1
///////////////////////////////////////////////////////////////////////////
2
/// \brief Simple service to provide a RunHistory configured to the right run
3
/// \author Christopher Backhouse - bckhouse@caltech.edu
4
//////////////////////////////////////////////////////////////////////////
5
6
// nutools includes
7
#include "nutools/IFDatabase/DBIService.h"
8
9
// Framework includes
10
#include "
messagefacility/MessageLogger/MessageLogger.h
"
11
12
namespace
nutools
13
{
14
namespace
dbi
15
{
16
17
//------------------------------------------------------------
18
DBIService::DBIService
(
const
fhicl::ParameterSet
& pset) :
evdb
::Reconfigurable{pset}
19
{
20
reconfigure
(pset);
21
}
22
23
//-----------------------------------------------------------
24
void
DBIService::reconfigure
(
const
fhicl::ParameterSet
& pset)
25
{
26
fVerbosity
= pset.
get
<
int
>(
"Verbosity"
,0);
27
fTimeQueries
= pset.
get
<
bool
>(
"TimeQueries"
,
false
);
28
fTimeParsing
= pset.
get
<
bool
>(
"TimeParsing"
,
false
);
29
30
fWebServiceURL
= pset.
get
<
std::string
>(
"WebServiceURL"
);
31
fQueryEngineURL
= pset.
get
<
std::string
>(
"QueryEngineURL"
);
32
fDBUser
= pset.
get
<
std::string
>(
"DBUser"
);
33
}
34
35
//-----------------------------------------------------------
36
Table
*
DBIService::CreateTable
(
std::string
tableName
,
37
std::string
schemaName,
38
int
tableType,
int
dataSource)
39
{
40
if
(tableName.empty())
return
0;
41
42
Table
*
t
=
new
nutools::dbi::Table
();
43
t->
SetTableName
(tableName);
44
t->
SetDetector
(schemaName);
45
if
(tableType < 0 || tableType >=
nutools::dbi::kNTableType
)
46
t->
SetTableType
(
nutools::dbi::kConditionsTable
);
47
if
(dataSource < 0 || dataSource >=
nutools::dbi::kNDataSources
)
48
t->
SetDataSource
(
nutools::dbi::kOffline
);
49
50
t->
SetVerbosity
(
fVerbosity
);
51
t->
SetTimeQueries
(
fTimeQueries
);
52
t->
SetTimeParsing
(
fTimeParsing
);
53
if
(!
fWebServiceURL
.empty())
54
t->
SetWSURL
(
fWebServiceURL
);
55
if
(!
fQueryEngineURL
.empty())
56
t->
SetQEURL
(
fQueryEngineURL
);
57
58
if
(!
fDBUser
.empty())
59
t->
SetUser
(
fDBUser
);
60
61
return
t
;
62
}
63
64
DEFINE_ART_SERVICE
(
DBIService
)
65
66
}
67
}
68
////////////////////////////////////////////////////////////////////////
nutools::dbi::Table::SetTimeQueries
void SetTimeQueries(bool f)
Definition:
Table.h:305
generate_CCQE_events.t
t
Definition:
generate_CCQE_events.py:68
nutools::dbi::Table::SetDataSource
void SetDataSource(std::string ds)
Definition:
Table.cpp:530
string
std::string string
Definition:
nybbler.cc:12
nutools::dbi::Table::SetWSURL
void SetWSURL(std::string url)
Definition:
Table.h:302
DEFINE_ART_SERVICE
#define DEFINE_ART_SERVICE(svc)
Definition:
ServiceMacros.h:88
nutools::dbi::DBIService
Simple service to provide a RunHistory configured to the right run.
Definition:
DBIService.h:25
nutools::dbi::kNDataSources
Definition:
Table.h:38
nutools::dbi::kNTableType
Definition:
Table.h:30
nutools::dbi::DBIService::DBIService
DBIService(const fhicl::ParameterSet &pset)
Definition:
DBI_service.cc:18
nutools
Simple service to provide a RunHistory configured to the right run.
Definition:
Column.cpp:14
evdb
Manage all things related to colors for the event display.
Definition:
Edge3DDrawer_tool.cc:10
MessageLogger.h
nutools::dbi::Table::SetTimeParsing
void SetTimeParsing(bool f)
Definition:
Table.h:306
nutools::dbi::Table::SetQEURL
void SetQEURL(std::string url)
Definition:
Table.h:303
nutools::dbi::DBIService::fTimeQueries
bool fTimeQueries
Definition:
DBIService.h:40
nutools::dbi::DBIService::fDBUser
std::string fDBUser
Definition:
DBIService.h:45
nutools::dbi::DBIService::CreateTable
Table * CreateTable(std::string tableName="", std::string schemaName="", int tableType=nutools::dbi::kConditionsTable, int dataSource=nutools::dbi::kOffline)
Definition:
DBI_service.cc:36
fhicl::ParameterSet::get
T get(std::string const &key) const
Definition:
ParameterSet.h:231
nutools::dbi::Table::SetDetector
bool SetDetector(std::string det)
Definition:
Table.cpp:493
nutools::dbi::Table::SetTableName
void SetTableName(std::string tname)
Definition:
Table.cpp:517
nutools::dbi::DBIService::fTimeParsing
bool fTimeParsing
Definition:
DBIService.h:41
nutools::dbi::Table
Definition:
Table.h:47
nutools::dbi::DBIService::fQueryEngineURL
std::string fQueryEngineURL
Definition:
DBIService.h:44
nutools::dbi::DBIService::fWebServiceURL
std::string fWebServiceURL
Definition:
DBIService.h:43
nutools::dbi::Table::SetVerbosity
void SetVerbosity(int i)
Definition:
Table.h:100
nutools::dbi::DBIService::fVerbosity
int fVerbosity
Definition:
DBIService.h:39
nutools::dbi::Table::SetTableType
bool SetTableType(int t)
Definition:
Table.cpp:451
nutools::dbi::DBIService::reconfigure
void reconfigure(const fhicl::ParameterSet &pset)
Definition:
DBI_service.cc:24
nutools::dbi::Table::SetUser
void SetUser(std::string uname)
Definition:
Table.h:79
nutools::dbi::kConditionsTable
Definition:
Table.h:27
tableName
std::string tableName
Definition:
tagConditionsTableInDB.cc:14
fhicl::ParameterSet
Definition:
ParameterSet.h:34
nutools::dbi::kOffline
Definition:
Table.h:36
Generated by
1.8.11