Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JPrintRandom.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 "TRandom.h"
9#include "TBufferJSON.h"
10
12
13#include "Jeep/JParser.hh"
14#include "Jeep/JMessage.hh"
15
16
17/**
18 * \file
19 *
20 * Auxiliary program to print ROOT TRandom seed.
21 * \author mdejong
22 */
23int main(int argc, char **argv)
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}
General purpose messaging.
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
int main(int argc, char **argv)
Utility class to parse command line options.
Definition JParser.hh:1698
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).