Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 716)
+++ trunk/MagicSoft/Mars/Changelog	(revision 717)
@@ -1,3 +1,28 @@
                                                                   -*-*- END -*-*-
+
+ 2000/04/03: Thomas Bretz
+
+ * manalysis/MCT1ReadAscii.cc:
+   - the pedestal values read from the file are now stored in MeanRms 
+     instead of Sigma
+   
+ * manalysis/MCerPhotCalc.cc:
+   - The pedestal mean Rms is used as the pixel error
+   
+ * MImgCleanStd.cc:
+   - CleanStep1: the '<' was replaced by a '<=' to clean also pixels 
+     with value=noise=0
+     
+ * MMcPedestalCopy.cc:
+   - All the pedestal values are now filled in (are they calculated correctly?)
+   
+ * mgui/MGeomCamMagic.cc:
+   - Forgot to initialize the Nextneighbors of the Magic Camera
+     (thanks to Oscar)
+     
+ * mhist/MHStarMap.cc:
+   - I changed the model of the display (colors and bin width) to
+     get a 'better' result
+
 
  2000/04/02: Thomas Bretz
Index: trunk/MagicSoft/Mars/manalysis/MCT1ReadAscii.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCT1ReadAscii.cc	(revision 716)
+++ trunk/MagicSoft/Mars/manalysis/MCT1ReadAscii.cc	(revision 717)
@@ -156,5 +156,5 @@
 
         if (val > 0.0)
-            (*fPedest)[i].SetSigma(val);
+            (*fPedest)[i].SetMeanRms(val);
     }
 }
@@ -188,5 +188,5 @@
 
         if (nphot > 0.0)
-            fNphot->AddPixel(i, nphot, (*fPedest)[i].GetSigma());
+            fNphot->AddPixel(i, nphot, (*fPedest)[i].GetMeanRms());
     }
 
Index: trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc	(revision 716)
+++ trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc	(revision 717)
@@ -65,5 +65,6 @@
 
         const Float_t nphot = (Float_t)pixel.GetSumHiGainFadcSamples() - ped.GetMean();
-        fCerPhotEvt->AddPixel(pixid, nphot, 0);
+
+        fCerPhotEvt->AddPixel(pixid, nphot, ped.GetMeanRms());
 
         // FIXME! Handling of Lo Gains is missing!
Index: trunk/MagicSoft/Mars/manalysis/MImgCleanStd.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MImgCleanStd.cc	(revision 716)
+++ trunk/MagicSoft/Mars/manalysis/MImgCleanStd.cc	(revision 717)
@@ -18,7 +18,8 @@
     //   the default constructor
     //
-  
     *fName  = name  ? name  : "MImgCleanStd";
     *fTitle = title ? title : "Task which does a standard image cleaning";
+
+    *fLog << "Cleaning initialized. Using noise level " << lvl1 << " and " << lvl2 << endl;
 }
 
@@ -44,5 +45,6 @@
         const Float_t noise = pix.GetErrorPhot();
 
-        if (entry < fCleanLvl1 * noise )
+        // COBB: '<=' to skip entry=noise=0
+        if (entry <= fCleanLvl1 * noise )
             pix.SetPixelUnused();
     }
@@ -113,5 +115,4 @@
             pix.SetCorePixel();
     }
-
 } 
 
@@ -124,5 +125,4 @@
     //
     const Int_t entries = fEvt->GetNumPixels();
-
     for (Int_t i=0; i<entries; i++)
     {
@@ -174,4 +174,5 @@
         }
     }
+
 }
 
Index: trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc	(revision 716)
+++ trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc	(revision 717)
@@ -41,12 +41,22 @@
 Bool_t MMcPedestalCopy::Process()
 {
-    fPedestals->InitSize(fMcPedestals->GetNumPixel());
+    const int num = fMcPedestals->GetNumPixel();
 
-    for (int i=0; i<MFADC_CHANNELS; i++)
+    fPedestals->InitSize(num);
+
+    for (int i=0; i<num; i++)
     {
         MPedestalPix &pix = (*fPedestals)[i];
 
-        pix.SetPedestal(fMcPedestals->GetPedestal(i), 0);
-        pix.SetPedestalRms(fMcPedestals->GetPedestalRms(i), 0);
+        const Float_t pedest = fMcPedestals->GetPedestal(i);
+        const Float_t pedrms = fMcPedestals->GetPedestalRms(i);
+
+        const Float_t sigma  = pedest*sqrt(num);
+        const Float_t sigrms = sigma/sqrt(2*num);
+
+        pix.SetPedestal(pedest, sigma);
+        pix.SetPedestalRms(pedrms, sigrms);
+
+        *fLog << pedest << " " << sigma << " " << pedrms << " " << sigrms << endl;
     }
 
Index: trunk/MagicSoft/Mars/mgui/MGeomCamMagic.cc
===================================================================
--- trunk/MagicSoft/Mars/mgui/MGeomCamMagic.cc	(revision 716)
+++ trunk/MagicSoft/Mars/mgui/MGeomCamMagic.cc	(revision 717)
@@ -10,4 +10,5 @@
 {
     CreateCam();
+    CreateNN();
 }
 
@@ -263,8 +264,5 @@
 
     for (UInt_t i=0; i<GetNumPixels(); i++)
-    {
         (*this)[i].Set(xtemp[i], ytemp[i], rtemp[i]) ;
-        //fPixels->Add( new MGeomPix() ;
-    }
 }
 
Index: trunk/MagicSoft/Mars/mhist/MHStarMap.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHStarMap.cc	(revision 716)
+++ trunk/MagicSoft/Mars/mhist/MHStarMap.cc	(revision 717)
@@ -11,7 +11,8 @@
 #include "MHStarMap.h"
 
-#include <TH2.h>
-#include <TStyle.h>
-#include <TCanvas.h>
+#include <TH2.h>      // TH2F
+#include <TStyle.h>   // gStyle
+#include <TColor.h>   // SetRGB
+#include <TCanvas.h>  // TCanvas
 
 #include "MHillas.h"
@@ -39,6 +40,6 @@
     //
     fStarMap = new TH2F("Star Map", "Counts",
-                        50, -300, 300,
-                        50, -300, 300);
+                        150, -300, 300,
+                        150, -300, 300);
 }
 
@@ -50,7 +51,56 @@
 void MHStarMap::Draw(Option_t *)
 {
+    //
+    // Creates a new canvas, creates a useful palette and
+    // draws the histogram in the new created canvas
+    //
+
     TCanvas *c = new TCanvas("Star Map", "Star Map created from Hillas Parameters", 500, 500);
 
-    gStyle->SetPalette(1, 0);
+    //
+    // Set the palette you wanna use:
+    //  - you could set the root "Pretty Palette Violet->Red" by
+    //    gStyle->SetPalette(1, 0), but in some cases this may look
+    //    confusing
+    //  - The maximum colors root allowes us to set by ourself
+    //    is 50 (idx: 51-100). This colors are set to a grayscaled
+    //    palette
+    //  - the number of contours must be two less than the number
+    //    of palette entries
+    //
+
+    const Int_t numg = 32; // number of gray scaled colors
+    const Int_t numw = 32; // number of white
+
+    Int_t palette[numg+numw];
+
+    //
+    // The first half of the colors are white.
+    // This is some kind of optical background supression
+    //
+    gROOT->GetColor(51)->SetRGB(1, 1, 1);
+
+    Int_t i;
+    for (i=0; i<numw; i++)
+        palette[i] = 51;
+
+    //
+    // now the (gray) scaled part is coming
+    //
+    for (;i<numw+numg; i++)
+    {
+        const Float_t gray = 1.0-(float)(i-numw)/(numg-1.0);
+
+        gROOT->GetColor(52+i)->SetRGB(gray, gray, gray);
+        palette[i] = 52+i;
+    }
+
+    //
+    // Set the palette and the number of contour levels
+    //
+    gStyle->SetPalette(numg+numw, palette);
+    fStarMap->SetContour(numg+numw-2);
+
+    // gStyle->SetPalette(1, 0);
     fStarMap->Draw("colz");
 
@@ -68,15 +118,18 @@
     const float t = dist*(sin(theta)-cos(theta)*m);
 
-    float y0 = -m*300+t;
-    for (int i=-297; i<300; i+=3)
-    {
-        const float y1 = m*i+t;
+    if (m>-1 && m<1)
+        for (int x=-298; x<298; x+=4)
+        {
+            const float y = m*x+t;
 
-//        if (y1<=y0-3 || y1>=y0+3)
-//            continue;
+            fStarMap->Fill(x, y);
+        }
+    else
+        for (int y=-298; y<298; y+=4)
+        {
+            const float x = (y-t)/m;
 
-        fStarMap->Fill(i, y1);
-        y0 = y1;
-    }
+            fStarMap->Fill(x, y);
+        }
 }
 
