Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 7774)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 7775)
@@ -19,8 +19,24 @@
                                                  -*-*- END OF LINE -*-*-
 
+ 2006/07/03 Thomas Bretz
+
+   * mhflux/MHThetaSqN.[h,cc]:
+     - added counter and output some statistics afterwards
+
+
+
  2006/06/29 Thomas Bretz
 
    * mmain/MEventDisplay.cc:
      - added decoding of calibration pattern
+
+   * mbase/MContinue.cc:
+     - small change to some output
+
+   * mmc/MMcTrig.hxx, mmc/MMcTrigHeader.hxx:
+     - increased version number 
+
+   * mmc/Mdefine.h:
+     - increased CAMERA_PIXELS from 3500 to 3800
 
 
Index: /trunk/MagicSoft/Mars/mhflux/MHThetaSqN.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhflux/MHThetaSqN.cc	(revision 7774)
+++ /trunk/MagicSoft/Mars/mhflux/MHThetaSqN.cc	(revision 7775)
@@ -68,5 +68,6 @@
 MHThetaSqN::MHThetaSqN(const char *name, const char *title)
     : MHAlpha(name, title), fDisp(0), fSrcPosCam(0), fSignificanceCutLevel(1.7),
-    fNumBinsSignal(3), fNumBinsTotal(75), fNumOffSourcePos(3), fDoOffCut(kTRUE)
+    fNumBinsSignal(3), fNumBinsTotal(75), fNumOffSourcePos(3), fDoOffCut(kTRUE),
+    fCounter(4)
 {
     //
@@ -176,4 +177,6 @@
 
     fThetaSqCut = fSignificanceCutLevel*fFit.GetSignalIntegralMax()/1.7;
+
+    fCounter.Reset();
 
     return kTRUE;
@@ -280,13 +283,44 @@
 
         const Double_t dist = src0.Mod()*TMath::Sin(rad/2);
-        if (dist<TMath::Sqrt(fFit.GetSignalIntegralMax()))
+        const Double_t cut  = TMath::Sqrt(fFit.GetSignalIntegralMax());
+        if (dist<cut)
         {
-            *fLog << warn << "WARNING - Source regions overlap: ";
-            *fLog << "distance " << dist << " less than theta-sq cut ";
-            *fLog << TMath::Sqrt(fFit.GetSignalIntegralMax()) << "!" << endl;
+            *fLog << warn << "WARNING - Source regions overlap: distance ";
+            *fLog << dist << " less than theta-sq cut " << cut << "!" << endl;
+            if (dist*1.7<cut*1.0)
+                fCounter[3]++;
+            else
+                if (dist*1.7<cut*1.5)
+                    fCounter[2]++;
+                else
+                    fCounter[1]++;
+
         }
+        else
+            fCounter[0]++;
     }
 
     return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// Print execution statistics
+//
+Bool_t MHThetaSqN::Finalize()
+{
+    if (GetNumExecutions()>0)
+    {
+        *fLog << inf << endl;
+        *fLog << GetDescriptor() << " execution statistics:" << endl;
+        PrintSkipped(fCounter[3], "Region distance below 1.0sigma (68.3%)");
+        PrintSkipped(fCounter[2], "Region distance below 1.5sigma (86.6%)");
+        PrintSkipped(fCounter[1], "Region distance below 1.7sigma (91.1%)");
+        *fLog << " " << (int)fCounter[0] << " (" << Form("%5.1f", 100.*fCounter[0]/GetNumExecutions()) << "%) Evts ok!" << endl;
+        //*fLog << " " << (int)fCounter[0] << " (" << Form("%5.1f", 100.*fCounter[0]/GetNumExecutions()) << "%) Evts survived calculation!" << endl;
+        *fLog << endl;
+    }
+
+    return MHAlpha::Finalize();
 }
 
Index: /trunk/MagicSoft/Mars/mhflux/MHThetaSqN.h
===================================================================
--- /trunk/MagicSoft/Mars/mhflux/MHThetaSqN.h	(revision 7774)
+++ /trunk/MagicSoft/Mars/mhflux/MHThetaSqN.h	(revision 7775)
@@ -27,4 +27,6 @@
     Bool_t fDoOffCut;
 
+    TArrayI fCounter;        //!
+
     // MHThetaSqN
     TVector2 GetVec(const TVector2 &v, Int_t n1) const;
@@ -45,6 +47,7 @@
 
     // MH
-    Bool_t   SetupFill(const MParList *pl);
-    Bool_t   Fill(const MParContainer *par, const Stat_t weight);
+    Bool_t SetupFill(const MParList *pl);
+    Bool_t Fill(const MParContainer *par, const Stat_t weight);
+    Bool_t Finalize();
 
     // MParContainer
@@ -61,5 +64,5 @@
     void SetNumOffSourcePos(UInt_t n=3)  { fNumOffSourcePos=TMath::Max(n, 1U); }
 
-    void SetSignificanceCutLevel(Double_t l=1.7)  { fSignificanceCutLevel=l; }
+    void SetSignificanceCutLevel(Double_t l=1.7) { fSignificanceCutLevel=l; }
 
     void SetDoOffCut(Bool_t b=kTRUE)     { fDoOffCut = b; }
