32 int main(
int argc,
char **argv)
44 JParser<> zap(
"Program to add multi-dimensional histograms of shower light");
50 if (zap.
read(argc, argv) != 0)
53 catch(
const exception &error) {
54 FATAL(error.what() << endl);
61 JMAPLIST<JHistogramMap_t,
65 JHistogramGridMap_t>::maplist> JMultiHistogram_t;
67 typedef JPDFTransformer<5, abscissa_type> JFunction5DTransformer_t;
72 h1.transformer.reset(
new JFunction5DTransformer_t());
78 NOTICE(
"loading input from file " << *file_name <<
"... " << flush);
82 JFileStreamReader in(file_name->c_str());
89 p1.transformer.reset(
new JFunction5DTransformer_t());
91 for(JMultiHistogram_t* buffer[] = { &p0, &
p1, NULL }, **i = buffer; *i != NULL; ++i) {
101 double integral1 = 0.0;
102 double integral2 = 0.0;
104 for(JMultiHistogram_t::super_iterator
105 i0 = h0.super_begin(), i1 = h1.super_begin(),
106 j0 = p0.super_begin(), j1 =
p1.super_begin(); i1 != h1.super_end(); ++i0, ++i1, ++j0, ++j1) {
108 integral1 += i0.getValue().getIntegral();
110 i0.getValue().add(j0.getValue());
111 i1.getValue().add(j1.getValue());
113 integral2 += i0.getValue().getIntegral();
118 for(JMultiHistogram_t* buffer[] = { &h0, &h1, NULL }, **i = buffer; *i != NULL; ++i) {
129 catch(
const JException& error) {
130 FATAL(error.what() << endl);
138 for (
const JMultiHistogram_t* buffer[] = { &h0, &h1, NULL }, **i = buffer; *i != NULL; ++i) {
143 NOTICE(
"JAddHDE done." << endl);