Index: trunk/FACT++/src/spectrum.cc
===================================================================
--- trunk/FACT++/src/spectrum.cc	(revision 19882)
+++ trunk/FACT++/src/spectrum.cc	(revision 19886)
@@ -130,5 +130,5 @@
 #endif
          , "Database link as in\n\tuser:password@server[:port]/database[?compress=0|1].")
-        ("out,o",            var<string>(conf.GetName()), "")
+        ("out,o",            var<string>(conf.GetName()), "Defines the prefix (with path) of the output files.")
         ("dry-run",          po_switch(),   "Only write the queries to the query.log file. Internally overwrites uri with an empty string.")
         ;
@@ -136,26 +136,26 @@
     po::options_description binnings("Binnings");
     binnings.add_options()
-        ("theta",            var<Binning>(Binning(90, 0, 90)),   "")
-        ("theta-bin",        vars<double>(),                     "")
-        ("esim",             var<Binning>(Binning(15, 2, 5)),    "")
-        ("esim-bin",         vars<double>(),                     "")
-        ("eest",             var<Binning>(Binning(15, 2, 5)),    "")
-        ("eest-bin",         vars<double>(),                     "")
+        ("theta",     var<Binning>(Binning(90, 0, 90)), "Add equidistant bins in theta (degrees). Syntax: N,lo,hi (Number N of equidistant bins between lo and hi)")
+        ("theta-bin", vars<double>(),                   "Add a bin-edge to the theta binning (degree)")
+        ("esim",      var<Binning>(Binning(15, 2, 5)),  "Add equidistant bins in log10 simulated energy. Syntax: N,lo,hi (Number N of equidistant bins between lo and hi)")
+        ("esim-bin",  vars<double>(),                   "Add a bin-edge to the binnnig in log10 simulated enegry")
+        ("eest",      var<Binning>(Binning(15, 2, 5)),  "Add equidistant bins in log10 estimated energy. Syntax: N,lo,hi (Number N of equidistant bins between lo and hi)")
+        ("eest-bin",  vars<double>(),                   "Add a bin-edge to the binning in log10 estimated enegry")
         ;
 
     po::options_description queries("Queries");
     queries.add_options()
-        ("analysis",    var<string>("analysis.sql"),   "")
-        ("data",        var<string>("data.sql"),       "")
-        ("simulation",  var<string>("simulation.sql"), "")
+        ("analysis",    var<string>("analysis.sql"),   "File with the analysis query. A default file is created automatically in the <prefix> directory it does not exist.")
+        ("data",        var<string>("data.sql"),       "File with the query which creates the data summary. A default file is created automatically in the <prefix> directory it does not exist.")
+        ("simulation",  var<string>("simulation.sql"), "File with the query which creates the simulation summary. A default file is created automatically in the <prefix> directory it does not exist.")
         ;
 
     po::options_description preparation("Preparation");
     preparation.add_options()
-        ("source-key", var<uint16_t>(5),          "")
-        ("selector",   vars<string>(),            "")
-        ("estimator",  var<string>()->required(), "")
-        ("spectrum",   var<string>()->required(), "")
-        ("env.*",      var<string>(),             "")
+        ("source-key", var<uint16_t>(5),          "Source key to be used in file selection.")
+        ("selector",   vars<string>(),            "WHERE clause to be used in file selection.")
+        ("estimator",  var<string>()->required(), "Energy estimator to be used.")
+        ("spectrum",   var<string>()->required(), "Spectral shape for re-weighting of simulated 'Energy'")
+        ("env.*",      var<string>(),             "Define a variable that is replaced in all queries automatically.")
         ;
 
@@ -163,5 +163,9 @@
     debug.add_options()
         ("print-connection", po_switch(),       "Print database connection information")
-        ("print-queries",    po_switch(),       "")
+#ifdef HAVE_HIGHLIGHT
+        ("print-queries",    po_switch(),       "Print all queries to the console. They are automatically highlighted.")
+#else
+        ("print-queries",    po_switch(),       "Print all queries to the console. (For highlighting recompile with 'libsource-highlight-dev' installed)")
+#endif
         ("verbose,v",        var<uint16_t>(1),  "Verbosity (0: quiet, 1: default, 2: more, 3, ...)")
         ;
@@ -567,7 +571,8 @@
     Binning binning_eest  = conf.Get<Binning>("eest");
 
-    cout << "B\"theta\": " << binning_theta.str() << endl;
-    cout << "B\"esim\":  " << binning_esim.str()  << endl;
-    cout << "B\"eest\":  " << binning_eest.str()  << endl;
+    cout << '\n';
+    cout << "Binning 'theta': " << binning_theta.str() << endl;
+    cout << "Binning 'Esim':  " << binning_esim.str()  << endl;
+    cout << "Binning 'Eest':  " << binning_eest.str()  << endl;
 
     const uint16_t source_key = conf.Get<uint16_t>("source-key");
@@ -1028,16 +1033,19 @@
 
 
-        const mysqlpp::StoreQueryResult res4 = connection.query("SELECT * FROM ThetaHist").store();
-
-        cout << "  Bin   MC Counts     OnTime ZdWeight\n";
-        const auto bins = binning_theta.vec();
-        for (auto ir=res4.cbegin(); ir!=res4.cend(); ir++)
+        if (verbose>0)
         {
-            const mysqlpp::Row &row = *ir;
-
-            const uint32_t bin = row[".theta"];
-            cout << setw(5) << bins[bin] << ": " << setw(10) << row["CountN"] << " " << setw(10) << row["OnTime"] << " " << setw(10) << row["ZdWeight"] << '\n';
+            const mysqlpp::StoreQueryResult res4 = connection.query("SELECT * FROM ThetaHist").store();
+
+            cout << "  Bin   MC Counts     OnTime ZdWeight\n";
+            const auto bins = binning_theta.vec();
+            for (auto ir=res4.cbegin(); ir!=res4.cend(); ir++)
+            {
+                const mysqlpp::Row &row = *ir;
+
+                const uint32_t bin = row[".theta"];
+                cout << setw(5) << bins[bin] << ": " << setw(10) << row["CountN"] << " " << setw(10) << row["OnTime"] << " " << setw(10) << row["ZdWeight"] << '\n';
+            }
+            cout << endl;
         }
-        cout << endl;
     }
 
@@ -1142,15 +1150,17 @@
         cout << "Execution time: " << sec5 << "s\n";
 
-
-        const mysqlpp::StoreQueryResult res5 = connection.query("SELECT * FROM AnalysisData").store();
-
-        cout << "       Bin     Signal   Background   Excess   Significance   Error" << endl;
-        for (auto row=res5.cbegin(); row!=res5.cend(); row++)
+        if (verbose>0)
         {
-            for (auto it=row->begin(); it!=row->end(); it++)
-                cout << setw(10) << *it << " ";
-            cout << '\n';
+            const mysqlpp::StoreQueryResult res5 = connection.query("SELECT * FROM AnalysisData").store();
+
+            cout << "       Bin     Signal   Background   Excess   Significance   Error" << endl;
+            for (auto row=res5.cbegin(); row!=res5.cend(); row++)
+            {
+                for (auto it=row->begin(); it!=row->end(); it++)
+                    cout << setw(10) << *it << " ";
+                cout << '\n';
+            }
+            cout << endl;
         }
-        cout << endl;
     }
 
@@ -1298,19 +1308,19 @@
 
 
-        const mysqlpp::StoreQueryResult res7 = connection.query("SELECT * FROM SimulatedSpectrum").store();
-
-        //cout << "Received rows: " << res7.num_rows() << '\n' << endl;
-
-        //       123456789|123456789|123456789|123456789|123456789|123456789|123456789
-        cout << "       Bin CountW           CountW2" << endl;
-        const auto bins = binning_esim.vec();
-        for (auto ir=res7.cbegin(); ir!=res7.cend(); ir++)
+        if (verbose>0)
         {
-            const mysqlpp::Row &row = *ir;
-
-            const uint32_t bin = row[".energy"];
-            cout << setw(5) << bins[bin] << ": " << setw(10) << row["CountW"] << " " << setw(10) << row["CountW2"] << '\n';
+            const mysqlpp::StoreQueryResult res7 = connection.query("SELECT * FROM SimulatedSpectrum").store();
+
+            cout << "       Bin CountW           CountW2" << endl;
+            const auto bins = binning_esim.vec();
+            for (auto ir=res7.cbegin(); ir!=res7.cend(); ir++)
+            {
+                const mysqlpp::Row &row = *ir;
+
+                const uint32_t bin = row[".energy"];
+                cout << setw(5) << bins[bin] << ": " << setw(10) << row["CountW"] << " " << setw(10) << row["CountW2"] << '\n';
+            }
+            cout << endl;
         }
-        cout << endl;
     }
 
@@ -1463,14 +1473,17 @@
         const mysqlpp::StoreQueryResult res8 = connection.query("SELECT * FROM Spectrum").store();
 
-        cout << "  Bin  Flux                   Error" << endl;
-        const auto bins = binning_eest.vec();
-        for (auto ir=res8.cbegin(); ir!=res8.cend(); ir++)
+        if (verbose>0)
         {
-            const mysqlpp::Row &row = *ir;
-
-            const uint32_t bin = row[".energy"];
-            cout << setw(5) << bins[bin] << ": " << setw(10) << row["Flux"] << " " << setw(10) << row["ErrFlux"] << '\n';
+            cout << "  Bin  Flux                   Error" << endl;
+            const auto bins = binning_eest.vec();
+            for (auto ir=res8.cbegin(); ir!=res8.cend(); ir++)
+            {
+                const mysqlpp::Row &row = *ir;
+
+                const uint32_t bin = row[".energy"];
+                cout << setw(5) << bins[bin] << ": " << setw(10) << row["Flux"] << " " << setw(10) << row["ErrFlux"] << '\n';
+            }
+            cout << endl;
         }
-        cout << endl;
 
         // --------------------------------------------------------------------------
