Jpp  16.0.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
getLivetime.cc
Go to the documentation of this file.
1 
2 #include <string>
3 #include <iostream>
4 #include <iomanip>
5 
6 #include "TROOT.h"
7 #include "TFile.h"
8 
9 #include "JSupport/JSupport.hh"
11 
12 #include "Jeep/JParser.hh"
13 #include "Jeep/JMessage.hh"
14 
15 
16 /**
17  * \file
18  *
19  * Auxiliary program to print live time of data taking.
20  * \author mdejong
21  */
22 int main(int argc, char **argv)
23 {
24  using namespace std;
25  using namespace JPP;
26 
27  vector<string> inputFile;
28  int debug;
29 
30  try {
31 
32  JParser<> zap("Auxiliary program to print live time of data taking.");
33 
34  zap['f'] = make_field(inputFile);
35  zap['d'] = make_field(debug) = 1;
36 
37  zap(argc, argv);
38  }
39  catch(const exception &error) {
40  FATAL(error.what() << endl);
41  }
42 
43  cout.tie(&cerr);
44 
45  cout << getLivetime(inputFile.begin(), inputFile.end()) << endl;
46 }
Utility class to parse command line options.
Definition: JParser.hh:1500
int main(int argc, char *argv[])
Definition: Main.cc:15
ROOT TTree parameter settings of various packages.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1961
Support methods.
int debug
debug level
Definition: JSirene.cc:63
General purpose messaging.
#define FATAL(A)
Definition: JMessage.hh:67
double getLivetime(const std::string &file_name)
Get data taking live time.
Utility class to parse command line options.