Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 8654)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 8655)
@@ -18,4 +18,11 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2007/08/02 Thomas Bretz
+
+   * mjobs/MJSpectrum.[h,cc]:
+     - made it compile again
+
+
 
  2007/07/29 Thomas Bretz
Index: /trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc	(revision 8654)
+++ /trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc	(revision 8655)
@@ -86,7 +86,7 @@
 
 MJSpectrum::MJSpectrum(const char *name, const char *title)
-    : fCutQ(0), fCut0(0),fCut1(0), fCut2(0), fCut3(0), fEstimateEnergy(0),
-    fCalcHadronness(0), fRefill(kFALSE), fSimpleMode(kTRUE),
-    fRawMc(kFALSE), fNoThetaWeights(kFALSE)
+    : fCutQ(0), fCut0(0),fCut1(0), fCut2(0), fCut3(0), fCutS(0),
+    fEstimateEnergy(0), fCalcHadronness(0), fRefill(kFALSE),
+    fSimpleMode(kTRUE), fRawMc(kFALSE), fNoThetaWeights(kFALSE)
 {
     fName  = name  ? name  : "MJSpectrum";
@@ -106,4 +106,6 @@
     if (fCut3)
         delete fCut3;
+    if (fCutS)
+        delete fCutS;
     if (fEstimateEnergy)
         delete fEstimateEnergy;
@@ -158,5 +160,5 @@
     fLog->Separator("Alpha Fitter");
     *fLog << all;
-    fit.Print();
+    fit.Print("result");
 
     fLog->Separator("Used Cuts");
@@ -164,9 +166,7 @@
     fCut0->Print();
     fCut1->Print();
+    fCutS->Print();
     fCut2->Print();
     fCut3->Print();
-
-    //gLog.Separator("Energy Estimator");
-    //fEstimateEnergy->Print();
 }
 
@@ -383,5 +383,8 @@
 {
     if (!fDisplay || !fDisplay->CdCanvas("ZdDist"))
-        return;
+    {
+        *fLog << err << "ERROR - Display or tab ZdDist vanished... abort." << endl;
+        return kFALSE;
+    }
 
     TH1D &proj = *h2.ProjectionX();
@@ -459,5 +462,5 @@
 // The resulting histogram excess-vs-energy ist copied into h2.
 //
-Bool_t MJSpectrum::Refill(MParList &plist, TH1D &h2) const
+Bool_t MJSpectrum::Refill(MParList &plist, TH1D &h2)/*const*/
 {
     // Try to find the class used to determin the signal!
@@ -478,6 +481,4 @@
     }
 
-    cout << "FOUND: "<< cls << endl;
-
     // Now fill the histogram
     *fLog << endl;
@@ -492,8 +493,18 @@
     read.AddFile(fPathIn);
 
+    MTaskEnv taskenv0("CalcHadronness");
+    taskenv0.SetDefault(fCalcHadronness);
+
     MEnergyEstimate est;
     MTaskEnv taskenv1("EstimateEnergy");
     taskenv1.SetDefault(fEstimateEnergy ? fEstimateEnergy : &est);
 
+    MContinue *cont = new MContinue("", "CutS");
+    cont->SetAllowEmpty();
+
+    if (fCutS)
+        delete fCutS;
+    fCutS = cont;
+
     // FIXME: Create HistE and HistEOff to be able to modify it from
     // the resource file.
@@ -509,4 +520,6 @@
 
     tlist.AddToList(&read);
+    //tlist.AddToList(&taskenv0); // not necessary, stored in file!
+    tlist.AddToList(fCutS);
     tlist.AddToList(&taskenv1);
     tlist.AddToList(&f0);
@@ -1121,6 +1134,4 @@
         return kFALSE;
 
-    // Print the setup of the MAlphaFitter
-    PrintSetup(fit);
     bins3.SetEdges(temp1, 'x');
 
@@ -1144,4 +1155,8 @@
     if (!Refill(plist, excess))
         return kFALSE;
+
+    // Print the setup and result of the MAlphaFitter
+    // Print used cuts
+    PrintSetup(fit);
 
     TH2D hist;
@@ -1172,6 +1187,6 @@
     else
     {
-        // This rereads the original MC spectrumand aaplies both
-        // weights spectral weights and ZA-weights.
+        // This rereads the original MC spectrum and aplies both
+        // weights, spectral weights and ZA-weights.
         weight.SetNameMcEvt("MMcEvtBasic");
         if (!IntermediateLoop(plist, mh1, temp1, set, weight))
@@ -1298,4 +1313,5 @@
     tlist2.AddToList(fCut0);
     tlist2.AddToList(&taskenv0);
+    tlist2.AddToList(fCutS);
     tlist2.AddToList(fCut1);
     tlist2.AddToList(fCut2);
Index: /trunk/MagicSoft/Mars/mjobs/MJSpectrum.h
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJSpectrum.h	(revision 8654)
+++ /trunk/MagicSoft/Mars/mjobs/MJSpectrum.h	(revision 8655)
@@ -29,4 +29,5 @@
     MTask *fCut2;
     MTask *fCut3;
+    MTask *fCutS;
     MTask *fEstimateEnergy;
     MTask *fCalcHadronness;
@@ -42,5 +43,5 @@
     Bool_t  ReadOrigMCDistribution(const MDataSet &set, TH1 &h, MMcSpectrumWeight &w) const;
     Bool_t  GetThetaDistribution(TH1D &temp1, TH1D &temp2) const;
-    Bool_t  Refill(MParList &plist, TH1D &h) const;
+    Bool_t  Refill(MParList &plist, TH1D &h) /*const*/;
     Bool_t  InitWeighting(const MDataSet &set, MMcSpectrumWeight &w) const;
 
