Jpp
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
examples
JGizmo
JManager.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 "TH2D.h"
9
10
#include "
JGizmo/JManager.hh
"
11
12
#include "
JLang/JException.hh
"
13
14
#include "
Jeep/JParser.hh
"
15
#include "
Jeep/JMessage.hh
"
16
17
18
/**
19
* \file
20
*
21
* Example program to test JGIZMO::JManager class.
22
* \author mdejong
23
*/
24
int
main
(
int
argc,
char
**argv)
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
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1410
JException.hh
Exceptions.
std::map
Definition:
JSTDTypes.hh:16
JManager
Auxiliary class to manage set of histograms.
Definition:
JHistogramToolkit.hh:160
JManager.hh
Dynamic ROOT object management.
outputFile
string outputFile
Definition:
JDAQTimesliceSelector.cc:37
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1836
debug
int debug
debug level
Definition:
JSirene.cc:59
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:65
JParser.hh
Utility class to parse command line options.
main
int main(int argc, char *argv[])
Definition:
Main.cpp:15
Generated by
1.8.5