Index: trunk/MagicSoft/Mars/mhist/MHCamEvent.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHCamEvent.cc	(revision 2544)
+++ trunk/MagicSoft/Mars/mhist/MHCamEvent.cc	(revision 2550)
@@ -54,5 +54,5 @@
 //
 MHCamEvent::MHCamEvent(const char *name, const char *title)
-    : fSum(NULL), fEvt(NULL), fType(0)
+    : fSum(NULL), fRms(NULL), fEvt(NULL), fType(0)
 {
     //
@@ -71,4 +71,6 @@
     if (fSum)
         delete fSum;
+    if (fRms)
+        delete fRms;
 }
 
@@ -99,4 +101,6 @@
     if (fSum)
         delete (fSum);
+    if (fRms)
+        delete (fRms);
 
     const TString name = fNameEvt.IsNull() ? fName : fNameEvt;
@@ -105,4 +109,7 @@
     fSum->SetYTitle("a.u.");
     fSum->SetBit(MHCamera::kProfile);
+
+    fRms = new MHCamera(*cam, name+";rms", fTitle);
+    fRms->SetYTitle("a.u.");
     return kTRUE;
 }
@@ -131,10 +138,13 @@
 Bool_t MHCamEvent::Finalize()
 {
-    fSum->ResetBit(MHCamera::kProfile);
-    if (fSum->GetEntries()>0)
-        fSum->Scale(1./fSum->GetEntries());
+    fRms->AddCamContent(*fSum, 1);
     return kTRUE;
 }
 
+// --------------------------------------------------------------------------
+//
+// Take the mean of the sum histogram and print all pixel indices
+// which are above sum+s*rms
+//
 void MHCamEvent::PrintOutliers(Float_t s) const
 {
@@ -156,9 +166,16 @@
 // --------------------------------------------------------------------------
 //
-// Return fSum.
+// Return fSum for "sum" and fRms for "rms"
 //
 TH1 *MHCamEvent::GetHistByName(const TString name)
 {
-    return fSum;
+//    name.ToLower();
+
+    if (name=="sum")
+        return fSum;
+    if (name=="rms")
+        return fRms;
+
+    return NULL;
 }
 
@@ -171,8 +188,18 @@
 
     pad->cd(1);
+    gPad->SetBorderMode(0);
+    fSum->Draw("EPhist");
+
+    pad->cd(2);
+    gPad->SetBorderMode(0);
+    gPad->Divide(2, 1);
+    pad = gPad;
+
+    pad->cd(1);
+    gPad->SetBorderMode(0);
     fSum->Draw();
 
     pad->cd(2);
     gPad->SetBorderMode(0);
-    fSum->Draw("EPhist");
-}
+    fRms->Draw();
+}
Index: trunk/MagicSoft/Mars/mhist/MHCamEvent.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHCamEvent.h	(revision 2544)
+++ trunk/MagicSoft/Mars/mhist/MHCamEvent.h	(revision 2550)
@@ -13,4 +13,5 @@
 private:
     MHCamera  *fSum; // storing the sum
+    MHCamera  *fRms; // storing the rms
     MCamEvent *fEvt; //! the current event
 
Index: trunk/MagicSoft/Mars/mhist/MHCamera.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHCamera.cc	(revision 2544)
+++ trunk/MagicSoft/Mars/mhist/MHCamera.cc	(revision 2550)
@@ -1131,7 +1131,8 @@
     cout << "Software Pixel Index: " << idx << endl;
     cout << "Hardware Pixel Id:    " << idx+1 << endl;
-    cout << "Contents:             " << GetBinContent(idx+1) << "  <";
-    cout << (IsUsed(idx)?"on":"off");
-    cout << ">" << endl;
+    cout << "Contents:             " << GetBinContent(idx+1);
+    if (GetBinError(idx+1)>0)
+        cout << " +/- " << GetBinError(idx+1);
+    cout << "  <" << (IsUsed(idx)?"on":"off") << ">" << endl;
 
     if (fNotify && fNotify->GetSize()>0)
Index: trunk/MagicSoft/Mars/mhist/MHTriggerLvl0.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHTriggerLvl0.cc	(revision 2544)
+++ trunk/MagicSoft/Mars/mhist/MHTriggerLvl0.cc	(revision 2550)
@@ -111,5 +111,6 @@
 
     fSum = new MHCamera(*cam, name+";avg", fTitle);
-    fSum->SetYTitle("%");
+    fSum->SetBit(MHCamera::kProfile);
+    fSum->SetYTitle("% [1]");
 
     return kTRUE;
@@ -140,10 +141,10 @@
 Bool_t MHTriggerLvl0::Finalize()
 {
-    if (fSum->GetEntries()>0)
-        fSum->Scale(100./fSum->GetEntries());
+    //    if (fSum->GetEntries()>0)
+    //        fSum->Scale(100);
     return kTRUE;
 }
 
-void MHTriggerLvl0::PrintOutlayers(Float_t s) const
+void MHTriggerLvl0::PrintOutliers(Float_t s) const
 {
     const Double_t mean = fSum->GetMean();
Index: trunk/MagicSoft/Mars/mhist/MHTriggerLvl0.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHTriggerLvl0.h	(revision 2544)
+++ trunk/MagicSoft/Mars/mhist/MHTriggerLvl0.h	(revision 2550)
@@ -36,5 +36,5 @@
     void Draw(Option_t * ="");
 
-    void PrintOutlayers(Float_t s) const;
+    void PrintOutliers(Float_t s) const;
 
     ClassDef(MHTriggerLvl0, 1) // Histogram to count how often a pixel is above threshold
