25{
27
30
31 try {
32
33 JParser<> zap(
"Example program to test histogram manager.");
34
37
38 zap(argc, argv);
39 }
40 catch(const exception &error) {
41 FATAL(error.what() << endl);
42 }
43
44
46
47
48 const char wildcard = '%';
49 const ios::fmtflags format(ios::showpos);
50
51
52 typedef JManager<int, TH2D> JManager_t;
53
54 JManager_t zmap(new TH2D("H2[%]", NULL, 10, -1.0, +1.0, 10, -1.0, +1.0), wildcard, format);
55
56 const double x_val = 0.5;
57
58 for (int i = 0; i != 10; ++i) {
59 zmap[i]->Fill(x_val, 0.0, 1.0);
60 }
61
63
64 {
65 JManager_t test(zmap);
66
67 ASSERT(zmap.size() != 0 && test.size() == 0);
68
70
71 in >> test;
72
73 ASSERT(zmap.size() == test.size());
74
75 ASSERT(zmap[0]->GetMean() == test[0]->GetMean());
76
77 in.Close();
78 }
79
80
81 {
83
84 JManager_t test = JManager_t::Read(in, zmap->GetName(), zmap.wc);
85
86 ASSERT(zmap.size() == test.size());
87
88 ASSERT(zmap[0]->GetMean() == test[0]->GetMean());
89
90 in.Close();
91 }
92
93 return 0;
94}
#define ASSERT(A,...)
Assert macro.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).