Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 5030)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 5031)
@@ -69,4 +69,6 @@
      - simply calls to IntensityCam somewhat
 
+   * mcalib/MCalibrationBlindCam.[h,cc]
+     - added function GetFluxInsidePlexiglass() and variances
 
 
Index: /trunk/MagicSoft/Mars/mcalib/MCalibrationBlindCam.cc
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrationBlindCam.cc	(revision 5030)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrationBlindCam.cc	(revision 5031)
@@ -106,3 +106,93 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// Return true, if any of the blind pixels have an available photon flux
+//
+Bool_t MCalibrationBlindCam::IsFluxInsidePlexiglassAvailable() const
+{
+  for (Int_t i=0; i<GetSize(); i++)
+    {
+      MCalibrationBlindPix &bp = (MCalibrationBlindPix&)(*this)[i];      
+      if (bp.IsFluxInsidePlexiglassAvailable())
+        return kTRUE;
+    }
+  
+  return kFALSE;
+}
 
+// --------------------------------------------------------------------------
+//
+// Returns weighted average of the flux calculated by each blind pixel
+//
+Float_t MCalibrationBlindCam::GetFluxInsidePlexiglass() const
+{
+
+  Float_t flux    = 0.;
+  Float_t fluxvar = 0.;  
+
+  for (Int_t i=0; i<GetSize(); i++)
+    {
+      MCalibrationBlindPix &bp = (MCalibrationBlindPix&)(*this)[i];
+      if (bp.IsFluxInsidePlexiglassAvailable())
+        {
+          const Float_t weight = 1./ 
+                                bp.GetFluxInsidePlexiglassErr() 
+                                / bp.GetFluxInsidePlexiglassErr();
+          flux    += weight * bp.GetFluxInsidePlexiglass();
+          fluxvar += weight;
+        }
+    }
+  return fluxvar > 0.0001 ? flux / fluxvar : -1.;
+}
+
+// --------------------------------------------------------------------------
+//
+// Returns weighted variance of the flux calculated by each blind pixel
+//
+Float_t MCalibrationBlindCam::GetFluxInsidePlexiglassVar() const
+{
+
+  Float_t fluxvar = 0.;  
+
+  for (Int_t i=0; i<GetSize(); i++)
+    {
+      MCalibrationBlindPix &bp = (MCalibrationBlindPix&)(*this)[i];
+      if (bp.IsFluxInsidePlexiglassAvailable())
+        {
+          const Float_t weight = 1./ 
+                                bp.GetFluxInsidePlexiglassErr() 
+                                / bp.GetFluxInsidePlexiglassErr();
+          fluxvar += weight;
+        }
+    }
+  return fluxvar > 0.0001 ? 1. / fluxvar : -1.;
+}
+
+// --------------------------------------------------------------------------
+//
+// Returns weighted rel. variance of the flux calculated by each blind pixel
+//
+Float_t MCalibrationBlindCam::GetFluxInsidePlexiglassRelVar() const
+{
+
+  Float_t flux    = 0.;
+  Float_t fluxvar = 0.;  
+
+  for (Int_t i=0; i<GetSize(); i++)
+    {
+      MCalibrationBlindPix &bp = (MCalibrationBlindPix&)(*this)[i];
+      if (bp.IsFluxInsidePlexiglassAvailable())
+        {
+          const Float_t weight = 1./ 
+                                bp.GetFluxInsidePlexiglassErr() 
+                                / bp.GetFluxInsidePlexiglassErr();
+          flux    += weight * bp.GetFluxInsidePlexiglass();
+          fluxvar += weight;
+        }
+    }
+
+  return fluxvar > 0.0001 ? flux * fluxvar : -1.;
+}
+
+
Index: /trunk/MagicSoft/Mars/mcalib/MCalibrationBlindCam.h
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrationBlindCam.h	(revision 5030)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrationBlindCam.h	(revision 5031)
@@ -12,5 +12,5 @@
   void Add(const UInt_t a, const UInt_t b);
 
- public:
+public:
 
   MCalibrationBlindCam(Int_t nblind=1,const char *name=NULL, const char *title=NULL);
@@ -21,4 +21,10 @@
   void  Init ( const MGeomCam &geom ) {}
   void  InitSize ( const UInt_t n );
+
+  Bool_t IsFluxInsidePlexiglassAvailable () const;
+
+  Float_t GetFluxInsidePlexiglass    () const;
+  Float_t GetFluxInsidePlexiglassVar () const;
+  Float_t GetFluxInsidePlexiglassRelVar() const;
   
   ClassDef(MCalibrationBlindCam, 2) // Container Blind Pixels Calibration Results Camera
