LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
writeConditionsCSVToDB.cc File Reference
#include <iostream>
#include <iomanip>
#include <vector>
#include "nuevdb/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:1298
bool Write(bool commit=true)
Definition: Table.cpp:2356
bool SetDetector(std::string det)
Definition: Table.cpp:500
void SetTableName(std::string tname)
Definition: Table.cpp:524
void SetVerbosity(int i)
Definition: Table.h:100
bool GetColsFromDB(std::vector< std::string > pkeyList={})
Definition: Table.cpp:245
bool SetTableType(int t)
Definition: Table.cpp:458
void SetDataTypeMask(int mask)
Definition: Table.h:76
map< int, array< map< int, double >, 2 >> Table
Definition: plot.C:18