Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
JManager.cc File Reference

Example program to test JGIZMO::JManager class. More...

#include <string>
#include <iostream>
#include <iomanip>
#include "TROOT.h"
#include "TFile.h"
#include "TH2D.h"
#include "JGizmo/JManager.hh"
#include "JLang/JException.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

Example program to test JGIZMO::JManager class.

Author
mdejong

Definition in file JManager.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 24 of file JManager.cc.

25 {
26  using namespace std;
27 
28  string outputFile;
29  int debug;
30 
31  try {
32 
33  JParser<> zap("Example program to test histogram manager.");
34 
35  zap['o'] = make_field(outputFile) = "manager.root";
36  zap['d'] = make_field(debug) = 2;
37 
38  zap(argc, argv);
39  }
40  catch(const exception &error) {
41  FATAL(error.what() << endl);
42  }
43 
44 
45  using namespace JPP;
46 
47 
48  const char wildcard = '%';
49  const ios::fmtflags format(ios::showpos);
50 
51  typedef JManager<int, TH2D> JManager_t;
52 
53  JManager_t map(new TH2D("H2[%]", NULL, 10, -1.0, +1.0, 10, -1.0, +1.0), wildcard, format);
54 
55  for (int i = 0; i != 10; ++i) {
56  map[i]->Fill(0.0, 0.0, 1.0);
57  }
58 
59  map.Write(outputFile.c_str());
60 }
Utility class to parse command line options.
Definition: JParser.hh:1410
Auxiliary class to manage set of histograms.
string outputFile
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1836
int debug
debug level
Definition: JSirene.cc:59
#define FATAL(A)
Definition: JMessage.hh:65