LArSoft
v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
writeConditionsCSVToDB.cc
Go to the documentation of this file.
1
#include <iostream>
2
#include <iomanip>
3
#include <vector>
4
#include "
nutools/IFDatabase/Table.h
"
5
6
using namespace
std
;
7
8
int
main
(
int
argc,
char
*argv[])
9
{
10
if
(argc != 5) {
11
cout <<
"Usage: writeConditionsCSVToDB [detector name] [data|mc|datamc] [table name] [CSV data file]"
12
<< endl;
13
exit(1);
14
}
15
16
nutools::dbi::Table
* t =
new
nutools::dbi::Table
();
17
t->
SetDetector
(argv[1]);
18
t->
SetTableName
(argv[3]);
19
t->
SetTableType
(
nutools::dbi::kConditionsTable
);
20
t->
GetColsFromDB
();
21
22
std::string dt = argv[2];
23
if
(dt ==
"data"
)
24
t->
SetDataTypeMask
(
nutools::dbi::kDataOnly
);
25
else
if
(dt ==
"mc"
)
26
t->
SetDataTypeMask
(
nutools::dbi::kMCOnly
);
27
else
if
(dt ==
"datamc"
)
28
t->
SetDataTypeMask
(
nutools::dbi::kDataOnly
|
nutools::dbi::kMCOnly
);
29
30
t->
SetVerbosity
(100);
31
32
if
(t->
LoadFromCSV
(argv[4]))
33
t->
Write
();
34
35
return
0;
36
37
}
std
STL namespace.
nutools::dbi::kMCOnly
Definition:
DataType.h:8
nutools::dbi::kDataOnly
Definition:
DataType.h:9
nutools::dbi::Table::LoadFromCSV
bool LoadFromCSV(std::string fname)
Definition:
Table.cpp:1291
nutools::dbi::Table::Write
bool Write(bool commit=true)
Definition:
Table.cpp:2349
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
Table.h
nutools::dbi::Table
Definition:
Table.h:47
nutools::dbi::Table::SetVerbosity
void SetVerbosity(int i)
Definition:
Table.h:100
nutools::dbi::Table::GetColsFromDB
bool GetColsFromDB(std::vector< std::string > pkeyList={})
Definition:
Table.cpp:238
nutools::dbi::Table::SetTableType
bool SetTableType(int t)
Definition:
Table.cpp:451
main
int main(int argc, char *argv[])
Definition:
writeConditionsCSVToDB.cc:8
nutools::dbi::kConditionsTable
Definition:
Table.h:27
nutools::dbi::Table::SetDataTypeMask
void SetDataTypeMask(int mask)
Definition:
Table.h:76
nutools
IFDatabase
writeConditionsCSVToDB.cc
Generated on Thu Jul 26 2018 13:10:23 for LArSoft by
1.8.11