Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 710)
+++ trunk/MagicSoft/Mars/Changelog	(revision 711)
@@ -4,4 +4,6 @@
  
    * mdatacheck/MH*, mdatacheck/MFillH* moved to mhist
+   
+   * mraw/MrawEvtPixelIter: IsLoGain -> HasLoGain
  
  
Index: trunk/MagicSoft/Mars/mhist/MFillHFadc.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MFillHFadc.cc	(revision 710)
+++ trunk/MagicSoft/Mars/mhist/MFillHFadc.cc	(revision 711)
@@ -1,2 +1,12 @@
+////////////////////////////////////////////////////////////////////////
+//
+//  MFillHFadc
+//
+//  This task fill the n time slices from all pixels
+//  (stored in a MRawEvtData container) into histograms.
+//  This histograms (one per pixel) are stored in MHFadcCam, MHFadcPix
+//
+////////////////////////////////////////////////////////////////////////
+
 #include "MFillHFadc.h"
 
@@ -10,5 +20,5 @@
 ClassImp(MFillHFadc)
 
-    MFillHFadc::MFillHFadc (const char *name, const char *title) : fRawEvtData(NULL)
+MFillHFadc::MFillHFadc (const char *name, const char *title) : fRawEvtData(NULL)
 {
   *fName  = name  ? name  : "MFillHFadc";
@@ -18,48 +28,60 @@
 Bool_t MFillHFadc::PreProcess (MParList *pList)
 {
-  // connect the raw data with this task
-  
-  fHistos = (MHFadcCam*)pList->FindCreateObj("MHFadcCam");
-  if (!fHistos)
-      return kFALSE;
+    //
+    // The PrProcess function checks for the existance of all necessary
+    // parameter containers
+    //
 
-  fRawEvtData = (MRawEvtData*)pList->FindCreateObj("MRawEvtData");
-  if (!fRawEvtData)
-  {
-      *fLog << dbginf << " Error: MRawEvtData not found... exit." << endl;
-      return kFALSE ;
-  }
+    //
+    // check if all necessary input containers are existing
+    //
+    fRawEvtData = (MRawEvtData*)pList->FindCreateObj("MRawEvtData");
+    if (!fRawEvtData)
+    {
+        *fLog << dbginf << " Error: MRawEvtData not found... exit." << endl;
+        return kFALSE;
+    }
 
-  return kTRUE ; 
+    //
+    // check if the output containers are existing, if not craete them
+    //
+    fHistos = (MHFadcCam*)pList->FindCreateObj("MHFadcCam");
+    if (!fHistos)
+        return kFALSE;
 
+    return kTRUE;
 } 
 
 Bool_t MFillHFadc::Process()
 {
-  //  loop over the pixels and fill the values in the histograms
+    //
+    // This process function loops over all pixels in an MRawEvtData
+    // event and fills the values into histograms
+    //
+
+    //  loop over the pixels and fill the values in the histograms
   
-  MRawEvtPixelIter pixel(fRawEvtData);
+    MRawEvtPixelIter pixel(fRawEvtData);
 
-  const Int_t nhisamples = fRawEvtData->GetNumHiGainSamples() ;
-  const Int_t nlosamples = fRawEvtData->GetNumLoGainSamples() ;
+    const Int_t nhisamples = fRawEvtData->GetNumHiGainSamples() ;
+    const Int_t nlosamples = fRawEvtData->GetNumLoGainSamples() ;
 
-  //  cout << "HighSamples " << iHighSamples ;
+    //  cout << "HighSamples " << iHighSamples ;
 
-  while ( pixel.Next() )
-    { 
-      for (Int_t i=0 ; i<nhisamples ; i++ )
-	{ 
-            fHistos->FillHi ( pixel.GetPixelId(),
-                              pixel.GetHiGainFadcSamples()[i] );
-	}
+    while ( pixel.Next() )
+    {
+        const UInt_t id = pixel.GetPixelId();
 
-      for (Int_t i=0 ; i<nlosamples ; i++ )
-	{ 
-            fHistos->FillLo ( pixel.GetPixelId(),
-                              pixel.GetLoGainFadcSamples()[i] );
-	}
-    } 
-  
-  return kTRUE;
-  
-} 
+        for (Int_t i=0;  i<nhisamples; i++)
+            fHistos->FillHi(id, pixel.GetHiGainFadcSamples()[i]);
+
+        if (!pixel.HasLoGain())
+            continue;
+
+        for (Int_t i=0; i<nlosamples; i++)
+            fHistos->FillLo(id, pixel.GetLoGainFadcSamples()[i]);
+    }
+
+    return kTRUE;
+
+}
Index: trunk/MagicSoft/Mars/mhist/MFillHFadc.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MFillHFadc.h	(revision 710)
+++ trunk/MagicSoft/Mars/mhist/MFillHFadc.h	(revision 711)
@@ -16,7 +16,6 @@
 class MFillHFadc : public MTask {
  private:
-  MRawEvtData      *fRawEvtData;
-
-  MHFadcCam        *fHistos ;
+  MRawEvtData *fRawEvtData; // The raw event data from which the spektrum is created
+  MHFadcCam   *fHistos ;    // The histogram container into which holds the spektrum
 
  public:   
Index: trunk/MagicSoft/Mars/mhist/MFillHHillas.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MFillHHillas.cc	(revision 710)
+++ trunk/MagicSoft/Mars/mhist/MFillHHillas.cc	(revision 711)
@@ -1,2 +1,10 @@
+////////////////////////////////////////////////////////////////////////
+//
+//  MFillHHillas
+//
+//  This task fills the hillas parameter from MHillas into
+//  histograms (MHHillas)
+//
+////////////////////////////////////////////////////////////////////////
 #include "MFillHHillas.h"
 
Index: trunk/MagicSoft/Mars/mhist/MFillHStarMap.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MFillHStarMap.cc	(revision 710)
+++ trunk/MagicSoft/Mars/mhist/MFillHStarMap.cc	(revision 711)
@@ -1,2 +1,11 @@
+////////////////////////////////////////////////////////////////////////
+//
+//  MFillHStarMap
+//
+//  This task fills a star map (a 2D histogram, MHStarMap)
+//  from the calculated hillas parameter (MHillas).
+//  The algorithm for this can be found in MHStarMap::Fill
+//
+////////////////////////////////////////////////////////////////////////
 #include "MFillHStarMap.h"
 
@@ -33,7 +42,4 @@
 Bool_t MFillHStarMap::Process()
 {
-//    if (fabs(fEvt->GetAlpha())>60)
-//        return kCONTINUE;
-
     fHistos->Fill(fEvt);
 
Index: trunk/MagicSoft/Mars/mhist/MHFadcCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHFadcCam.cc	(revision 710)
+++ trunk/MagicSoft/Mars/mhist/MHFadcCam.cc	(revision 711)
@@ -3,5 +3,5 @@
 // MHFadcCam
 //
-// This class contains a list of all ADC spektra histograms
+// This class contains a list of MHFadcPix.
 //
 ///////////////////////////////////////////////////////////////////////
Index: trunk/MagicSoft/Mars/mhist/MHFadcPix.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHFadcPix.cc	(revision 710)
+++ trunk/MagicSoft/Mars/mhist/MHFadcPix.cc	(revision 711)
@@ -1,7 +1,8 @@
 ///////////////////////////////////////////////////////////////////////
 //
-// MHistosAdc
+// MHFadcPix
 //
-// This class contains a list of all ADC spektra histograms
+// This container stores a hostogram to display an Fadc Spekrtum.
+// The spektrum of all the values measured by the Fadcs.
 //
 ///////////////////////////////////////////////////////////////////////
@@ -12,4 +13,39 @@
 
 ClassImp(MHFadcPix)
+
+MHFadcPix::MHFadcPix(UInt_t pixid)
+{
+    //
+    // Creates the histograms for lo and hi gain of one pixel
+    //
+    // FIXME! Set the right axis titles and ... and ...
+    //
+    Char_t tmp1[40]="hi";
+    Char_t tmp2[40]="hi gain Pixel";
+
+    if (pixid)
+    {
+        sprintf(tmp1, "%s%d",  tmp1, pixid);
+        sprintf(tmp2, "%s %d", tmp2, pixid);
+    }
+    fHistHi =  new TH1F(tmp1, tmp2, 256, 0, 255);
+
+
+    Char_t tmp3[40]="lo";
+    Char_t tmp4[40]="lo gain Pixel";
+
+    if (pixid)
+    {
+        sprintf(tmp3, "%s%d",  tmp3, pixid);
+        sprintf(tmp4, "%s %d", tmp4, pixid);
+    }
+    fHistLo =  new TH1F(tmp3, tmp4, 256, 0, 255);
+}
+
+MHFadcPix::~MHFadcPix()
+{
+    delete fHistHi;
+    delete fHistLo;
+}
 
 void MHFadcPix::Draw(Option_t *)
Index: trunk/MagicSoft/Mars/mhist/MHFadcPix.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHFadcPix.h	(revision 710)
+++ trunk/MagicSoft/Mars/mhist/MHFadcPix.h	(revision 711)
@@ -17,24 +17,7 @@
 
 public:
-    MHFadcPix(UInt_t pixid)
-    {
-        Char_t tmp1[40];
-        Char_t tmp2[40];
+    MHFadcPix(UInt_t pixid=0);
+    ~MHFadcPix();
 
-        sprintf(tmp1, "high%d", pixid);
-        sprintf(tmp2, "high gain Pixel %d", pixid);
-
-        fHistHi =  new TH1F(tmp1, tmp2, 256, 0, 255);
-
-        sprintf(tmp1, "low %d", pixid);
-        sprintf(tmp2, "low gain Pixel %d", pixid);
-
-        fHistLo =  new TH1F(tmp1, tmp2, 256, 0, 255);
-    }
-    ~MHFadcPix()
-    {
-        delete fHistHi;
-        delete fHistLo;
-    }
     TH1F *GetHistHi() { return fHistHi; }
     TH1F *GetHistLo() { return fHistLo; }
