LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
writeConditionsCSVToDB.cc File Reference
#include <iostream>
#include <iomanip>
#include <vector>
#include "nutools/IFDatabase/Table.h"

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 8 of file writeConditionsCSVToDB.cc.

References nutools::dbi::Table::GetColsFromDB(), nutools::dbi::kConditionsTable, nutools::dbi::kDataOnly, nutools::dbi::kMCOnly, nutools::dbi::Table::LoadFromCSV(), nutools::dbi::Table::SetDataTypeMask(), nutools::dbi::Table::SetDetector(), nutools::dbi::Table::SetTableName(), nutools::dbi::Table::SetTableType(), nutools::dbi::Table::SetVerbosity(), and nutools::dbi::Table::Write().

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 }
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
void SetDataTypeMask(int mask)
Definition: Table.h:76