Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
nutools
old
IFDatabase
dumpConditionsToCSV.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 != 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
16
nutools::dbi::Table
*
t
;
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"
)
28
t->
SetDataTypeMask
(
nutools::dbi::kDataOnly
);
29
else
if
(dt ==
"mc"
)
30
t->
SetDataTypeMask
(
nutools::dbi::kMCOnly
);
31
else
if
(dt ==
"datamc"
)
32
t->
SetDataTypeMask
(
nutools::dbi::kDataOnly
|
nutools::dbi::kMCOnly
);
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
}
generate_CCQE_events.t
t
Definition:
generate_CCQE_events.py:68
string
std::string string
Definition:
nybbler.cc:12
nutools::dbi::Table::SetMaxTSVld
void SetMaxTSVld(float t)
Definition:
Table.h:272
std
STL namespace.
nutools::dbi::kMCOnly
Definition:
DataType.h:8
nutools::dbi::kDataOnly
Definition:
DataType.h:9
freeze_graph.argv
argv
Definition:
freeze_graph.py:218
e
const double e
Definition:
gUpMuFluxGen.cxx:165
main
int main(int argc, char *argv[])
Definition:
dumpConditionsToCSV.cc:8
nutools::dbi::Table
Definition:
Table.h:47
nutools::dbi::Table::Load
bool Load()
Definition:
Table.cpp:1964
nutools::dbi::Table::SetMinTSVld
void SetMinTSVld(float t)
Definition:
Table.h:271
nutools::dbi::kConditionsTable
Definition:
Table.h:27
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
nutools::dbi::Table::WriteToCSV
bool WriteToCSV(std::string fname, bool appendToFile=false, bool writeColNames=false)
Definition:
Table.cpp:2405
nutools::dbi::Table::SetDataTypeMask
void SetDataTypeMask(int mask)
Definition:
Table.h:76
Generated by
1.8.11