Index: trunk/MagicSoft/Mars/manalysis/MMinuitInterface.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MMinuitInterface.cc	(revision 7033)
+++ 	(revision )
@@ -1,307 +1,0 @@
-/* ======================================================================== *\
-!
-! *
-! * This file is part of MARS, the MAGIC Analysis and Reconstruction
-! * Software. It is distributed to you in the hope that it can be a useful
-! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
-! * It is distributed WITHOUT ANY WARRANTY.
-! *
-! * Permission to use, copy, modify and distribute this software and its
-! * documentation for any purpose is hereby granted without fee,
-! * provided that the above copyright notice appear in all copies and
-! * that both that copyright notice and this permission notice appear
-! * in supporting documentation. It is provided "as is" without express
-! * or implied warranty.
-! *
-!
-!
-!   Author(s): Wolfgang Wittek 7/2003 <mailto:wittek@mppmu.mpg.de>
-!
-!   Copyright: MAGIC Software Development, 2000-2003
-!
-!
-\* ======================================================================== */
-
-/////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-// MMinuitInterface                                                        //
-//                                                                         //
-// Class for interfacing with Minuit                                       //
-//                                                                         //
-//                                                                         //
-//                                                                         //
-/////////////////////////////////////////////////////////////////////////////
-#include "MMinuitInterface.h"
-
-#include <math.h>            // fabs 
-
-#include <TArrayD.h>
-#include <TArrayI.h>
-#include <TMinuit.h>
-#include <TStopwatch.h>
-
-#include "MLog.h"
-#include "MLogManip.h"
-#include "MParContainer.h"
-
-ClassImp(MMinuitInterface);
-
-using namespace std;
-
-
-// --------------------------------------------------------------------------
-//
-// Default constructor.
-//
-MMinuitInterface::MMinuitInterface(const char *name, const char *title)
-{
-    fName  = name  ? name  : "MMinuitInterface";
-    fTitle = title ? title : "Interface for Minuit";
-}
-
-// -----------------------------------------------------------------------
-//
-// Interface to MINUIT
-//
-//
-Bool_t MMinuitInterface::CallMinuit( 
-             void (*fcn)(Int_t &, Double_t *, Double_t &, Double_t *, Int_t),
-             const TString* name, const TArrayD &vinit, const TArrayD &step2,
-             const TArrayD &limlo, const TArrayD &limup, const TArrayI &fix,
-             TObject *objectfit , const TString &method, Bool_t nulloutput)
-{
-    TArrayD step(step2);
-
-    //
-    // Be carefull: This is not thread safe
-    //
-    if (vinit.GetSize() != step.GetSize()  ||
-        vinit.GetSize() != limlo.GetSize() ||
-        vinit.GetSize() != limup.GetSize() ||
-        vinit.GetSize() != fix.GetSize())
-    {
-        *fLog << "CallMinuit: Parameter Size Mismatch" << endl;
-        return kFALSE;
-    }
-
-
-
-    //..............................................
-    // Set the maximum number of parameters
-    //TMinuit *const save = gMinuit;
-
-    TMinuit &minuit = *new TMinuit(vinit.GetSize());
-    minuit.SetName("MinuitSupercuts");
-
-
-    //..............................................
-    // Set the print level
-    // -1   no output except SHOW comands
-    //  0   minimum output
-    //  1   normal output (default)
-    //  2   additional ouput giving intermediate results
-    //  3   maximum output, showing progress of minimizations
-    //
-    minuit.SetPrintLevel(-1);
-
-    //..............................................
-    // Printout for warnings
-    //    SET WAR      print warnings
-    //    SET NOW      suppress warnings
-    Int_t errWarn;
-    Double_t tmpwar = 0;
-    minuit.mnexcm("SET NOW", &tmpwar, 0, errWarn);
-    //minuit.mnexcm("SET WAR", &tmpwar, 0, errWarn);
-
-    //..............................................
-    // Set the address of the minimization function
-    minuit.SetFCN(fcn);
-
-    //..............................................
-    // Store address of object to be used in fcn
-    minuit.SetObjectFit(objectfit );
-
-    //..............................................
-    // Set starting values and step sizes for parameters
-    for (Int_t i=0; i<vinit.GetSize(); i++)
-    {
-        if (minuit.DefineParameter(i, name[i], vinit[i], step[i],
-                                   limlo[i], limup[i]))
-        {
-            *fLog << "CallMinuit: Error in defining parameter "
-                << name[i][0] << endl;
-            return kFALSE;
-        }
-    }
-
-    //..............................................
-    //Int_t NumPars;
-    //NumPars = minuit.GetNumPars();
-    //*fLog << "CallMinuit :  number of free parameters = "
-    //     << NumPars << endl;
-
-
-    //..............................................
-        // Error definition :
-    //
-    //    for chisquare function :
-    //      up = 1.0   means calculate 1-standard deviation error
-    //         = 4.0   means calculate 2-standard deviation error
-    //
-    //    for log(likelihood) function :
-    //      up = 0.5   means calculate 1-standard deviation error
-    //         = 2.0   means calculate 2-standard deviation error
-    minuit.SetErrorDef(1.0);
-
-    // Int_t errMigrad;
-    // Double_t tmp = 0;
-    // minuit.mnexcm("MIGRAD", &tmp, 0, errMigrad);
-
-    //..............................................
-    // fix a parameter
-    for (Int_t i=0; i<vinit.GetSize(); i++)
-    {
-        if (fix[i] > 0)
-        {
-            minuit.FixParameter(i);
-            step[i] = 0.0;
-        }
-    }
-
-    //..............................................
-    //NumPars = minuit.GetNumPars();
-    //*fLog << "CallMinuit :  number of free parameters = "
-    //     << NumPars << endl;
-
-    //..............................................
-    // This doesn't seem to have any effect
-    // Set maximum number of iterations (default = 500)
-    //Int_t maxiter = 100000;
-    //minuit.SetMaxIterations(maxiter);
-
-    //..............................................
-    // minimization by the method of Migrad
-    if (method.Contains("Migrad", TString::kIgnoreCase))
-    {
-        //*fLog << "call MIGRAD" << endl;
-        if (nulloutput)
-            fLog->SetNullOutput(kTRUE);
-        Double_t tmp = 0;
-        minuit.mnexcm("MIGRAD", &tmp, 0, fErrMinimize);
-        if (nulloutput)
-            fLog->SetNullOutput(kFALSE);
-        //*fLog << "return from MIGRAD" << endl;
-    }
-
-    //..............................................
-    // same minimization as by Migrad
-    // but switches to the SIMPLEX method if MIGRAD fails to converge
-    if (method.Contains("Minimize", TString::kIgnoreCase))
-    {
-        *fLog << "call MINIMIZE" << endl;
-        Double_t tmp = 0;
-        minuit.mnexcm("MINIMIZE", &tmp, 0, fErrMinimize);
-        *fLog << "return from MINIMIZE" << endl;
-    }
-
-    //..............................................
-    // minimization by the SIMPLEX method
-    if (method.Contains("Simplex", TString::kIgnoreCase))
-    {
-        *fLog << "call SIMPLEX" << endl;
-        if (nulloutput)
-            fLog->SetNullOutput(kTRUE);
-        Int_t    maxcalls  = 3000;
-        Double_t tolerance = 0.1;
-        Double_t tmp[2];
-        tmp[0] = maxcalls;
-        tmp[1] = tolerance;
-        minuit.mnexcm("SIMPLEX", &tmp[0], 2, fErrMinimize);
-        if (nulloutput)
-            fLog->SetNullOutput(kFALSE);
-        *fLog << "return from SIMPLEX" << endl;
-    }
-
-    //..............................................
-    // check quality of minimization
-    // istat = 0   covariance matrix not calculated
-    //         1   diagonal approximation only (not accurate)
-    //         2   full matrix, but forced positive-definite
-    //         3   full accurate covariance matrix
-    //             (indication of normal convergence)
-    minuit.mnstat(fMin, fEdm, fErrdef, fNpari, fNparx, fIstat);
-
-    //if (fErrMinimize != 0  ||  fIstat < 3)
-    if (fErrMinimize != 0)
-    {
-        *fLog << "CallMinuit : Minimization failed" << endl;
-        *fLog << "       fMin = " << fMin   << ",   fEdm = "  << fEdm
-            << ",   fErrdef = "  << fErrdef << ",   fIstat = " << fIstat
-            << ",   fErrMinimize = " << fErrMinimize << endl;
-        return kFALSE;
-    }
-
-    //*fLog << "CallMinuit : Minimization was successful" << endl;
-    //*fLog << "       fMin = " << fMin   << ",   fEdm = "  << fEdm
-    //     << ",   fErrdef = "  << fErrdef << ",   fIstat = " << fIstat
-    //     << ",   fErrMinimize = " << fErrMinimize << endl;
-
-
-    //..............................................
-    // minimization by the method of Migrad
-    if (method.Contains("Hesse", TString::kIgnoreCase))
-    {
-        //*fLog << "call HESSE" << endl;
-        Double_t tmp = 0;
-        minuit.mnexcm("HESSE", &tmp, 0, fErrMinimize);
-        //*fLog << "return from HESSE" << endl;
-    }
-
-    //..............................................
-    // Minos error analysis
-    if (method.Contains("Minos", TString::kIgnoreCase))
-    {
-        //*fLog << "call MINOS" << endl;
-        Double_t tmp = 0;
-        minuit.mnexcm("MINOS", &tmp, 0, fErrMinimize);
-        //*fLog << "return from MINOS" << endl;
-    }
-
-    //..............................................
-    // Print current status of minimization
-    // if nkode = 0    only function value
-    //            1    parameter values, errors, limits
-    //            2    values, errors, step sizes, internal values
-    //            3    values, errors, step sizes, 1st derivatives
-    //            4    values, parabolic errors, MINOS errors
-
-    //Int_t nkode = 4;
-    //minuit.mnprin(nkode, fmin);
-
-    //..............................................
-    // call fcn with IFLAG = 3 (final calculation : calculate p(chi2))
-    // iflag = 1   initial calculations only
-    //         2   calculate 1st derivatives and function
-    //         3   calculate function only
-    //         4   calculate function + final calculations
-    Double_t iflag = 3;
-    Int_t errfcn3;
-    minuit.mnexcm("CALL", &iflag, 1, errfcn3);
-
-    // WW : the following statements were commented out because the
-    // Minuit object will still be used;
-    // this may be changed in the future 
-    //delete &minuit;
-    //gMinuit = save;
-
-    return kTRUE;
-}
-
-
-
-
-
-
-
-
-
Index: trunk/MagicSoft/Mars/manalysis/MMinuitInterface.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MMinuitInterface.h	(revision 7033)
+++ 	(revision )
@@ -1,61 +1,0 @@
-#ifndef MARS_MMinuitInterface
-#define MARS_MMinuitInterface
-
-#ifndef MARS_MParContainer
-#include "MParContainer.h"
-#endif
-
-class TArrayD;
-class TArrayI;
-
-class MMinuitInterface : public MParContainer
-{
-private:
-    UInt_t   fNpar;
-    Double_t fMin,   fEdm,   fErrdef;
-    Int_t    fNpari, fNparx, fIstat;
-    Int_t    fErrMinimize;
-
-public:
-    MMinuitInterface(const char *name=NULL, const char *title=NULL);
-
-    Bool_t CallMinuit(
-                      void (*fcn)(Int_t &, Double_t *, Double_t &, Double_t *, Int_t),
-                      const TString *name, const TArrayD &vinit, const TArrayD &step,
-                      const TArrayD &limlo, const TArrayD &limup, const TArrayI &fix,
-                      TObject *fObjectFit, const TString &method, Bool_t nulloutput);
-
-    ClassDef(MMinuitInterface, 0) // Class for interfacing with Minuit
-};
-
-#endif
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Index: trunk/MagicSoft/Mars/manalysis/MSigmabar.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MSigmabar.cc	(revision 7033)
+++ 	(revision )
@@ -1,265 +1,0 @@
-/* ======================================================================== *\
-!
-! *
-! * This file is part of MARS, the MAGIC Analysis and Reconstruction
-! * Software. It is distributed to you in the hope that it can be a useful
-! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
-! * It is distributed WITHOUT ANY WARRANTY.
-! *
-! * Permission to use, copy, modify and distribute this software and its
-! * documentation for any purpose is hereby granted without fee,
-! * provided that the above copyright notice appear in all copies and
-! * that both that copyright notice and this permission notice appear
-! * in supporting documentation. It is provided "as is" without express
-! * or implied warranty.
-! *
-!
-!
-!   Author(s): Robert Wagner,   10/2002 <mailto:magicsoft@rwagner.de>
-!   Author(s): Wolfgang Wittek, 01/2003 <mailto:wittek@mppmu.mpg.de>
-!   Author(s): Thomas Bretz,    04/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
-!
-!   Copyright: MAGIC Software Development, 2003
-!
-!
-\* ======================================================================== */
-
-/////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-// MSigmabar                                                               //
-//                                                                         //
-// This is the storage container to hold information about                 //
-// "average" pedestal RMS                                                  //
-//                                                                         //
-// The "average" pedestal RMS is calculated as                             //
-//     <pedRMS> = sqrt( sum_i( (pedRMS_i)^2/area_i ) / no.of pixels )      //
-//                                                                         //
-//     which is the sqrt of the average (pedRMS^2 per area)                //
-//                                                                         //
-/////////////////////////////////////////////////////////////////////////////
-#include "MSigmabar.h"
-
-#include <TMath.h>
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-#include "MParList.h"
-
-#include "MGeomCam.h"
-#include "MGeomPix.h"
-
-#include "MCerPhotEvt.h"
-#include "MCerPhotPix.h"
-
-#include "MPedPhotCam.h"
-#include "MPedPhotPix.h"
-
-ClassImp(MSigmabar);
-
-using namespace std;
-
-// --------------------------------------------------------------------------
-//
-MSigmabar::MSigmabar(const char *name, const char *title)
-{
-    fName  = name  ? name  : "MSigmabar";
-    fTitle = title ? title : "Storage container for Sigmabar";
-}
-
-// --------------------------------------------------------------------------
-//
-MSigmabar::~MSigmabar()
-{
-  // do nothing special.
-}
-
-void MSigmabar::Reset()
-{
-    fSigmabar      = -1;
-    fInnerPixels   = -1;
-    fOuterPixels   = -1;
-    fSigmabarInner = -1;
-    fSigmabarOuter = -1;
-
-    memset(fSigmabarSector, 0, sizeof(fSigmabarSector));
-    memset(fSigmabarInnerSector, 0, sizeof(fSigmabarInnerSector));
-    memset(fSigmabarOuterSector, 0, sizeof(fSigmabarOuterSector));
-}
-
-// --------------------------------------------------------------------------
-//
-// Actual calculation of sigmabar. This is done for each of the six sectors
-// separately due to their possibly different HV behavior. Also inner and
-// outer pixels are treated separately.
-//
-// Preliminary! Works for CT1 test, for real MAGIC crosschecks still have
-// to be done. Also implementation details will be updated, like 
-// determination of sector to which a respective pixel belongs
-//
-Float_t MSigmabar::Calc(const MGeomCam &geom, const MPedPhotCam &ped, 
-                        const MCerPhotEvt &evt)
-{
-    Int_t innerPixels[6];
-    Int_t outerPixels[6];
-    Float_t innerSum[6];
-    Float_t outerSum[6];
-
-    memset(innerPixels, 0, sizeof(innerPixels));
-    memset(outerPixels, 0, sizeof(outerPixels));
-    memset(innerSum, 0, sizeof(innerSum));
-    memset(outerSum, 0, sizeof(outerSum));
-
-    //
-    // sum up sigma^2/area for each sector, 
-    // separately for inner and outer region;
-    //
-    // consider all pixels with Cherenkov photon information
-    // and require "Used"
-    //
-
-    const UInt_t npix = evt.GetNumPixels();
-
-    //*fLog << "MSigmabar : npix = " << npix << endl;
-
-    for (UInt_t i=0; i<npix; i++)
-    {
-        MCerPhotPix &cerpix = evt.operator[](i);
-        if (!cerpix.IsPixelUsed())
-            continue;
-
-	/*
-         if ( cerpix.GetNumPhotons() == 0 )
-         {
-         *fLog << "MSigmabar::Calc(); no.of photons is 0 for used pixel"
-         << endl;
-         continue;
-         }
-	*/
-
-        const Int_t idx = cerpix.GetPixId();
-        if (idx == 0)
-	{
-          //*fLog << "MSigmabar : id = 0;  pixel '0' is used, ignore it" 
-	  //      << endl;
-          continue;
-        }
-
-        // ratio is the area of pixel 0
-        //          divided by the area of the current pixel
-        const Double_t ratio = geom.GetPixRatio(idx);
-
-        //*fLog << "pixel id, ratio = " << idx << ",  " << ratio << endl;
-
-        const MGeomPix &gpix = geom[idx];
-
-        // This is wrong : rounding has to be done on positive values
-        //Int_t sector = (Int_t)(atan2(gpix.GetY(),gpix.GetX())*6 
-        //               / (TMath::Pi()*2));
-        //if (sector<0)
-        //    sector+=6;
-
-        Float_t sectorf = atan2(gpix.GetY(),gpix.GetX()) * 6.0 
-                          / (TMath::Pi()*2);
-        if (sectorf < 0.0)
-          sectorf += 6.0;
-        Int_t sector = (Int_t)sectorf;
-
-        // count only those pixels which have a sigma != 0.0
-        const Float_t sigma = ped[idx].GetRms();
-
-        if ( sigma <= 0 )
-            continue;
-
-        //if (area < 1.5)
-        if (ratio > 0.5)
-        {
-            innerPixels[sector]++;
-            innerSum[sector]+= sigma*sigma * ratio;
-        }
-        else
-        {
-            outerPixels[sector]++;
-            outerSum[sector]+= sigma*sigma * ratio;
-        }
-    }
-
-    fInnerPixels   = 0;
-    fOuterPixels   = 0;
-    Double_t fSumInner = 0;
-    Double_t fSumOuter = 0;
-    for (UInt_t i=0; i<6; i++)
-    {
-        fSumInner      += innerSum[i];
-        fInnerPixels   += innerPixels[i];
-        fSumOuter      += outerSum[i];
-        fOuterPixels   += outerPixels[i];
-    }
-
-    if (fInnerPixels > 0) fSigmabarInner = sqrt(fSumInner / fInnerPixels);
-    if (fOuterPixels > 0) fSigmabarOuter = sqrt(fSumOuter / fOuterPixels);
-
-    //
-    // this is the sqrt of the average sigma^2/area 
-    //
-    fSigmabar = (fInnerPixels+fOuterPixels)<=0 ? 0:
-                sqrt( (fSumInner+fSumOuter)/(fInnerPixels+fOuterPixels) );
-
-    for (UInt_t i=0; i<6; i++)
-    {
-        const Double_t ip  = innerPixels[i];
-        const Double_t op  = outerPixels[i];
-        const Double_t iss = innerSum[i];
-        const Double_t oss = outerSum[i];
-
-        const Double_t sum = ip + op;
-        fSigmabarInnerSector[i] = ip <=0 ? 0 :        sqrt(iss/ip);
-        fSigmabarOuterSector[i] = op <=0 ? 0 :        sqrt(oss/op);
-        fSigmabarSector[i]      = sum<=0 ? 0 : sqrt((iss+oss)/sum);
-    }
-
-    //TString opt = "";
-    //Print(opt);
-
-  return fSigmabarInner;
-}
-
-// --------------------------------------------------------------------------
-//
-void MSigmabar::Print(Option_t *) const
-{
-  *fLog << all << endl;
-  *fLog << "Total number of inner pixels is " << fInnerPixels << endl;
-  *fLog << "Total number of outer pixels is " << fOuterPixels << endl;
-  *fLog << endl;
-
-  *fLog << "Sigmabar     Overall : " << fSigmabar << "   ";
-  *fLog << " Sectors: ";
-  for (Int_t i=0;i<6;i++)
-      *fLog << fSigmabarSector[i] << ", ";
-  *fLog << endl;
-
-
-  *fLog << "Sigmabar     Inner   : " << fSigmabarInner << "   ";
-  *fLog << " Sectors: ";
-  for (Int_t i=0;i<6;i++)
-      *fLog << fSigmabarInnerSector[i] << ", ";
-  *fLog << endl;
-
-
-  *fLog << "Sigmabar     Outer   : " << fSigmabarOuter << "   ";
-  *fLog << " Sectors: ";
-  for (Int_t i=0;i<6;i++)
-      *fLog << fSigmabarOuterSector[i] << ", ";
-  *fLog << endl;
-
-}
-
-
-
-
-
-
-
-
-
Index: trunk/MagicSoft/Mars/manalysis/MSigmabar.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MSigmabar.h	(revision 7033)
+++ 	(revision )
@@ -1,56 +1,0 @@
-#ifndef MARS_MSigmabar
-#define MARS_MSigmabar
-
-#ifndef MARS_MParContainer
-#include "MParContainer.h"
-#endif
-
-class MGeomCam;
-class MParList;
-class MCerPhotEvt;
-class MPedPhotCam;
-
-class MSigmabar : public MParContainer
-{
-private:
-    Float_t fSigmabar;          // Sigmabar ( sqrt(average pedestalRMS^2) ) 
-    Float_t fSigmabarInner;     // --only for inner pixels
-    Float_t fSigmabarOuter;     // --only for outer pixels  
-
-    Float_t fSigmabarSector[6]; // --for the 6 sectors of the camera
-    Float_t fSigmabarInnerSector[6];
-    Float_t fSigmabarOuterSector[6];
-
-    Int_t  fInnerPixels;       // Overall number of inner pixels
-    Int_t  fOuterPixels;       // Overall number of outer pixels
-
-public:
-    MSigmabar(const char *name=NULL, const char *title=NULL);
-    ~MSigmabar();
-    
-    void Reset();
-
-    void Print(Option_t *) const;
- 
-    Float_t GetSigmabar() const       { return fSigmabar;       }
-    Float_t GetSigmabarInner() const  { return fSigmabarInner;  }
-    Float_t GetSigmabarOuter() const  { return fSigmabarOuter;  }
-    Float_t GetSigmabarSector(const Int_t sector) const 
-                              { return fSigmabarSector[sector]; } 
-  
-    //   void SetSigmabar(Float_t f, Float_t i, Float_t o) 
-    //      { fSigmabar = f; fSigmabarInner = i; fSigmabarOuter = o; }
-    //    void SetSigmabarInner(Float_t f) { fSigmabarInner = f; }
-    //    void SetSigmabarOuter(Float_t f) { fSigmabarOuter = f; }   
-
-    Float_t Calc(const MGeomCam &geom, const MPedPhotCam &ped, const MCerPhotEvt &evt);
-      
-    ClassDef(MSigmabar, 1)  // Storage Container for Sigmabar
-};
-
-#endif
-
-
-
-
-
Index: trunk/MagicSoft/Mars/manalysis/MSigmabarCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MSigmabarCalc.cc	(revision 7033)
+++ 	(revision )
@@ -1,186 +1,0 @@
-/* ======================================================================== *\
-!
-! *
-! * This file is part of MARS, the MAGIC Analysis and Reconstruction
-! * Software. It is distributed to you in the hope that it can be a useful
-! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
-! * It is distributed WITHOUT ANY WARRANTY.
-! *
-! * Permission to use, copy, modify and distribute this software and its
-! * documentation for any purpose is hereby granted without fee,
-! * provided that the above copyright notice appear in all copies and
-! * that both that copyright notice and this permission notice appear
-! * in supporting documentation. It is provided "as is" without express
-! * or implied warranty.
-! *
-!
-!
-!   Author(s): Robert Wagner, 10/2002 <rwagner@mppmu.mpg.de>
-!   Author(s): Thomas Bretz, 4/2003 <tbretz@astro.uni-wuerzburg.de>
-!
-!   Copyright: MAGIC Software Development, 2000-2003
-!
-!
-\* ======================================================================== */
-
-/////////////////////////////////////////////////////////////////////////////
-//
-//  MSigmabarCalc
-//
-//  This task calculates Sigmabar using the MSigmabar container and stores
-//  its extremal values together with the corresponding Theta values       
-//  in MSigmabarParam. For the time being, Theta is taken from a Monte
-//  Carlo container. This is preliminary and to be changed ASAP.
-//
-//  Input Containers:
-//   MGeomCam
-//   MPedPhotCam
-//   MRawRunHeader
-//   MPointingPos
-//   MCerPhotEvt
-//
-//  Output Containers:
-//   MSigmabar
-//   MSigmabarParam
-//
-/////////////////////////////////////////////////////////////////////////////
-#include "MSigmabarCalc.h"
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-#include "MParList.h"
-
-#include "MGeomCam.h"
-#include "MPedPhotCam.h"
-
-#include "MSigmabar.h"
-#include "MSigmabarParam.h"
-
-#include "MPointingPos.h"
-
-ClassImp(MSigmabarCalc);
-
-using namespace std;
-
-// --------------------------------------------------------------------------
-//
-// Default constructor. 
-//
-MSigmabarCalc::MSigmabarCalc(const char *name, const char *title)
-{
-    fName  = name  ? name  : "MSigmabarCalc";
-    fTitle = title ? title : "Task to calculate Sigmabar";
-
-    Reset();
-}
-
-// --------------------------------------------------------------------------
-//
-//  check if necessary containers exists in the Parameter list already.
-//  if not create one and add them to the list
-//
-Int_t MSigmabarCalc::PreProcess(MParList *pList)
-{
-    fCam = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam"));
-    if (!fCam)
-    {
-        *fLog << err << "MGeomCam not found (no geometry information available)... aborting." << endl;
-        return kFALSE;
-    }
-
-    fPed = (MPedPhotCam*)pList->FindObject(AddSerialNumber(fNamePedPhotCam), "MPedPhotCam");
-    if (!fPed)
-    {
-        *fLog << err << "MPedPhotCam not found... aborting." << endl;
-        return kFALSE;
-    }
-
-    fRun = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
-    if (!fRun)
-    {
-        *fLog << err << "MRawRunHeader not found... aborting." << endl;
-        return kFALSE;
-    }
-
-    // This is needed for determining min/max Theta
-    fPointPos = (MPointingPos*)pList->FindObject(AddSerialNumber("MPointingPos"));
-    if (!fPointPos)
-    {
-        *fLog << warn << "MPointingPos not found... aborting." << endl;
-        fThetaMin =  0;
-        fThetaMax = 90;
-    }
-
-    fEvt = (MCerPhotEvt*)pList->FindObject(AddSerialNumber("MCerPhotEvt"));
-    if (!fEvt)
-      {
-	*fLog << err << "MCerPhotEvt not found... aborting." << endl;
-	return kFALSE;
-      }
-
-    fSig = (MSigmabar*)pList->FindCreateObj(AddSerialNumber("MSigmabar"));
-    if (!fSig)
-        return kFALSE;
-
-    // FIXME: This might have to change in a
-    //        'more-than-one-telescope-environment'
-    fSigParam = (MSigmabarParam*)pList->FindCreateObj(AddSerialNumber("MSigmabarParam"));
-    if (!fSigParam)
-        return kFALSE;
-
-
-    return kTRUE;
-}
-
-// --------------------------------------------------------------------------
-//
-// Calculating a new Sigmabar is not necessary on event basis as long as
-// we deal with CT1 data. Therefore, the real calculation is done in
-// the ReInit function. Process just takes care for finding the extremal
-// values. Preliminary.
-//
-Int_t MSigmabarCalc::Process()
-{
-    const Double_t rc = fSig->Calc(*fCam, *fPed, *fEvt);
-
-    if (rc>fSigmabarMax) fSigmabarMax=rc;
-    if (rc<fSigmabarMin) fSigmabarMin=rc;
-
-    if (!fPointPos)
-        return kTRUE;
-
-    const Double_t theta = fPointPos->GetZd();
-
-    if (theta>fThetaMax) fThetaMax=theta;
-    if (theta<fThetaMin) fThetaMin=theta;
-
-    return kTRUE;
-}
-
-// --------------------------------------------------------------------------
-//
-// Calculates Sigmabar (for CT1 only needed at Reinit, i.e. when reading
-// a new file)
-//
-Bool_t MSigmabarCalc::ReInit(MParList *pList)
-{
-    fSigParam->SetParams(1, fSigmabarMin, fSigmabarMax, fThetaMin, fThetaMax);
-    fSigParam->SetRunNumber(fRun->GetRunNumber());
-
-    Reset();
-
-    return kTRUE;
-}
-
-void MSigmabarCalc::Reset()
-{
-    if (!fPointPos)
-        return;
-
-    fThetaMin    = FLT_MAX;
-    fThetaMax    = 0;
-    fSigmabarMin = FLT_MAX;
-    fSigmabarMax = 0;
-}
-
Index: trunk/MagicSoft/Mars/manalysis/MSigmabarCalc.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MSigmabarCalc.h	(revision 7033)
+++ 	(revision )
@@ -1,68 +1,0 @@
-#ifndef MARS_MSigmabarCalc
-#define MARS_MSigmabarCalc
-
-#ifndef MARS_MTask
-#include "MTask.h"
-#endif
-
-#ifndef MARS_MGeomCam
-#include "MGeomCam.h"
-#endif
-
-#ifndef MARS_MPointingPos
-#include "MPointingPos.h"
-#endif
-
-#ifndef MARS_MPedPhotCam
-#include "MPedPhotCam.h"
-#endif
-
-#ifndef MARS_MSigmabar
-#include "MSigmabar.h"
-#endif
-
-#ifndef MARS_MSigmabarParam
-#include "MSigmabarParam.h"
-#endif
-
-#ifndef MARS_MRawRunHeader
-#include "MRawRunHeader.h"
-#endif
-
-class MSigmabarCalc : public MTask
-{
-private:
-    MPointingPos   *fPointPos;
-    MCerPhotEvt    *fEvt;
-    MGeomCam       *fCam;
-    MPedPhotCam   *fPed;
-    MRawRunHeader  *fRun;
-    MSigmabar      *fSig;
-    MSigmabarParam *fSigParam;
-
-    Double_t fSigmabarMin; // Parametrization
-    Double_t fSigmabarMax;
-    Double_t fThetaMin;
-    Double_t fThetaMax;
-
-    TString  fNamePedPhotCam; // name of the 'MPedPhotCam' container
-
-    void Reset();
-
-    Int_t PreProcess(MParList *pList);
-    Int_t Process();
-
-    Bool_t ReInit(MParList *pList);
-
-public:
-    MSigmabarCalc(const char *name=NULL, const char *title=NULL);
-
-    void SetNamePedPhotCam(const char *name)  { fNamePedPhotCam = name; }
-
-    ClassDef(MSigmabarCalc, 0) // task for calculating sigmabar
-}; 
-
-#endif
-
-
-
Index: trunk/MagicSoft/Mars/manalysis/MSigmabarParam.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MSigmabarParam.cc	(revision 7033)
+++ 	(revision )
@@ -1,82 +1,0 @@
-/* ======================================================================== *\
-!
-! *
-! * This file is part of MARS, the MAGIC Analysis and Reconstruction
-! * Software. It is distributed to you in the hope that it can be a useful
-! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
-! * It is distributed WITHOUT ANY WARRANTY.
-! *
-! * Permission to use, copy, modify and distribute this software and its
-! * documentation for any purpose is hereby granted without fee,
-! * provided that the above copyright notice appear in all copies and
-! * that both that copyright notice and this permission notice appear
-! * in supporting documentation. It is provided "as is" without express
-! * or implied warranty.
-! *
-!
-!
-!   Author(s): Robert Wagner  10/2002 <mailto:magicsoft@rwagner.de>
-!
-!   Copyright: MAGIC Software Development, 2002
-!
-!
-\* ======================================================================== */
-
-/////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-// MSigmabarParam                                                          //
-//                                                                         //
-// Storage Container for parameters characterizing a distribution of       //
-// events in the Sigmabar-Theta plane                                      //
-//                                                                         //
-// For CT1 tests, we just store Sigmabar_max, Sigmabar_min, Theta_max,     //
-// Theta_min. Later MJD and perhaps more than two points on the            //
-// distribution might follow.                                              //
-//                                                                         //
-//  This implementation is still PRELIMINARY and requires some workarounds //
-//  put in SPECIFICALLY FOR THE CT1 TESTS, since a database to access is   //
-//  missing. It is not the FINAL MAGIC VERSION.                            //
-//                                                                         //
-/////////////////////////////////////////////////////////////////////////////
-#include "MSigmabarParam.h"
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-ClassImp(MSigmabarParam);
-
-using namespace std;
-
-MSigmabarParam::MSigmabarParam(const char *name, const char *title) : fSigmabarMin(0), fSigmabarMax(0), fMjdMin(0), fMjdMax(0), fThetaMin(0), fThetaMax(0), fRunNumber(0)
-{
-    fName  = name  ? name  : "MSigmabarParam";
-    fTitle = title ? title : "Storage container for characterizing a distribution of events in the Sigmabar-Theta plane";      
-}
-
-MSigmabarParam::~MSigmabarParam()
-{
-  // nothing special yet
-}
-
-void MSigmabarParam::SetRunNumber(Int_t r)
-{
-  fRunNumber = r;
-}
-
-void MSigmabarParam::SetParams(Int_t r, Double_t si, Double_t sx, Double_t ti, Double_t tx, Double_t mi, Double_t mx)
-{
-  fSigmabarMin = si;
-  fSigmabarMax = sx;
-  fThetaMin = ti;
-  fThetaMax = tx;
-  fMjdMin = mi;
-  fMjdMax = mx;
-  //fRunNumber = r;
-}
-
-void MSigmabarParam::Print(Option_t *) const
-{
-  *fLog << endl << "Run " << fRunNumber << " | " 
-       << "Sigmabar Min, Max: " << fSigmabarMin << " " << fSigmabarMax 
-       << "| Theta Min, Max: " << fThetaMin << " " << fThetaMax << endl;
-}
Index: trunk/MagicSoft/Mars/manalysis/MSigmabarParam.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MSigmabarParam.h	(revision 7033)
+++ 	(revision )
@@ -1,42 +1,0 @@
-#ifndef MARS_MSigmabarParam
-#define MARS_MSigmabarParam
-
-#ifndef MARS_MParContainer
-#include "MParContainer.h"
-#endif
-
-class MSigmabarParam : public MParContainer
-{
-private:
-  Double_t fSigmabarMin;
-  Double_t fSigmabarMax;
-  Double_t fMjdMin;
-  Double_t fMjdMax;
-  Double_t fThetaMin;
-  Double_t fThetaMax;
-  Int_t    fRunNumber;
-
-public:
-  
-  MSigmabarParam(const char *name=NULL, const char *title=NULL);
-  ~MSigmabarParam();
-  
-  //  void Print(Option_t *) const;
-
-  void SetRunNumber(Int_t r);
-  
-  void SetParams(Int_t r, Double_t si, Double_t sx, Double_t ti, Double_t tx, Double_t mi=0, Double_t mx=0);
-
-  Double_t GetSigmabarMin() const { return fSigmabarMin; }
-  Double_t GetSigmabarMax() const { return fSigmabarMax; }
-  Double_t GetThetaMin() const { return fThetaMin; }
-  Double_t GetThetaMax() const { return fThetaMax; }
-
-  void Print(Option_t *o="") const;
-      
-  ClassDef(MSigmabarParam, 1)  // Storage container for characterizing a distribution of events in the Sigmabar-Theta plane
-
-};
-
-#endif
-
