Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
dunecore
dunecore
DuneCommon
Exe
duneRunData.cxx
Go to the documentation of this file.
1
// duneRunData.cxx
2
//
3
// David Adams
4
// May 2018
5
//
6
// Executable that displays the run data for a run.
7
8
#include <string>
9
#include <iostream>
10
#include <vector>
11
#include <sstream>
12
#include <memory>
13
#include "
dunecore/ArtSupport/DuneToolManager.h
"
14
#include "
dunecore/DuneInterface/Tool/RunDataTool.h
"
15
16
using
std::string
;
17
using
std::cout;
18
using
std::endl
;
19
using
std::istringstream;
20
21
int
main
(
int
argc,
char
**
argv
) {
22
const
string
myname =
"duneRunData: "
;
23
bool
help
=
false
;
24
unsigned
int
irun = 0;
25
bool
verbose
=
false
;
26
string
fname
;
27
if
( argc > 1 ) {
28
for
(
int
iarg=1; iarg< argc; ++iarg ) {
29
string
sarg = argv[iarg];
30
if
( sarg ==
"-h"
) {
31
help =
true
;
32
break
;
33
}
34
if
( sarg ==
"-v"
) verbose =
true
;
35
}
36
if
( ! help ) {
37
string
sarg = argv[argc-1];
38
istringstream ssarg(sarg);
39
ssarg >> irun;
40
if
( irun == 0 ) {
41
cout << myname <<
"ERROR: Last field does not appear to be a number: \""
42
<< sarg <<
"\""
<<
endl
;
43
return
1;
44
}
45
}
46
}
else
{
47
help =
true
;
48
}
49
if
( help ) {
50
cout <<
"Usage: duneRunData [-h] [-v] [-c FCLFILE] RUN"
<<
endl
;
51
cout <<
" Displays the run info for a run."
<<
endl
;
52
cout <<
" -h - Display this message."
<<
endl
;
53
cout <<
" -v - Verbose display including info about fcl file and run data tool."
<<
endl
;
54
return
0;
55
}
56
string
tname =
"protoduneRunDataTool"
;
57
if
( ! verbose ) cout.setstate(std::ios_base::failbit);
// Turn off cout
58
cout <<
endl
;
59
cout << myname <<
"Fetching tool manager."
<<
endl
;
60
DuneToolManager
* ptm =
DuneToolManager::instance
();
61
cout <<
endl
;
62
cout << myname <<
"Fetching run data tool."
<<
endl
;
63
const
RunDataTool
* prdt = ptm->
getShared
<
RunDataTool
>(tname);
64
cout <<
endl
;
65
if
( ! verbose ) cout.clear();
// Turn cout back on.
66
if
( prdt ==
nullptr
) {
67
cout << myname <<
"ERROR: Unable to find RunDataTool "
<< tname <<
endl
;
68
return
1;
69
}
70
RunData
rdat = prdt->
runData
(irun);
71
if
( rdat.
isValid
() ) {
72
cout << rdat <<
endl
;
73
}
else
{
74
cout << myname <<
"Unable to find run "
<< irun <<
endl
;
75
return
2;
76
}
77
return
0;
78
}
string
std::string string
Definition:
nybbler.cc:12
RunData
Definition:
RunData.h:21
wirecell.sigproc.paper.noise.fname
fname
Definition:
noise.py:68
freeze_graph.argv
argv
Definition:
freeze_graph.py:218
RunData::isValid
bool isValid() const
Definition:
RunData.h:48
main
int main(int argc, char **argv)
Definition:
duneRunData.cxx:21
DuneToolManager.h
RunDataTool::runData
virtual RunData runData(Index run, Index subRun=0) const =0
train.verbose
verbose
Definition:
train.py:477
DuneToolManager
Definition:
DuneToolManager.h:34
RunDataTool
Definition:
RunDataTool.h:10
ValidateOpDetReco.help
help
Definition:
ValidateOpDetReco.py:23
RunDataTool.h
DuneToolManager::instance
static DuneToolManager * instance(std::string fclname="", int dbg=1)
Definition:
DuneToolManager.cxx:95
DuneToolManager::getShared
T * getShared(std::string name)
Definition:
DuneToolManager.h:101
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
Generated by
1.8.11