Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7207)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7208)
@@ -20,4 +20,30 @@
 
                                                  -*-*- END OF LINE -*-*-
+ 2005/07/22 Thomas Bretz
+
+   * macros/tutorials/extendcam.C, macros/tutorials/hft.C:
+     - some updates. Replaced MCerPhotEvt by MSignalCam
+
+   * mhflux/MHDisp.cc:
+     - some more fixes to allow no-smearing
+
+   * mhft/MGeomCamMagicEnhance.cc:
+     - replaced GetPixById by the id itself
+
+   * mimage/MImgCleanStd.cc:
+     - do not check for the pedestal container if absolute cleaning
+       has been chosen
+
+   * mjobs/MJCalibrateSignal.cc:
+     - removed obsolete comments
+
+   * mreport/MReport.[h,cc]:
+     - added some conversions for wrong version numbers
+
+   * mreport/MReportCamera.cc:
+     - fixed a problem reading files with gkActiveLoadControlVersNum
+
+
+
  2005/07/21 Thomas Bretz
 
Index: trunk/MagicSoft/Mars/macros/tutorials/extendcam.C
===================================================================
--- trunk/MagicSoft/Mars/macros/tutorials/extendcam.C	(revision 7207)
+++ trunk/MagicSoft/Mars/macros/tutorials/extendcam.C	(revision 7208)
@@ -65,5 +65,5 @@
 MHCamera *d6=new MHCamera(MGeomCamMagicXT());
 
-MCerPhotEvt *evt=0;
+MSignalCam *evt=0;
 MMcEvt *mc;
 
@@ -81,8 +81,8 @@
 
     //Für Real-Raum
-    evt = (MCerPhotEvt*)plist->FindObject("MCerPhotEvt");
+    evt = (MSignalCam*)plist->FindObject("MSignalCam");
     if (!evt)
     {
-        cout << "Fehler: MCerPhotEvt" << endl;
+        cout << "Fehler: MSignalCam" << endl;
         return kFALSE;
     }
@@ -135,9 +135,9 @@
 Int_t Process()
 {
-    d1->SetCamContent(*(MCerPhotEvt*)cl1->GetClone());
-    d2->SetCamContent(*(MCerPhotEvt*)cl2->GetClone());
+    d1->SetCamContent(*(MSignalCam*)cl1->GetClone());
+    d2->SetCamContent(*(MSignalCam*)cl2->GetClone());
     d3->SetCamContent(*fFreq2);
-    d4->SetCamContent(*(MCerPhotEvt*)cl4->GetClone());
-    d5->SetCamContent(*(MCerPhotEvt*)cl3->GetClone());
+    d4->SetCamContent(*(MSignalCam*)cl4->GetClone());
+    d5->SetCamContent(*(MSignalCam*)cl3->GetClone());
     d6->SetCamContent(*evt);
 
@@ -174,5 +174,5 @@
     MReadMarsFile read("Events");
     read.DisableAutoScheme();
-    read.AddFile("/home/kolodziejski/Diplomarbeit/marsdata/mcdata/*.root");
+    read.AddFile("/home/tbretz/Software/mcwobble/lza/cal/19*.root");
     //read.AddFile("/home/hoehne/data/mcdata/gammas/calib/calib_gamma_zbin0.root");
     //read.AddFile("/home/hoehne/data/mcdata/hadrons/calib/calib_proton_zbin0.root");
@@ -184,8 +184,8 @@
     // enhance.SetNameCerPhotEvtOut("MCerPhotEvt2");
 
-    MClone clone1("MCerPhotEvt", "Clone1");
-    MClone clone2("MCerPhotEvt", "Clone2");
-    MClone clone3("MCerPhotEvt", "Clone3");
-    MClone clone4("MCerPhotEvt", "Clone4");
+    MClone clone1("MSignalCam", "Clone1");
+    MClone clone2("MSignalCam", "Clone2");
+    MClone clone3("MSignalCam", "Clone3");
+    MClone clone4("MSignalCam", "Clone4");
 
     cl1 = &clone1;
@@ -202,11 +202,13 @@
     mytask.SetProcess(Process);
 
-    MImgCleanStd clean1(26, 18);
+    MImgCleanStd clean1(8, 4.5);
     clean1.SetMethod(MImgCleanStd::kAbsolute);
     clean1.SetNameGeomCam("MGeomCamMagicXT");
-
-    MImgCleanStd clean2(26, 18);
+    clean1.SetNamePedPhotCam("MPedPhotFromExtractorRndm");
+
+    MImgCleanStd clean2(8, 4.5);
     clean2.SetMethod(MImgCleanStd::kAbsolute);
     clean2.SetNameGeomCam("MGeomCamMagicXT");
+    clean2.SetNamePedPhotCam("MPedPhotFromExtractorRndm");
 
     // Setup your tasklist
Index: trunk/MagicSoft/Mars/macros/tutorials/hft.C
===================================================================
--- trunk/MagicSoft/Mars/macros/tutorials/hft.C	(revision 7207)
+++ trunk/MagicSoft/Mars/macros/tutorials/hft.C	(revision 7208)
@@ -188,5 +188,5 @@
 }
 
-void hft(const char *fname="/home/hoehne/data/mcdata/hadrons/calib/calib_proton_zbin0.root")
+void hft(const char *fname="/home/tbretz/Software/mcwobble/lza/cal/19*.root")
 {
     // Setup parameter- and tasklist
@@ -201,12 +201,13 @@
 
     // Clone MCerPhotEvt befor eimage cleaning
-    MClone clone1("MCerPhotEvt", "Clone1");
+    MClone clone1("MSignalCam", "Clone1");
 
     // Setup image cleaning
-    MImgCleanStd clean(24, 12);
+    MImgCleanStd clean(8.5, 4);
     clean.SetMethod(MImgCleanStd::kAbsolute);
+    clean.SetNamePedPhotCam("MPedPhotFromExtractorRndm");
 
     // Clone MCerPhotEvt befor eimage cleaning
-    MClone clone2("MCerPhotEvt", "Clone2");
+    MClone clone2("MSignalCam", "Clone2");
 
     // Setup intercative task calling the functions defined above
Index: trunk/MagicSoft/Mars/mhflux/MHDisp.cc
===================================================================
--- trunk/MagicSoft/Mars/mhflux/MHDisp.cc	(revision 7207)
+++ trunk/MagicSoft/Mars/mhflux/MHDisp.cc	(revision 7208)
@@ -248,45 +248,48 @@
     // To calculate significance map smear with 2*theta-cut and
     // do not normalize gauss, for event map use theta-cut/2 instead
-    for (int x=1; x<=nx; x++)
-    {
-        const Double_t cx = axex.GetBinCenter(x);
-        const Double_t px = cx-pos1.X();
-
-        for (int y=1; y<=ny; y++)
-        {
-            const Double_t cy = axey.GetBinCenter(y);
-            const Double_t sp = Sq(px, cy-pos1.Y());
-            if (smear)
+    if (smear || fHistOff)
+    {
+        for (int x=1; x<=nx; x++)
+        {
+            const Double_t cx = axex.GetBinCenter(x);
+            const Double_t px = cx-pos1.X();
+
+            for (int y=1; y<=ny; y++)
             {
-                const Double_t dp = sp/psf;
-
-                // Values below 1e-3 (>3.5sigma) are not filled into the histogram
-                if (dp<4)
+                const Double_t cy = axey.GetBinCenter(y);
+                const Double_t sp = Sq(px, cy-pos1.Y());
+                if (smear)
                 {
-                    const Double_t rc = TMath::Exp(-dp)/normg;
-                    if (!fHistOff)
-                        bg.AddBinContent(bg.GetBin(x, y), rc);
-                    else
-                        fHist.AddBinContent(fHist.GetBin(x, y, bz), rc);
+                    const Double_t dp = sp/psf;
+
+                    // Values below 1e-3 (>3.5sigma) are not filled into the histogram
+                    if (dp<4)
+                    {
+                        const Double_t rc = TMath::Exp(-dp)/normg;
+                        if (!fHistOff)
+                            bg.AddBinContent(bg.GetBin(x, y), rc);
+                        else
+                            fHist.AddBinContent(fHist.GetBin(x, y, bz), rc);
+                    }
                 }
+
+                if (!fHistOff)
+                    continue;
+
+                // If we are filling the signal already (fHistOff!=NULL)
+                // we also fill the background by projecting the
+                // background in the camera into the sky plot.
+                const TVector2 v = TVector2(cx+m.X(), cy+m.Y());
+
+                // Speed up further: Xmax-fWobble
+                if (v.Mod()>axex.GetXmax()) // Gains 10% speed
+                    continue;
+
+                const Int_t    bx = axex.FindFixBin(v^rot);
+                const Int_t    by = axey.FindFixBin(v*rot);
+                const Double_t bg = fHistOff->GetBinContent(bx, by, bz);
+
+                fHistBg.AddBinContent(fHistBg.GetBin(x, y), bg);
             }
-
-            if (!fHistOff)
-                continue;
-
-            // If we are filling the signal already (fHistOff!=NULL)
-            // we also fill the background by projecting the
-            // background in the camera into the sky plot.
-            const TVector2 v = TVector2(cx+m.X(), cy+m.Y());
-
-            // Speed up further: Xmax-fWobble
-            if (v.Mod()>axex.GetXmax()) // Gains 10% speed
-                continue;
-
-            const Int_t    bx = axex.FindFixBin(v^rot);
-            const Int_t    by = axey.FindFixBin(v*rot);
-            const Double_t bg = fHistOff->GetBinContent(bx, by, bz);
-
-            fHistBg.AddBinContent(fHistBg.GetBin(x, y), bg);
         }
     }
Index: trunk/MagicSoft/Mars/mhft/MGeomCamMagicEnhance.cc
===================================================================
--- trunk/MagicSoft/Mars/mhft/MGeomCamMagicEnhance.cc	(revision 7207)
+++ trunk/MagicSoft/Mars/mhft/MGeomCamMagicEnhance.cc	(revision 7208)
@@ -92,5 +92,5 @@
     Double_t dEvt[577];
     for (int i = 0; i<577; ++i)
-        dEvt[i] = fEvtIn->GetPixById(i)->GetNumPhotons();
+        dEvt[i] = (*fEvtIn)[i].GetNumPhotons();
 
     MArrayD dEvent(1141);
Index: trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc	(revision 7207)
+++ trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc	(revision 7208)
@@ -563,9 +563,13 @@
     }
 
-    fPed = (MPedPhotCam*)pList->FindObject(AddSerialNumber(fNamePedPhotCam), "MPedPhotCam");
-    if (!fPed)
-    {
-        *fLog << err << fNamePedPhotCam << " [MPedPhotCam] not found... aborting." << endl;
-        return kFALSE;
+    fPed=0;
+    if (fCleaningMethod!=kAbsolute)
+    {
+        fPed = (MPedPhotCam*)pList->FindObject(AddSerialNumber(fNamePedPhotCam), "MPedPhotCam");
+        if (!fPed)
+        {
+            *fLog << err << fNamePedPhotCam << " [MPedPhotCam] not found... aborting." << endl;
+            return kFALSE;
+        }
     }
 
Index: trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc	(revision 7207)
+++ trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc	(revision 7208)
@@ -620,6 +620,4 @@
     write.AddContainer("MTime",                     "Events",     kFALSE);
     write.AddContainer("MRawEvtHeader",             "Events");
-    //write.AddContainer("MArrivalTime",              "Events",     kFALSE);
-    //write.AddContainer("MPointingPos",              "Events",     kFALSE);
     // Slow-Control: Current-tree
     write.AddContainer("MTimeCurrents",             "Currents",   kFALSE);
Index: trunk/MagicSoft/Mars/mreport/MReport.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReport.cc	(revision 7207)
+++ trunk/MagicSoft/Mars/mreport/MReport.cc	(revision 7208)
@@ -29,4 +29,14 @@
 //  This is a base class for all reports comming from subsystems stored in
 //  a report file.
+//
+//
+// Due to wrong assignment by arehucas the veriosn number for some
+// cases is replaced.
+//
+//   Old Version | MjdMin  | MjdMax  | New Version
+//  -------------+---------+---------+-------------
+//   200504130   | 53548.0 | 53567.0 | 200506300
+//   200503170   | 53446.5 | 53447.5 | 200502240
+//
 //
 //  Be carefull: The class name of all classes derived from this class
@@ -105,6 +115,15 @@
 // SetupReading must be called successfully before.
 //
+// Due to wrong assignment by arehucas the veriosn number for some
+// cases is replaced.
+//
+//   Old Version | MjdMin  | MjdMax  | New Version
+//  -------------+---------+---------+-------------
+//   200504130   | 53548.0 | 53567.0 | 200506300
+//   200503170   | 53446.5 | 53447.5 | 200502240
+//
 Int_t MReport::Interprete(TString &str, const MTime &start, const MTime &stop, Int_t ver)
 {
+    // Interprete header (time, status, etc) of report
     if (!InterpreteHeader(str))
         return kFALSE;
@@ -116,4 +135,13 @@
         return -1;
 
+    // Due to wrong assignment by arehucas the veriosn number for some
+    // cases is replaced.
+    if (ver==200504130 && GetMjd()>53548 && GetMjd()<53567)
+        ver=200506300;
+
+    if (ver==200503170 && GetMjd()>53446.5 && GetMjd()<53447.5)
+        ver=200502240;
+
+    // Interprete body (contents) of report
     const Int_t rc = InterpreteBody(str, ver);
     if (rc != kTRUE)
Index: trunk/MagicSoft/Mars/mreport/MReport.h
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReport.h	(revision 7207)
+++ trunk/MagicSoft/Mars/mreport/MReport.h	(revision 7208)
@@ -5,5 +5,5 @@
 #include "MParContainer.h"
 #endif
-
+#include "MTime.h"
 class MTime;
 class MParList;
@@ -42,4 +42,5 @@
 
     Byte_t GetState() const { return fState; }
+    Double_t GetMjd() const { return fTime ? fTime->GetMjd() : -1; }
 
     ClassDef(MReport, 1) // Base class for control reports
Index: trunk/MagicSoft/Mars/mreport/MReportCamera.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportCamera.cc	(revision 7207)
+++ trunk/MagicSoft/Mars/mreport/MReportCamera.cc	(revision 7208)
@@ -622,5 +622,5 @@
         return kCONTINUE;
 
-    if (ver >= gkActiveLoadControlVersNum)
+    if (ver > gkActiveLoadControlVersNum)
     {
          if (!InterpreteActiveLoad(str))
