Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
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 "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

int main ( int  argc,
char **  argv 
)

Definition at line 22 of file JPrintRandom.cc.

23 {
24  using namespace std;
25 
26  string inputFile;
27  int debug;
28 
29  try {
30 
31  JParser<> zap("Auxiliary program to print ROOT TRandom seed.");
32 
33  zap['f'] = make_field(inputFile);
34  zap['d'] = make_field(debug) = 1;
35 
36  zap(argc, argv);
37  }
38  catch(const exception &error) {
39  FATAL(error.what() << endl);
40  }
41 
42 
43  cout.tie(&cerr);
44 
45  using namespace JPP;
46 
47  JRootFileReader<TRandom> reader(inputFile.c_str(), gRandom->GetName());
48 
49  while (reader.hasNext()) {
50 
51  TRandom* x = reader.next();
52 
53  cout << "seed[" << reader.getCycle() << "] = " << x->GetSeed() << endl;
54  }
55 
56  reader.close();
57 }
Utility class to parse command line options.
Definition: JParser.hh:1493
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1954
int debug
debug level
Definition: JSirene.cc:61
#define FATAL(A)
Definition: JMessage.hh:67