Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 8745)
+++ trunk/MagicSoft/Mars/Changelog	(revision 8746)
@@ -18,4 +18,23 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2007/09/17 Thomas Bretz
+
+   * mbase/MEvtLoop.cc, mbase/MStatusDisplay.cc, mjobs/MJSpectrum.cc:
+     - do not create an instance of TDatime if not necessary
+
+   * mbase/MStatusDisplay.cc, mfileio/MReadTree.cc:
+     - improvements in inf debugging levels
+
+   * mhflux/MMcSpectrumWeight.cc:
+     - removed a double brace in an output
+     - more acurrately print the new formula/slope when set
+
+   * mjobs/MJSpectrum.cc:
+     - improved output in case of an error
+     - added text to describe the two example spectra
+     - write MC dataset to output
+
+
 
  2007/09/12 Markus Meyer
Index: trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 8745)
+++ trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 8746)
@@ -575,6 +575,5 @@
 Bool_t MEvtLoop::Eventloop(UInt_t maxcnt, Statistics_t printstat)
 {
-    TDatime d;
-    *fLog << inf << underline << "Eventloop: " << fName << " started at " << d.AsString() << endl;
+    *fLog << inf << endl << underline << "Eventloop: " << fName << " started at " << TDatime().AsString() << endl;
 
     Bool_t rc = PreProcess();
Index: trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 8745)
+++ trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 8746)
@@ -472,6 +472,5 @@
 
     // Add date and time
-    TDatime d;
-    l = new TGLabel(f, d.AsString());
+    l = new TGLabel(f, TDatime().AsString());
     fList->Add(l);
     f->AddFrame(l, lay);
@@ -980,5 +979,5 @@
         gClient->ProcessEventsFor(fTab);
 
-    *fLog << inf << "Adding Raw Tab '" << name << "' (" << f->GetWidth() << "x";
+    *fLog << inf3 << "Adding Raw Tab '" << name << "' (" << f->GetWidth() << "x";
     *fLog << f->GetHeight() << ")" << endl;
 
@@ -1091,5 +1090,5 @@
         gClient->ProcessEventsFor(fTab);
 
-    *fLog << inf << "Adding Tab '" << name << "' (" << f->GetWidth() << "x";
+    *fLog << inf3 << "Adding Tab '" << name << "' (" << f->GetWidth() << "x";
     *fLog << f->GetHeight() << ", TCanvas=" << &c << ")" << endl;
 
@@ -2590,8 +2589,8 @@
 
         if (num<0)
-            *fLog << " - Updating header of PS file... " << flush;
+            *fLog << inf3 << " - Updating header of PS file... " << flush;
         UpdatePSHeader(name);
         if (num<0)
-            *fLog << inf << "done." << endl;
+            *fLog << inf3 << "done." << endl;
     }
 
Index: trunk/MagicSoft/Mars/mfileio/MReadTree.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MReadTree.cc	(revision 8745)
+++ trunk/MagicSoft/Mars/mfileio/MReadTree.cc	(revision 8746)
@@ -848,5 +848,5 @@
         fTree->SetBranchAddress(bname, pcont); // *CHANGED-fChain-to-fTree*
 
-        *fLog << inf << "Master branch address '" << bname << "' ";
+        *fLog << inf2 << "Master branch address '" << bname << "' ";
         if ((TString)bname!=(TString)classname)
             *fLog << "[" << classname << "] ";
@@ -859,5 +859,5 @@
     }
 
-    *fLog << inf << GetDescriptor() << " setup " << num << " master branches addresses." << endl;
+    *fLog << inf2 << GetDescriptor() << " setup " << num << " master branches addresses." << endl;
 
     //
Index: trunk/MagicSoft/Mars/mhflux/MMcSpectrumWeight.cc
===================================================================
--- trunk/MagicSoft/Mars/mhflux/MMcSpectrumWeight.cc	(revision 8745)
+++ trunk/MagicSoft/Mars/mhflux/MMcSpectrumWeight.cc	(revision 8746)
@@ -364,5 +364,5 @@
         {
             *fLog << err;
-            *fLog << "ERROR - The maximum simulated Monte Carlo energy is not allowed to change (";
+            *fLog << "ERROR - The maximum simulated Monte Carlo energy is not allowed to change ";
             *fLog << "(" << fEnergyMax << " --> " << rh.GetEUppLim() << ")... abort." << endl;
             return kFALSE;
@@ -392,7 +392,7 @@
     fEnergyMax = rh.GetEUppLim();
 
-    if (fNewSlope==-99)
-    {
-        *fLog << inf << "A new slope for the power law has not been defined... no weighting applied." << endl;
+    if (fNewSlope==-99 && fFormula.IsNull())
+    {
+        *fLog << inf << "A new slope for the power law has not yet been defined... using " << fOldSlope << "." << endl;
         fNewSlope = fOldSlope;
     }
@@ -400,4 +400,15 @@
     if (fFunc)
         delete fFunc;
+
+    if (GetFormulaSpecOld()==GetFormulaSpecNew())
+        *fLog << inf << "No spectral change requested..." << endl;
+    else
+    {
+        *fLog << inf << "Weighting from slope " << fOldSlope << " to ";
+        if (fFormula.IsNull())
+            *fLog << "slope " << fNewSlope << "." << endl;
+        else
+            *fLog << GetFormulaSpecNewX() << endl;
+    }
 
     fFunc = new TF1("", GetFormulaWeightsX());
Index: trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc	(revision 8745)
+++ trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc	(revision 8746)
@@ -333,4 +333,5 @@
 {
     // Some debug output
+    *fLog << all << endl;
     fLog->Separator("Compiling original MC distribution");
 
@@ -455,5 +456,5 @@
         if (!weight.Set(*head))
         {
-            *fLog << err << "ERROR - Initializing MMcSpectrumWeight failed." << endl;
+            *fLog << err << "ERROR - Initializing MMcSpectrumWeight from " << fname << " failed." << endl;
             return kFALSE;
         }
@@ -463,5 +464,5 @@
 
         // No we found everything... go on reading contents
-        *fLog << inf << "Reading OriginalMC of " << fname << endl;
+        *fLog << inf2 << "Reading OriginalMC of " << fname << endl;
 
         // Fill histogram from tree
@@ -948,5 +949,5 @@
     gPad->SetGridy();
     TH1D *spec=(TH1D*)spectrum.DrawCopy();
-    FitSpectrum(*spec);
+    //FitSpectrum(*spec);
 
     c1.cd(3);
@@ -985,4 +986,6 @@
     spec = (TH1D*)spectrum.DrawCopy();
 
+    TLatex tex;
+
     TF1 fc("Crab", "7.0e-6*(x/300)^(-2.31-0.26*log10(x/300))", 100, 6000);
     fc.SetLineStyle(7);
@@ -991,7 +994,11 @@
     fc.DrawCopy("same");
 
+    tex.DrawText(90, fc.Eval(100), "Crab (\\Gamma=-2.31)");
+
     TF1 fa("PG1553", "1.8e-6*(x/200)^-4.21", 90, 600);
     static_cast<const TAttLine&>(fc).Copy(fa);
     fa.DrawCopy("same");
+
+    tex.DrawText(90, fa.Eval(90), "PG1553 (\\Gamma=-4.21)");
 
     // Display dN/dE*E^2 for conveinience
@@ -1329,5 +1336,5 @@
     *fLog << inf;
     fLog->Separator(GetDescriptor());
-    *fLog << "Compile Monte Carlo Sample (data set " << set.GetName() << ")" << endl;
+    *fLog << "Compile Monte Carlo sample (dataset " << set.GetName() << ")" << endl;
     *fLog << endl;
 
@@ -1696,4 +1703,5 @@
     cont.Add(&area1);
     cont.Add(&hest);
+    cont.Add(&set);
 
     if (fDisplay)
