Index: trunk/MagicSoft/Mars/manalysis/MSelBasic.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MSelBasic.cc	(revision 1762)
+++ trunk/MagicSoft/Mars/manalysis/MSelBasic.cc	(revision 1809)
@@ -44,4 +44,5 @@
 #include "MGeomCam.h"
 #include "MPedestalCam.h"
+#include "MPedestalPix.h"
 #include "MGeomPix.h"
 
@@ -119,7 +120,83 @@
 Bool_t MSelBasic::Process()
 {
+  /*
+  //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
+  *fLog << "=========================================================" << endl;
+  *fLog << "" << endl;
+  *fLog << "MmcEvt data : " << endl;
+  *fLog << "" << endl;
+  fMcEvt->Print();
+  *fLog << "" << endl;
+  *fLog << "PartId() = " << fMcEvt->GetPartId() << endl;
+  *fLog << "Energy() = " << fMcEvt->GetEnergy() << endl;
+  *fLog << "Theta()  = " << fMcEvt->GetTheta() << endl;
+
+  *fLog << "Phi()    = " << fMcEvt->GetPhi() << endl;
+  //*fLog << "CoreD()  = " << fMcEvt->GetCoreD() << endl;
+  //*fLog << "CoreX()  = " << fMcEvt->GetCoreX() << endl;
+
+  //*fLog << "CoreY()  = " << fMcEvt->GetCoreY() << endl;
+  *fLog << "Impact() = " << fMcEvt->GetImpact() << endl;
+  //*fLog << "PhotIni()= " << fMcEvt->GetPhotIni() << endl;
+
+  //*fLog << "PassPhotAtm() = " << fMcEvt->GetPassPhotAtm() << endl;
+  //*fLog << "PassPhotRef() = " << fMcEvt->GetPassPhotRef() << endl;
+  //*fLog << "PassPhotCone()  = " << fMcEvt->GetPassPhotCone() << endl;
+
+  //*fLog << "PhotElfromShower()    = " << fMcEvt->GetPhotElfromShower() << endl;
+  //*fLog << "PhotElinCamera()  = " << fMcEvt->GetPhotElinCamera() << endl;
+  *fLog << "TelescopePhi()  = " << fMcEvt->GetTelescopePhi() << endl;
+
+  *fLog << "TelescopeTheta()  = " << fMcEvt->GetTelescopeTheta() << endl;
+  *fLog << "Impact() = " << fMcEvt->GetImpact() << endl;
+  //*fLog << "PhotIni()= " << fMcEvt->GetPhotIni() << endl;
+  *fLog << "" << endl;
+  *fLog << "=========================================================" << endl;
+
+  *fLog << "=========================================================" << endl;
+  *fLog << "" << endl;
+  *fLog << "MPedestalPix data : " << endl;
+  *fLog << "" << endl;
+
+  Int_t ntot;
+  ntot = fPed->GetSize();
+    *fLog << "MeanRms() :" << endl;    
+  for (Int_t i=0; i<ntot; i++)
+  {
+    MPedestalPix &pix = (*fPed)[i];
+    //*fLog << "Mean()    = " << i << ",  " << pix.GetMean() << endl;    
+    //*fLog << "Sigma()   = " << i << ",  " << pix.GetSigma() << endl;    
+    *fLog << pix.GetMeanRms() << " ";    
+    //*fLog << "SigmaRms()= " << i << ",  " << pix.GetSigmaRms() << endl;    
+  }
+  *fLog << "" << endl;
+
+  *fLog << "" << endl;
+  ntot = fEvt->GetNumPixels();
+    *fLog << "MCerPhotPix :  pix.GetNumPhotons()" << endl;    
+  for (Int_t i=0; i<ntot; i++)
+  {
+    MCerPhotPix &pix = (*fEvt)[i];
+    *fLog << pix.GetNumPhotons() << " ";    
+  }
+  *fLog << "" << endl;
+
+  *fLog << "" << endl;
+  ntot = fEvt->GetNumPixels();
+    *fLog << "MCerPhotPix :  pix.GetErrorPhot()" << endl;    
+  for (Int_t i=0; i<ntot; i++)
+  {
+    MCerPhotPix &pix = (*fEvt)[i];
+    *fLog << pix.GetErrorPhot() << " ";    
+  }
+  *fLog << "" << endl;
+
+  //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
+  */
+
+
     Int_t rc = 0;
 
-    //if ( fRawRun->GetRunNumber() < 1025 ) 
+    //if ( fRawRun->GetRunNumber() < 16279 ) 
     //{
     //   rc = 1;
@@ -128,8 +205,21 @@
 
     Double_t Theta = kRad2Deg*fMcEvt->GetTelescopeTheta();
-    if (Theta > 45.0  ||  !SwTrigger() )
-    {
-      //*fLog << "MSelBasic::Process; Theta = " << Theta << endl;
+    if ( Theta < 0.0 )
+    {
+      *fLog << "MSelBasic::Process; Run, Event, Theta = " 
+            << fRawRun->GetRunNumber()<< ",  " 
+            << fMcEvt->GetEvtNumber() << ",  " << Theta << endl;
       rc = 1;
+    }    
+
+    else if ( Theta > 45.0 )
+    {
+      rc = 2;
+    }    
+
+    else if ( !SwTrigger() )
+    {
+      //*fLog << "MSelBasic::Process; SwTrigger = " << SwTrigger << endl;
+      rc = 3;
     }    
 
@@ -223,5 +313,9 @@
     *fLog << GetDescriptor() << " execution statistics:" << endl;
     *fLog << dec << setfill(' ');
-    *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3) << (int)(fErrors[1]*100/GetNumExecutions()) << "%) Evts skipped due to: Basic selections are not fullfilled" << endl;
+    *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3) << (int)(fErrors[1]*100/GetNumExecutions()) << "%) Evts skipped due to: Zenith angle < 0" << endl;
+
+    *fLog << " " << setw(7) << fErrors[2] << " (" << setw(3) << (int)(fErrors[2]*100/GetNumExecutions()) << "%) Evts skipped due to: Zenith angle too high" << endl;
+
+    *fLog << " " << setw(7) << fErrors[3] << " (" << setw(3) << (int)(fErrors[3]*100/GetNumExecutions()) << "%) Evts skipped due to: Software trigger not fullfilled" << endl;
 
     *fLog << " " << fErrors[0] << " (" << (int)(fErrors[0]*100/GetNumExecutions()) << "%) Evts survived Basic selections!" << endl;
@@ -230,2 +324,3 @@
     return kTRUE;
 }
+
