LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
dumpConditionsToCSV.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 dumpConditionsToCSV.cc.

References e, nutools::dbi::kConditionsTable, nutools::dbi::kDataOnly, nutools::dbi::kMCOnly, nutools::dbi::Table::Load(), nutools::dbi::Table::SetDataTypeMask(), nutools::dbi::Table::SetMaxTSVld(), nutools::dbi::Table::SetMinTSVld(), and nutools::dbi::Table::WriteToCSV().

9 {
10  if (argc != 6) {
11  cout << "Usage: dumpValidityTabletoCSV [detector name] [data|mc|datamc] [Validity Time Stamp (seconds)] [table name] [CSV data file]"
12  << endl;
13  exit(1);
14  }
15 
17 
18  try {
19  t = new nutools::dbi::Table(argv[1],argv[4],nutools::dbi::kConditionsTable);
20  }
21  catch (std::runtime_error& e) {
22  std::cerr << e.what() << " Exiting..." << std::endl;
23  exit(2);
24  }
25 
26  std::string dt = argv[2];
27  if (dt == "data")
29  else if (dt == "mc")
31  else if (dt == "datamc")
33 
34  std::cout << argv[3] << std::endl;
35  time_t tStart = atof(argv[3]);
36  time_t tEnd = time_t(1<<31);
37 
38  t->SetMinTSVld(tStart);
39  t->SetMaxTSVld(tEnd);
40 
41  t->Load();
42 
43  t->WriteToCSV(argv[5]);
44 
45  return 0;
46 
47 }
void SetMaxTSVld(double t)
Definition: Table.h:272
void SetMinTSVld(double t)
Definition: Table.h:271
Float_t e
Definition: plot.C:35
bool WriteToCSV(std::string fname, bool appendToFile=false, bool writeColNames=false)
Definition: Table.cpp:2412
void SetDataTypeMask(int mask)
Definition: Table.h:76
map< int, array< map< int, double >, 2 >> Table
Definition: plot.C:18