32 int main(
int argc, 
char **argv)
 
   38   string      fileDescriptor;
 
   43     JParser<> zap(
"Program to convert multi-dimensional histograms of muon light to multi-dimensional PDFs.");
 
   46     zap[
'o'] = 
make_field(fileDescriptor)      = 
"J%p.dat";
 
   51   catch(
const exception &error) {
 
   52     FATAL(error.what() << endl);
 
   57     FATAL(
"error file descriptor " << fileDescriptor << endl);
 
   63                                        JMAPLIST<JHistogramMap_t,
 
   65                                                 JHistogramGridMap_t>::maplist> JMultiHistogram_t;
 
   67   typedef JPDFTransformer<3, abscissa_type>                         JFunction3DTransformer_t;
 
   73   h1.transformer.reset(
new JFunction3DTransformer_t());
 
   74   h2.transformer.reset(
new JFunction3DTransformer_t());
 
   79   JFileStreamReader in(inputFile.c_str());
 
   81   for (JMultiHistogram_t* buffer[] = { &h0, &h1, &h2, NULL }, **i = buffer; *i != NULL; ++i) {
 
   90   for (JMultiHistogram_t::super_iterator
 
   91          i0 = h0.super_begin(),
 
   92          i1 = h1.super_begin(),
 
   93          i2 = h2.super_begin(); i0 != h0.super_end(); ++i0, ++i1, ++i2) {
 
   95     const double W = i0.getValue().getIntegral();
 
   99       const JDirection3D 
u(JAngle3D(i0->second->first, i0->second->second->first));
 
  102       int number_of_bins = (int) (2 + 
u.getDot(
v));
 
  104       for (
JHistogram1D_t* buffer[] = { &i1.getValue(), &i2.getValue(), NULL }, **i = buffer; *i != NULL; ++i) {
 
  116     const JMultiHistogram_t& value;
 
  125   typedef JPDFTable<JPolint1Function1D_t, 
 
  126                     JMAPLIST<JPolint1FunctionalMap,
 
  127                              JPolint1FunctionalGridMap,
 
  128                              JPolint1FunctionalGridMap>::maplist> JPDF_t;
 
  130   for (
int i = 0; i != 
sizeof(ntuple)/
sizeof(ntuple[0]); ++i) {
 
  132     const string file_name = 
getFilename(fileDescriptor, ntuple[i].type);
 
  136       NOTICE(
"storing output to file " << file_name << 
"... " << flush);
 
  138       const JPDF_t pdf(ntuple[i].value);
 
  140       pdf.store(file_name.c_str());
 
  144     catch(
const JException& error) {
 
  145       FATAL(error.what() << endl);