Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 6965)
+++ trunk/MagicSoft/Mars/Changelog	(revision 6966)
@@ -44,4 +44,8 @@
      - print result of optimization in case MAlphaFitter is used
      - store results back in initial MAlphaFitter
+
+   * mjobs/MJSpectrum.[h,cc]:
+     - implemented a faster simple mode weighting the read spectrum
+       with the theta-probability
 
 
Index: trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc	(revision 6965)
+++ trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc	(revision 6966)
@@ -301,10 +301,8 @@
 }
 
-void MJSpectrum::DisplayResult(const MH3 &mh1) const
+void MJSpectrum::DisplayResult(const TH2D &h2) const
 {
     if (!fDisplay->CdCanvas("ZdDist"))
         return;
-
-    const TH2D &h2 = (const TH2D&)mh1.GetHist();
 
     TH1D &proj = *h2.ProjectionX();
@@ -446,6 +444,17 @@
         return kFALSE;
     }
-/*
+
+    TH1D temp2(temp1);
+    if (!ReadOrigMCDistribution(set, temp2))
+        return kFALSE;
+
+    if (!GetThetaDistribution(temp1, temp2))
+        return kFALSE;
+
+    if (fRefill && !Refill(plist, temp2))
+        return kFALSE;
+
     TH2D hist;
+    MH3 mh1("MMcEvtBasic.fTelescopeTheta*kRad2Deg", "MMcEvtBasic.fEnergy");
     if (fSimpleMode)
     {
@@ -455,89 +464,67 @@
             return kFALSE;
 
-        TCanvas &c =fDisplay->AddTab("test");
-        c.Divide(2,2);
-        c.cd(1);
-        gPad->SetLogy();
-        hist.DrawCopy();
-        c.cd(2);
-        hist.ProjectionX()->Draw();
-        c.cd(3);
-        hist.ProjectionY()->Draw();
-
-        MH3 mh1(hist);
+        for (int y=0; y<hist.GetNbinsY(); y++)
+            for (int x=0; x<hist.GetNbinsX(); x++)
+                hist.SetBinContent(x, y, hist.GetBinContent(x, y)*temp1.GetBinContent(x));
+    }
+    else
+    {
+        MTaskList tlist1;
+        plist.Replace(&tlist1);
+
+        MReadMarsFile readmc("OriginalMC");
+        //readmc.DisableAutoScheme();
+        set.AddFilesOn(readmc);
+        readmc.EnableBranch("MMcEvtBasic.fTelescopeTheta");
+        readmc.EnableBranch("MMcEvtBasic.fEnergy");
+
         mh1.SetLogy();
         mh1.SetLogz();
         mh1.SetName("ThetaE");
-    }
-  */
-    TH1D temp2(temp1);
-    if (!ReadOrigMCDistribution(set, temp2))
-        return kFALSE;
-
-    if (!GetThetaDistribution(temp1, temp2))
-        return kFALSE;
-
-    if (fRefill && !Refill(plist, temp2))
-        return kFALSE;
-
-    // ------------------- Loop1 ----------------------------
-
-    MTaskList tlist1;
-    plist.Replace(&tlist1);
-
-    MReadMarsFile readmc("OriginalMC");
-    //readmc.DisableAutoScheme();
-    set.AddFilesOn(readmc);
-    readmc.EnableBranch("MMcEvtBasic.fTelescopeTheta");
-    readmc.EnableBranch("MMcEvtBasic.fEnergy");
-
-    MH3 mh1("MMcEvtBasic.fTelescopeTheta*kRad2Deg", "MMcEvtBasic.fEnergy");
-    mh1.SetLogy();
-    mh1.SetLogz();
-    mh1.SetName("ThetaE");
-
-    MFillH fill0(&mh1);
-    //fill0.SetDrawOption("projx only");
-
-    MBinning binsx(bins3, "BinningThetaEX");
-    MBinning binsy(bins2, "BinningThetaEY");
-    plist.AddToList(&binsx);
-    plist.AddToList(&binsy);
-    tlist1.AddToList(&readmc);
-
-    temp1.SetXTitle("MMcEvtBasic.fTelescopeTheta*kRad2Deg");
-    MH3 mh3mc(temp1);
-
-    MFEventSelector2 sel1(mh3mc);
-    sel1.SetHistIsProbability();
-
-    fill0.SetFilter(&sel1);
-
-    tlist1.AddToList(&sel1);
-    tlist1.AddToList(&fill0);
-
-    MEvtLoop loop1(fName);
-    loop1.SetParList(&plist);
-    loop1.SetLogStream(fLog);
-    loop1.SetDisplay(fDisplay);
-
-    if (!SetupEnv(loop1))
-        return kFALSE;
-
-    if (!loop1.Eventloop(fMaxEvents))
-    {
-        *fLog << err << GetDescriptor() << ": Processing of MC-data failed." << endl;
-        return kFALSE;
-    }
-
-    tlist1.PrintStatistics();
-
-    if (!loop1.GetDisplay())
-    {
-        *fLog << err << GetDescriptor() << ": Execution stopped by user." << endl;
-        return kFALSE;
-    }
-
-    DisplayResult(mh1);
+
+        MFillH fill0(&mh1);
+        //fill0.SetDrawOption("projx only");
+
+        MBinning binsx(bins3, "BinningThetaEX");
+        MBinning binsy(bins2, "BinningThetaEY");
+        plist.AddToList(&binsx);
+        plist.AddToList(&binsy);
+        tlist1.AddToList(&readmc);
+
+        temp1.SetXTitle("MMcEvtBasic.fTelescopeTheta*kRad2Deg");
+        MH3 mh3mc(temp1);
+
+        MFEventSelector2 sel1(mh3mc);
+        sel1.SetHistIsProbability();
+
+        fill0.SetFilter(&sel1);
+
+        tlist1.AddToList(&sel1);
+        tlist1.AddToList(&fill0);
+
+        MEvtLoop loop1(fName);
+        loop1.SetParList(&plist);
+        loop1.SetLogStream(fLog);
+        loop1.SetDisplay(fDisplay);
+
+        if (!SetupEnv(loop1))
+            return kFALSE;
+
+        if (!loop1.Eventloop(fMaxEvents))
+        {
+            *fLog << err << GetDescriptor() << ": Processing of MC-data failed." << endl;
+            return kFALSE;
+        }
+
+        tlist1.PrintStatistics();
+
+        if (!loop1.GetDisplay())
+        {
+            *fLog << err << GetDescriptor() << ": Execution stopped by user." << endl;
+            return kFALSE;
+        }
+    }
+
+    DisplayResult(fSimpleMode ? hist : (TH2D&)mh1.GetHist());
 
     // ------------------------- Final loop --------------------------
@@ -579,5 +566,5 @@
     // Make sure to use the same binning for MHCollectionArea and MHEnergyEst
     MHCollectionArea area;
-    area.SetHistAll((TH2D&)mh1.GetHist());
+    area.SetHistAll(fSimpleMode ? hist : (TH2D&)mh1.GetHist());
     MHEnergyEst      hest;
 
Index: trunk/MagicSoft/Mars/mjobs/MJSpectrum.h
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJSpectrum.h	(revision 6965)
+++ trunk/MagicSoft/Mars/mjobs/MJSpectrum.h	(revision 6966)
@@ -8,4 +8,5 @@
 class TH1;
 class TH1D;
+class TH2D;
 
 class MH3;
@@ -33,5 +34,5 @@
     Bool_t  ReadOrigMCDistribution(const MDataSet &set, TH1 &h) const;
     Bool_t  GetThetaDistribution(TH1D &temp1, TH1D &temp2) const;
-    void    DisplayResult(const MH3 &mh1) const;
+    void    DisplayResult(const TH2D &mh1) const;
     Bool_t  Refill(MParList &plist, TH1D &h) const;
 
