Index: trunk/MagicSoft/Mars/manalysis/MPointingCorr.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MPointingCorr.cc	(revision 1886)
+++ trunk/MagicSoft/Mars/manalysis/MPointingCorr.cc	(revision 1888)
@@ -38,4 +38,5 @@
 #include "MSrcPosCam.h"
 #include "MGeomCam.h"
+#include "MParameters.h"
 
 #include "MLog.h"
@@ -81,4 +82,11 @@
     }
 
+    fHourAngle = (MParameterD*)pList->FindObject("HourAngle", "MParameterD");
+    if (!fHourAngle)
+    {
+        *fLog << dbginf << "HourAngle not found... aborting." << endl;
+        return kFALSE;
+    }
+
 
     fSrcPos = (MSrcPosCam*)pList->FindObject(fSrcName, "MSrcPosCam");
@@ -104,5 +112,9 @@
    // (cx, cy) is the source position in the camera [mm]
    //
-   Float_t fhourangle = fMcEvt->GetOtherCphFraction();
+   Float_t fhourangle = fHourAngle->GetVal();
+
+   //*fLog << "MPointingCorr::Process; fhourangle = " 
+   //      << fhourangle << endl;
+
    Float_t cx = -0.05132 - 0.001064 * fhourangle 
                          - 3.530e-6 * fhourangle * fhourangle;
Index: trunk/MagicSoft/Mars/manalysis/MPointingCorr.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MPointingCorr.h	(revision 1886)
+++ trunk/MagicSoft/Mars/manalysis/MPointingCorr.h	(revision 1888)
@@ -16,4 +16,6 @@
 class MMcEvt;
 class MSrcPosCam;
+class MParameterD;
+
 
 class MPointingCorr : public MTask
@@ -23,4 +25,5 @@
     MSrcPosCam   *fSrcPos;
     TString       fSrcName;
+    MParameterD  *fHourAngle;
 
     Float_t      fMm2Deg;
Index: trunk/MagicSoft/Mars/manalysis/MSelBasic.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MSelBasic.cc	(revision 1886)
+++ trunk/MagicSoft/Mars/manalysis/MSelBasic.cc	(revision 1888)
@@ -61,6 +61,6 @@
     fTitle = title ? title : "Task to evaluate basic cuts";
 
-    ThetaMin =  0.0;
-    ThetaMax = 60.0;
+    fThetaMin =  0.0;
+    fThetaMax = 60.0;
 }
 
@@ -109,5 +109,5 @@
     }
 
-    memset(fErrors, 0, sizeof(fErrors));
+    memset(fCut, 0, sizeof(fCut));
 
     return kTRUE;
@@ -123,80 +123,4 @@
 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;
 
@@ -207,14 +131,14 @@
     //}
 
-    Double_t Theta = kRad2Deg*fMcEvt->GetTelescopeTheta();
-    if ( Theta < ThetaMin )
+    Double_t theta = kRad2Deg*fMcEvt->GetTelescopeTheta();
+    if ( theta < fThetaMin )
     {
       *fLog << "MSelBasic::Process; Run, Event, Theta = " 
             << fRawRun->GetRunNumber()<< ",  " 
-            << fMcEvt->GetEvtNumber() << ",  " << Theta << endl;
+            << fMcEvt->GetEvtNumber() << ",  " << theta << endl;
       rc = 1;
     }    
 
-    else if ( Theta > ThetaMax )
+    else if ( theta > fThetaMax )
     {
       rc = 2;
@@ -227,5 +151,5 @@
     }    
 
-    fErrors[rc]++;
+    fCut[rc]++;
 
     return rc==0 ? kTRUE : kCONTINUE;
@@ -246,23 +170,4 @@
     const Int_t entries = fEvt->GetNumPixels();
  
-    //$$$$$$$$$$$$$$$$$$
-    //const Int_t nall = fPed->GetSize();  
-    //*fLog << "nall = " << nall << endl;
-    //for (Int_t id=0; id<nall; id++)
-    //{
-    //  MGeomPix &gpix = (*fCam)[id];
-    //  if ( gpix.IsInOutermostRing() ) 
-    //  {
-    //    *fLog << "IsInOutermostRing : pixel no. = " << id << endl;
-    //  }
-
-    //  if ( gpix.IsInOuterRing() ) 
-    //  {
-    //    *fLog << "IsInOuterRing : pixel no. = " << id << endl;
-    //  }
-    //}
-    //$$$$$$$$$$$$$$$$$$
-
-
     for (Int_t i=0; i<entries; i++)
     {
@@ -316,17 +221,17 @@
     *fLog << GetDescriptor() << " execution statistics:" << endl;
     *fLog << dec << setfill(' ');
-    *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3) 
-          << (int)(fErrors[1]*100/GetNumExecutions()) 
-          << "%) Evts skipped due to: Zenith angle < " << ThetaMin << endl;
-
-    *fLog << " " << setw(7) << fErrors[2] << " (" << setw(3) 
-          << (int)(fErrors[2]*100/GetNumExecutions()) 
-          << "%) Evts skipped due to: Zenith angle > " << ThetaMax << endl;
-
-    *fLog << " " << setw(7) << fErrors[3] << " (" << setw(3) 
-          << (int)(fErrors[3]*100/GetNumExecutions()) 
+    *fLog << " " << setw(7) << fCut[1] << " (" << setw(3) 
+          << (int)(fCut[1]*100/GetNumExecutions()) 
+          << "%) Evts skipped due to: Zenith angle < " << fThetaMin << endl;
+
+    *fLog << " " << setw(7) << fCut[2] << " (" << setw(3) 
+          << (int)(fCut[2]*100/GetNumExecutions()) 
+          << "%) Evts skipped due to: Zenith angle > " << fThetaMax << endl;
+
+    *fLog << " " << setw(7) << fCut[3] << " (" << setw(3) 
+          << (int)(fCut[3]*100/GetNumExecutions()) 
           << "%) Evts skipped due to: Software trigger not fullfilled" << endl;
 
-    *fLog << " " << fErrors[0] << " (" << (int)(fErrors[0]*100/GetNumExecutions()) 
+    *fLog << " " << fCut[0] << " (" << (int)(fCut[0]*100/GetNumExecutions()) 
           << "%) Evts survived Basic selections!" << endl;
     *fLog << endl;
@@ -336,2 +241,9 @@
 
 
+
+
+
+
+
+
+
Index: trunk/MagicSoft/Mars/manalysis/MSelBasic.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MSelBasic.h	(revision 1886)
+++ trunk/MagicSoft/Mars/manalysis/MSelBasic.h	(revision 1888)
@@ -24,14 +24,14 @@
 {
 private:
-    const MPedestalCam *fPed;      // Pedestal information
-    const MGeomCam     *fCam;      // Camera Geometry 
-    const MCerPhotEvt  *fEvt;      // Cerenkov Photon Event 
-    const MMcEvt       *fMcEvt;       
+    const MPedestalCam  *fPed;      // Pedestal information
+    const MGeomCam      *fCam;      // Camera Geometry 
+    const MCerPhotEvt   *fEvt;      // Cerenkov Photon Event 
+    const MMcEvt        *fMcEvt;       
     const MRawRunHeader *fRawRun;       
 
-    Double_t     ThetaMin;
-    Double_t     ThetaMax;
+    Float_t     fThetaMin;
+    Float_t     fThetaMax;
 
-    Int_t        fErrors[4];
+    Int_t        fCut[4];
 
 public:
@@ -43,4 +43,6 @@
 
     Bool_t SwTrigger();
+    void SetCuts(Float_t thetamin, Float_t thetamax)
+         { fThetaMin = thetamin; fThetaMax = thetamax; }
 
     ClassDef(MSelBasic, 0)   // Task to evaluate basic cuts
Index: trunk/MagicSoft/Mars/manalysis/MSelFinal.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MSelFinal.cc	(revision 1886)
+++ trunk/MagicSoft/Mars/manalysis/MSelFinal.cc	(revision 1888)
@@ -67,6 +67,7 @@
     fHilSrcName = HilSrcName;
 
-    fHadronnessCut =   0.2;
-    fAlphaCut      = 100.0; //degrees
+    // default values of cuts
+    fHadronnessMax =   1.0;
+    fAlphaMax      = 100.0; //degrees
 }
 
@@ -109,5 +110,5 @@
     }
 
-    memset(fErrors, 0, sizeof(fErrors));
+    memset(fCut, 0, sizeof(fCut));
 
     return kTRUE;
@@ -133,5 +134,5 @@
     Double_t h = fHadronness->GetHadronness();
 
-    if ( h>fHadronnessCut )
+    if ( h>fHadronnessMax )
     {
       //*fLog << "MSelFinal::Process; h, alpha = " << h << ",  " 
@@ -140,5 +141,5 @@
     }    
 
-    else if ( modalpha > fAlphaCut )
+    else if ( modalpha > fAlphaMax )
     {
       //*fLog << "MSelFinal::Process; h, alpha = " << h << ",  " 
@@ -147,5 +148,5 @@
     }    
 
-    fErrors[rc]++;
+    fCut[rc]++;
 
     return rc==0 ? kTRUE : kCONTINUE;
@@ -164,16 +165,15 @@
     *fLog << GetDescriptor() << " execution statistics:" << endl;
     *fLog << dec << setfill(' ');
-    *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3) 
-          << (int)(fErrors[1]*100/GetNumExecutions()) 
-          << "%) Evts skipped due to: g/h separation cut (" << fHadronnessCut
-          << ")" << endl;
+    *fLog << " " << setw(7) << fCut[1] << " (" << setw(3) 
+          << (int)(fCut[1]*100/GetNumExecutions()) 
+          << "%) Evts skipped due to: hadroness > "<< fHadronnessMax << endl;
 
-    *fLog << " " << setw(7) << fErrors[2] << " (" << setw(3) 
-          << (int)(fErrors[2]*100/GetNumExecutions()) 
-          << "%) Evts skipped due to: cut in ALPHA (" << fAlphaCut
-          << " degrees)" << endl;
+    *fLog << " " << setw(7) << fCut[2] << " (" << setw(3) 
+          << (int)(fCut[2]*100/GetNumExecutions()) 
+          << "%) Evts skipped due to: |ALPHA| > " << fAlphaMax
+          << " [degrees]" << endl;
 
-    *fLog << " " << fErrors[0] << " (" 
-          << (int)(fErrors[0]*100/GetNumExecutions()) 
+    *fLog << " " << fCut[0] << " (" 
+          << (int)(fCut[0]*100/GetNumExecutions()) 
           << "%) Evts survived Final selections!" << endl;
     *fLog << endl;
Index: trunk/MagicSoft/Mars/manalysis/MSelFinal.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MSelFinal.h	(revision 1886)
+++ trunk/MagicSoft/Mars/manalysis/MSelFinal.h	(revision 1888)
@@ -32,10 +32,10 @@
 
     Double_t     fMm2Deg;   // conversion mm to degrees in camera
-    Int_t        fErrors[3];
+    Int_t        fCut[3];
     TString      fHilName;
     TString      fHilSrcName;
  
-    Float_t      fHadronnessCut;
-    Float_t      fAlphaCut;
+    Float_t      fHadronnessMax;
+    Float_t      fAlphaMax;
 
 public:
@@ -47,6 +47,6 @@
     Bool_t PostProcess();
 
-    void SetHadronnessCut(Float_t hadcut) { fHadronnessCut = hadcut; }
-    void SetAlphaCut(Float_t alpha)       { fAlphaCut      = alpha;  }
+    void SetCuts(Float_t hadmax, Float_t alphamax) 
+         { fHadronnessMax = hadmax; fAlphaMax = alphamax;  }
 
     ClassDef(MSelFinal, 0)   // Task to evaluate final cuts
Index: trunk/MagicSoft/Mars/manalysis/MSelStandard.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MSelStandard.cc	(revision 1886)
+++ trunk/MagicSoft/Mars/manalysis/MSelStandard.cc	(revision 1888)
@@ -64,4 +64,13 @@
     fHilName    = HilName;
     fHilSrcName = HilSrcName;
+
+    // default values of cuts
+    fUsedPixelsMax =   92;
+    fCorePixelsMin =    4;
+    fSizeMin       =   60;
+    fDistMin       =  0.4;
+    fDistMax       = 1.05;
+    fLengthMin     =  0.0;
+    fWidthMin      =  0.0;
 }
 
@@ -114,5 +123,5 @@
     //*fLog << "fMm2Deg = " << fMm2Deg << endl;
 
-    memset(fErrors, 0, sizeof(fErrors));
+    memset(fCut, 0, sizeof(fCut));
 
     return kTRUE;
@@ -131,37 +140,34 @@
     Int_t rc = 0;
 
-    Double_t fLength       = fHil->GetLength() * fMm2Deg;
-    Double_t fWidth        = fHil->GetWidth()  * fMm2Deg;
-    Double_t fDist         = fHilSrc->GetDist()* fMm2Deg;
-    //Double_t fDelta        = fHil->GetDelta()  * kRad2Deg;
-    Double_t fSize         = fHil->GetSize();
-    Int_t fNumUsedPixels   = fHil->GetNumUsedPixels();
-    Int_t fNumCorePixels   = fHil->GetNumCorePixels();
-
-    if ( fNumUsedPixels >= 92  ||  fNumCorePixels <= 4 )
-    {
-      //*fLog << "MSelStandard::Process; fSize, fDist, fNumUsedPixels, fNumCorePixels = "
-      //      << fSize << ",  " << fDist << ",  " << fNumUsedPixels << ",  "
-      //      << fNumCorePixels << endl;
+    Double_t length       = fHil->GetLength() * fMm2Deg;
+    Double_t width        = fHil->GetWidth()  * fMm2Deg;
+    Double_t dist         = fHilSrc->GetDist()* fMm2Deg;
+    //Double_t delta        = fHil->GetDelta()  * kRad2Deg;
+    Double_t size         = fHil->GetSize();
+    Int_t numusedpixels   = fHil->GetNumUsedPixels();
+    Int_t numcorepixels   = fHil->GetNumCorePixels();
+
+    if ( numusedpixels >= fUsedPixelsMax  ||  numcorepixels <= fCorePixelsMin )
+    {
       rc = 1;
     }    
 
-    else if ( fSize <= 60.0         ||  fDist< 0.4           ||  fDist > 1.05 )
-    {
-      //*fLog << "MSelStandard::Process; fSize, fDist, fNumUsedPixels, fNumCorePixels = "
-      //      << fSize << ",  " << fDist << ",  " << fNumUsedPixels << ",  "
-      //      << fNumCorePixels << endl;
+    else if ( size <= fSizeMin )
+    {
       rc = 2;
     }    
 
-    else if ( fLength <= 0.0         ||  fWidth <= 0.0 )
-    {
-      //*fLog << "MSelStandard::Process; fLength, fWidth = "
-      //      << fLength << ",  " << fWidth << endl;
+    else if ( dist< fDistMin   ||  dist > fDistMax )
+    {
       rc = 3;
     }    
 
-
-    fErrors[rc]++;
+    else if ( length <= fLengthMin   ||  width <= fWidthMin )
+    {
+      rc = 4;
+    }    
+
+
+    fCut[rc]++;
 
     return rc==0 ? kTRUE : kCONTINUE;
@@ -180,18 +186,25 @@
     *fLog << GetDescriptor() << " execution statistics:" << endl;
     *fLog << dec << setfill(' ');
-    *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3) 
-          << (int)(fErrors[1]*100/GetNumExecutions()) 
-          << "%) Evts skipped due to: Requirements on no.of used or core pxels not fullfilled" << endl;
-
-    *fLog << " " << setw(7) << fErrors[2] << " (" << setw(3) 
-          << (int)(fErrors[2]*100/GetNumExecutions()) 
-          << "%) Evts skipped due to: Requirements on SIZE or DIST not fullfilled" << endl;
-
-    *fLog << " " << setw(7) << fErrors[3] << " (" << setw(3) 
-          << (int)(fErrors[3]*100/GetNumExecutions()) 
-          << "%) Evts skipped due to: Length or Width is <= 0" << endl;
-
-    *fLog << " " << fErrors[0] << " (" 
-          << (int)(fErrors[0]*100/GetNumExecutions()) 
+    *fLog << " " << setw(7) << fCut[1] << " (" << setw(3) 
+          << (int)(fCut[1]*100/GetNumExecutions()) 
+          << "%) Evts skipped due to: Used pixels >= " << fUsedPixelsMax 
+          << " or Core pixels <= " << fCorePixelsMin << endl;
+
+    *fLog << " " << setw(7) << fCut[2] << " (" << setw(3) 
+          << (int)(fCut[2]*100/GetNumExecutions()) 
+          << "%) Evts skipped due to: SIZE <= " << fSizeMin << endl;
+
+    *fLog << " " << setw(7) << fCut[3] << " (" << setw(3) 
+          << (int)(fCut[3]*100/GetNumExecutions()) 
+          << "%) Evts skipped due to: DIST < " << fDistMin 
+          << " or DIST > " << fDistMax << endl;
+
+    *fLog << " " << setw(7) << fCut[4] << " (" << setw(3) 
+          << (int)(fCut[4]*100/GetNumExecutions()) 
+          << "%) Evts skipped due to: LENGTH <= " << fLengthMin 
+          << " or WIDTH <= " << fWidthMin << endl;
+
+    *fLog << " " << fCut[0] << " (" 
+          << (int)(fCut[0]*100/GetNumExecutions()) 
           << "%) Evts survived Standard selections!" << endl;
     *fLog << endl;
@@ -201,2 +214,12 @@
 
 
+
+
+
+
+
+
+
+
+
+
Index: trunk/MagicSoft/Mars/manalysis/MSelStandard.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MSelStandard.h	(revision 1886)
+++ trunk/MagicSoft/Mars/manalysis/MSelStandard.h	(revision 1888)
@@ -30,7 +30,15 @@
 
     Double_t     fMm2Deg;   // conversion mm to degrees in camera
-    Int_t        fErrors[4];
+    Int_t        fCut[5];
     TString      fHilName;
     TString      fHilSrcName; 
+
+    Float_t     fUsedPixelsMax;
+    Float_t     fCorePixelsMin;
+    Float_t     fSizeMin;
+    Float_t     fDistMin;
+    Float_t     fDistMax;
+    Float_t     fLengthMin;
+    Float_t     fWidthMin;
 
 public:
@@ -42,4 +50,10 @@
     Bool_t PostProcess();
 
+    void SetCuts(Float_t usedpixelsmax, Float_t corepixelsmin,
+                 Float_t sizemin, Float_t distmin, Float_t distmax,
+                 Float_t lengthmin, Float_t widthmin)
+      { fUsedPixelsMax = usedpixelsmax; fCorePixelsMin = corepixelsmin;
+        fSizeMin = sizemin; fDistMin = distmin; fDistMax = distmax;
+        fLengthMin = lengthmin; fWidthMin = widthmin; } 
 
     ClassDef(MSelStandard, 0)   // Task to evaluate standard cuts
