Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JPrintRandom.cc File Reference

Auxiliary program to print ROOT TRandom seed. More...

#include <string>
#include <iostream>
#include <iomanip>
#include "TROOT.h"
#include "TFile.h"
#include "TRandom.h"
#include "TBufferJSON.h"
#include "JROOT/JRootFileReader.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 ROOT TRandom seed.

Author
mdejong

Definition in file JPrintRandom.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 23 of file JPrintRandom.cc.

24{
25 using namespace std;
26 using namespace JPP;
27
28 string inputFile;
29 int debug;
30
31 try {
32
33 JParser<> zap("Auxiliary program to print ROOT TRandom seed.");
34
35 zap['f'] = make_field(inputFile);
36 zap['d'] = make_field(debug) = 1;
37
38 zap(argc, argv);
39 }
40 catch(const exception &error) {
41 FATAL(error.what() << endl);
42 }
43
44
45 JRootFileReader<TRandom> reader(inputFile.c_str(), gRandom->GetName());
46
47 while (reader.hasNext()) {
48
49 TRandom* p = reader.next();
50
51 cout << "seed[" << reader.getCycle() << "] = " << endl;
52 cout << TBufferJSON::ConvertToJSON(p) << endl;
53 }
54
55 reader.close();
56}
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
#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
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).