LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
writeConditionsCSVToDB.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include <iomanip>
3 #include <vector>
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 
17  t->SetDetector(argv[1]);
18  t->SetTableName(argv[3]);
20  t->GetColsFromDB();
21 
22  std::string dt = argv[2];
23  if (dt == "data")
25  else if (dt == "mc")
27  else if (dt == "datamc")
29 
30  t->SetVerbosity(100);
31 
32  if (t->LoadFromCSV(argv[4]))
33  t->Write();
34 
35  return 0;
36 
37 }
STL namespace.
bool LoadFromCSV(std::string fname)
Definition: Table.cpp:1291
bool Write(bool commit=true)
Definition: Table.cpp:2349
bool SetDetector(std::string det)
Definition: Table.cpp:493
void SetTableName(std::string tname)
Definition: Table.cpp:517
void SetVerbosity(int i)
Definition: Table.h:100
bool GetColsFromDB(std::vector< std::string > pkeyList={})
Definition: Table.cpp:238
bool SetTableType(int t)
Definition: Table.cpp:451
int main(int argc, char *argv[])
void SetDataTypeMask(int mask)
Definition: Table.h:76