Index: trunk/MagicSoft/Mars/manalysis/MEnergyEst.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MEnergyEst.cc	(revision 6949)
+++ 	(revision )
@@ -1,57 +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): Thomas Bretz  1/2002 <mailto:tbretz@uni-sw.gwdg.de>
-!   Author(s): Wolfgang Wittek 1/2002 <mailto:wittek@mppmu.mpg.de>
-!
-!   Copyright: MAGIC Software Development, 2000-2002
-!
-!
-\* ======================================================================== */
-
-/////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-// MEnergyEst                                                              //
-//                                                                         //
-// Storage Container for the estimated energy                              //
-//                                                                         //
-//                                                                         //
-/////////////////////////////////////////////////////////////////////////////
-#include "MEnergyEst.h"
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-ClassImp(MEnergyEst);
-
-using namespace std;
-
-// --------------------------------------------------------------------------
-//
-// Default constructor.
-//
-MEnergyEst::MEnergyEst(const char *name, const char *title) : fEnergy(0)
-{
-    fName  = name  ? name  : "MEnergyEst";
-    fTitle = title ? title : "Storage container for the estimated energy [GeV]";
-}
-
-void MEnergyEst::Print(Option_t *o) const
-{
-    *fLog << all << GetDescriptor() << ": Eest = " << (int)fEnergy << "GeV \t Ir = " << (int)(fImpact/100) << "m" << endl;
-}
-
Index: trunk/MagicSoft/Mars/manalysis/MEnergyEst.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MEnergyEst.h	(revision 6949)
+++ 	(revision )
@@ -1,28 +1,0 @@
-#ifndef MARS_MEnergyEst
-#define MARS_MEnergyEst
-
-#ifndef MARS_MParContainer
-#include "MParContainer.h"
-#endif
-
-class MEnergyEst : public MParContainer
-{
-private:
-    Double_t fEnergy; // [GeV] Estimated Energy
-    Double_t fImpact; // [cm]  Estimated Impact
-
-public:
-    MEnergyEst(const char *name=NULL, const char *title=NULL);
-
-    void SetEnergy(Double_t e) { fEnergy = e; }
-    void SetImpact(Double_t i) { fImpact = i; }
-    Double_t GetEnergy() const { return fEnergy; }
-    Double_t GetImpact() const { return fImpact; }
-
-    void Print(Option_t *o="") const;
-
-    ClassDef(MEnergyEst, 1) // Storage Container for the estimated Energy
-};
-
-#endif
-
Index: trunk/MagicSoft/Mars/manalysis/MFindSupercuts.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MFindSupercuts.cc	(revision 6949)
+++ 	(revision )
@@ -1,1153 +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): Thomas Bretz, 6/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
-!   Author(s): Wolfgang Wittek, 7/2003 <mailto:wittek@mppmu.mpg.de>
-!
-!   Copyright: MAGIC Software Development, 2000-2003
-!
-!
-\* ======================================================================== */
-
-/////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-// MFindSupercuts                                                       //
-//                                                                         //
-// Class for otimizing the parameters of the supercuts                     //
-//                                                                         //
-//                                                                         //
-//                                                                         //
-/////////////////////////////////////////////////////////////////////////////
-#include "MFindSupercuts.h"
-
-#include <math.h>            // fabs 
-
-#include <TFile.h>
-#include <TArrayD.h>
-#include <TMinuit.h>
-#include <TCanvas.h>
-#include <TStopwatch.h>
-#include <TVirtualFitter.h>
-
-#include "MBinning.h"
-#include "MContinue.h"
-#include "MSupercuts.h"
-#include "MSupercutsCalc.h"
-#include "MDataElement.h"
-#include "MDataMember.h"
-
-#include "MEvtLoop.h"
-#include "MFSelFinal.h"
-#include "MF.h"
-#include "MFEventSelector.h"
-#include "MFEventSelector2.h"
-#include "MFillH.h"
-//#include "MGeomCamCT1Daniel.h"
-#include "MFEventSelector.h"
-#include "MGeomCamMagic.h"
-#include "MH3.h"
-#include "MHSupercuts.h"
-#include "MHFindSignificance.h"
-#include "MHMatrix.h"
-#include "MHOnSubtraction.h"
-
-#include "MLog.h"
-#include "MLogManip.h"
-#include "MMatrixLoop.h"
-#include "MMinuitInterface.h"
-#include "MParList.h"
-#include "MProgressBar.h"
-#include "MReadMarsFile.h"
-#include "MReadTree.h"
-#include "MTaskList.h"
-
-
-ClassImp(MFindSupercuts);
-
-using namespace std;
-
-
-//------------------------------------------------------------------------
-//
-// fcnSupercuts 
-//
-// - calculates the quantity to be minimized (using TMinuit)
-//
-// - the quantity to be minimized is (-1)*significance of the gamma signal
-//   in the alpha distribution (after cuts)
-//
-// - the parameters to be varied in the minimization are the cut parameters
-//   (par)
-//
-static void fcnSupercuts(Int_t &npar, Double_t *gin, Double_t &f, 
-                         Double_t *par, Int_t iflag)
-{
-    //cout <<  "entry fcnSupercuts" << endl;
-
-    //-------------------------------------------------------------
-    // save pointer to the MINUIT object for optimizing the supercuts
-    // because it will be overwritten 
-    // when fitting the alpha distribution in MHFindSignificance
-    TMinuit *savePointer = gMinuit;
-    //-------------------------------------------------------------
-
-
-    MEvtLoop *evtloopfcn = (MEvtLoop*)gMinuit->GetObjectFit();
-
-    MParList *plistfcn   = (MParList*)evtloopfcn->GetParList();
-    //MTaskList *tasklistfcn   = (MTaskList*)plistfcn->FindObject("MTaskList");
-
-    MSupercuts *super = (MSupercuts*)plistfcn->FindObject("MSupercuts");
-    if (!super)
-    {
-        gLog << "fcnSupercuts : MSupercuts object '" << "MSupercuts"
-            << "' not found... aborting" << endl;
-        return;
-    }
-
-    //
-    // transfer current parameter values to MSupercuts
-    //
-    // Attention : npar is the number of variable parameters
-    //                  not the total number of parameters
-    //
-    Double_t fMin, fEdm, fErrdef;
-    Int_t     fNpari, fNparx, fIstat;
-    gMinuit->mnstat(fMin, fEdm, fErrdef, fNpari, fNparx, fIstat);
-
-    super->SetParameters(TArrayD(fNparx, par));
-
-    //$$$$$$$$$$$$$$$$$$$$$
-    // for testing
-    //TArrayD checkparameters = super->GetParameters();
-    //gLog << "fcnsupercuts : fNpari, fNparx =" << fNpari << ",  " 
-    //     << fNparx  << endl;
-    //gLog << "fcnsupercuts : i, par, checkparameters =" << endl;
-    //for (Int_t i=0; i<fNparx; i++)
-    //{
-    //  gLog << i << ",  " << par[i] << ",  " << checkparameters[i] << endl;
-    //}
-    //$$$$$$$$$$$$$$$$$$$$$
-
-    //
-    // plot alpha with the current cuts
-    //
-    evtloopfcn->Eventloop();
-
-    //tasklistfcn->PrintStatistics(0, kTRUE);
-
-    MH3* alpha = (MH3*)plistfcn->FindObject("AlphaFcn", "MH3");
-    if (!alpha)
-        return;
-
-    TH1 &alphaHist = alpha->GetHist();
-    alphaHist.SetName("alpha-fcnSupercuts");
-
-    //-------------------------------------------
-    // set Minuit pointer to zero in order not to destroy the TMinuit
-    // object for optimizing the supercuts
-    gMinuit = NULL;
-
-    //=================================================================
-    // fit alpha distribution to get the number of excess events and
-    // calculate significance of gamma signal in the alpha plot
-  
-    const Double_t alphasig = 20.0;
-    const Double_t alphamin = 30.0;
-    const Double_t alphamax = 90.0;
-    const Int_t    degree   =    2;
-
-    Bool_t drawpoly;
-    Bool_t fitgauss;
-    if (iflag == 3)
-    {
-        drawpoly  = kTRUE;
-        fitgauss  = kTRUE;
-    }
-    else
-    {
-        drawpoly  = kFALSE;
-        fitgauss  = kFALSE;
-    }
-    //drawpoly  = kFALSE;
-    //fitgauss  = kFALSE;
-
-    const Bool_t print = kTRUE;
-
-    MHFindSignificance findsig;
-    findsig.SetRebin(kTRUE);
-    findsig.SetReduceDegree(kFALSE);
-    
-    const Bool_t rc = findsig.FindSigma(&alphaHist, alphamin, alphamax, degree,
-                                        alphasig, drawpoly, fitgauss, print);
-
-    //=================================================================
-
-    // reset gMinuit to the MINUIT object for optimizing the supercuts 
-    gMinuit = savePointer;
-    //-------------------------------------------
-
-    if (!rc)
-    {
-        gLog << "fcnSupercuts : FindSigma() failed" << endl;
-        f = 1.e10;
-        return;
-    }
-
-    // plot some quantities during the optimization
-    MHSupercuts *plotsuper = (MHSupercuts*)plistfcn->FindObject("MHSupercuts");
-    if (plotsuper)
-        plotsuper->Fill(&findsig);
-
-    //------------------------
-    // get significance
-    const Double_t significance = findsig.GetSignificance();
-    f = significance>0 ? -significance : 0;
-
-
-    //------------------------
-    // optimize signal/background ratio
-    //Double_t ratio = findsig.GetNbg()>0.0 ? 
-    //                 findsig.GetNex()/findsig.GetNbg() : 0.0; 
-    //f = -ratio;
-
-    //-------------------------------------------
-    // final calculations
-    //if (iflag == 3)
-    //{
-    //
-    //}    
-
-    //-------------------------------------------------------------
-}
-
-
-// --------------------------------------------------------------------------
-//
-// Default constructor.
-//
-MFindSupercuts::MFindSupercuts(const char *name, const char *title)
-: fHowManyTrain(10000), fHowManyTest(10000), fMatrixFilter(NULL)
-{
-    fName  = name  ? name  : "MFindSupercuts";
-    fTitle = title ? title : "Optimizer of the supercuts";
-
-    //---------------------------
-    // camera geometry is needed for conversion mm ==> degree
-    //fCam = new MGeomCamCT1Daniel; 
-    fCam = new MGeomCamMagic; 
-
-    // matrices to contain the training/test samples
-    fMatrixTrain = new MHMatrix("MatrixTrain");
-    fMatrixTest  = new MHMatrix("MatrixTest");
-
-    // objects of MSupercutsCalc to which these matrices are attached
-    fCalcHadTrain = new MSupercutsCalc("SupercutsCalcTrain");
-    fCalcHadTest  = new MSupercutsCalc("SupercutsCalcTest");
-
-    // Define columns of matrices
-    fCalcHadTrain->InitMapping(fMatrixTrain);
-    fCalcHadTest->InitMapping(fMatrixTest);
-}
-
-// --------------------------------------------------------------------------
-//
-// Default destructor.
-//
-MFindSupercuts::~MFindSupercuts()
-{
-    delete fCam;
-    delete fMatrixTrain;
-    delete fMatrixTest;
-    delete fCalcHadTrain;
-    delete fCalcHadTest;
-}
-
-// --------------------------------------------------------------------------
-//
-// Define the matrix 'fMatrixTrain' for the training sample
-//
-// alltogether 'howmanytrain' events are read from file 'nametrain';
-// the events are selected according to a target distribution 'hreftrain'
-//
-//
-Bool_t MFindSupercuts::DefineTrainMatrix(
-			  const TString &nametrain, MH3 &hreftrain,
-	                  const Int_t howmanytrain, const TString &filetrain)
-{
-    if (nametrain.IsNull() || howmanytrain <= 0)
-        return kFALSE;
-
-    *fLog << "=============================================" << endl;
-    *fLog << "fill training matrix from file '" << nametrain 
-          << "',   select " << howmanytrain 
-        << " events " << endl;
-    if (!hreftrain.GetHist().GetEntries()==0)
-    {
-      *fLog << "     according to a distribution given by the MH3 object '"
-            << hreftrain.GetName() << "'" << endl;
-    }
-    else
-    {
-      *fLog << "     randomly" << endl;
-    }
-
-
-    MParList  plist;
-    MTaskList tlist;
-
-    MReadMarsFile read("Events", nametrain);
-    read.DisableAutoScheme();
-
-    MFEventSelector2 seltrain(hreftrain);
-    seltrain.SetNumMax(howmanytrain);
-    seltrain.SetName("selectTrain");
-
-    MFillH filltrain(fMatrixTrain);
-    filltrain.SetFilter(&seltrain);
-    filltrain.SetName("fillMatrixTrain");
-
-    //******************************
-    // entries in MParList 
-    
-    plist.AddToList(&tlist);
-    plist.AddToList(fCam);
-    plist.AddToList(fMatrixTrain);
-
-    //******************************
-    // entries in MTaskList 
-
-    tlist.AddToList(&read);
-    tlist.AddToList(&seltrain);
-    tlist.AddToList(&filltrain);
-
-    //******************************
-
-    MProgressBar bar;
-    MEvtLoop evtloop;
-    evtloop.SetParList(&plist);
-    evtloop.SetName("EvtLoopMatrixTrain");
-    evtloop.SetProgressBar(&bar);
-
-    if (!evtloop.Eventloop())
-      return kFALSE;
-
-    tlist.PrintStatistics(0, kTRUE);
-
-    fMatrixTrain->Print("SizeCols");
-    Int_t howmanygenerated = fMatrixTrain->GetM().GetNrows();
-    if (TMath::Abs(howmanygenerated-howmanytrain) > TMath::Sqrt(9.*howmanytrain))
-    {
-      *fLog << "MFindSupercuts::DefineTrainMatrix; no.of generated events ("
-	    << howmanygenerated 
-            << ") is incompatible with the no.of requested events ("
-            << howmanytrain << ")" << endl;
-    }
-
-    *fLog << "training matrix was filled" << endl;
-    *fLog << "=============================================" << endl;
-
-    //--------------------------
-    // write out training matrix
-
-    if (filetrain != "")
-    {
-      TFile filetr(filetrain, "RECREATE");
-      fMatrixTrain->Write();
-      filetr.Close();
-
-      *fLog << "MFindSupercuts::DefineTrainMatrix; Training matrix was written onto file '"
-            << filetrain << "'" << endl;
-    }
-
-
-    return kTRUE;
-}
-
-// --------------------------------------------------------------------------
-//
-// Define the matrix for the test sample
-//
-// alltogether 'howmanytest' events are read from file 'nametest'
-//
-// the events are selected according to a target distribution 'hreftest'
-//
-//
-Bool_t MFindSupercuts::DefineTestMatrix(
-			  const TString &nametest, MH3 &hreftest,
-	                  const Int_t howmanytest, const TString &filetest)
-{
-    if (nametest.IsNull() || howmanytest<=0)
-        return kFALSE;
-
-    *fLog << "=============================================" << endl;
-    *fLog << "fill test matrix from file '" << nametest 
-          << "',   select " << howmanytest 
-          << " events " << endl;
-    if (!hreftest.GetHist().GetEntries()==0)
-    {
-      *fLog << "     according to a distribution given by the MH3 object '"
-            << hreftest.GetName() << "'" << endl;
-    }
-    else
-    {
-      *fLog << "     randomly" << endl;
-    }
-
-
-    MParList  plist;
-    MTaskList tlist;
-
-    MReadMarsFile read("Events", nametest);
-    read.DisableAutoScheme();
-
-    MFEventSelector2 seltest(hreftest);
-    seltest.SetNumMax(howmanytest);
-    seltest.SetName("selectTest");
- 
-    MFillH filltest(fMatrixTest);
-    filltest.SetFilter(&seltest);
-
-    //******************************
-    // entries in MParList 
-    
-    plist.AddToList(&tlist);
-    plist.AddToList(fCam);
-    plist.AddToList(fMatrixTest);
-
-    //******************************
-    // entries in MTaskList 
-
-    tlist.AddToList(&read);
-    tlist.AddToList(&seltest);
-    tlist.AddToList(&filltest);
-
-    //******************************
-
-    MProgressBar bar;
-    MEvtLoop evtloop;
-    evtloop.SetParList(&plist);
-    evtloop.SetName("EvtLoopMatrixTest");
-    evtloop.SetProgressBar(&bar);
-
-    if (!evtloop.Eventloop())
-      return kFALSE;
-
-    tlist.PrintStatistics(0, kTRUE);
-
-    fMatrixTest->Print("SizeCols");
-    const Int_t howmanygenerated = fMatrixTest->GetM().GetNrows();
-    if (TMath::Abs(howmanygenerated-howmanytest) > TMath::Sqrt(9.*howmanytest))
-    {
-      *fLog << "MFindSupercuts::DefineTestMatrix; no.of generated events ("
-	    << howmanygenerated 
-            << ") is incompatible with the no.of requested events ("
-            << howmanytest << ")" << endl;
-    }
-
-    *fLog << "test matrix was filled" << endl;
-    *fLog << "=============================================" << endl;
-
-    //--------------------------
-    // write out test matrix
-
-    if (filetest != "")
-    {
-      TFile filete(filetest, "RECREATE", "");
-      fMatrixTest->Write();
-      filete.Close();
-
-      *fLog << "MFindSupercuts::DefineTestMatrix; Test matrix was written onto file '"
-            << filetest << "'" << endl;
-    }
-
-
-  return kTRUE;
-}
-
-// --------------------------------------------------------------------------
-//
-// Define the matrices for the training and test sample respectively
-//
-//
-//
-Bool_t MFindSupercuts::DefineTrainTestMatrix(
-			  const TString &name, MH3 &href,
-	                  const Int_t howmanytrain, const Int_t howmanytest,
-                          const TString &filetrain, const TString &filetest)
-{
-    *fLog << "=============================================" << endl;
-    *fLog << "fill training and test matrix from file '" << name 
-          << "',   select "   << howmanytrain 
-          << " training and " << howmanytest << " test events " << endl;
-    if (!href.GetHist().GetEntries()==0)
-    {
-      *fLog << "     according to a distribution given by the MH3 object '"
-            << href.GetName() << "'" << endl;
-    }
-    else
-    {
-      *fLog << "     randomly" << endl;
-    }
-
-
-    MParList  plist;
-    MTaskList tlist;
-
-    MReadMarsFile read("Events", name);
-    read.DisableAutoScheme();
-
-    MFEventSelector2 selector(href);
-    selector.SetNumMax(howmanytrain+howmanytest);
-    selector.SetName("selectTrainTest");
-    selector.SetInverted();
-
-    MContinue cont(&selector);
-    cont.SetName("ContTrainTest");
-
-    Double_t prob =  ( (Double_t) howmanytrain )
-                   / ( (Double_t)(howmanytrain+howmanytest) );
-    MFEventSelector split;
-    split.SetSelectionRatio(prob);
-
-    MFillH filltrain(fMatrixTrain);
-    filltrain.SetFilter(&split);
-    filltrain.SetName("fillMatrixTrain");
-
-
-    // consider this event as candidate for a test event 
-    // only if event was not accepted as a training event
-
-    MContinue conttrain(&split);
-    conttrain.SetName("ContTrain");
-
-    MFillH filltest(fMatrixTest);
-    filltest.SetName("fillMatrixTest");
-
-
-    //******************************
-    // entries in MParList 
-    
-    plist.AddToList(&tlist);
-    plist.AddToList(fCam);
-    plist.AddToList(fMatrixTrain);
-    plist.AddToList(fMatrixTest);
-
-    //******************************
-    // entries in MTaskList 
-
-    tlist.AddToList(&read);
-    tlist.AddToList(&cont);
-
-    tlist.AddToList(&split);
-    tlist.AddToList(&filltrain);
-    tlist.AddToList(&conttrain);
-
-    tlist.AddToList(&filltest);
-
-    //******************************
-
-    MProgressBar bar;
-    MEvtLoop evtloop;
-    evtloop.SetParList(&plist);
-    evtloop.SetName("EvtLoopMatrixTrainTest");
-    evtloop.SetProgressBar(&bar);
-
-    Int_t maxev = -1;
-    if (!evtloop.Eventloop(maxev))
-      return kFALSE;
-
-    tlist.PrintStatistics(0, kTRUE);
-
-    fMatrixTrain->Print("SizeCols");
-    const Int_t generatedtrain = fMatrixTrain->GetM().GetNrows();
-    if (TMath::Abs(generatedtrain-howmanytrain) > TMath::Sqrt(9.*howmanytrain))
-    {
-      *fLog << "MFindSupercuts::DefineTrainTestMatrix; no.of generated events ("
-	    << generatedtrain 
-            << ") is incompatible with the no.of requested events ("
-            << howmanytrain << ")" << endl;
-    }
-
-    fMatrixTest->Print("SizeCols");
-    const Int_t generatedtest = fMatrixTest->GetM().GetNrows();
-    if (TMath::Abs(generatedtest-howmanytest) > TMath::Sqrt(9.*howmanytest))
-    {
-      *fLog << "MFindSupercuts::DefineTrainTestMatrix; no.of generated events ("
-	    << generatedtest 
-            << ") is incompatible with the no.of requested events ("
-            << howmanytest << ")" << endl;
-    }
-
-
-    *fLog << "training and test matrix were filled" << endl;
-    *fLog << "=============================================" << endl;
-
-
-    //--------------------------
-    // write out training matrix
-
-    if (filetrain != "")
-    {
-      TFile filetr(filetrain, "RECREATE");
-      fMatrixTrain->Write();
-      filetr.Close();
-
-      *fLog << "MFindSupercuts::DefineTrainTestMatrix; Training matrix was written onto file '"
-            << filetrain << "'" << endl;
-    }
-
-    //--------------------------
-    // write out test matrix
-
-    if (filetest != "")
-    {
-      TFile filete(filetest, "RECREATE", "");
-      fMatrixTest->Write();
-      filete.Close();
-
-      *fLog << "MFindSupercuts::DefineTrainTestMatrix; Test matrix was written onto file '"
-            << filetest << "'" << endl;
-    }
-
-  return kTRUE;
-}
-
-// --------------------------------------------------------------------------
-//
-// Read training and test matrices from files
-//
-//
-
-Bool_t MFindSupercuts::ReadMatrix(const TString &filetrain, const TString &filetest)
-{
-  //--------------------------
-  // read in training matrix
-
-  TFile filetr(filetrain);
-  fMatrixTrain->Read("MatrixTrain");
-  fMatrixTrain->Print("SizeCols");
-
-  *fLog << "MFindSupercuts::ReadMatrix; Training matrix was read in from file '"
-        << filetrain << "'" << endl;
-  filetr.Close();
-
-
-  //--------------------------
-  // read in test matrix
-
-  TFile filete(filetest);
-  fMatrixTest->Read("MatrixTest");
-  fMatrixTest->Print("SizeCols");
-
-  *fLog << "MFindSupercuts::ReadMatrix; Test matrix was read in from file '"
-        << filetest << "'" << endl;
-  filete.Close();
-
-  return kTRUE;  
-}
-
-
-//------------------------------------------------------------------------
-//
-// Steering program for optimizing the supercuts
-// ---------------------------------------------
-//
-//      the criterion for the 'optimum' is 
-//
-//          - a maximum significance of the gamma signal in the alpha plot, 
-//            in which the supercuts have been applied
-//
-// The various steps are :
-//
-// - setup the event loop to be executed for each call to fcnSupercuts 
-// - call TMinuit to do the minimization of (-significance) :
-//        the fcnSupercuts function calculates the significance 
-//                                             for the current cut values
-//        for this - the alpha plot is produced in the event loop, 
-//                   in which the cuts have been applied
-//                 - the significance of the gamma signal in the alpha plot 
-//                   is calculated
-//
-// Needed as input : (to be set by the Set functions)
-//
-// - fFilenameParam      name of file to which optimum values of the 
-//                       parameters are written
-//
-// - fHadronnessName     name of container where MSupercutsCalc will
-//                       put the supercuts hadronness
-//
-// - for the minimization, the starting values of the parameters are taken  
-//     - from file parSCinit (if it is != "")
-//     - or from the arrays params and/or steps 
-//
-//----------------------------------------------------------------------
-Bool_t MFindSupercuts::FindParams(TString parSCinit,
-                                     TArrayD &params, TArrayD &steps)
-{
-    // Setup the event loop which will be executed in the 
-    //                 fcnSupercuts function  of MINUIT
-    //
-    // parSCinit is the name of the file containing the initial values 
-    // of the parameters; 
-    // if parSCinit = ""   'params' and 'steps' are taken as initial values
-
-    *fLog << "=============================================" << endl;
-    *fLog << "Setup event loop for fcnSupercuts" << endl;
-
-    if (fHadronnessName.IsNull())
-    {
-      *fLog << "MFindSupercuts::FindParams; hadronness name is not defined... aborting"
-            << endl;
-      return kFALSE;
-    }
-
-    if (fMatrixTrain == NULL)
-    {
-      *fLog << "MFindSupercuts::FindParams; training matrix is not defined... aborting"
-            << endl;
-      return kFALSE;
-    }
-
-    if (fMatrixTrain->GetM().GetNrows() <= 0)
-    {
-      *fLog << "MFindSupercuts::FindParams; training matrix has no entries"
-            << endl;
-      return kFALSE;
-    }
-
-    MParList  parlistfcn;
-    MTaskList tasklistfcn;
-
-    // loop over rows of matrix
-    MMatrixLoop loop(fMatrixTrain);
-
-    //--------------------------------
-    // create container for the supercut parameters
-    // and set them to their initial values
-    MSupercuts super;
-
-    // take initial values from file parSCinit
-    if (parSCinit != "")
-    {
-      TFile inparam(parSCinit);
-      super.Read("MSupercuts");
-      inparam.Close();
-      *fLog << "MFindSupercuts::FindParams; initial values of parameters are taken from file "
-            << parSCinit << endl;
-    }
-
-    // take initial values from 'params' and/or 'steps'
-    else if (params.GetSize() != 0  || steps.GetSize()  != 0 )
-    {
-      if (params.GetSize()  != 0)
-      {
-        *fLog << "MFindSupercuts::FindParams; initial values of parameters are taken from 'params'"
-              << endl;
-        super.SetParameters(params);
-      }
-      if (steps.GetSize()  != 0)
-      {
-        *fLog << "MFindSupercuts::FindParams; initial step sizes are taken from 'steps'"
-              << endl;
-        super.SetStepsizes(steps);
-      }
-    }
-    else
-    {
-        *fLog << "MFindSupercuts::FindParams; initial values and step sizes are taken from the MSupercuts constructor"
-              << endl;
-    }
-
-
-    //--------------------------------
-    // calculate supercuts hadronness
-    fCalcHadTrain->SetHadronnessName(fHadronnessName);
-
-    // apply the supercuts
-    MF scfilter(fHadronnessName+".fHadronness>0.5");
-    MContinue supercuts(&scfilter);
-
-    // plot |alpha|
-    const TString  mh3Name = "AlphaFcn";
-    MBinning binsalpha("Binning"+mh3Name);
-    binsalpha.SetEdges(54, -12.0, 96.0);
-
-    *fLog << warn << "WARNING------------>ALPHA IS ASSUMED TO BE IN COLUMN 7!!!!!!!!" << endl;
-
-    // |alpha| is assumed to be in column 7 of the matrix
-    MH3 alpha("MatrixTrain[7]");
-    alpha.SetName(mh3Name);
-
-    MFillH fillalpha(&alpha);
-
-    // book histograms to be filled during the optimization
-    //                              ! not in the event loop !
-    MHSupercuts plotsuper;
-    plotsuper.SetupFill(&parlistfcn);
-
-    //******************************
-    // entries in MParList (extension of old MParList)
-    
-    parlistfcn.AddToList(&tasklistfcn);
-    parlistfcn.AddToList(&super);
-    parlistfcn.AddToList(fCam);
-    parlistfcn.AddToList(fMatrixTrain);
-
-    parlistfcn.AddToList(&binsalpha);
-    parlistfcn.AddToList(&alpha);
-
-    parlistfcn.AddToList(&plotsuper);
-
-    //******************************
-    // entries in MTaskList
-
-    tasklistfcn.AddToList(&loop);
-    tasklistfcn.AddToList(fCalcHadTrain);
-    tasklistfcn.AddToList(&supercuts);
-    tasklistfcn.AddToList(&fillalpha);
-
-
-    //******************************
-
-    MEvtLoop evtloopfcn("EvtLoopFCN");
-    evtloopfcn.SetParList(&parlistfcn);
-    *fLog << "Event loop for fcnSupercuts has been setup" << endl;
-
-    // address of evtloopfcn is used in CallMinuit()
-
-
-    //-----------------------------------------------------------------------
-    //
-    //----------   Start of minimization part   --------------------
-    //
-    // Do the minimization with MINUIT
-    //
-    // Be careful: This is not thread safe
-    //
-    *fLog << "========================================================" << endl;
-    *fLog << "Start minimization for supercuts" << endl;
-
-
-    // -------------------------------------------
-    // prepare call to MINUIT
-    //
-
-    // get initial values of parameters 
-    fVinit = super.GetParameters();
-    fStep  = super.GetStepsizes();
-
-    TString name[fVinit.GetSize()];
-    fStep.Set(fVinit.GetSize());
-    fLimlo.Set(fVinit.GetSize());
-    fLimup.Set(fVinit.GetSize());
-    fFix.Set(fVinit.GetSize());
-
-    fNpar = fVinit.GetSize();
-
-    for (UInt_t i=0; i<fNpar; i++)
-    {
-        name[i]   = "p";
-        name[i]  += i+1;
-        //fStep[i]  = TMath::Abs(fVinit[i]/10.0);
-        fLimlo[i] = -100.0;
-        fLimup[i] =  100.0;
-        fFix[i]   =     0;
-    }
-
-    // these parameters make no sense, fix them at 0.0
-    fVinit[33] = 0.0;
-    fStep[33]  = 0.0;
-    fFix[33]   = 1;
-
-    fVinit[36] = 0.0;
-    fStep[36]  = 0.0;
-    fFix[36]   = 1;
-
-    fVinit[39] = 0.0;
-    fStep[39]  = 0.0;
-    fFix[39]   = 1;
-
-    fVinit[41] = 0.0;
-    fStep[41]  = 0.0;
-    fFix[41]   = 1;
-
-    fVinit[44] = 0.0;
-    fStep[44]  = 0.0;
-    fFix[44]   = 1;
-
-    fVinit[47] = 0.0;
-    fStep[47]  = 0.0;
-    fFix[47]   = 1;
-
-    // vary only first 48 parameters
-    //for (UInt_t i=0; i<fNpar; i++)
-    //{
-    //    if (i >= 48)
-    //	{
-    //      fStep[i] = 0.0;
-    //      fFix[i]  =   1;
-    //	}
-    //}
- 
-
-    // -------------------------------------------
-    // call MINUIT
-
-    TStopwatch clock;
-    clock.Start();
-
-    *fLog << "before calling CallMinuit" << endl;
-
-    MMinuitInterface inter;               
-    Bool_t rc = inter.CallMinuit(fcnSupercuts, name,
-                                 fVinit, fStep, fLimlo, fLimup, fFix,
-                                 &evtloopfcn, "SIMPLEX", kFALSE);
- 
-    *fLog << "after calling CallMinuit" << endl;
-
-    *fLog << "Time spent for the minimization in MINUIT :   " << endl;;
-    clock.Stop();
-    clock.Print();
-
-    plotsuper.DrawClone();
-
-    if (!rc)
-        return kFALSE;
-
-    *fLog << "Minimization for supercuts finished" << endl;
-    *fLog << "========================================================" << endl;
-
-
-    // -----------------------------------------------------------------
-    // in 'fcnSupercuts' (IFLAG=3) the optimum parameter values were put 
-    //                    into MSupercuts
-
-    // write optimum parameter values onto file filenameParam
-    
-    TFile outparam(fFilenameParam, "RECREATE"); 
-    super.Write();
-    outparam.Close();
-
-    *fLog << "Optimum parameter values for supercuts were written onto file '"
-              << fFilenameParam << "' :" << endl;
-
-    const TArrayD &check = super.GetParameters();
-    for (Int_t i=0; i<check.GetSize(); i++)
-        *fLog << check[i] << ",  ";
-    *fLog << endl;
-
-
-
-    *fLog << "End of  supercuts optimization part" << endl;
-    *fLog << "======================================================" << endl;
-
-    return kTRUE;
-}
-
-
-// -----------------------------------------------------------------------
-//
-// Test the supercuts on the test sample
-//
-
-Bool_t MFindSupercuts::TestParams()
-{
-    if (fMatrixTest->GetM().GetNrows() <= 0)
-    {
-        *fLog << "MFindSupercuts::TestParams; test matrix has no entries" 
-              << endl;
-        return kFALSE;
-    }
-
-    // -------------   TEST the supercuts    ------------------------------
-    //
-    *fLog << "Test the supercuts on the test sample" << endl;
-
-    // -----------------------------------------------------------------
-    // read optimum parameter values from file filenameParam
-    // into array 'supercutsPar'
-
-    TFile inparam(fFilenameParam);
-    MSupercuts scin; 
-    scin.Read("MSupercuts");
-    inparam.Close();
-
-    *fLog << "Optimum parameter values for supercuts were read from file '";
-    *fLog << fFilenameParam << "' :" << endl;
-
-    const TArrayD &supercutsPar = scin.GetParameters();
-    for (Int_t i=0; i<supercutsPar.GetSize(); i++)
-        *fLog << supercutsPar[i] << ",  ";
-    *fLog << endl;
-    //---------------------------
-
-
-    // -----------------------------------------------------------------
-    if (fHadronnessName.IsNull())
-    {
-        *fLog << "MFindSupercuts::TestParams; hadronness name is not defined... aborting";
-        *fLog << endl;
-        return kFALSE;
-    }
-
-    MParList  parlist2;
-    MTaskList tasklist2;
-
-    MSupercuts supercuts;
-    supercuts.SetParameters(supercutsPar);
-
-    fCalcHadTest->SetHadronnessName(fHadronnessName);
-
-
-    //-------------------------------------------
-
-    MMatrixLoop loop(fMatrixTest);
-
-    // plot alpha before applying the supercuts
-    const TString  mh3NameB = "AlphaBefore";
-    MBinning binsalphabef("Binning"+mh3NameB);
-    binsalphabef.SetEdges(54, -12.0, 96.0);
-
-    // |alpha| is assumed to be in column 7 of the matrix
-    MH3 alphabefore("MatrixTest[7]");
-    alphabefore.SetName(mh3NameB);
-
-    TH1 &alphahistb = alphabefore.GetHist();
-    alphahistb.SetName("alphaBefore-TestParams");
-
-    MFillH fillalphabefore(&alphabefore);
-    fillalphabefore.SetName("FillAlphaBefore");
-
-    // apply the supercuts
-    MF scfilter(fHadronnessName+".fHadronness>0.5");
-    MContinue applysupercuts(&scfilter);
-
-    // plot alpha after applying the supercuts
-    const TString  mh3NameA = "AlphaAfter";
-    MBinning binsalphaaft("Binning"+mh3NameA);
-    binsalphaaft.SetEdges(54, -12.0, 96.0);
-
-    MH3 alphaafter("MatrixTest[7]");
-    alphaafter.SetName(mh3NameA);
-
-    TH1 &alphahista = alphaafter.GetHist();
-    alphahista.SetName("alphaAfter-TestParams");
-
-    MFillH fillalphaafter(&alphaafter);
-    fillalphaafter.SetName("FillAlphaAfter");
-
-    //******************************
-    // entries in MParList
-
-    parlist2.AddToList(&tasklist2);
-
-    parlist2.AddToList(&supercuts);
-
-    parlist2.AddToList(fCam);
-    parlist2.AddToList(fMatrixTest);
-
-    parlist2.AddToList(&binsalphabef);
-    parlist2.AddToList(&alphabefore);
-
-    parlist2.AddToList(&binsalphaaft);
-    parlist2.AddToList(&alphaafter);
-
-    //******************************
-    // entries in MTaskList
-
-    tasklist2.AddToList(&loop);
-    tasklist2.AddToList(&fillalphabefore);
-
-    tasklist2.AddToList(fCalcHadTest);
-    tasklist2.AddToList(&applysupercuts);
-
-    tasklist2.AddToList(&fillalphaafter);
-
-    //******************************
-
-    MProgressBar bar2;
-    MEvtLoop evtloop2;
-    evtloop2.SetParList(&parlist2);
-    evtloop2.SetName("EvtLoopTestParams");
-    evtloop2.SetProgressBar(&bar2);
-    Int_t maxevents2 = -1;
-    if (!evtloop2.Eventloop(maxevents2))
-        return kFALSE;
-
-    tasklist2.PrintStatistics(0, kTRUE);
-
-
-    //-------------------------------------------
-    // draw the alpha plots
-
-    MH3* alphaBefore = (MH3*)parlist2.FindObject(mh3NameB, "MH3");
-    TH1  &alphaHist1 = alphaBefore->GetHist();
-    alphaHist1.SetXTitle("|\\alpha|  [\\circ]");
-
-    MH3* alphaAfter = (MH3*)parlist2.FindObject(mh3NameA, "MH3");
-    TH1  &alphaHist2 = alphaAfter->GetHist();
-    alphaHist2.SetXTitle("|\\alpha|  [\\circ]");
-    alphaHist2.SetName("alpha-TestParams");
-
-    TCanvas *c = new TCanvas("AlphaAfterSC", "AlphaTest", 600, 300);
-    c->Divide(2,1);
-
-    gROOT->SetSelectedPad(NULL);
-
-    c->cd(1);
-    alphaHist1.DrawCopy();
-
-    c->cd(2);
-    alphaHist2.DrawCopy();
-
-
-
-    //-------------------------------------------
-    // fit alpha distribution to get the number of excess events and
-    // calculate significance of gamma signal in the alpha plot
-  
-    const Double_t alphasig = 20.0;
-    const Double_t alphamin = 30.0;
-    const Double_t alphamax = 90.0;
-    const Int_t    degree   =    2;
-    const Bool_t   drawpoly  = kTRUE;
-    const Bool_t   fitgauss  = kTRUE;
-    const Bool_t   print     = kTRUE;
-
-    MHFindSignificance findsig;
-    findsig.SetRebin(kTRUE);
-    findsig.SetReduceDegree(kFALSE);
-
-    findsig.FindSigma(&alphaHist2, alphamin, alphamax, degree, 
-                      alphasig, drawpoly, fitgauss, print);
-
-    const Double_t significance = findsig.GetSignificance();
-    const Double_t alphasi = findsig.GetAlphasi();
-
-    *fLog << "Significance of gamma signal after supercuts in test sample : "
-         << significance << " (for |alpha| < " << alphasi << " degrees)" 
-         << endl;
-    //-------------------------------------------
-
-
-    *fLog << "Test of supercuts part finished" << endl;
-    *fLog << "======================================================" << endl;
-
-    return kTRUE;
-}
-
Index: trunk/MagicSoft/Mars/manalysis/MFindSupercuts.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MFindSupercuts.h	(revision 6949)
+++ 	(revision )
@@ -1,132 +1,0 @@
-#ifndef MARS_MFindSupercuts
-#define MARS_MFindSupercuts
-
-#ifndef MARS_MParContainer
-#include "MParContainer.h"
-#endif
-
-#ifndef ROOT_TArrayD
-#include <TArrayD.h>
-#endif
-#ifndef ROOT_TArrayI
-#include <TArrayI.h>
-#endif
-
-class MFilter;
-class MEvtLoop;
-class MH3;
-class MSupercutsCalc;
-class MGeomCam;
-class MHMatrix;
-/*
-#include "MFilter.h"
-#include "MEvtLoop.h"
-#include "MH3.h"
-#include "MSupercutsCalc.h"
-#include "MGeomCam.h"
-#include "MHMatrix.h"
-*/
-
-class MFindSupercuts : public MParContainer
-{
-private:
-
-  TString fFilenameTrain;
-  TString fFilenameTest;
-
-  Int_t   fHowManyTrain;
-  Int_t   fHowManyTest;
-
-  Bool_t  fUseOrigDistribution;
-
-  TString  fFilenameParam;
-
-  TString  fHadronnessName;
-
-  MSupercutsCalc *fCalcHadTrain;
-  MSupercutsCalc *fCalcHadTest;
-
-  MHMatrix          *fMatrixTrain;
-  MHMatrix          *fMatrixTest;
-  MGeomCam          *fCam;
-
-  MEvtLoop *fObjectFit;
-
-  MFilter  *fMatrixFilter; 
-
-  // to comunicate with MINUIT -----------------
-  // attention : dimensions must agree with those in 
-  //             MMinuitInterface::CallMinuit()
-  //char    fParName [80][100];
-  TArrayD fVinit;
-  TArrayD fStep;
-  TArrayD fLimlo;
-  TArrayD fLimup;
-  TArrayI fFix;
-
-  UInt_t     fNpar;
-
-  TString    fMethod;
-
-  Double_t fMin,   fEdm,   fErrdef;
-  Int_t    fNpari, fNparx, fIstat;
-  Int_t    fErrMinimize;
-  //--------------------------------------------
-
-
-public:
-  MFindSupercuts(const char *name=NULL, const char *title=NULL);
-  ~MFindSupercuts();
-
-  void SetFilenameTraining(const TString &name, const Int_t howmany) 
-      {fFilenameTrain = name;  fHowManyTrain = howmany; }
-
-  void SetFilenameTest(const TString &name, const Int_t howmany)     
-      {fFilenameTest     = name;  fHowManyTest  = howmany; }
-
-  void SetFilenameParam(const TString &name)    {fFilenameParam  = name;}
-  void SetHadronnessName(const TString &name)   {fHadronnessName = name;}
-
-  void SetMatrixFilter(MFilter *filter)          {fMatrixFilter = filter;}
-
-  Bool_t DefineTrainMatrix(const TString &name, MH3 &href,
-                           const Int_t howmany, const TString &filetrain); 
-
-  Bool_t DefineTestMatrix(const TString &name, MH3 &href,
-                          const Int_t howmany, const TString &filetest);
-
-  Bool_t DefineTrainTestMatrix(const TString &name, MH3 &href,
-			 const Int_t howmanytrain, const Int_t howmanytest, 
-                         const TString &filetrain, const TString &filetest);
-
-  MHMatrix *GetMatrixTrain() { return fMatrixTrain; }
-  MHMatrix *GetMatrixTest()  { return fMatrixTest;  }
-
-  Bool_t ReadMatrix( const TString &filetrain, const TString &filetest);
-
-  Bool_t FindParams(TString parSCinit, TArrayD &params, TArrayD &steps);
-  Bool_t TestParams();
-
-  ClassDef(MFindSupercuts, 1) // Class for optimization of the Supercuts
-};
-
-#endif
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Index: trunk/MagicSoft/Mars/manalysis/MHPedestalCam.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHPedestalCam.cc	(revision 6949)
+++ 	(revision )
@@ -1,581 +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): Thomas Bretz  12/2000 <mailto:tbretz@atsro.uni-wuerzburh.de>
-!   Author(s): Markus Gaug   02/2004 <mailto:markus@ifae.es>
-!
-!   Copyright: MAGIC Software Development, 2000-2004
-!
-!
-\* ======================================================================== */
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// MHPedestalCam
-//
-// Fills the extracted pedestals of MExtractedSignalCam into
-// the MHCalibrationPix-classes MHPedestalPix for every:
-//
-// - Pixel, stored in the TObjArray's MHCalibrationCam::fHiGainArray
-//   or MHCalibrationCam::fHiGainArray, respectively, depending if
-//   MArrivalTimePix::IsLoGainUsed() is set.
-//
-// - Average pixel per AREA index (e.g. inner and outer for the MAGIC camera),
-//   stored in the TObjArray's MHCalibrationCam::fAverageHiGainAreas and
-//   MHCalibrationCam::fAverageHiGainAreas
-//
-// - Average pixel per camera SECTOR (e.g. sectors 1-6 for the MAGIC camera),
-//   stored in the TObjArray's MHCalibrationCam::fAverageHiGainSectors
-//   and MHCalibrationCam::fAverageHiGainSectors
-//
-// Every pedestal is directly taken from MExtractedSignalCam, filled by the
-// appropriate extractor.
-//
-// The pedestals are filled into a histogram and an array, in order to perform
-// a Fourier analysis (see MHGausEvents). The signals are moreover averaged on an
-// event-by-event basis and written into the corresponding average pixels.
-//
-// The histograms are fitted to a Gaussian, mean and sigma with its errors
-// and the fit probability are extracted. If none of these values are NaN's and
-// if the probability is bigger than MHGausEvents::fProbLimit (default: 0.5%),
-// the fit is declared valid.
-// Otherwise, the fit is repeated within ranges of the previous mean
-// +- MHCalibrationPix::fPickupLimit (default: 5) sigma (see MHCalibrationPix::RepeatFit())
-// In case this does not make the fit valid, the histogram means and RMS's are
-// taken directly (see MHCalibrationPix::BypassFit()).
-//
-// Outliers of more than MHCalibrationPix::fPickupLimit (default: 5) sigmas
-// from the mean are counted as Pickup events (stored in MHCalibrationPix::fPickup)
-//
-// The number of summed FADC slices is taken to re-normalize
-// the result to a pedestal per pixel with the formulas (see MHPedestalPix::Renorm()):
-// - Mean Pedestal        / slice = Mean Pedestal        / Number slices
-// - Mean Pedestal Error  / slice = Mean Pedestal Error  / Number slices
-// - Sigma Pedestal       / slice = Sigma Pedestal       / Sqrt (Number slices)
-// - Sigma Pedestal Error / slice = Sigma Pedestal Error / Sqrt (Number slices)
-//
-// The class also fills arrays with the signal vs. event number, creates a fourier
-// spectrum (see MHGausEvents::CreateFourierSpectrum()) and investigates if the
-// projected fourier components follow an exponential distribution.
-//
-// This same procedure is performed for the average pixels.
-//
-// The following results are written into MPedestalCam:
-//
-// - MCalibrationPix::SetMean()
-// - MCalibrationPix::SetMeanErr()
-// - MCalibrationPix::SetSigma()
-// - MCalibrationPix::SetSigmaErr()
-// - MCalibrationPix::SetProb()
-// - MCalibrationPix::SetNumPickup()
-//
-// For all averaged areas, the fitted sigma is multiplied with the square root of
-// the number involved pixels in order to be able to compare it to the average of
-// sigmas in the camera.
-//
-/////////////////////////////////////////////////////////////////////////////
-#include "MHPedestalCam.h"
-#include "MHPedestalPix.h"
-
-#include "MBadPixelsCam.h"
-#include "MBadPixelsPix.h"
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-#include "MParList.h"
-
-#include "MExtractedSignalCam.h"
-#include "MExtractedSignalPix.h"
-
-#include "MPedestalCam.h"
-#include "MPedestalPix.h"
-
-#include "MGeomCam.h"
-#include "MGeomPix.h"
-
-#include "MCalibrationPedCam.h"
-
-#include "TH1.h"
-
-ClassImp(MHPedestalCam);
-
-using namespace std;
-// --------------------------------------------------------------------------
-//
-// Default constructor. 
-//
-// Initializes:
-// - fExtractHiGainSlices to 0.
-// - fExtractLoGainSlices to 0.
-// - the event frequency to 1200 Hz.
-// - the fRenorm flag to kTRUE
-//
-MHPedestalCam::MHPedestalCam(const char *name, const char *title) 
-    : fExtractHiGainSlices(0.), fExtractLoGainSlices(0.)
-{
-
-  fName  = name  ? name  : "MHPedestalCam";
-  fTitle = title ? title : "";
-  
-  SetPulserFrequency(1200);
-  SetRenorm();
-
-}
-
-
-
-// --------------------------------------------------------------------------
-//
-// Searches pointer to:
-// - MPedestalCam
-// - MExtractedSignalCam
-//
-// Searches or creates:
-// - MCalibrationPedCam
-//
-// Retrieves from MExtractedSignalCam:
-// - number of used High Gain FADC slices (MExtractedSignalCam::GetNumUsedHiGainFADCSlices())
-// - number of used Low  Gain FADC slices (MExtractedSignalCam::GetNumUsedLoGainFADCSlices())
-//
-// Initializes, if empty to MGeomCam::GetNumPixels():
-// - MHCalibrationCam::fHiGainArray, MHCalibrationCam::fLoGainArray
-//
-// Initializes, if empty to MGeomCam::GetNumAreas() for:
-// - MHCalibrationCam::fAverageHiGainAreas, MHCalibrationCam::fAverageLoGainAreas
-//
-// Initializes, if empty to MGeomCam::GetNumSectors() for:
-// - MHCalibrationCam::fAverageHiGainSectors, MHCalibrationCam::fAverageLoGainSectors
-// 
-// Calls MHCalibrationCam::InitPedHists() for every entry in:
-// - MHCalibrationCam::fHiGainArray, MHCalibrationCam::fLoGainArray
-// - MHCalibrationCam::fAverageHiGainAreas, MHCalibrationCam::fAverageLoGainAreas
-// - MHCalibrationCam::fAverageHiGainSectors, MHCalibrationCam::fAverageLoGainSectors
-//
-// Sets Titles and Names for the Histograms 
-// - MHCalibrationCam::fAverageHiGainAreas
-// - MHCalibrationCam::fAverageHiGainSectors
-// 
-Bool_t MHPedestalCam::ReInitHists(MParList *pList)
-{
-
-  MExtractedSignalCam *signal = (MExtractedSignalCam*)pList->FindObject("MExtractedSignalCam");
-  if (!signal)
-    {
-      gLog << err << "Cannot find MExtractedSignalCam... abort." << endl;
-      return kFALSE;
-    }
-  
-
-  fPedestals = (MPedestalCam*)pList->FindObject("MPedestalCam");
-
-  if (!fPedestals)
-    {
-      gLog << err << "Cannot find MPedestalCam ... abort." << endl;
-      return kFALSE;
-    }
-
-  const Int_t npixels  = fGeom->GetNumPixels();
-  const Int_t nsectors = fGeom->GetNumSectors();
-  const Int_t nareas   = fGeom->GetNumAreas();
-
-  fCam = (MCalibrationCam*)pList->FindObject("MCalibrationPedCam");
-  if (!fCam)
-  {
-      fCam = (MCalibrationCam*)pList->FindCreateObj(AddSerialNumber("MCalibrationPedCam"));
-      if (!fCam)
-          return kFALSE;
-
-      fCam->Init(*fGeom);
-  }
-  
-  Float_t sliceshi = signal->GetNumUsedHiGainFADCSlices();
-  Float_t sliceslo = signal->GetNumUsedLoGainFADCSlices();
-
-  if (sliceshi == 0.)
-    {
-      gLog << err << "Number of used signal slices in MExtractedSignalCam is zero  ... abort." 
-           << endl;
-      return kFALSE;
-    }
-
-  if (fExtractHiGainSlices != 0. && sliceshi != fExtractHiGainSlices )
-    {
-      gLog << err << "Number of used High Gain signal slices changed in MExtractedSignalCam  ... abort." 
-           << endl;
-      return kFALSE;
-    }
-
-  if (fExtractLoGainSlices != 0. && sliceslo != fExtractLoGainSlices )
-    {
-      gLog << err << "Number of used Low Gain signal slices changed in MExtractedSignalCam  ... abort." 
-           << endl;
-      return kFALSE;
-    }
-
-  fExtractHiGainSlices = sliceshi;
-  fExtractLoGainSlices = sliceslo;
-
-  if (fHiGainArray->GetEntries()==0)
-  {
-      fHiGainArray->Expand(npixels);
-      for (Int_t i=0; i<npixels; i++)
-      {
-	  (*fHiGainArray)[i] = new MHPedestalPix;
-          InitPedHists((MHPedestalPix&)(*this)[i],i,fExtractHiGainSlices);
-          
-          if ((*fBadPixels)[i].IsBad())
-            (*this)[i].SetExcluded();
-
-          (*fPedestals)[i].InitUseHists();
-      }
-
-  }
-
-  if (fLoGainArray->GetEntries()==0)
-  {
-      fLoGainArray->Expand(npixels);
-      for (Int_t i=0; i<npixels; i++)
-      {
-	  (*fLoGainArray)[i] = new MHPedestalPix;
-          InitPedHists((MHPedestalPix&)(*this)(i),i,fExtractLoGainSlices);
-
-          if ((*fBadPixels)[i].IsBad())
-            (*this)(i).SetExcluded();
-      }
-  }
-
-  if (fAverageHiGainAreas->GetEntries()==0)
-  {
-    fAverageHiGainAreas->Expand(nareas);
-    
-    for (Int_t j=0; j<nareas; j++)
-      {
-        (*fAverageHiGainAreas)[j] = 
-          new MHPedestalPix("AverageHiGainArea",
-                                      "Average Pedestals area idx ");
-
-        GetAverageHiGainArea(j).GetHGausHist()->SetTitle("Pedestals average Area Idx ");
-
-        InitPedHists((MHPedestalPix&)GetAverageHiGainArea(j),j,fExtractHiGainSlices);
-
-      }
-  }
-
-  if (fAverageLoGainAreas->GetEntries()==0)
-  {
-    fAverageLoGainAreas->Expand(nareas);
-    
-    for (Int_t j=0; j<nareas; j++)
-      {
-        (*fAverageLoGainAreas)[j] = 
-          new MHPedestalPix("AverageLoGainArea",
-                                      "Pedestals average Area idx ");
-
-        GetAverageLoGainArea(j).GetHGausHist()->SetTitle("Pedestals average Area Idx ");
-
-        InitPedHists((MHPedestalPix&)GetAverageLoGainArea(j),j,fExtractLoGainSlices);
-
-      }
-  }
-
-  if (fAverageHiGainSectors->GetEntries()==0)
-  {
-      fAverageHiGainSectors->Expand(nsectors);
-
-      for (Int_t j=0; j<nsectors; j++)
-      {
-	  (*fAverageHiGainSectors)[j] = 
-            new MHPedestalPix("AverageHiGainSector",
-                                        "Pedestals average sector ");
-
-          GetAverageHiGainSector(j).GetHGausHist()->SetTitle("Pedestals average Sector ");
-
-          InitPedHists((MHPedestalPix&)GetAverageHiGainSector(j),j,fExtractHiGainSlices);
-
-      }
-  }
-
-  if (fAverageLoGainSectors->GetEntries()==0)
-  {
-      fAverageLoGainSectors->Expand(nsectors);
-
-      for (Int_t j=0; j<nsectors; j++)
-      {
-	  (*fAverageLoGainSectors)[j] = 
-            new MHPedestalPix("AverageLoGainSector",
-                                        "Pedestals average sector ");
-
-          GetAverageLoGainSector(j).GetHGausHist()->SetTitle("Pedestals average Sector ");
-
-          InitPedHists((MHPedestalPix&)GetAverageLoGainSector(j),j,fExtractLoGainSlices);
-          
-      }
-  }
-
-  return kTRUE;
-}
-
-
-// -------------------------------------------------------------
-//
-// If MBadPixelsPix::IsBad():
-// - calls MHCalibrationPix::SetExcluded()
-//
-// Calls:
-// - MHGausEvents::InitBins()
-// - MHCalibrationPix::ChangeHistId(i)
-// - MHCalibrationPix::SetEventFrequency(fPulserFrequency)
-// - MHPedestalPix::SetNSlices(nslices)
-//
-void MHPedestalCam::InitPedHists(MHPedestalPix &hist, const Int_t i, const Float_t nslices)
-{
-
-  hist.InitBins();
-  hist.ChangeHistId(i);
-  hist.SetEventFrequency(fPulserFrequency);
-
-  if (fRenorm)
-    hist.SetNSlices(nslices);
-
-  hist.SetProbLimit(0.);
-
-  TH1F *h = hist.GetHGausHist();
-  h->SetTitle( Form("%s%s", h->GetTitle()," Runs: "));
-}
-// -------------------------------------------------------------------------------
-//
-// Retrieves pointer to MExtractedSignalCam:
-//
-// Retrieves from MGeomCam:
-// - number of pixels
-// - number of pixel areas
-// - number of sectors
-//
-// Fills HiGain or LoGain histograms (MHGausEvents::FillHistAndArray()), respectively
-// with the signals MExtractedSignalCam::GetExtractedSignalHiGain() and 
-// MExtractedSignalCam::GetExtractedSignalLoGain(), respectively.
-//
-Bool_t MHPedestalCam::FillHists(const MParContainer *par, const Stat_t w)
-{
-
-  MExtractedSignalCam *signal = (MExtractedSignalCam*)par;
-  if (!signal)
-    {
-      gLog << err << "No argument in MExtractedSignalCam::Fill... abort." << endl;
-      return kFALSE;
-    }
-  
-  
-
-  const UInt_t npixels  = fGeom->GetNumPixels();
-  const UInt_t nareas   = fGeom->GetNumAreas();
-  const UInt_t nsectors = fGeom->GetNumSectors();
-
-  TArrayF sumareahi(nareas);
-  TArrayF sumarealo(nareas);
-  TArrayF sumsectorhi(nsectors);
-  TArrayD sumsectorlo(nsectors);
-  TArrayI numareahi(nareas);
-  TArrayI numarealo(nareas);
-  TArrayI numsectorhi(nsectors);
-  TArrayI numsectorlo(nsectors);
-
-  for (UInt_t i=0; i<npixels; i++)
-  {
-      MHCalibrationPix &histhi = (*this)[i];
-      MHCalibrationPix &histlo = (*this)(i);
-
-      if (histhi.IsExcluded())
-          continue;
-
-      const MExtractedSignalPix &pix = (*signal)[i];
-
-      const Float_t pedhi = pix.GetExtractedSignalHiGain();
-      const Float_t pedlo = pix.GetExtractedSignalLoGain();
-
-      const Int_t aidx   = (*fGeom)[i].GetAidx();
-      const Int_t sector = (*fGeom)[i].GetSector();
-
-      histhi.FillHistAndArray(pedhi) ;
-      sumareahi  [aidx]   += pedhi;
-      numareahi  [aidx]   ++;
-      sumsectorhi[sector] += pedhi;
-      numsectorhi[sector] ++;
-
-      histlo.FillHistAndArray(pedlo);
-      sumarealo  [aidx]   += pedlo;
-      numarealo  [aidx]   ++;
-      sumsectorlo[sector] += pedlo;
-      numsectorlo[sector] ++;
-
-    }
-  
-  for (UInt_t j=0; j<nareas; j++)
-    {
-      MHCalibrationPix &histhi = GetAverageHiGainArea(j);
-      histhi.FillHistAndArray(numareahi[j] == 0 ? 0. : sumareahi[j]/numareahi[j]);
-
-      MHCalibrationPix &histlo = GetAverageLoGainArea(j);
-      histlo.FillHistAndArray(numarealo[j] == 0 ? 0. : sumarealo[j]/numarealo[j]);
-    }
-  
-  for (UInt_t j=0; j<nsectors; j++)
-    {
-      MHCalibrationPix &histhi = GetAverageHiGainSector(j);
-      histhi.FillHistAndArray(numsectorhi[j] == 0 ? 0. : sumsectorhi[j]/numsectorhi[j]);
-
-      MHCalibrationPix &histlo = GetAverageLoGainSector(j);
-      histlo.FillHistAndArray(numsectorlo[j] == 0 ? 0. : sumsectorlo[j]/numsectorlo[j]);
-    }
-  
-  return kTRUE;
-}
-
-// --------------------------------------------------------------------------
-//
-// Calls:
-// - MHCalibrationCam::FitHiGainArrays() with Bad Pixels flags 0
-// - MHCalibrationCam::FitLoGainArrays() with Bad Pixels flags 0
-// 
-Bool_t MHPedestalCam::FinalizeHists()
-{
-
-  FitHiGainArrays((*fCam),*fBadPixels, 
-                  MBadPixelsPix::kHiGainNotFitted,
-                  MBadPixelsPix::kHiGainOscillating);
-  FitLoGainArrays((*fCam),*fBadPixels,
-                  MBadPixelsPix::kLoGainNotFitted,
-                  MBadPixelsPix::kLoGainOscillating);
-
-
-  return kTRUE;
-  
-
-}
-
-// ------------------------------------------------------------------
-//
-// The types are as follows:
-// 
-// Fitted values:
-// ============== 
-//
-// 0: Fitted Charge
-// 1: Error of fitted Charge
-// 2: Sigma of fitted Charge
-// 3: Error of Sigma of fitted Charge
-//
-//
-// Useful variables derived from the fit results:
-// =============================================
-//
-// 4: Returned probability of Gauss fit to Charge distribution
-// 5: Relative differenc of calculated pedestal (per slice) and fitted (per slice)
-// 6: Error of the Relative differenc of calculated pedestal (per slice) and fitted (per slice)
-// 7: Relative difference of the error of the mean pedestal (per slice) - calculated and fitted
-// 8: Relative differenc of calculated pedestal RMS (per slice) and fitted sigma (per slice)
-// 9: Error of Relative differenc of calculated pedestal RMS (per slice) and fitted sigma (per slice)
-// 10: Relative difference of the error of the pedestal RMS (per slice) - calculated and fitted
-//
-// Localized defects:
-// ==================
-//
-// 11: Gaus fit not OK
-// 12: Fourier spectrum not OK
-//
-Bool_t MHPedestalCam::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const
-{
-
-  if (fHiGainArray->GetSize() <= idx)
-    return kFALSE;
-
-  if ((*this)[idx].IsExcluded())
-    return kFALSE;
-
-  const Float_t ped      = (*fPedestals)[idx].GetPedestal();
-  const Float_t rms      = (*fPedestals)[idx].GetPedestalRms();
-
-  const Float_t entsqr    =  TMath::Sqrt((Float_t)fPedestals->GetTotalEntries());
-
-  const Float_t pederr   = rms/entsqr;
-  const Float_t rmserr   = rms/entsqr/2.;
-
-  const Float_t mean     = (*this)[idx].GetMean();
-  const Float_t meanerr  = (*this)[idx].GetMeanErr();
-  const Float_t sigma    = (*this)[idx].GetSigma() ;
-  const Float_t sigmaerr = (*this)[idx].GetSigmaErr();
-
-  switch (type)
-    {
-    case 0:
-      val = mean;
-      break;
-    case 1:
-      val = meanerr;
-      break;
-    case 2:
-      val = sigma;
-      break;
-    case 3:
-      val = sigmaerr;
-      break;
-    case 4:
-      val = (*this)[idx].GetProb();
-      break;
-    case 5:
-      val = 2.*(mean-ped)/(ped+mean);
-      break;
-    case 6:
-      val = TMath::Sqrt((pederr*pederr + meanerr*meanerr) * (ped*ped + mean*mean))
-            *2./(ped+mean)/(ped+mean);
-      break;
-    case 7:
-      val = 2.*(meanerr-pederr)/(pederr + meanerr);
-      break;
-    case 8:
-      val = 2.*(sigma-rms)/(sigma+rms);
-      break;
-    case 9:
-      val = TMath::Sqrt((rmserr*rmserr + sigmaerr*sigmaerr) * (rms*rms + sigma*sigma))
-            *2./(rms+sigma)/(rms+sigma);
-      break;
-    case 10:
-      val = 2.*(sigmaerr - rmserr)/(sigmaerr + rmserr);
-      break;
-    case 11:
-      if (!(*this)[idx].IsGausFitOK())
-        val = 1.;
-      break;
-    case 12:
-      if (!(*this)[idx].IsFourierSpectrumOK())
-        val = 1.;
-      break;
-    default:
-      return kFALSE;
-    }
-  return kTRUE;
-}
-
-// --------------------------------------------------------------------------
-//
-// Calls MHGausEvents::DrawClone() for pixel idx
-//
-void MHPedestalCam::DrawPixelContent(Int_t idx) const
-{
-  (*this)[idx].DrawClone();
-}
Index: trunk/MagicSoft/Mars/manalysis/MHPedestalCam.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHPedestalCam.h	(revision 6949)
+++ 	(revision )
@@ -1,42 +1,0 @@
-#ifndef MARS_MHPedestalCam
-#define MARS_MHPedestalCam
-
-#ifndef MARS_MHCalibrationCam
-#include "MHCalibrationCam.h"
-#endif
-
-class MGeomCam;
-class MPedestalCam;
-class MHPedestalPix;
-class MHPedestalCam : public MHCalibrationCam
-{
-
-private:
-
-  void   InitPedHists(MHPedestalPix &hist, const Int_t i, const Float_t nslices);
-  
-  Bool_t ReInitHists(MParList *pList);
-  Bool_t FillHists(const MParContainer *par, const Stat_t w=1);
-  Bool_t FinalizeHists();
-  
-  Float_t fExtractHiGainSlices;           // Number of FADC slices used for high gain signal extraction
-  Float_t fExtractLoGainSlices;           // Number of FADC slices used for low  gain signal extraction
-
-  Bool_t  fRenorm;
-
-  MPedestalCam *fPedestals;               //! Pedestal Cam filled by MPedCalcPedRun
-  
-public:
-  MHPedestalCam(const char *name=NULL, const char *title=NULL);
-  ~MHPedestalCam() {}
-  
-  Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
-  void DrawPixelContent(Int_t idx) const;
-  
-  void SetRenorm( const Bool_t b=kTRUE )  {  fRenorm = b; }
-
-  ClassDef(MHPedestalCam, 1)	// Histogram class for Charge Camera Pedestals 
-};
-
-#endif
-
Index: trunk/MagicSoft/Mars/manalysis/MHPedestalPix.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHPedestalPix.cc	(revision 6949)
+++ 	(revision )
@@ -1,134 +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): Markus Gaug 02/2004 <mailto:markus@ifae.es>
-!
-!   Copyright: MAGIC Software Development, 2000-2004
-!
-!
-\* ======================================================================== */
-
-//////////////////////////////////////////////////////////////////////////////
-//
-//  MHPedestalPix
-//
-//  Histogram class for pedestal analysis. 
-//  Stores and fits the pedestals taken from MPedestalPix on an event-by-event
-//  basis. The results are re-normalized to a value per slice with the formulae:
-//
-// - Mean Pedestal        / slice = Mean Pedestal        / Number slices
-// - Mean Pedestal Error  / slice = Mean Pedestal Error  / Number slices
-// - Sigma Pedestal       / slice = Sigma Pedestal       / Sqrt (Number slices)
-// - Sigma Pedestal Error / slice = Sigma Pedestal Error / Sqrt (Number slices)
-// 
-//  Derives from MHCalibrationPix, fits the pedestals to a Gaussian and performs
-//  a Fourier analysis.
-//
-//////////////////////////////////////////////////////////////////////////////
-#include "MHPedestalPix.h"
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-#include <TH1.h>
-
-ClassImp(MHPedestalPix);
-
-using namespace std;
-//
-const Int_t   MHPedestalPix::fgChargeNbins    = 500;
-const Axis_t  MHPedestalPix::fgChargeFirst    = -49.5;
-const Axis_t  MHPedestalPix::fgChargeLast     = 449.5;
-// --------------------------------------------------------------------------
-//
-// Default Constructor. 
-//
-// Sets: 
-// - the default number for fNbins        (fgChargeNbins)
-// - the default number for fFirst        (fgChargeFirst)
-// - the default number for fLast         (fgChargeLast)
-//
-// - the default name of the  fHGausHist ("HPedestalCharge")
-// - the default title of the fHGausHist ("Distribution of Summed FADC Pedestal slices Pixel ")
-// - the default x-axis title for fHGausHist ("Sum FADC Slices")
-// - the default y-axis title for fHGausHist ("Nr. of events")
-// - TH1::Sumw2() for fHGausHist
-//
-// Initializes:
-// - fNSlices to 1
-// - fProbLimit to 0.01
-//
-MHPedestalPix::MHPedestalPix(const char *name, const char *title) 
-    : fNSlices(1.)
-{ 
-
-  fName  = name  ? name  : "MHPedestalPix";
-  fTitle = title ? title : "Histogrammed Pedestal events";
-
-  SetNbins( fgChargeNbins );
-  SetFirst( fgChargeFirst );
-  SetLast(  fgChargeLast  );
-
-  SetProbLimit(0.01);
-
-  // Create a large number of bins, later we will rebin
-  fHGausHist.SetName("HPedestalCharge");
-  fHGausHist.SetTitle("Distribution of Summed FADC Pedestal Slices Pixel ");
-  fHGausHist.SetXTitle("Sum FADC Slices");
-  fHGausHist.SetYTitle("Nr. of events");
-  fHGausHist.Sumw2();
-
-}
-
-// --------------------------------------------------------------------------
-// 
-// If mean and sigma have not yet been set, returns.
-//
-// Renormalizes the pedestal fit results by the following formulae:
-//
-// - Mean Pedestal        / slice = Mean Pedestal        / Number slices
-// - Mean Pedestal Error  / slice = Mean Pedestal Error  / Number slices
-// - Sigma Pedestal       / slice = Sigma Pedestal       / Sqrt (Number slices)
-// - Sigma Pedestal Error / slice = Sigma Pedestal Error / Sqrt (Number slices)
-// 
-void MHPedestalPix::Renorm()
-{
-
-  //
-  // One never knows...
-  //
-  if (fNSlices <= 0)
-    return;
-
-  const Float_t sqslices = TMath::Sqrt(fNSlices);
-
-  SetMean     ( GetMean()    / fNSlices  );
-  //
-  // Mean error goes with PedestalRMS/Sqrt(entries) -> scale with slices
-  // 
-  SetMeanErr  ( GetMeanErr() / fNSlices  );
-  //
-  // Sigma goes like PedestalRMS -> scale with sqrt(slices)    
-  //
-  SetSigma    ( GetSigma()   / sqslices  );
-  //
-  // Sigma error goes like PedestalRMS/2.(entries) -> scale with sqrt(slices)
-  //
-  SetSigmaErr ( GetSigmaErr() / sqslices );
-  
-}
-
Index: trunk/MagicSoft/Mars/manalysis/MHPedestalPix.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHPedestalPix.h	(revision 6949)
+++ 	(revision )
@@ -1,36 +1,0 @@
-#ifndef MARS_MHPedestalPix
-#define MARS_MHPedestalPix
-
-#ifndef MARS_MHCalibrationPix
-#include "MHCalibrationPix.h"
-#endif
-
-class MHPedestalPix : public MHCalibrationPix
-{
-
-private:
-
-  static const Int_t   fgChargeNbins;        // Default for fNbins   (now set to: 450  )
-  static const Axis_t  fgChargeFirst;        // Default for fFirst   (now set to: -0.5 )
-  static const Axis_t  fgChargeLast;         // Default for fLast    (now set to: 449.5)
-
-  Float_t fNSlices;                         // Number of FADC slices summed in extraction
-  
-public:
-
-  MHPedestalPix(const char *name=NULL, const char *title=NULL);
-  ~MHPedestalPix() {}
-
-  // Setters
-  void SetNSlices( const Float_t n)    { fNSlices = n ; }
-  
-  // Getters
-  Float_t GetNSlices() const       { return fNSlices; }
-  
-  // Others
-  void Renorm();  
-
-  ClassDef(MHPedestalPix, 1)     // Histogram class for Charge Pedestal Pixel
-};
-
-#endif
Index: trunk/MagicSoft/Mars/manalysis/MHadronness.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHadronness.cc	(revision 6949)
+++ 	(revision )
@@ -1,71 +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): Thomas Bretz 5/2002 <mailto:tbretz@astro.uni-wuerzburg.de>
-!
-!   Copyright: MAGIC Software Development, 2000-2002
-!
-!
-\* ======================================================================== */
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// MHadronness
-//
-// The Value must be in the range [0,1]
-// It should be the value used for gamma/hadron seperation.
-// For quality histograms look at MHHadronness
-//
-/////////////////////////////////////////////////////////////////////////////
-#include "MHadronness.h"
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-ClassImp(MHadronness);
-
-using namespace std;
-
-// --------------------------------------------------------------------------
-//
-// Default constructor.
-//
-MHadronness::MHadronness(const char *name, const char *title)
-    : fHadronness(-1)
-{
-    fName  = name  ? name  : "MHadronness";
-    fTitle = title ? title : "Storage container for hadroness value";
-}
-
-// --------------------------------------------------------------------------
-//
-// Reset hadroness, -1 indicates: invalid value
-//
-void MHadronness::Reset()
-{
-    fHadronness = -1;
-}
-
-// --------------------------------------------------------------------------
-//
-// Print the hillas Parameters to *fLog
-//
-void MHadronness::Print(Option_t *) const
-{
-    *fLog << all << GetDescriptor() << ": Hadronness = " << fHadronness << endl;
-}
-
Index: trunk/MagicSoft/Mars/manalysis/MHadronness.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHadronness.h	(revision 6949)
+++ 	(revision )
@@ -1,26 +1,0 @@
-#ifndef MARS_MHadronness
-#define MARS_MHadronness
-
-#ifndef MARS_MParContainer
-#include "MParContainer.h"
-#endif
-
-class MHadronness : public MParContainer
-{
-private:
-    Double_t fHadronness; // [0,1] Hadronness
-
-public:
-    MHadronness(const char *name=NULL, const char *title=NULL);
-
-    void Reset();
-
-    virtual void Print(Option_t *opt=NULL) const;
-
-    Double_t GetHadronness() const { return fHadronness; }
-    void     SetHadronness(Double_t h) { fHadronness = h; }
-
-    ClassDef(MHadronness, 1) // Storage Container for the hadroness
-};
-
-#endif
Index: trunk/MagicSoft/Mars/manalysis/MPedCalUpdate.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MPedCalUpdate.cc	(revision 6949)
+++ 	(revision )
@@ -1,236 +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): Thomas Bretz 03/2004 <mailto:tbretz@astro.uni.wuerzburg.de>
-!
-!   Copyright: MAGIC Software Development, 2000-2004
-!
-!
-\* ======================================================================== */
-
-/////////////////////////////////////////////////////////////////////////////
-//
-//  MPedCalUpdate
-//
-//  This task reads files stored by MJ* storing pedestals (F2) and
-//  calibration constants (F1) while an eventloop is running.
-//
-//  The update is done according to the run-number. The information
-//  which ped/cal files corresponds to which run-number is stored in
-//  an ascii file. In a next step this ascii file can be created
-//  automatically (hopefully from the Database)
-//
-/////////////////////////////////////////////////////////////////////////////
-#include "MPedCalUpdate.h"
-
-#include <fstream>
-#include <TFile.h>
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-#include "MParList.h"
-
-#include "MRawRunHeader.h"
-#include "MPedPhotCam.h"
-#include "MCalibrationChargeCam.h"
-#include "MBadPixelsCam.h"
-
-ClassImp(MPedCalUpdate);
-
-using namespace std;
-
-static const TString gsDefName  = "MPedCalUpdate";
-static const TString gsDefTitle = "";
-
-// --------------------------------------------------------------------------
-//
-// Default constructor.
-//
-MPedCalUpdate::MPedCalUpdate(const char *fname, const char *name, const char *title)
-    : fPedPhot(0), fCalCam(0), fFileName(fname)
-{
-    fName  = name  ? name  : gsDefName.Data();
-    fTitle = title ? title : gsDefTitle.Data();
-
-    fLast=0;
-}
-
-Bool_t MPedCalUpdate::ReadPed(const char *fname)
-{
-    TFile file(fname, "READ");
-    if (fPedPhot->Read()<=0)
-    {
-        *fLog << err << "Unable to read MPedPhotCam from " << fname << endl;
-        return kFALSE;
-    }
-
-    if (file.FindKey("MBadPixelsCam"))
-    {
-        MBadPixelsCam bad;
-        if (bad.Read()<=0)
-        {
-            *fLog << err << "Unable to read MBadPixelsCam from " << fname << endl;
-            return kFALSE;
-        }
-        fBadPix->Merge(bad);
-    }
-    return kTRUE;
-}
-
-Bool_t MPedCalUpdate::ReadCal(const char *fname)
-{
-    TFile file(fname, "READ");
-    if (fCalCam->Read()<=0)
-    {
-        *fLog << err << "Unable to read MCalibrationChargeCam from " << fname << endl;
-        return kFALSE;
-    }
-
-    if (file.FindKey("MBadPixelsCam"))
-    {
-        MBadPixelsCam bad;
-        if (bad.Read()<=0)
-        {
-            *fLog << "Unable to read MBadPixelsCam from " << fname << endl;
-            return kFALSE;
-        }
-        fBadPix->Merge(bad);
-    }
-    return kTRUE;
-}
-
-Bool_t MPedCalUpdate::ReadPC(TString &line)
-{
-    const Int_t f = line.First(' ');
-    if (f<0)
-    {
-        *fLog << err << "Entry for pedestal file not found!" << endl;
-        return kFALSE;
-    }
-
-    const Int_t l = line.Last(' ')+1;
-    if (l<0)
-    {
-        *fLog << err << "Entry for calibration file not found!" << endl;
-        return kFALSE;
-    }
-
-    const TString fname1 = line(0, f);
-    const TString fname2 = line(l, line.Length());
-
-    TString mid(line(f, l-f));
-    mid=mid.Strip(TString::kBoth);
-    if (!mid.IsNull())
-    {
-        *fLog << err << "Found three filenames '" << fname1 << "' '" << mid << "' '" << fname2 << "'" << endl;
-        return kFALSE;
-    }
-
-    if (!ReadPed(fname1))
-        return kFALSE;
-
-    if (!ReadCal(fname2))
-        return kFALSE;
-
-    return kTRUE;
-}
-
-// --------------------------------------------------------------------------
-//
-//
-Bool_t MPedCalUpdate::ReInit(MParList *pList)
-{
-    MRawRunHeader *header = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
-    if (!header)
-    {
-        *fLog << err << "MRawRunHeader not found... aborting." << endl;
-        return kFALSE;
-    }
-    fPedPhot = (MPedPhotCam*)pList->FindCreateObj("MPedPhotCam");
-    if (!fPedPhot)
-        return kFALSE;
-    fBadPix = (MBadPixelsCam*)pList->FindCreateObj("MBadPixelsCam");
-    if (!fBadPix)
-        return kFALSE;
-    fCalCam = (MCalibrationChargeCam*)pList->FindCreateObj("MCalibrationChargeCam");
-    if (!fCalCam)
-        return kFALSE;
-
-    const Int_t run = header->GetRunNumber();
-
-    ifstream fin(fFileName);
-    if (!fin)
-    {
-        *fLog << err << "Cannot open file: " << fFileName << endl;
-        return kFALSE;
-    }
-
-    Int_t last = 0;
-
-    TString readline;
-
-    while (1)
-    {
-        // Read line from file
-        TString line;
-        line.ReadLine(fin);
-        if (!fin && !readline.IsNull() && fLast!=last)
-        {
-            *fLog << dbg << "Reading line " << readline << endl;
-            fLast = last;
-            return ReadPC(readline);
-        }
-
-        if (!fin)
-            break;
-
-        line = line.Strip(TString::kBoth);
-
-        // Interprete line
-        Int_t len, num;
-        if (sscanf(line.Data(), "%d %n", &num, &len)!=1)
-            continue;
-
-        // Check whether entries are in increasing order
-        if (num<=last)
-        {
-            *fLog << err << "Runs must be in increasing order..." << endl;
-            return kFALSE;
-        }
-        last = num;
-
-        // Check if a new set of files must be read
-        if (num<=run)
-        {
-            readline=line;
-            readline.Remove(0, len);
-            continue;
-        }
-
-        // This is the case if the correct files were already read
-        if (fLast==num)
-            return kTRUE;
-
-        // Read files given in new line
-        *fLog << dbg << "Reading line " << readline << endl;
-        fLast = num;
-        return ReadPC(readline);
-    }
-
-    return kTRUE;
-}
Index: trunk/MagicSoft/Mars/manalysis/MPedCalUpdate.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MPedCalUpdate.h	(revision 6949)
+++ 	(revision )
@@ -1,35 +1,0 @@
-#ifndef MARS_MPedCalUpdate
-#define MARS_MPedCalUpdate
-
-#ifndef MARS_MTask
-#include "MTask.h"
-#endif
-
-class MPedPhotCam;
-class MCalibrationChargeCam;
-class MBadPixelsCam;
-
-class MPedCalUpdate : public MTask
-{
-private:
-    MPedPhotCam           *fPedPhot;
-    MCalibrationChargeCam *fCalCam;
-    MBadPixelsCam         *fBadPix;
-
-    TString fFileName;
-
-    Int_t fLast;
-
-    Bool_t ReadCal(const char *name);
-    Bool_t ReadPed(const char *name);
-    Bool_t ReadPC(TString &line);
-    Bool_t ReInit(MParList *pList);
-
-public:
-    MPedCalUpdate(const char *filename, const char *name=NULL, const char *title=NULL);
-
-    ClassDef(MPedCalUpdate, 1) // Task to update Pedestals and Cal-Constants while an eventloop is running
-}; 
-
-#endif
-
Index: trunk/MagicSoft/Mars/manalysis/MPedestalCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MPedestalCalc.cc	(revision 6949)
+++ 	(revision )
@@ -1,229 +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): Josep Flix 11/2002 <mailto:jflix@ifae.es>
-!   Author(s): Thomas Bretz 11/2002 <mailto:tbretz@astro.uni-wuerburg.de>
-!
-!   Copyright: MAGIC Software Development, 2002
-!
-!
-\* ======================================================================== */
-
-/////////////////////////////////////////////////////////////////////////////
-//
-//  MPedestalCalc
-//
-//  Task to calculate the pedestals from the event stream.
-//
-//  From the events two streams of pedestals are created like in the
-//  following table
-//  MRawEvtData:    1   2   3   4   5   6   7   8   9  10  11  12
-//  MPedestalCam;1: ------1------   ------2------   ------3------...
-//  MPedestalCam;2:         ------1------   ------2------  ------...
-//
-//  Input Containers:
-//   MRawEvtData
-//
-//  Output Containers:
-//   MPedestalCam;1
-//   MPedestalCam;2
-//
-/////////////////////////////////////////////////////////////////////////////
-#include "MPedestalCalc.h"
-
-#include "MParList.h"
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-#include "MTime.h"
-#include "MHFadcCam.h"
-#include "MRawEvtPixelIter.h"
-
-#include "MPedestalCam.h"
-#include "MPedestalPix.h"
-
-ClassImp(MPedestalCalc);
-
-MPedestalCalc::MPedestalCalc(const char *name, const char *title)
-    : fNumBranches(2), fTimeSlot(6), fHists(NULL)
-{
-    fName  = name  ? name  : "MPedestalCalc";
-    fTitle = title ? title : "Task to calculate pedestals from pedestal runs raw data";
-
-    AddToBranchList("fHiGainPixId");
-    AddToBranchList("fLoGainPixId");
-    AddToBranchList("fHiGainFadcSamples");
-    AddToBranchList("fLoGainFadcSamples");
-}
-
-Int_t MPedestalCalc::PreProcess(MParList *pList)
-{
-    if (fHists)
-    {
-        *fLog << err << "ERROR - Previous PostProcess not called." << endl;
-        return kFALSE;
-    }
-
-    fHists = new MHFadcCam[fNumBranches];
-    fStart = new MTime    [fNumBranches];
-
-    fRawEvt = (MRawEvtData*)pList->FindObject("MRawEvtData");
-    if (!fRawEvt)
-    {
-        *fLog << dbginf << "MRawEvtData not found... aborting." << endl;
-        return kFALSE;
-    }
-
-    fPedestals = (MPedestalCam*)pList->FindCreateObj("MPedestalCam");
-    if (!fPedestals)
-        return kFALSE;
-
-    fPedTime = (MTime*)pList->FindCreateObj("MTime", "MPedestalTime");
-    if (!fPedTime)
-        return kFALSE;
-
-    //
-    // Fixme: FindCreateObj --> FindObject
-    //
-    fEvtTime = (MTime*)pList->FindCreateObj("MTime", "MRawEvtTime");
-    if (!fEvtTime)
-        return kFALSE;
-
-    for (int i=0; i<fNumBranches; i++)
-        fStart[i].SetTime(fTimeSlot*10/fNumBranches*i, 0);
-
-    fPedTime->SetDuration(fTimeSlot);
-    fEvtTime->SetTime(0, 0);
-
-    return kTRUE;
-}
-
-// --------------------------------------------------------------------------
-//
-//  Checks whether the current event exceed the validity range of a pedestal
-//  in one of the streams. If this is the case the data from the histogram
-//  is dumped as pedestals into the corresponding containers and the
-//  histograms are reset.
-//
-//  Then the current event is filled into the histograms.
-//
-Int_t MPedestalCalc::Process()
-{
-    //
-    // Time when filling of stream a/b must be restarted
-    //
-    for (int i=0; i<fNumBranches; i++)
-    {
-        Check(i);
-        Fill(i);
-    }
-
-    fEvtTime->SetTime(fEvtTime->GetTimeLo()+10, 0);
-
-    return kTRUE;
-}
-
-// --------------------------------------------------------------------------
-//
-//  Fill the event in the histogram if the current time of the
-//  event is _after_ the start time for filling
-//
-void MPedestalCalc::Fill(Int_t i)
-{
-    if (*fEvtTime < fStart[i])
-        return;
-
-    fHists[i].Fill(fRawEvt);
-}
-
-// --------------------------------------------------------------------------
-//
-//  If the current time of the event is equal or after the time
-//  which is given by the start time plus the validity range
-//  calculate the corresponding set of pedestals and reset the
-//  histograms
-//
-void MPedestalCalc::Check(Int_t i)
-{
-    if (*fEvtTime-fStart[i] < fTimeSlot*10)
-        return;
-
-    Calc(i);
-
-    fStart[i] = *fEvtTime;
-    fHists[i].ResetHistograms();
-}
-
-// --------------------------------------------------------------------------
-//
-//  Deletes all dynamicly allocated arrays
-//
-Bool_t MPedestalCalc::PostProcess()
-{
-    delete fHists;
-    delete fStart;
-
-    fHists=NULL;
-
-    return kTRUE;
-}
-
-/*
- #include "MRawEvtData.h"
- */
-// --------------------------------------------------------------------------
-//
-//  Dumps the mean, rms and their errors from the filled histograms into
-//  the Pedestal container. Sets the ReadyToSaveFlag of the MPedestalCam
-//  container.
-//
-void MPedestalCalc::Calc(Int_t i) const
-{
-    // FIXME! Fit +- 3 sigma to avoid outliers...
-
-    MRawEvtPixelIter pixel(fRawEvt);
-    while (pixel.Next())
-    {
-        const UInt_t pixid = pixel.GetPixelId();
-
-        const TH1 &h = *fHists[i].GetHistHi(pixid);
-
-        const Int_t   entries = (Int_t)h.GetEntries();
-        const Float_t meanhi  = h.GetMean();
-        const Float_t rmshi   = h.GetRMS();
-
-        const Float_t meanhierr = rmshi/sqrt(entries);
-        const Float_t rmshierr  = rmshi/sqrt(entries*2);
-
-        MPedestalPix &pix = (*fPedestals)[pixid];
-        pix.SetPedestal(meanhi, rmshi);
-        pix.SetPedestalRms(meanhierr, rmshierr);
-    }
-
-    *fPedTime = fStart[i];
-
-    fPedTime->SetReadyToSave();
-    fPedestals->SetReadyToSave();
-
-    /*
-     *fLog << i << "[" << fHists[i].GetHistHi(0)->GetEntries()/fRawEvt->GetNumHiGainSamples() << "]:  ";
-     *fLog << fEvtTime->GetTimeLo() << ": Calc [";
-     *fLog << fStart[i].GetTimeLo() << " < ";
-     *fLog << fStart[i].GetTimeLo()+fTimeSlot*10 << "]" << endl;
-     */
-}
Index: trunk/MagicSoft/Mars/manalysis/MPedestalCalc.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MPedestalCalc.h	(revision 6949)
+++ 	(revision )
@@ -1,59 +1,0 @@
-#ifndef MARS_MPedestalCalc
-#define MARS_MPedestalCalc
-
-/////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-// MPedestalCalc                                                           //
-//                                                                         //
-// Implementation of ped. Eval. defined in Jan 02                          //
-//                                                                         //
-/////////////////////////////////////////////////////////////////////////////
-#ifndef MARS_MTask
-#include "MTask.h"
-#endif
-
-#ifndef MARS_MHFadCam
-#include "MHFadcCam.h"
-#endif
-
-class MTime;
-class MRawEvtData;
-class MPedestalCam;
-
-class MPedestalCalc : public MTask 
-{
-private:
-    Int_t   fNumBranches;
-    Float_t fTimeSlot;
-
-    MRawEvtData  *fRawEvt;
-    MPedestalCam *fPedestals;  //
-
-    MHFadcCam *fHists;         //[fNumBranches]
-
-    MTime     *fPedTime; // time of the pedestal event
-    MTime     *fEvtTime; // time of the current event
-    MTime     *fStart;   //[fNumBranches] starting time of the current pedestal
-
-
-    void Calc(Int_t i) const;
-    void Fill(Int_t i);
-    void Check(Int_t i);
-
-    Int_t PreProcess(MParList *pList);
-    Int_t Process();
-    Int_t PostProcess();
-
-public:
-    MPedestalCalc(const char *name=NULL, const char *title=NULL);
-
-    void SetTimeSlot(Float_t newslot) { fTimeSlot = newslot; }
-    void SetNumBranches(Int_t num) { fNumBranches = num; }
-
-    ClassDef(MPedestalCalc, 0) // Task to calculate the pestels from pedestal events
-};
-
-#endif
-
-
-
Index: trunk/MagicSoft/Mars/manalysis/MPedestalSum.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MPedestalSum.cc	(revision 6949)
+++ 	(revision )
@@ -1,227 +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): Abelardo Moralejo 7/2002  <mailto:moralejo@pd.infn.it>
-!   Author(s): Thomas Bretz 2002  <mailto:tbretz@astro.uni-wuerzburg.de>
-!
-!   Copyright: MAGIC Software Development, 2002-2003
-!
-!
-\* ======================================================================== */
-
-//////////////////////////////////////////////////////////////////////////////
-//
-//   MPedestalSum
-//
-//   This is a task which calculates the number of photons from the FADC
-//   time slices. It weights the each slice according to the numbers in
-//   the array fWeight (default: all slices added up with weight 1).
-//
-//   The weights are rescaled, such that sum(weigths)=num slices
-//
-//  Input Containers:
-//   MRawRunHeader, MRawEvtData, MPedestalCam
-//
-//  Output Containers:
-//   MCerPhotEvt
-//
-//////////////////////////////////////////////////////////////////////////////
-#include "MPedestalSum.h"
-
-#include "MParList.h"
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-#include "MMcRunHeader.hxx"
-
-#include "MRawRunHeader.h"
-#include "MRawEvtData.h"       // MRawEvtData::GetNumPixels
-#include "MCerPhotEvt.h"
-#include "MPedestalPix.h"
-#include "MPedestalCam.h"
-#include "MRawEvtPixelIter.h"
-
-ClassImp(MPedestalSum);
-
-using namespace std;
-
-// --------------------------------------------------------------------------
-//
-// Default constructor.
-//
-MPedestalSum::MPedestalSum(const char *name, const char *title)
-{
-    fName  = name  ? name  : "MPedestalSum";
-    fTitle = title ? title : "Calculate pixel signal from FADC data";
-
-    AddToBranchList("MRawEvtData.fHiGainPixId");
-    AddToBranchList("MRawEvtData.fLoGainPixId");
-    AddToBranchList("MRawEvtData.fHiGainFadcSamples");
-    AddToBranchList("MRawEvtData.fLoGainFadcSamples");
-
-    SetDefaultWeights();
-}
-
-// --------------------------------------------------------------------------
-//
-// The PreProcess searches for the following input containers:
-//  - MRawRunHeader
-//  - MRawEvtData
-//  - MPedestalCam
-//
-// The following output containers are also searched and created if
-// they were not found:
-//  - MCerPhotEvt
-//
-Int_t MPedestalSum::PreProcess(MParList *pList)
-{
-    fRunHeader = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
-    if (!fRunHeader)
-    {
-        *fLog << dbginf << "MRawRunHeader not found... aborting." << endl;
-        return kFALSE;
-    }
-    fRawEvt = (MRawEvtData*)pList->FindObject("MRawEvtData");
-    if (!fRawEvt)
-    {
-        *fLog << dbginf << "MRawEvtData not found... aborting." << endl;
-        return kFALSE;
-    }
-
-    fCerPhotEvt = (MCerPhotEvt*)pList->FindCreateObj("MCerPhotEvt");
-    if (!fCerPhotEvt)
-    {
-        *fLog << dbginf << "MCerPhotEvt not found... aborting." << endl;
-        return kFALSE;
-    }
-
-    return kTRUE;
-}
-
-// --------------------------------------------------------------------------
-//
-// Check for the run type and camera version.
-// If the file is a MC file and the used camera version is <= 40
-// we enable a fix for truncated pedestal means in this version.
-//
-Bool_t MPedestalSum::ReInit(MParList *pList)
-{
-    /*
-    const MRawRunHeader *runheader = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
-    if (!runheader)
-    {
-        *fLog << warn << dbginf << "Warning - cannot check file type, MRawRunHeader not found." << endl;
-        return kTRUE;
-    }
-
-    if (fRunHeader->GetNumSamplesHiGain() != fWeight.GetSize())
-    {
-        *fLog << dbginf << "Number of FADC slices (" << fRunHeader->GetNumSamplesHiGain() <<") is different from assumed one (" << fWeight.GetSize() << ")... aborting." << endl;
-        return kFALSE;
-    }
-
-    Bool_t fIsMcFile = runheader->GetRunType() == kRTMonteCarlo;
-    if (!fIsMcFile)
-        return kTRUE;
-
-    ScalePedestals();
-
-    MMcRunHeader *mcrunheader = (MMcRunHeader*)pList->FindObject("MMcRunHeader");
-    if (!mcrunheader)
-    {
-        *fLog << warn << dbginf << "Warning - cannot check for camera version, MC run header not found." << endl;
-        return kTRUE;
-    }
-
-    fEnableFix = kFALSE;
-    if (mcrunheader->GetCamVersion() <= 40)
-        fEnableFix = kTRUE;
-     */
-    return kTRUE;
-}
-
-void MPedestalSum::ScalePedestals()
-{
-    Int_t n = 577; //FIXME: fPedestals->GetNumPixel();
-
-    for (int idx=0; idx<n; idx++)
-    {
-        MPedestalPix &ped = (*fPedestals)[idx];
-
-        const Double_t offset = fEnableFix ? ped.GetPedestal()-0.5 : ped.GetPedestal();
-        ped.Set(offset*fSumWeights, ped.GetPedestalRms()*sqrt(fSumQuadWeights));
-    }
-
-    fPedestals->SetReadyToSave();
-}
-
-// --------------------------------------------------------------------------
-//
-// Calculate the integral of the FADC time slices and store them as a new
-// pixel in the MCerPhotEvt container.
-//
-Int_t MPedestalSum::Process()
-{
-    //fCerPhotEvt->InitSize(fRawEvt->GetNumPixels());
-
-//    if (fIsMcFile)
-//        ScalePedestals();
-
-    MRawEvtPixelIter pixel(fRawEvt);
-
-    while (pixel.Next())
-    {
-        const UInt_t idx = pixel.GetPixelId();
-
-        const int n = fRunHeader->GetNumSamplesHiGain();
-
-        //
-        // Calculate pixel signal unless it has all FADC slices empty:
-        //
-        Byte_t *ptr = pixel.GetHiGainSamples();
-
-        Float_t nphot = 0;
-        Float_t nerr  = 0;
-        for(Int_t i=0; i<n; i++)
-        {
-            nphot += ptr[i];
-            nerr  += ptr[i]*ptr[i];
-        }
-
-        nphot /= n;
-
-        fCerPhotEvt->AddPixel(idx, nphot, sqrt(nerr/n-nphot*nphot));
-
-        // FIXME! Handling of Lo Gains is missing!
-    }
-
-    fCerPhotEvt->FixSize();
-    fCerPhotEvt->SetReadyToSave();
-
-    return kTRUE;
-}
-
-// --------------------------------------------------------------------------
-//
-// Set default values for the number of slices and weights:
-//
-void MPedestalSum::SetDefaultWeights()
-{
-    const Float_t dummy[15] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
-    fWeight.Set(15, dummy);
-}
Index: trunk/MagicSoft/Mars/manalysis/MPedestalSum.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MPedestalSum.h	(revision 6949)
+++ 	(revision )
@@ -1,57 +1,0 @@
-#ifndef MARS_MPedestalSum
-#define MARS_MPedestalSum
-
-/////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-// MPedestalSum                                                            //
-//                                                                         //
-// Integrates the desired ADC time slices of one pixel and substracts the  //
-// pedestal (offset) value                                                 //
-//                                                                         //
-/////////////////////////////////////////////////////////////////////////////
-#ifndef ROOT_TArrayF
-#include <TArrayF.h>
-#endif
-
-#ifndef MARS_MTask
-#include "MTask.h"
-#endif
-
-class MRawEvtData;
-class MPedestalCam;
-class MCerPhotEvt;
-class MRawRunHeader;
-
-class MPedestalSum : public MTask
-{
-    MPedestalCam   *fPedestals;  // Pedestals of all pixels in the camera
-    MRawEvtData    *fRawEvt;     // raw event data (time slices)
-    MCerPhotEvt    *fCerPhotEvt; // Cerenkov Photon Event used for calculation
-    MRawRunHeader  *fRunHeader;  // RunHeader information
- 
-    Bool_t          fEnableFix;  // fix for a bug in files from older camera versions (<=40)
-    Bool_t          fIsMcFile;
-
-    TArrayF         fWeight;  // Weights for adding up the ADC slices
-    Float_t         fSumWeights;
-    Float_t         fSumQuadWeights;
-
-    void SetDefaultWeights();
-
-    Int_t PreProcess(MParList *pList);
-    Int_t Process();
-
-    Bool_t ReInit(MParList *pList);
-    void ScalePedestals();
-
-public:
-    MPedestalSum(const char *name=NULL, const char *title=NULL);
-
-    // FIXME: The array size should be checked!
-    void   SetWeights(const TArrayF &w) { fWeight = w; }
-
-    ClassDef(MPedestalSum, 0)   // Task to calculate cerenkov photons from raw data
-};
- 
-
-#endif
Index: trunk/MagicSoft/Mars/manalysis/MPedestalWorkaround.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MPedestalWorkaround.cc	(revision 6949)
+++ 	(revision )
@@ -1,552 +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): Sabrina Stark   12/2003 <mailto:lstark@particle.phys.ethz.ch>
-!              Wolfgang Wittek 12/2003 <mailto:wittek@mppmu.mpg.de>
-!
-!   Copyright: MAGIC Software Development, 2000-2003
-!
-!
-\* ======================================================================== */
-
-/////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-// MPedestalWorkaround                                                     //
-//                                                                         //
-// copies the pedestal value and the pedestal RMS                          //
-//        from the container MPedPhotCam                                   //
-//        into the contaier  MPedestalCam                                  //
-//                                                                         //
-// put the zenith angle into MMcEvt;                                       //
-//     the zenith angle is taken from the runbooks                         //
-//     (1 fixed zenith angle for a given run)                              //
-//                                                                         //
-// this workaround is necessary                                            //
-// - as long as the analysis classes                                       //
-//   take the pedestals from MPedestalCam; in the long run they have to    //
-//   be taken from MPedPhotCam                                             //
-// - and as long as the container for the zenith angle is not defined      //
-//                                                                         //
-/////////////////////////////////////////////////////////////////////////////
-#include "MPedestalWorkaround.h"
-
-#include <stdio.h>
-#include "MLog.h"
-#include "MLogManip.h"
-#include "MParList.h"
-#include "MGeomCam.h"
-
-#include "MPedPhotCam.h"
-#include "MPedPhotPix.h"
-#include "MMcEvt.hxx"
-#include "MRawRunHeader.h"
-
-using namespace std;
-
-ClassImp(MPedestalWorkaround);
-
-MPedestalWorkaround::MPedestalWorkaround(const char *name, const char *title)
-{
-    fName = name ? name : "MPedestalWorkaround";
-    fTitle = title ? title : "Storage of pedestal values and RMS in units of photons";
-   
-}
-
-// ------------------------------------------------------------------------
-//
-
-Int_t MPedestalWorkaround::PreProcess(MParList *pList)
-{
-  /*
-   fPed = (MPedestalCam*)pList->FindObject("MPedestalCam");
-   if (!fPed)
-     {
-       *fLog << err << "MPedestalCam not found... aborting." << endl;
-       return kFALSE;
-     }
-  */
-
-   fPedPhot = (MPedPhotCam*)pList->FindObject("MPedPhotCam");
-   if (!fPedPhot)
-     {
-       *fLog << err << "MPedPhotCam not found... aborting." << endl;
-       return kFALSE;
-     }
-
-   fCam = (MGeomCam*)pList->FindObject("MGeomCam");
-   if (!fCam)
-     {
-       *fLog << err << "MGeomCam not found (no geometry information available)... aborting." << endl;
-       return kFALSE;
-     }
-
-   fRun = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
-   if (!fRun)
-   {
-       *fLog << err << "MRawRunHeader not found... aborting." << endl;
-       return kFALSE;
-   }
-
-   fMcEvt = (MMcEvt*)pList->FindCreateObj("MMcEvt");
-   if (!fMcEvt)
-   {
-       *fLog << err << "MMcEvt not found... aborting." << endl;
-       return kFALSE;
-   }
-
-   return kTRUE;
-}
-
-// ------------------------------------------------------------------------
-//
-Int_t MPedestalWorkaround::Process()
-{
-  //-------------------------------------------------------------------
-  // copy the pedestal and the pedestal RMS 
-  // from MPedPhotCam into MPedestalCam   
-
-  // set pedestalRMS = 0 if it is too high
-  UInt_t imaxnumpix = fCam->GetNumPixels();
-  for (UInt_t i=0; i<imaxnumpix; i++)
-  {
-    Double_t val = (*fPedPhot)[i].GetRms();
-    if (val < 0.0 || val > 10.0)
-      (*fPedPhot)[i].SetRms(0.0);
-  }
-
-
-  //-------------------------------------------------------------------
-  // put the zenith angle into MMcEvt
-
-  Double_t thetadeg;
-  Double_t thetarad;
-
-
-  /*
-  Int_t run = fRun->GetRunNumber();
-
-  if      (run == 3127)  thetadeg = 27.2;  // Crab
-  else if (run == 3128)  thetadeg = 25.6;
-  else if (run == 3129)  thetadeg = 24.3;
-  else if (run == 3130)  thetadeg = 23.9;
-
-
-  else if (run == 3132)  thetadeg = 22.9;
-  else if (run == 3133)  thetadeg = 22.8;
-  else if (run == 3134)  thetadeg = 22.3;
-  else if (run == 3135)  thetadeg = 21.9;
-  else if (run == 3136)  thetadeg = 21.5;
-  else if (run == 3137)  thetadeg = 21.1;
-  else if (run == 3138)  thetadeg = 20.8;
-  else if (run == 3139)  thetadeg = 20.4;
-
-  else if (run == 3140)  thetadeg = 19.5;
-  else if (run == 3141)  thetadeg = 19.4;
-  else if (run == 3142)  thetadeg = 19.0;
-  else if (run == 3143)  thetadeg = 18.6;
-  else if (run == 3144)  thetadeg = 13.0;
-  else if (run == 3145)  thetadeg = 12.4;
-  else if (run == 3146)  thetadeg = 12.1;
-  else if (run == 3147)  thetadeg = 11.7;
-  else if (run == 3148)  thetadeg = 11.3;
-  else if (run == 3149)  thetadeg = 11.9;
-
-  else if (run == 3150)  thetadeg = 10.6;
-  else if (run == 3151)  thetadeg = 10.3;
-  else if (run == 3152)  thetadeg = 10.0;
-  else if (run == 3153)  thetadeg =  9.6;
-  else if (run == 3154)  thetadeg =  9.3;
-  else if (run == 3155)  thetadeg =  9.0;
-  else if (run == 3156)  thetadeg =  8.7;
-  else if (run == 3157)  thetadeg =  8.4;
-  else if (run == 3158)  thetadeg =  8.1;
-  else if (run == 3159)  thetadeg =  7.9;
-
-  else if (run == 3160)  thetadeg =  7.7;
-  else if (run == 3161)  thetadeg =  7.3;
-  else if (run == 3162)  thetadeg =  7.2;
-  else if (run == 3163)  thetadeg =  7.0;
-  else if (run == 3164)  thetadeg =  6.8;
-  else if (run == 3165)  thetadeg =  6.7;
-  else if (run == 3166)  thetadeg =  6.6;
-  else if (run == 3167)  thetadeg =  6.5;
-  else if (run == 3168)  thetadeg =  6.4;
-  else if (run == 3169)  thetadeg =  6.4;
-
-  else if (run == 3170)  thetadeg =  6.4;
-  else if (run == 3171)  thetadeg =  6.4;
-  else if (run == 3172)  thetadeg =  6.5;
-  else if (run == 3173)  thetadeg =  6.6;
-  else if (run == 3174)  thetadeg =  6.7;
-
-  else if (run == 3176)  thetadeg =  7.1;
-  else if (run == 3177)  thetadeg =  7.4;
-  else if (run == 3178)  thetadeg =  7.6;
-  else if (run == 3179)  thetadeg =  7.9;
-
-
-  else if (run == 3182)  thetadeg =  8.4;
-  else if (run == 3183)  thetadeg =  8.9;
-  else if (run == 3184)  thetadeg =  9.2;
-  else if (run == 3185)  thetadeg =  9.5;
-  else if (run == 3186)  thetadeg =  9.8;
-  else if (run == 3187)  thetadeg = 10.5;
-  else if (run == 3188)  thetadeg = 10.9;
-  else if (run == 3189)  thetadeg = 11.2;
-
-  else if (run == 3190)  thetadeg = 11.6;
-  else if (run == 3191)  thetadeg = 11.6;
-  else if (run == 3192)  thetadeg = 12.4;
-  else if (run == 3193)  thetadeg = 12.7;
-  else if (run == 3194)  thetadeg = 13.1;
-  else if (run == 3195)  thetadeg = 13.5;
-  else if (run == 3196)  thetadeg = 13.9;
-  else if (run == 3197)  thetadeg = 14.3;
-  else if (run == 3198)  thetadeg = 14.7;
-  else if (run == 3199)  thetadeg = 15.1;
-
-  else if (run == 3200)  thetadeg = 15.6;
-  else if (run == 3201)  thetadeg = 16.0;
-  else if (run == 3202)  thetadeg = 16.5;
-  else if (run == 3203)  thetadeg = 16.9;
-  else if (run == 3204)  thetadeg = 17.3;
-  else if (run == 3205)  thetadeg = 17.7;
-  else if (run == 3206)  thetadeg = 18.2;
-  else if (run == 3207)  thetadeg = 18.6;
-  else if (run == 3208)  thetadeg = 19.0;
-  else if (run == 3209)  thetadeg = 19.4;
-
-  else if (run == 3210)  thetadeg = 19.9;
-  else if (run == 3211)  thetadeg = 20.4;
-  else if (run == 3212)  thetadeg = 20.8;
-  else if (run == 3213)  thetadeg = 21.2;
-  else if (run == 3214)  thetadeg = 21.7;
-  else if (run == 3215)  thetadeg = 22.2;
-  else if (run == 3216)  thetadeg = 25.6;  // Off Crab1
-  else if (run == 3217)  thetadeg = 25.0;
-  else if (run == 3218)  thetadeg = 24.5;
-  else if (run == 3219)  thetadeg = 24.0;
-
-  else if (run == 3220)  thetadeg = 23.5;
-  else if (run == 3221)  thetadeg = 22.5;
-  else if (run == 3222)  thetadeg = 22.1;
-
-  else if (run == 3225)  thetadeg = 15.1;
-  else if (run == 3226)  thetadeg = 15.0;
-  else if (run == 3227)  thetadeg = 14.5;
-  else if (run == 3228)  thetadeg = 14.1;
-  else if (run == 3229)  thetadeg = 13.8;
-
-  else if (run == 3230)  thetadeg = 13.3;
-  else if (run == 3231)  thetadeg = 13.0;
-  else if (run == 3232)  thetadeg = 12.6;
-  else if (run == 3233)  thetadeg = 12.3;
-  else if (run == 3234)  thetadeg = 12.0;
-  else if (run == 3235)  thetadeg = 11.6;
-  else if (run == 3236)  thetadeg = 11.3;
-  else if (run == 3237)  thetadeg = 11.0;
-  else if (run == 3238)  thetadeg = 10.8;
-  else if (run == 3239)  thetadeg = 10.4;
-
-  else if (run == 3240)  thetadeg = 10.1;
-  else if (run == 3241)  thetadeg =  9.9;
-  else if (run == 3242)  thetadeg =  9.6;
-  else if (run == 3243)  thetadeg =  9.4;
-  else if (run == 3244)  thetadeg =  9.2;
-  else if (run == 3245)  thetadeg =  9.0;
-  else if (run == 3246)  thetadeg =  8.9;
-  else if (run == 3247)  thetadeg =  8.8;
-  else if (run == 3248)  thetadeg =  8.7;
-  else if (run == 3249)  thetadeg =  8.6;
-
-  else if (run == 3250)  thetadeg =  8.6;
-  else if (run == 3251)  thetadeg =  8.6;
-  else if (run == 3252)  thetadeg =  8.6;
-  else if (run == 3253)  thetadeg =  8.7;
-  else if (run == 3254)  thetadeg =  8.8;
-  else if (run == 3255)  thetadeg =  8.9;
-  else if (run == 3256)  thetadeg =  9.1;
-  else if (run == 3257)  thetadeg =  9.3;
-  else if (run == 3258)  thetadeg =  9.5;
-  else if (run == 3259)  thetadeg =  9.7;
-  else if (run == 3260)  thetadeg =  9.9;
-
-  else if (run == 3261)  thetadeg = 10.2;
-  else if (run == 3262)  thetadeg = 10.5;
-  else if (run == 3263)  thetadeg = 10.8;
-  else if (run == 3264)  thetadeg = 11.1;
-  else if (run == 3265)  thetadeg = 11.4;
-  else if (run == 3266)  thetadeg = 11.8;
-  else if (run == 3267)  thetadeg = 12.1;
-  else if (run == 3268)  thetadeg = 12.5;
-  else if (run == 3269)  thetadeg = 12.8;
-
-  else if (run == 3270)  thetadeg = 13.2;
-  else if (run == 3271)  thetadeg = 13.5;
-  else if (run == 3272)  thetadeg = 13.9;
-  else if (run == 3273)  thetadeg = 14.0;
-  else if (run == 3274)  thetadeg = 14.4;
-
-  else if (run == 3284)  thetadeg =  7.0;  // Crab
-  else if (run == 3285)  thetadeg =  7.2;
-  else if (run == 3286)  thetadeg =  7.4;
-  else if (run == 3287)  thetadeg =  7.5;
-  else if (run == 3288)  thetadeg =  8.4;
-  else if (run == 3289)  thetadeg =  9.0;
-
-  else if (run == 3290)  thetadeg =  9.4;
-  else if (run == 3291)  thetadeg =  9.8;
-  else if (run == 3292)  thetadeg = 10.2;
-  else if (run == 3293)  thetadeg = 10.5;
-  else if (run == 3294)  thetadeg = 10.9;
-  else if (run == 3295)  thetadeg = 11.3;
-  else if (run == 3296)  thetadeg = 11.8;
-  else if (run == 3297)  thetadeg = 12.2;
-  else if (run == 3298)  thetadeg = 12.6;
-  else if (run == 3299)  thetadeg = 13.0;
-
-  else if (run == 3300)  thetadeg = 13.5;
-  else if (run == 3301)  thetadeg = 13.9;
-  else if (run == 3302)  thetadeg = 14.3;
-  else if (run == 3303)  thetadeg = 14.8;
-  else if (run == 3304)  thetadeg = 15.2;
-  else if (run == 3305)  thetadeg = 15.7;
-  else if (run == 3306)  thetadeg = 16.2;
-  else if (run == 3307)  thetadeg = 16.6;
-  else if (run == 3308)  thetadeg = 17.1;
-  else if (run == 3309)  thetadeg = 17.6;
-
-  else if (run == 3310)  thetadeg = 17.9;
-  else if (run == 3311)  thetadeg = 18.4;
-  else if (run == 3312)  thetadeg = 18.9;
-  else if (run == 3313)  thetadeg = 19.3;
-  else if (run == 3314)  thetadeg = 19.8;
-  else if (run == 3315)  thetadeg = 20.1;
-  else if (run == 3316)  thetadeg = 20.7;
-  else if (run == 3317)  thetadeg = 21.2;
-  else if (run == 3318)  thetadeg = 21.7;
-  else if (run == 3319)  thetadeg = 22.1;
-
-  else if (run == 3320)  thetadeg = 22.5;
-  else if (run == 3321)  thetadeg = 23.1;
-  else if (run == 3322)  thetadeg = 23.6;
-  else if (run == 3323)  thetadeg = 24.1;
-  else if (run == 3324)  thetadeg = 24.6;
-  else if (run == 3325)  thetadeg = 24.9;
-  else if (run == 3326)  thetadeg = 25.5;
-  else if (run == 3327)  thetadeg = 26.0;
-  else if (run == 3328)  thetadeg = 26.0;
-  else if (run == 3329)  thetadeg = 26.6;
-
-  else if (run == 3330)  thetadeg = 26.6;
-  else if (run == 3331)  thetadeg = 27.1;
-  else if (run == 3332)  thetadeg = 27.7;
-  else if (run == 3333)  thetadeg = 28.2;
-  else if (run == 3334)  thetadeg = 28.5;
-
-  else if (run == 3340)  thetadeg = 10.5;
-  else if (run == 3341)  thetadeg = 10.3;
-  else if (run == 3342)  thetadeg =  9.6;
-  else if (run == 3343)  thetadeg =  9.2;
-  else if (run == 3344)  thetadeg =  8.9;
-  else if (run == 3345)  thetadeg =  8.6;
-  else if (run == 3346)  thetadeg =  8.3;
-  else if (run == 3347)  thetadeg =  8.0;
-  else if (run == 3348)  thetadeg =  7.7;
-  else if (run == 3349)  thetadeg =  7.5;
-
-  else if (run == 3350)  thetadeg =  7.2;
-  else if (run == 3351)  thetadeg =  7.0;
-  else if (run == 3352)  thetadeg =  6.8;
-  else if (run == 3353)  thetadeg =  6.7;
-  else if (run == 3354)  thetadeg =  6.6;
-  else if (run == 3355)  thetadeg =  6.5;
-  else if (run == 3356)  thetadeg =  6.4;
-  else if (run == 3357)  thetadeg =  6.4;
-  else if (run == 3358)  thetadeg =  6.4;
-  else if (run == 3359)  thetadeg =  6.5;
-
-  else if (run == 3360)  thetadeg =  6.6;
-
-  else if (run == 3362)  thetadeg =  6.7;
-  else if (run == 3363)  thetadeg =  6.8;
-  else if (run == 3364)  thetadeg =  7.0;
-  else if (run == 3365)  thetadeg =  7.2;
-  else if (run == 3366)  thetadeg =  7.5;
-  else if (run == 3367)  thetadeg =  7.7;
-  else if (run == 3368)  thetadeg =  8.0;
-  else if (run == 3369)  thetadeg =  8.3;
-
-  else if (run == 3370)  thetadeg =  8.6;
-  else if (run == 3371)  thetadeg =  9.0;
-  else if (run == 3372)  thetadeg =  9.3;
-  else if (run == 3373)  thetadeg =  9.6;
-  else if (run == 3374)  thetadeg = 10.0;
-  else if (run == 3375)  thetadeg = 10.4;
-  else if (run == 3376)  thetadeg = 10.7;
-  else if (run == 3377)  thetadeg = 11.1;
-  else if (run == 3378)  thetadeg = 11.5;
-  else if (run == 3379)  thetadeg = 11.9;
-
-  else if (run == 3380)  thetadeg = 12.3;
-  else if (run == 3381)  thetadeg = 12.7;
-  else if (run == 3382)  thetadeg = 13.1;
-  else if (run == 3383)  thetadeg = 13.5;
-  else if (run == 3384)  thetadeg = 13.9;
-  else if (run == 3385)  thetadeg = 14.3;
-  else if (run == 3386)  thetadeg = 14.7;
-  else if (run == 3387)  thetadeg = 15.2;
-  else if (run == 3388)  thetadeg = 15.6;
-  else if (run == 3389)  thetadeg = 16.0;
-
-  else if (run == 3390)  thetadeg = 16.4;
-  else if (run == 3391)  thetadeg = 16.7;
-  else if (run == 3392)  thetadeg = 17.9;
-  else if (run == 3393)  thetadeg = 18.3;
-  else if (run == 3394)  thetadeg = 18.7;
-  else if (run == 3395)  thetadeg = 19.2;
-  else if (run == 3396)  thetadeg = 19.6;
-  else if (run == 3397)  thetadeg = 20.0;
-  else if (run == 3398)  thetadeg = 20.5;
-  else if (run == 3399)  thetadeg = 20.9;
-
-  else if (run == 3400)  thetadeg = 21.4;
-  else if (run == 3401)  thetadeg = 21.8;
-  else if (run == 3402)  thetadeg = 22.1;
-  else if (run == 3403)  thetadeg = 22.6;
-  else if (run == 3404)  thetadeg = 23.1;
-  else if (run == 3405)  thetadeg = 23.4;
-  else if (run == 3406)  thetadeg = 23.9;
-  else if (run == 3407)  thetadeg = 24.3;
-  else if (run == 3408)  thetadeg = 24.7;
-  else if (run == 3409)  thetadeg = 26.9;
-
-  else if (run == 3410)  thetadeg = 27.3;
-  else if (run == 3411)  thetadeg = 27.7;
-  else if (run == 3412)  thetadeg = 28.2;
-  else if (run == 3413)  thetadeg = 28.7;
-  else if (run == 3414)  thetadeg = 29.1;
-  else if (run == 3415)  thetadeg = 29.2;
-  else if (run == 3416)  thetadeg = 30.0;
-  else if (run == 3417)  thetadeg = 18.5;  // Off Crab1
-  else if (run == 3418)  thetadeg = 18.4;
-  else if (run == 3419)  thetadeg = 17.5;
-
-  else if (run == 3420)  thetadeg = 17.2;
-  else if (run == 3421)  thetadeg = 16.8;
-  else if (run == 3422)  thetadeg = 16.4;
-  else if (run == 3423)  thetadeg = 16.0;
-  else if (run == 3424)  thetadeg = 15.6;
-  else if (run == 3425)  thetadeg = 15.3;
-  else if (run == 3426)  thetadeg = 14.9;
-  else if (run == 3427)  thetadeg = 14.5;
-  else if (run == 3428)  thetadeg = 14.1;
-  else if (run == 3429)  thetadeg = 13.7;
-
-  else if (run == 3430)  thetadeg = 13.4;
-  else if (run == 3431)  thetadeg = 13.0;
-  else if (run == 3432)  thetadeg = 12.7;
-  else if (run == 3433)  thetadeg = 12.3;
-  else if (run == 3434)  thetadeg = 12.0;
-  else if (run == 3435)  thetadeg = 12.0;
-  else if (run == 3436)  thetadeg = 11.6;
-  else if (run == 3437)  thetadeg = 11.3;
-  else if (run == 3438)  thetadeg = 11.0;
-  else if (run == 3439)  thetadeg = 10.7;
-
-  else if (run == 3440)  thetadeg = 10.4;
-  else if (run == 3441)  thetadeg = 10.1;
-  else if (run == 3442)  thetadeg =  9.9;
-  else if (run == 3443)  thetadeg =  9.8;
-  else if (run == 3444)  thetadeg = 30.8;  // Mkn 421
-  else if (run == 3445)  thetadeg = 30.6;
-  else if (run == 3446)  thetadeg = 29.7;
-  else if (run == 3447)  thetadeg = 29.3;
-  else if (run == 3448)  thetadeg = 28.9;
-  else if (run == 3449)  thetadeg = 28.5;
-
-  else if (run == 3450)  thetadeg = 28.1;
-  else if (run == 3451)  thetadeg = 27.7;
-  else if (run == 3452)  thetadeg = 27.3;
-  else if (run == 3453)  thetadeg = 26.9;
-  else if (run == 3454)  thetadeg = 26.5;
-  else if (run == 3455)  thetadeg = 26.1;
-  else if (run == 3456)  thetadeg = 25.7;
-  else if (run == 3457)  thetadeg = 25.3;
-  else if (run == 3458)  thetadeg = 24.9;
-  else if (run == 3459)  thetadeg = 24.5;
-
-  else if (run == 3460)  thetadeg = 24.1;
-
-  else if (run == 3463)  thetadeg = 23.2;
-  else if (run == 3464)  thetadeg = 22.8;
-  else if (run == 3465)  thetadeg = 22.4;
-  else if (run == 3466)  thetadeg = 22.0;
-  else if (run == 3467)  thetadeg = 21.6;
-  else if (run == 3468)  thetadeg = 21.2;
-  else if (run == 3469)  thetadeg = 20.8;
-
-  else if (run == 3470)  thetadeg = 20.4;
-  else if (run == 3471)  thetadeg = 20.1;
-  else if (run == 3472)  thetadeg = 19.7;
-  else if (run == 3473)  thetadeg = 19.3;
-  else if (run == 3474)  thetadeg = 18.9;
-  else if (run == 3475)  thetadeg = 18.5;
-  else if (run == 3476)  thetadeg = 18.2;
-  else if (run == 3477)  thetadeg = 18.1;
-  else if (run == 3478)  thetadeg = 17.7;
-
-
-  else if (run == 3480)  thetadeg = 17.5;
-  else if (run == 3481)  thetadeg = 17.1;
-  else if (run == 3482)  thetadeg = 16.7;
-  else if (run == 3483)  thetadeg = 16.3;
-  else if (run == 3484)  thetadeg = 16.0;
-  else if (run == 3485)  thetadeg = 15.6;
-  else if (run == 3486)  thetadeg = 15.3;
-  else if (run == 3487)  thetadeg = 15.0;
-  else if (run == 3488)  thetadeg = 14.8;
-  else if (run == 3489)  thetadeg = 14.8;
-  
-  else
-  {
-    *fLog << warn << "MPedestalWorkaround : no zenith angle for run number = "
-          << run << endl;
-    thetadeg = 90.0;
-  }
-
-  thetarad = thetadeg / kRad2Deg;
-  */
-
-  thetadeg = 10.0;
-  thetarad = thetadeg / kRad2Deg;
-  fMcEvt->SetTelescopeTheta(thetarad);
-  
-  return kTRUE;
-}
-
-Int_t MPedestalWorkaround::PostProcess()
-{
-    return kTRUE;
-}
-
-
-
-
-
-
-
Index: trunk/MagicSoft/Mars/manalysis/MPedestalWorkaround.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MPedestalWorkaround.h	(revision 6949)
+++ 	(revision )
@@ -1,47 +1,0 @@
-#ifndef MARS_MPedestalWorkaround
-#define MARS_MPedestalWorkaround
-
-/////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-// MPedestalWorkaround                                                     //
-//                                                                         //
-// Temporary copy of pedestal values and RMS into MPedestalCam from        //
-// MPedPhotCam in order to have the pedestal RMS in units of number of     // 
-// photons                                                                  //
-//                                                                         //
-/////////////////////////////////////////////////////////////////////////////
-#ifndef MARS_MTask
-#include "MTask.h"
-#endif
-
-class MPedestalCam;
-class MPedPhotCam;
-class MGeomCam;
-class MParList;
-class MMcEvt;
-class MRawRunHeader;
-
-class MPedestalWorkaround : public MTask 
-{
-private:
-
-    MPedestalCam  *fPed;  
-    MPedPhotCam   *fPedPhot; 
-    MGeomCam      *fCam;  
-    MMcEvt        *fMcEvt;
-    MRawRunHeader *fRun;  
-
-    Int_t PreProcess(MParList *pList);
-    Int_t Process();
-    Int_t PostProcess();
-
-public:
-    MPedestalWorkaround(const char *name=NULL, const char *title=NULL);
-
-    ClassDef(MPedestalWorkaround, 0) // Task to copy pedestal RMS
-};
-
-#endif
-
-
-
Index: trunk/MagicSoft/Mars/manalysis/MPointingCorr.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MPointingCorr.cc	(revision 6949)
+++ 	(revision )
@@ -1,134 +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  03/2003 <mailto:wittek@mppmu.mpg.de>
-!
-!   Copyright: MAGIC Software Development, 2000-2003
-!
-!
-\* ======================================================================== */
-
-/////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-//  MPointingCorr                                                          //
-//                                                                         //
-//  This is a task to do the pointing correction                           //
-//                                                                         //
-/////////////////////////////////////////////////////////////////////////////
-
-#include "MPointingCorr.h"
-
-#include "MParList.h"
-
-#include "MMcEvt.hxx"
-#include "MSrcPosCam.h"
-#include "MGeomCam.h"
-#include "MParameters.h"
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-ClassImp(MPointingCorr);
-
-// --------------------------------------------------------------------------
-//
-// Default constructor.
-//
-MPointingCorr::MPointingCorr(const char *name, const char *title,
-                             const char *srcname)
-{
-    fName  = name  ? name  : "MPointingCorr";
-    fTitle = title ? title : "Task to do the pointing correction";
-
-    fSrcName = srcname;
-}
-
-// --------------------------------------------------------------------------
-//
-// 
-// 
-// 
-//
-Int_t MPointingCorr::PreProcess(MParList *pList)
-{
-    MGeomCam *geom = (MGeomCam*)pList->FindObject("MGeomCam");
-    if (!geom)
-        *fLog << warn << GetDescriptor() << ": No Camera Geometry available. Using mm-scale for histograms." << endl;
-    else
-    {
-        fMm2Deg = geom->GetConvMm2Deg();
-    }
-
-
-    fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt");
-    if (!fMcEvt)
-    {
-        *fLog << dbginf << "MMcEvt not found... aborting." << endl;
-        return kFALSE;
-    }
-
-    fHourAngle = (MParameterD*)pList->FindObject("HourAngle", "MParameterD");
-    if (!fHourAngle)
-    {
-        *fLog << dbginf << "HourAngle not found... aborting." << endl;
-        return kFALSE;
-    }
-
-
-    fSrcPos = (MSrcPosCam*)pList->FindObject(fSrcName, "MSrcPosCam");
-    if (!fSrcPos)
-    {
-        *fLog << err << dbginf << fSrcName << " [MSrcPosCam] not found... aborting." << endl;
-        return kFALSE;
-    }
-
-
-    return kTRUE;
-}
-
-// --------------------------------------------------------------------------
-//
-// Do the pointing correction
-//
-// the parametrization is for Mkn421 2001 data (Daniel Kranich)
-// 
-Int_t MPointingCorr::Process()
-{
-   // fhourangle is the hour angle [degrees]
-   // (cx, cy) is the source position in the camera [mm]
-   //
-   Float_t fhourangle = fHourAngle->GetVal();
-
-   //*fLog << "MPointingCorr::Process; fhourangle = " 
-   //      << fhourangle << endl;
-
-   Float_t cx = -0.05132 - 0.001064 * fhourangle 
-                         - 3.530e-6 * fhourangle * fhourangle;
-   cx /= fMm2Deg;
-
-   Float_t cy = -0.04883 - 0.0003175* fhourangle
-                         - 2.165e-5 * fhourangle * fhourangle;
-   cy /= fMm2Deg;
-
-   fSrcPos->SetXY(cx, cy);
-
-   //*fLog << "MPointingCorr::Process; fhourangle, cx, cy, fMm2Deg = "
-   //      << fhourangle << ",  " << cx << ",  " << cy << ",  " 
-   //      << fMm2Deg << endl;
-
-   return kTRUE;
-}
Index: trunk/MagicSoft/Mars/manalysis/MPointingCorr.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MPointingCorr.h	(revision 6949)
+++ 	(revision )
@@ -1,40 +1,0 @@
-#ifndef MARS_MPointingCorr
-#define MARS_MPointingCorr
-
-/////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-// MPointingCorr                                                           //
-//                                                                         //
-// Task to do the pointing correction                                      //
-//                                                                         //
-/////////////////////////////////////////////////////////////////////////////
-
-#ifndef MARS_MTask
-#include "MTask.h"
-#endif
-
-class MMcEvt;
-class MSrcPosCam;
-class MParameterD;
-
-class MPointingCorr : public MTask
-{
-private:
-    MMcEvt       *fMcEvt;       
-    MSrcPosCam   *fSrcPos;
-    TString       fSrcName;
-    MParameterD  *fHourAngle;
-
-    Float_t       fMm2Deg;
-
-    Int_t PreProcess(MParList *pList);
-    Int_t Process();
-
-public:
-    MPointingCorr(const char *name=NULL, const char *title=NULL,
-                  const char *srcname="MSrcPosCam");
-
-    ClassDef(MPointingCorr, 0)   // Task to do the pointing correction
-};
-
-#endif
Index: trunk/MagicSoft/Mars/manalysis/MSupercuts.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MSupercuts.cc	(revision 6949)
+++ 	(revision )
@@ -1,388 +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, 08/2003 <mailto:wittek@mppmu.mpg.de>
-!   Author(s): Thomas Bretz, 08/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
-!
-!   Copyright: MAGIC Software Development, 2000-2003
-!
-!
-\* ======================================================================== */
-
-/////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-//   MSupercuts                                                         //
-//                                                                         //
-//   this is the container for the parameters of the supercuts             //
-//                                                                         //
-/////////////////////////////////////////////////////////////////////////////
-#include "MSupercuts.h"
-
-#include <math.h>
-#include <fstream>
-
-#include "MParList.h"
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-ClassImp(MSupercuts);
-
-using namespace std;
-
-// --------------------------------------------------------------------------
-//
-// constructor
-//
-MSupercuts::MSupercuts(const char *name, const char *title)
-  : fParameters(104), fStepsizes(104),
-    fLengthUp(fParameters.GetArray()),   fLengthLo(fParameters.GetArray()+8),
-    fWidthUp(fParameters.GetArray()+16), fWidthLo(fParameters.GetArray()+24),
-    fDistUp(fParameters.GetArray()+32),  fDistLo(fParameters.GetArray()+40),
-    fAsymUp(fParameters.GetArray()+48),  fAsymLo(fParameters.GetArray()+56),
-    fConcUp(fParameters.GetArray()+64),  fConcLo(fParameters.GetArray()+72),
-    fLeakage1Up(fParameters.GetArray()+80), fLeakage1Lo(fParameters.GetArray()+88),
-    fAlphaUp(fParameters.GetArray()+96)
-{
-    fName  = name  ? name  : "MSupercuts";
-    fTitle = title ? title : "Container for the supercut parameters";
-
-    // set supercut parameters to their default values
-    InitParameters();
-}
-
-
-// --------------------------------------------------------------------------
-//
-// set default values for the supercut parameters
-//
-void MSupercuts::InitParameters()
-{
-    //---------------------------------------------------
-    //  these are the default values
-
-    fLengthUp[0] =  0.2;
-    fLengthUp[1] =  0.0;
-    fLengthUp[2] =  0.0;
-    fLengthUp[3] =  0.0;
-    fLengthUp[4] =  0.0;
-    fLengthUp[5] =  0.0;
-    fLengthUp[6] =  0.0;
-    fLengthUp[7] =  0.0;
-
-    fLengthLo[0] =  0.;
-    fLengthLo[1] =  0.;
-    fLengthLo[2] =  0.;
-    fLengthLo[3] =  0.;
-    fLengthLo[4] =  0.;
-    fLengthLo[5] =  0.;
-    fLengthLo[6] =  0.;
-    fLengthLo[7] =  0.;
-
-    fWidthUp[0] =  0.1;
-    fWidthUp[1] =  0.0;
-    fWidthUp[2] =  0.0;
-    fWidthUp[3] =  0.0;
-    fWidthUp[4] =  0.0;
-    fWidthUp[5] =  0.0;
-    fWidthUp[6] =  0.0;
-    fWidthUp[7] =  0.0;
-
-    fWidthLo[0] =  0.;
-    fWidthLo[1] =  0.;
-    fWidthLo[2] =  0.;
-    fWidthLo[3] =  0.;
-    fWidthLo[4] =  0.;
-    fWidthLo[5] =  0.;
-    fWidthLo[6] =  0.;
-    fWidthLo[7] =  0.;
-
-    fDistUp[0] =  1.e10;
-    fDistUp[1] =  0.0;
-    fDistUp[2] =  0.0;
-    fDistUp[3] =  0.0;
-    fDistUp[4] =  0.0;
-    fDistUp[5] =  0.0;
-    fDistUp[6] =  0.0;
-    fDistUp[7] =  0.0;
-
-    fDistLo[0] =  0.0;
-    fDistLo[1] =  0.0;
-    fDistLo[2] =  0.0;
-    fDistLo[3] =  0.0;
-    fDistLo[4] =  0.0;
-    fDistLo[5] =  0.0;
-    fDistLo[6] =  0.0;
-    fDistLo[7] =  0.0;
-    
-
-    // dummy values
-
-    fAsymUp[0] =  1.e10;
-    fAsymUp[1] =  0.0;
-    fAsymUp[2] =  0.0;
-    fAsymUp[3] =  0.0;
-    fAsymUp[4] =  0.0;
-    fAsymUp[5] =  0.0;
-    fAsymUp[6] =  0.0;
-    fAsymUp[7] =  0.0;
-
-    fAsymLo[0] = -1.e10;
-    fAsymLo[1] =  0.0;
-    fAsymLo[2] =  0.0;
-    fAsymLo[3] =  0.0;
-    fAsymLo[4] =  0.0;
-    fAsymLo[5] =  0.0;
-    fAsymLo[6] =  0.0;
-    fAsymLo[7] =  0.0;
-
-    fConcUp[0] =  1.e10;
-    fConcUp[1] =  0.0;
-    fConcUp[2] =  0.0;
-    fConcUp[3] =  0.0;
-    fConcUp[4] =  0.0;
-    fConcUp[5] =  0.0;
-    fConcUp[6] =  0.0;
-    fConcUp[7] =  0.0;
-
-    fConcLo[0] = -1.e10;
-    fConcLo[1] =  0.0;
-    fConcLo[2] =  0.0;
-    fConcLo[3] =  0.0;
-    fConcLo[4] =  0.0;
-    fConcLo[5] =  0.0;
-    fConcLo[6] =  0.0;
-    fConcLo[7] =  0.0;
-
-    fLeakage1Up[0] =  1.e10;
-    fLeakage1Up[1] =  0.0;
-    fLeakage1Up[2] =  0.0;
-    fLeakage1Up[3] =  0.0;
-    fLeakage1Up[4] =  0.0;
-    fLeakage1Up[5] =  0.0;
-    fLeakage1Up[6] =  0.0;
-    fLeakage1Up[7] =  0.0;
-
-    fLeakage1Lo[0] = -1.e10;
-    fLeakage1Lo[1] =  0.0;
-    fLeakage1Lo[2] =  0.0;
-    fLeakage1Lo[3] =  0.0;
-    fLeakage1Lo[4] =  0.0;
-    fLeakage1Lo[5] =  0.0;
-    fLeakage1Lo[6] =  0.0;
-    fLeakage1Lo[7] =  0.0;
-
-    fAlphaUp[0] = 13.123440; 
-    fAlphaUp[1] = 0;
-    fAlphaUp[2] = 0;
-    fAlphaUp[3] = 0;
-    fAlphaUp[4] = 0;
-    fAlphaUp[5] = 0;
-    fAlphaUp[6] = 0;
-    fAlphaUp[7] = 0;
-
-    //---------------------------------------------------
-    // fStepsizes 
-    // if == 0.0    the parameter will be fixed in the minimization
-    //    != 0.0    initial step sizes for the parameters
-
-    // LengthUp
-    fStepsizes[0] = 0.02;
-    fStepsizes[1] = 0.0;
-    fStepsizes[2] = 0.0;
-    fStepsizes[3] = 0.0;
-    fStepsizes[4] = 0.0;
-    fStepsizes[5] = 0.0;
-    fStepsizes[6] = 0.0;
-    fStepsizes[7] = 0.0;
-
-    // LengthLo
-    fStepsizes[8]  = 0.0;
-    fStepsizes[9]  = 0.0;
-    fStepsizes[10] = 0.0;
-    fStepsizes[11] = 0.0;
-    fStepsizes[12] = 0.0;
-    fStepsizes[13] = 0.0;
-    fStepsizes[14] = 0.0;
-    fStepsizes[15] = 0.0;
-
-    // WidthUp
-    fStepsizes[16] = 0.01;
-    fStepsizes[17] = 0.0;
-    fStepsizes[18] = 0.0;
-    fStepsizes[19] = 0.0;
-    fStepsizes[20] = 0.0;
-    fStepsizes[21] = 0.0;
-    fStepsizes[22] = 0.0;
-    fStepsizes[23] = 0.0;
-
-    // WidthLo
-    fStepsizes[24] = 0.0;
-    fStepsizes[25] = 0.0;
-    fStepsizes[26] = 0.0;
-    fStepsizes[27] = 0.0;
-    fStepsizes[28] = 0.0;
-    fStepsizes[29] = 0.0;
-    fStepsizes[30] = 0.0;
-    fStepsizes[31] = 0.0;
-
-    // DistUp
-    fStepsizes[32] = 0.0;
-    fStepsizes[33] = 0.0;
-    fStepsizes[34] = 0.0;
-    fStepsizes[35] = 0.0;
-    fStepsizes[36] = 0.0;
-    fStepsizes[37] = 0.0;
-    fStepsizes[38] = 0.0;
-    fStepsizes[39] = 0.0;
-
-    // DistLo
-    fStepsizes[40] = 0.0;
-    fStepsizes[41] = 0.0;
-    fStepsizes[42] = 0.0;
-    fStepsizes[43] = 0.0;
-    fStepsizes[44] = 0.0;
-    fStepsizes[45] = 0.0;
-    fStepsizes[46] = 0.0;
-    fStepsizes[47] = 0.0;
-
-    // AsymUp
-    fStepsizes[48] = 0.0;
-    fStepsizes[49] = 0.0;
-    fStepsizes[50] = 0.0;
-    fStepsizes[51] = 0.0;
-    fStepsizes[52] = 0.0;
-    fStepsizes[53] = 0.0;
-    fStepsizes[54] = 0.0;
-    fStepsizes[55] = 0.0;
-
-    // AsymLo
-    fStepsizes[56] = 0.0;
-    fStepsizes[57] = 0.0;
-    fStepsizes[58] = 0.0;
-    fStepsizes[59] = 0.0;
-    fStepsizes[60] = 0.0;
-    fStepsizes[61] = 0.0;
-    fStepsizes[62] = 0.0;
-    fStepsizes[63] = 0.0;
-
-    // ConcUp
-    fStepsizes[64] = 0.0;
-    fStepsizes[65] = 0.0;
-    fStepsizes[66] = 0.0;
-    fStepsizes[67] = 0.0;
-    fStepsizes[68] = 0.0;
-    fStepsizes[69] = 0.0;
-    fStepsizes[70] = 0.0;
-    fStepsizes[71] = 0.0;
-
-    // ConcLo
-    fStepsizes[72] = 0.0;
-    fStepsizes[73] = 0.0;
-    fStepsizes[74] = 0.0;
-    fStepsizes[75] = 0.0;
-    fStepsizes[76] = 0.0;
-    fStepsizes[77] = 0.0;
-    fStepsizes[78] = 0.0;
-    fStepsizes[79] = 0.0;
-
-    // Leakage1Up
-    fStepsizes[80] = 0.0;
-    fStepsizes[81] = 0.0;
-    fStepsizes[82] = 0.0;
-    fStepsizes[83] = 0.0;
-    fStepsizes[84] = 0.0;
-    fStepsizes[85] = 0.0;
-    fStepsizes[86] = 0.0;
-    fStepsizes[87] = 0.0;
-
-    // Leakage1Lo
-    fStepsizes[88] = 0.0;
-    fStepsizes[89] = 0.0;
-    fStepsizes[90] = 0.0;
-    fStepsizes[91] = 0.0;
-    fStepsizes[92] = 0.0;
-    fStepsizes[93] = 0.0;
-    fStepsizes[94] = 0.0;
-    fStepsizes[95] = 0.0;
-
-    // AlphaUp
-    fStepsizes[96]  = 0.0;
-    fStepsizes[97]  = 0.0;
-    fStepsizes[98]  = 0.0;
-    fStepsizes[99]  = 0.0;
-    fStepsizes[100] = 0.0;
-    fStepsizes[101] = 0.0;
-    fStepsizes[102] = 0.0;
-    fStepsizes[103] = 0.0;
-}
-
-
-// --------------------------------------------------------------------------
-//
-// Set the parameter values from the array 'd'
-//
-//
-Bool_t MSupercuts::SetParameters(const TArrayD &d)
-{
-    if (d.GetSize() != fParameters.GetSize())
-    {
-        *fLog << err << "Sizes of d and of fParameters are different : "
-              << d.GetSize() << ",  " << fParameters.GetSize() << endl;
-        return kFALSE;
-    }
-
-    fParameters = d;
-
-    return kTRUE;
-}
-
-// --------------------------------------------------------------------------
-//
-// Set the step sizes from the array 'd'
-//
-//
-Bool_t MSupercuts::SetStepsizes(const TArrayD &d)
-{
-    if (d.GetSize() != fStepsizes.GetSize())
-    {
-        *fLog << err << "Sizes of d and of fStepsizes are different : "
-              << d.GetSize() << ",  " << fStepsizes.GetSize() << endl;
-        return kFALSE;
-    }
-
-    fStepsizes = d;
-
-    return kTRUE;
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Index: trunk/MagicSoft/Mars/manalysis/MSupercuts.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MSupercuts.h	(revision 6949)
+++ 	(revision )
@@ -1,69 +1,0 @@
-#ifndef MARS_MSupercuts
-#define MARS_MSupercuts
-
-#ifndef MARS_MParContainer
-#include "MParContainer.h"
-#endif
-
-#ifndef ROOT_TArrayD
-#include <TArrayD.h>
-#endif
-
-class MSupercuts : public MParContainer
-{
-private:
-    TArrayD fParameters; // supercut parameters
-    TArrayD fStepsizes;  // step sizes of supercut parameters
-
-    Double_t *fLengthUp; //!
-    Double_t *fLengthLo; //!
-    Double_t *fWidthUp;  //!
-    Double_t *fWidthLo;  //!
-    Double_t *fDistUp;   //!
-    Double_t *fDistLo;   //!
-    Double_t *fAsymUp;   //!
-    Double_t *fAsymLo;   //!
-
-    Double_t *fConcUp;   //!
-    Double_t *fConcLo;   //!
-    Double_t *fLeakage1Up;   //!
-    Double_t *fLeakage1Lo;   //!
-
-    Double_t *fAlphaUp;  //!
-
-
-public:
-    MSupercuts(const char *name=NULL, const char *title=NULL);
-
-    void InitParameters();
-
-    Bool_t SetParameters(const TArrayD &d);
-    Bool_t SetStepsizes(const TArrayD &d);
-
-    const TArrayD &GetParameters() const { return fParameters; }
-    const TArrayD &GetStepsizes()  const { return fStepsizes;  }
-
-    const Double_t *GetLengthUp() const { return fLengthUp; }
-    const Double_t *GetLengthLo() const { return fLengthLo; }
-    const Double_t *GetWidthUp() const  { return fWidthUp; }
-    const Double_t *GetWidthLo() const  { return fWidthLo; }
-    const Double_t *GetDistUp() const   { return fDistUp; }
-    const Double_t *GetDistLo() const   { return fDistLo; }
-    const Double_t *GetAsymUp() const   { return fAsymUp; }
-    const Double_t *GetAsymLo() const   { return fAsymLo; }
-
-    const Double_t *GetConcUp() const   { return fConcUp; }
-    const Double_t *GetConcLo() const   { return fConcLo; }
-
-    const Double_t *GetLeakage1Up() const   { return fLeakage1Up; }
-    const Double_t *GetLeakage1Lo() const   { return fLeakage1Lo; }
-
-    const Double_t *GetAlphaUp() const  { return fAlphaUp; }
-
-    ClassDef(MSupercuts, 1) // A container for the Supercut parameters
-};
-
-#endif
-
-
-
