Jpp  master_rocky
the software that should make you happy
Functions
getUTC.cc File Reference

Auxiliary program to print UTC start and stop time of data taking run. More...

#include <string>
#include <iostream>
#include <iomanip>
#include "TROOT.h"
#include "TFile.h"
#include "TTimeStamp.h"
#include "JSupport/JSupport.hh"
#include "JSupport/JSupportToolkit.hh"
#include "Jeep/JPrint.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Auxiliary program to print UTC start and stop time of data taking run.

Author
mdejong

Definition in file getUTC.cc.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 24 of file getUTC.cc.

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 
48  const JDAQUTCTimeRange UTC = getUTCTimeRange(inputFile.begin(), inputFile.end());
49 
50  if (option == "")
51  cout << FIXED(12,1) << UTC.getLowerLimit().getUTCseconds() << ' '
52  << FIXED(12,1) << UTC.getUpperLimit().getUTCseconds() << endl;
53  else
54  cout << TTimeStamp((time_t) UTC.getLowerLimit().getUTCseconds()).AsString(option.c_str()) << ' '
55  << TTimeStamp((time_t) UTC.getUpperLimit().getUTCseconds()).AsString(option.c_str()) << endl;
56 }
#define FATAL(A)
Definition: JMessage.hh:67
int debug
debug level
Definition: JSirene.cc:69
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:2142
Utility class to parse command line options.
Definition: JParser.hh:1698
Range of values.
Definition: JRange.hh:42
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:202
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:213
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
JDAQUTCTimeRange getUTCTimeRange()
Get UTC time range.
Definition: JSTDTypes.hh:14
Auxiliary data structure for floating point format specification.
Definition: JManip.hh:448