Jpp  17.2.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
getUTC.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 #include "TTimeStamp.h"
9 
10 #include "JSupport/JSupport.hh"
12 
13 #include "Jeep/JPrint.hh"
14 #include "Jeep/JParser.hh"
15 #include "Jeep/JMessage.hh"
16 
17 
18 /**
19  * \file
20  *
21  * Auxiliary program to print UTC start and stop time of data taking run.
22  * \author mdejong
23  */
24 int main(int argc, char **argv)
25 {
26  using namespace std;
27  using namespace JPP;
28 
29  vector<string> inputFile;
30  string option;
31  int debug;
32 
33  try {
34 
35  JParser<> zap("Auxiliary program to print UTC start and stop time of data taking run.");
36 
37  zap['f'] = make_field(inputFile);
38  zap['O'] = make_field(option, "print UNIX time as TTimeStamp::AsString(<option>)") = "";
39  zap['d'] = make_field(debug) = 1;
40 
41  zap(argc, argv);
42  }
43  catch(const exception &error) {
44  FATAL(error.what() << endl);
45  }
46 
47  cout.tie(&cerr);
48 
49  const JDAQUTCTimeRange UTC = getUTCTimeRange(inputFile.begin(), inputFile.end());
50 
51  if (option == "")
52  cout << FIXED(12,1) << UTC.getLowerLimit().getUTCseconds() << ' '
53  << FIXED(12,1) << UTC.getUpperLimit().getUTCseconds() << endl;
54  else
55  cout << TTimeStamp((time_t) UTC.getLowerLimit().getUTCseconds()).AsString(option.c_str()) << ' '
56  << TTimeStamp((time_t) UTC.getUpperLimit().getUTCseconds()).AsString(option.c_str()) << endl;
57 }
Utility class to parse command line options.
Definition: JParser.hh:1517
JDAQUTCTimeRange getUTCTimeRange()
Get UTC time range.
int main(int argc, char *argv[])
Definition: Main.cc:15
ROOT TTree parameter settings of various packages.
Auxiliary data structure for floating point format specification.
Definition: JManip.hh:446
I/O formatting auxiliaries.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1993
Support methods.
Range of values.
Definition: JRange.hh:38
General purpose messaging.
#define FATAL(A)
Definition: JMessage.hh:67
Utility class to parse command line options.
int debug
debug level