Index: trunk/MagicSoft/Mars/mhist/HistLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/HistLinkDef.h	(revision 4840)
+++ trunk/MagicSoft/Mars/mhist/HistLinkDef.h	(revision 4841)
@@ -19,4 +19,5 @@
 #pragma link C++ class MHGamma+;
 #pragma link C++ class MHFlux;
+#pragma link C++ class MHSigmaTheta;
 #pragma link C++ class MHEffOnTime+;
 #pragma link C++ class MHTimeDiffTime+;
Index: trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc	(revision 4840)
+++ trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc	(revision 4841)
@@ -44,8 +44,8 @@
 #include "MBinning.h"
 #include "MParList.h"
-#include "MSigmabar.h"
 
 #include "MGeomCam.h"
-#include "MBlindPixels.h"
+#include "MGeomPix.h"
+#include "MBadPixelsCam.h"
 
 #include "MPedPhotCam.h"
@@ -114,4 +114,6 @@
     SetBinning(&fSigmaPixTheta,   &binst, &binspix, &binsb);
     SetBinning(&fDiffPixTheta,    &binst, &binspix, &binsd);
+
+    fNamePedPhotCam = "MPedPhotCamFromData";
 }
 
@@ -134,17 +136,19 @@
 
 
-    fPed = (MPedPhotCam*)plist->FindObject("MPedPhotCam");
+
+    fPed = (MPedPhotCam*)plist->FindObject(AddSerialNumber(fNamePedPhotCam), "MPedPhotCam");
     if (!fPed)
     {
-        *fLog << err << "MPedPhotCam not found... aborting." << endl;
+        *fLog << err << AddSerialNumber(fNamePedPhotCam) 
+              << "[MPedPhotCam] not found... aborting." << endl;
         return kFALSE;
     }
-    fPed->InitSize(fCam->GetNumPixels());
+    //fPed->InitSize(fCam->GetNumPixels()); 
 
     
-    fBlindPix = (MBlindPixels*)plist->FindObject("MBlindPixels");
-    if (!fBlindPix)
+    fBad = (MBadPixelsCam*)plist->FindObject("MBadPixelsCam");
+    if (!fBad)
     {  
-       *fLog << err << "MBlindPixels not found... continue. " << endl; 
+       *fLog << err << "MBadPixelsCam not found... continue. " << endl; 
     }
 
@@ -157,10 +161,4 @@
     }
 
-    fSigmabar = (MSigmabar*)plist->FindObject("MSigmabar");
-    if (!fSigmabar)
-    {
-        *fLog << err << "MSigmabar not found... aborting." << endl;
-        return kFALSE;
-    }
 
     // Get Theta Binning
@@ -213,10 +211,10 @@
 {
     Double_t theta = fPointPos->GetZd();
-    fSigmabar->Calc(*fCam, *fPed, *fEvt);
-    Double_t mysig      = fSigmabar->GetSigmabarInner();
-    Double_t mysigouter = fSigmabar->GetSigmabarOuter();
-
-    //*fLog << "theta, mysig, mysigouter = " << theta << ",  " << mysig 
-    //      << ",  " << mysigouter << endl;
+
+    Double_t mysig      = (fPed->GetArea(0)).GetRms();
+    Double_t mysigouter = (fPed->GetArea(1)).GetRms();
+
+    *fLog << "theta, mysig, mysigouter = " << theta << ",  " << mysig 
+          << ",  " << mysigouter << endl;
 
     fSigmaTheta.Fill(theta, mysig);
@@ -239,10 +237,10 @@
         const MPedPhotPix &pix = (*fPed)[id];
 
-        if ( fBlindPix != NULL  &&  fBlindPix->IsBlind(id) )
+        if ( fBad != NULL  &&  ((*fBad)[id]).IsUnsuitable() )
 	{
-          // this should never occur, because blind pixels should have
-          // been set unused by MBlindPixelsCalc2::UnMap()
-          //*fLog << all << "MHSigmaTheta::Fill; blind pixel found which is used, id = "
-          //      << id << "... go to next pixel." << endl;
+          // this should never occur, because bad pixels should have
+          // been set unused 
+          *fLog << all << "MHSigmaTheta::Fill; bad pixel found which is used, id = "
+                << id << "... go to next pixel." << endl;
 	  continue;
 	}
@@ -256,5 +254,6 @@
 
 	Double_t diff;
-        if (ratio > 0.5)
+        const Byte_t aidx = (*fCam)[id].GetAidx();
+        if (aidx == 0)
 	{
           // inner pixel
Index: trunk/MagicSoft/Mars/mhist/MHSigmaTheta.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHSigmaTheta.h	(revision 4840)
+++ trunk/MagicSoft/Mars/mhist/MHSigmaTheta.h	(revision 4841)
@@ -14,11 +14,11 @@
 #endif
 
+
+class MParList;
 class MGeomCam;
 class MCerPhotEvt;
 class MPointingPos;
 class MPedPhotCam;
-class MSigmabar;
-class MParList;
-class MBlindPixels;
+class MBadPixelsCam;
 
 
@@ -29,7 +29,8 @@
     MPedPhotCam    *fPed;        //!
     MCerPhotEvt    *fEvt;        //!
-    MSigmabar      *fSigmabar;   //!
     MPointingPos   *fPointPos;   //!
-    MBlindPixels   *fBlindPix;   //!
+    MBadPixelsCam  *fBad;        //!
+
+    TString  fNamePedPhotCam; //! name of the 'MPedPhotCam' container
 
                            // sigmabar is the average pedestal sigma  
@@ -44,4 +45,6 @@
 public:
     MHSigmaTheta(const char *name=NULL, const char *title=NULL);
+
+    void SetNamePedPhotCam(const char *name)  { fNamePedPhotCam = name; }
 
     Bool_t SetupFill(const MParList *plist);
Index: trunk/MagicSoft/Mars/mhist/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mhist/Makefile	(revision 4840)
+++ trunk/MagicSoft/Mars/mhist/Makefile	(revision 4841)
@@ -22,5 +22,5 @@
 	   -I../mgui -I../mgeom -I../mdata -I../mfilter -I../mimage \
            -I../mmain -I../mmc -I../mreflector -I../mpointing       \
-           -I../mastro -I../mpedestal
+           -I../mastro -I../mpedestal -I../mbadpixels
 
 SRCFILES = MHEvent.cc \
@@ -45,4 +45,5 @@
            MHGamma.cc \
            MHFlux.cc \
+           MHSigmaTheta.cc \
 	   MHSigmaPixel.cc \
 	   MHSigmabarTheta.cc \
