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 
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 }
std::string string
Definition: nybbler.cc:12
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[])
QTextStream & endl(QTextStream &s)
void SetDataTypeMask(int mask)
Definition: Table.h:76