Index: trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MFRandomSplit.cc
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MFRandomSplit.cc	(revision 4411)
+++ trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MFRandomSplit.cc	(revision 4411)
@@ -0,0 +1,113 @@
+/* ======================================================================== *\
+!
+! *
+! * 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, 11/2003 <mailto:wittek@mppmu.mpg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2003
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+//  MFRandomSplit
+//
+//  A filter which gives fResult = kTRUE with the probability fProb
+//
+/////////////////////////////////////////////////////////////////////////////
+#include "MFRandomSplit.h"
+
+#include <fstream>
+#include <TRandom.h>
+
+#include "MParList.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+ClassImp(MFRandomSplit);
+
+using namespace std;
+
+// --------------------------------------------------------------------------
+//
+//     Constructor
+//
+MFRandomSplit::MFRandomSplit(Double_t f, const char *name, const char *title)
+    : fProb(f)
+{
+    fName  = name  ? name  : "MFRandomSplit";
+    fTitle = title ? title : "Filter for random splitting";
+
+    if (fProb < 0)
+    {
+        *fLog << warn << "WARNING - MFRandomSplit::MFRandomSplit: Probability less than 0... set to 0." << endl;
+        fProb = 0;
+    }
+
+    if (fProb > 1)
+    {
+        *fLog << warn << "WARNING - MFRandomSplit::MFRandomSplit: Probability greater than 1... set to 1." << endl;
+        fProb = 1;
+    }
+}
+
+// --------------------------------------------------------------------------
+//
+//  PreProcess. Set fNumSelectedEvts=0
+//
+Int_t MFRandomSplit::PreProcess(MParList *pList)
+{
+    fNumSelectedEvts = 0;
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//  
+//  Select events randomly according to the probability fProb. Count all
+//  selected events
+//
+Int_t MFRandomSplit::Process()
+{
+    fResult = gRandom->Uniform() < fProb;
+
+    if (fResult)
+        fNumSelectedEvts++;
+
+    return kTRUE;
+}
+
+
+// --------------------------------------------------------------------------
+//  
+//  PostProcess. Prints execution statistics
+//
+Int_t MFRandomSplit::PostProcess()
+{
+    if (GetNumExecutions()==0)
+        return kTRUE;
+
+    *fLog << inf << endl;
+    *fLog << GetDescriptor() << " execution statistics:" << endl;
+    *fLog << dec << setfill(' ');
+    *fLog << " " << setw(7) << fNumSelectedEvts << " (";
+    *fLog << setw(3) << (int)(100.*fNumSelectedEvts/GetNumExecutions());
+    *fLog << "%) selected - out of " << GetNumExecutions() << endl;
+    *fLog << endl;
+
+    return kTRUE;
+}
Index: trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MFRandomSplit.h
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MFRandomSplit.h	(revision 4411)
+++ trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MFRandomSplit.h	(revision 4411)
@@ -0,0 +1,41 @@
+#ifndef MARS_MFRandomSplit
+#define MARS_MFRandomSplit
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MFRandomSplit                                                           //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef MARS_MFilter
+#include "MFilter.h"
+#endif
+
+class MParList;
+
+class MFRandomSplit : public MFilter
+{
+private:
+    Int_t    fNumSelectedEvts;
+    Double_t fProb;    // probability with which the result should be kTRUE
+
+    Bool_t   fResult;  // Result returned by IsExpressionTrue
+
+    Int_t PreProcess(MParList *pList);
+    Int_t Process();
+    Int_t PostProcess();
+
+public:
+    MFRandomSplit(Double_t f, const char *name=NULL, const char *title=NULL);
+
+    Bool_t IsExpressionTrue() const { return fResult; }
+
+    ClassDef(MFRandomSplit, 0) // A Filter giving kTRUE with a certain probability
+};
+
+#endif
+
+
+
+
+
+
Index: trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MFindSupercutsONOFF.cc
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MFindSupercutsONOFF.cc	(revision 4411)
+++ trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MFindSupercutsONOFF.cc	(revision 4411)
@@ -0,0 +1,4299 @@
+/* ======================================================================== *\
+!
+! *
+! * 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 9/2003 <mailto:wittek@mppmu.mpg.de>
+!              David Paneque   11/2003 <mailto:dpaneque@mppmu.mpg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2003
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MFindSupercutsONOFF                                                       //
+//                                                                         //
+// Class for optimizing the parameters of the supercuts                     //
+// Using ON and OFF data                                                   //
+//                                                                         //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+#include "MFindSupercutsONOFF.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 "MSupercutsCalcONOFF.h"
+#include "MDataElement.h"
+#include "MDataMember.h"
+
+
+#include <TPostScript.h>
+
+#include "MEvtLoop.h"
+#include "MFCT1SelFinal.h"
+#include "MF.h"
+#include "MFEventSelector.h"
+#include "MFEventSelector2.h"
+#include "MFillH.h"
+//#include "MGeomCamCT1Daniel.h"
+//#include "MGeomCamCT1.h"
+#include "MGeomCamMagic.h"
+#include "MFRandomSplit.h"
+#include "MH3.h"
+#include "MHCT1Supercuts.h"
+#include "MHFindSignificance.h" // To be removed at some point...
+#include "MHFindSignificanceONOFF.h"
+#include "MTSupercutsApplied.h"
+#include "MHMatrix.h"
+#include "MHOnSubtraction.h"
+#include "MDataValue.h"
+// #include "MDataString.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(MFindSupercutsONOFF);
+
+using namespace std;
+
+
+
+// Function that computes the normalization factor using COUNTED events in alpha histogram 
+// for ON data  and alpha histogram for OFF data;
+// in alpha region defined by AlphaBkgMin and AlphaBkgMax
+
+// It is defined outside the class MFindSupercutsONOFF so that it can be used 
+// in function fcnSupercuts
+
+
+static Double_t ComputeNormFactorFromAlphaBkg(TH1 *histON, TH1 *histOFF, 
+					      Double_t AlphaBkgMin, 
+					      Double_t AlphaBkgMax)
+{                                                      
+
+    Double_t NormFactor = 0.0;
+    Double_t ONEvents = 0.0; 
+    Double_t OFFEvents = 0.0;
+
+    const Double_t SmallQuantity = 0.01;
+    
+    Double_t xlo = 0.0;
+    Double_t xup = 0.0;
+    Double_t width = 0.0;
+
+    Int_t BinCounterOFF = 0;
+    Int_t BinCounterON = 0;
+    
+
+    // I make a copy of the histograms so that nothing happens to the 
+    // histograms used in argument
+
+    TH1* HistON = (TH1*) histON->Clone();
+    TH1* HistOFF = (TH1*) histOFF->Clone();
+
+    if ( !HistON )
+    {
+	gLog << "ComputeNormFactorFromAlphaBkg; " << endl
+	      << "Clone of ON histogram could not be generated" 
+	      << endl;
+	return 0.0;
+    }
+
+
+    
+    if ( !HistOFF )
+    {
+	gLog << "ComputeNormFactorFromAlphaBkg; " << endl
+	      << " Clone of OFF histogram could not be generated" 
+	      << endl;
+	return 0.0;
+    }
+
+  // Calculate the number of OFF events in the Bkg region 
+  // defined by AlphaBkgMin and AlphaBkgMax 
+  // ___________________________________________________
+  
+
+    Int_t nbinsOFF = HistOFF -> GetNbinsX();  
+    Double_t binwidthOFF = HistOFF -> GetBinWidth(1);
+
+    for (Int_t i=1; i<=nbinsOFF; i++)
+    {
+	xlo = HistOFF->GetBinLowEdge(i);
+	xup = HistOFF->GetBinLowEdge(i+1);
+ 
+	// bin must be completely contained in the bkg region
+	if ( xlo >= (AlphaBkgMin-SmallQuantity)  &&  xup <= (AlphaBkgMax+SmallQuantity)    )
+	{
+	    width = fabs(xup-xlo);
+	    if (fabs(width-binwidthOFF) > SmallQuantity)
+	    {
+		gLog << "ComputeNormFactorFromAlphaBkg; " 
+		      << endl << " HistOFF has variable binning, which is not allowed" 
+		      << endl;
+		return 0.0;
+	    }
+
+	    BinCounterOFF++;
+
+	    OFFEvents  += HistOFF->GetBinContent(i);
+	    
+	}
+    }
+
+
+    // Calculate the number of ON events in the Bkg region 
+  // defined by AlphaBkgMin and AlphaBkgMax 
+  // ___________________________________________________
+  
+
+    Int_t nbinsON = HistON -> GetNbinsX();  
+    Double_t binwidthON = HistON -> GetBinWidth(1);
+
+    for (Int_t i=1; i<=nbinsON; i++)
+    {
+	xlo = HistON->GetBinLowEdge(i);
+	xup = HistON->GetBinLowEdge(i+1);
+ 
+	// bin must be completely contained in the bkg region
+	if ( xlo >= (AlphaBkgMin-SmallQuantity)  &&  xup <= (AlphaBkgMax+SmallQuantity)    )
+	{
+	    width = fabs(xup-xlo);
+	    if (fabs(width-binwidthON) > SmallQuantity)
+	    {
+		gLog << "ComputeNormFactorFromAlphaBkg; " 
+		      << endl << " HistON has variable binning, which is not allowed" 
+		      << endl;
+		return 0.0;
+	    }
+
+	    BinCounterON++;
+	    ONEvents  += HistON->GetBinContent(i);
+	    
+	}
+    }
+
+
+  
+
+    // NormFactor is computed
+
+      if (ONEvents < SmallQuantity || OFFEvents < SmallQuantity)
+      {
+	  gLog << "ComputeNormFactorFromAlphaBkg; " 
+		<< endl 
+		<< "ONEvents or OFFEvents computed in bkg region are < " 
+		<< SmallQuantity << endl;
+	  return 0.0;
+	  
+      }
+
+     
+	  
+    
+    NormFactor = ONEvents/OFFEvents;
+
+    Double_t error = 1/ONEvents + 1/OFFEvents;
+    error = TMath::Sqrt(error);
+    error = error * NormFactor;
+
+     // tmp info
+      gLog << "ComputeNormFactorFromAlphaBkg;" << endl
+	   << "ON Events in bkg region = " << ONEvents 
+	   << " (" << BinCounterON << " bins)"
+	   << " , OFF Events in bkg region = " << OFFEvents 
+	   << " (" << BinCounterOFF << " bins)" << endl
+	   <<"NormFactor computed from bkg region = " << NormFactor 
+	   << " +/- " << error << endl;
+      // end temp
+
+    return NormFactor;
+
+}
+
+
+
+
+
+
+
+
+//------------------------------------------------------------------------
+//
+// 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();
+
+    // Event loops for ON and OFF data are recovered. 
+
+    MEvtLoop* ONDataevtloopfcn = &evtloopfcn[0];
+    MEvtLoop* OFFDataevtloopfcn = &evtloopfcn[1];
+
+
+    // Parameter list from event loops for ON and OFF data are recovered
+
+    MParList *ONDataplistfcn   = (MParList*) ONDataevtloopfcn->GetParList();
+    MParList *OFFDataplistfcn   = (MParList*) OFFDataevtloopfcn->GetParList();
+    
+    // MTaskList *ONDataTasklistfcn   = (MTaskList*) ONDataevtloopfcn->GetTaskList();
+    // MTaskList *OFFDataTasklistfcn   = (MTaskList*) OFFDataevtloopfcn->GetTaskList();
+
+
+
+    // Container for supercuts is retrieved from ONDataplistfcn. 
+    // NOTE: The same supercuts parameter container is used in  OFFDataplistfcn
+
+    MSupercuts *super = (MSupercuts*) ONDataplistfcn->FindObject("MSupercuts");
+    if (!super)
+    {
+        gLog << "fcnSupercuts : MSupercuts object '" << "MSupercuts"
+            << "' not found... aborting" << endl;
+        return;
+    }
+
+
+    // Normalization factor for train sample (Train ON before cuts/ train OFF before cuts) 
+    // is retrieved from the ONDataplistfcn
+
+    Double_t NormalizationFactorTrain = 0.0;
+    
+    MDataValue* NormFactorContainer = (MDataValue*) ONDataplistfcn->FindObject("NormFactorTrain");
+    NormalizationFactorTrain = NormFactorContainer -> GetValue();
+
+    
+    gLog << "fcnSupercuts : Normalization factor retrieved from ONDataplistfcn: " << endl
+	 << "NormalizationFactorTrain = " << NormalizationFactorTrain << endl;
+    
+
+    Double_t AlphaSig = 0.0;
+    MDataValue* AlphaSigContainer = (MDataValue*) ONDataplistfcn->FindObject("AlphaSigValue");
+    AlphaSig = AlphaSigContainer -> GetValue();
+
+    Double_t AlphaBkgMin = 0.0;
+    MDataValue* AlphaBkgMinContainer = 
+	(MDataValue*) ONDataplistfcn->FindObject("AlphaBkgMinValue");
+    AlphaBkgMin = AlphaBkgMinContainer -> GetValue();
+
+    Double_t AlphaBkgMax = 0.0;
+    MDataValue* AlphaBkgMaxContainer = 
+	(MDataValue*) ONDataplistfcn->FindObject("AlphaBkgMaxValue");
+    AlphaBkgMax = AlphaBkgMaxContainer -> GetValue();
+
+    
+    gLog << "fcnSupercuts : AlphaSig and AlphaBkgMin-AlphaBkgMax retrieved from ONDataplistfcn: "
+	 << endl
+	 << "AlphaSig = " << AlphaSig << "; AlphaBkgMin-AlphaBkgMax = " 
+	 << AlphaBkgMin << "-" << AlphaBkgMax << endl;
+
+
+
+    // Variable fUseFittedQuantities is retrieved from ONDataplistfcn
+
+    Bool_t UseFittedQuantities;
+    MDataValue* UseFittedQuantitiesContainer = 
+	(MDataValue*) ONDataplistfcn->FindObject("UseFittedQuantitiesValue");
+    UseFittedQuantities = bool(UseFittedQuantitiesContainer -> GetValue());
+    
+    if (UseFittedQuantities)
+    {
+	gLog << "fcnSupercuts :  UseFittedQuantities variable set to kTRUE" << endl;
+    }
+    else
+    {
+	gLog << "fcnSupercuts :  UseFittedQuantities variable set to kFALSE" << endl;
+    }
+    
+
+    Bool_t UseNormFactorFromAlphaBkg;
+    MDataValue* UseNormFactorFromAlphaBkgContainer = 
+      (MDataValue*) ONDataplistfcn -> FindObject("UseNormFactorFromAlphaBkgValue");
+    UseNormFactorFromAlphaBkg = bool(UseNormFactorFromAlphaBkgContainer -> GetValue());
+
+
+    if (UseNormFactorFromAlphaBkg)
+    {
+	gLog << "fcnSupercuts :  UseNormFactorFromAlphaBkg variable set to kTRUE" << endl;
+    }
+    else
+    {
+	gLog << "fcnSupercuts :  UseNormFactorFromAlphaBkg variable set to kFALSE" << endl;
+    }
+
+
+
+
+    //
+    // 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 for ON data with the current cuts
+    //
+    if (!ONDataevtloopfcn->Eventloop())
+    {
+	gLog << "fcnsupercuts  : ONDataevtloopfcn->Eventloop() failed" << endl;
+    }
+    
+    // Somehow (??) I can not use the function MTaskList::PrintStatistics...
+    // it produces a segmentation fault...
+
+    //ONDataTasklistfcn->PrintStatistics(0, kFALSE);
+    
+    MH3* alpha = (MH3*)ONDataplistfcn->FindObject("AlphaFcn", "MH3");
+    if (!alpha)
+        return;
+
+    TH1 &alphaHist = alpha->GetHist();
+    alphaHist.SetName("alpha-fcnSupercuts");
+
+
+    //
+    // plot alpha for OFF data with the current cuts
+    //
+    if(!OFFDataevtloopfcn->Eventloop())
+    {
+	gLog << "fcnsupercuts  : OFFDataevtloopfcn->Eventloop() failed" << endl;
+    }
+
+    // Somehow (??) I can not use the function MTaskList::PrintStatistics...
+    // it produces a segmentation fault...
+
+    //OFFDataTasklistfcn->PrintStatistics(0, kFALSE);
+
+    MH3* alphaOFF = (MH3*) OFFDataplistfcn->FindObject("AlphaOFFFcn", "MH3");
+    if (!alphaOFF)
+        return;
+
+    TH1 &alphaHistOFF = alphaOFF->GetHist();
+    alphaHistOFF.SetName("alphaOFF-fcnSupercuts");
+
+
+
+
+
+    if (UseNormFactorFromAlphaBkg)
+      {
+	// Normalization factor computed using alpha bkg region
+	Double_t NewNormFactor = 
+	    ComputeNormFactorFromAlphaBkg(&alphaHist, &alphaHistOFF, 
+					  AlphaBkgMin, AlphaBkgMax);
+	
+	gLog << "Normalization factor computed from alpha plot (after cuts) " << endl
+	      << "using counted number of ON and OFF events in alpha region " << endl
+	      << "defined by range " << AlphaBkgMin << "-" << AlphaBkgMax << endl
+	      << "Normalization factor = " << NewNormFactor << endl;
+
+	gLog << "Normalization factor used is the one computed in bkg region; " << endl
+	      << "i.e. " << NewNormFactor << " instead of " << NormalizationFactorTrain << endl;
+
+	NormalizationFactorTrain = NewNormFactor;
+
+
+    }
+
+
+
+
+
+
+
+    //-------------------------------------------
+    // 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 = AlphaSig;
+    const Double_t alphamin = AlphaBkgMin; 
+   // alpha min for bkg region in ON data
+    const Double_t alphamax = AlphaBkgMax; // alpha max for bkg region in ON data
+    const Int_t    degreeON   =    2; 
+    // degree of polynomial used to fit ON data in Bkg  region
+    const Int_t    degreeOFF   =    2; 
+    // degree of polynomial used to fit OFF data in ALL region
+
+    Bool_t drawpoly;
+    Bool_t fitgauss;
+    Bool_t saveplots;
+    
+
+    if (iflag == 3)
+    {// Even though minimization finished successfully, I will NOT produce 
+	// final plots now... i'll do it later via the function 
+	// "MFindSupercutsONOFF::OutputOptimizationOnTrainSample()"
+
+        drawpoly  = kFALSE;
+        fitgauss  = kFALSE;
+	saveplots = kFALSE;
+    }
+    else
+    {
+        drawpoly  = kFALSE;
+        fitgauss  = kFALSE;
+	saveplots = kFALSE;
+	
+	
+    }
+
+
+    const Bool_t print = kTRUE;
+
+    MHFindSignificanceONOFF findsig;
+    findsig.SetRebin(kTRUE);
+    findsig.SetReduceDegree(kFALSE);
+    findsig.SetUseFittedQuantities(UseFittedQuantities);
+    
+    // TPostScript* DummyPs  = new TPostScript("dummy.ps");
+    
+    TString DummyPs = ("Dummy");
+
+    const Bool_t rc = findsig.FindSigmaONOFF(&alphaHist,&alphaHistOFF, 
+					     NormalizationFactorTrain, 
+					     alphamin, alphamax, 
+					     degreeON, degreeOFF,
+					     alphasig, drawpoly, fitgauss, 
+					     print, saveplots, 
+					     DummyPs);
+    //DummyPs -> Close();
+    //delete DummyPs;
+
+    
+    //=================================================================
+
+    // reset gMinuit to the MINUIT object for optimizing the supercuts 
+    gMinuit = savePointer;
+    //-------------------------------------------
+
+    if (!rc)
+    {
+        gLog << "fcnSupercuts : FindSigmaONOFF() failed" << endl;
+        f = 1.e10;
+        return;
+    }
+
+    /*
+
+    // plot some quantities during the optimization
+    MHCT1Supercuts *plotsuper = (MHCT1Supercuts*)ONDataplistfcn->FindObject("MHCT1Supercuts");
+    if (plotsuper)
+        plotsuper->Fill(&findsig);
+
+
+
+    */
+
+    //------------------------
+    // get significance
+    const Double_t significance = findsig.GetSignificance();
+    f = significance>0 ? -significance : 0;
+
+
+    gLog << " ///****************************************** ///" << endl;
+    gLog << "Significance (Li&Ma)is now: " << f << endl;
+    gLog << " ///****************************************** ///" << endl;
+
+    //------------------------
+    // 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.
+//
+MFindSupercutsONOFF::MFindSupercutsONOFF(const char *name, const char *title)
+    : fHowManyTrain(10000), fHowManyTest(10000), fMatrixFilter(NULL)
+{
+    fName  = name  ? name  : "MFindSupercutsONOFF";
+    fTitle = title ? title : "Optimizer of the supercuts";
+
+    //---------------------------
+    // camera geometry is needed for conversion mm ==> degree
+    //fCam = new MGeomCamCT1Daniel; 
+    // fCam = new MGeomCamCT1; 
+    fCam = new MGeomCamMagic; 
+
+    // matrices to contain the training/test samples
+    fMatrixTrain = new MHMatrix("MatrixTrain");
+    fMatrixTest  = new MHMatrix("MatrixTest");
+    fMatrixTrainOFF = new MHMatrix("MatrixTrainOFF");
+    fMatrixTestOFF  = new MHMatrix("MatrixTestOFF");
+    
+
+    // objects of MSupercutsCalcONOFF to which these matrices are attached
+    fCalcHadTrain = new MSupercutsCalcONOFF("SupercutsCalcTrain");
+    fCalcHadTest  = new MSupercutsCalcONOFF("SupercutsCalcTest");
+    fCalcHadTrainOFF = new MSupercutsCalcONOFF("SupercutsCalcTrainOFF");
+    fCalcHadTestOFF  = new MSupercutsCalcONOFF("SupercutsCalcTestOFF");
+
+    // Define columns of matrices
+    fCalcHadTrain->InitMapping(fMatrixTrain);
+    fCalcHadTest->InitMapping(fMatrixTest);
+    fCalcHadTrainOFF->InitMapping(fMatrixTrainOFF);
+    fCalcHadTestOFF->InitMapping(fMatrixTestOFF);
+
+    // For the time being weights method is not implemented
+    //UseWeights = kFALSE; 
+
+    // Normalization factors are initialized to -1
+    // Functions determining Number of excess events will not work 
+    // with negative norm factors;  
+    // This will ensure that Norm factors are computed before running
+    // DetExcessONOFF() function.
+
+    fNormFactorTrain = -1.0;
+    fNormFactorTest = -1.0;
+
+    // SigmaLiMa and Nex member variables are initialized to 0
+
+    fSigmaLiMaTrain = 0.0;
+    fSigmaLiMaTest = 0.0;
+    fNexTrain = 0.0; 
+    fNexTest = 0.0; 
+
+    
+    // Cuts (low and up) in variable MPointingPos.fZd
+    // (at some point real theta)
+    // The default is not cut, i.e. all values (0-1) are taken
+    
+    fThetaMin = 0; // in miliradians  // FIXME: change name
+    fThetaMax = 90; // new: in deg; old: (1570) in miliradians // FIXME: change name
+    
+
+    fAlphaSig = 20; // By default, signal is expected in alpha<20 for CT1
+
+    // By default, bkg region is set to alpha range 30-90 for CT1
+    fAlphaBkgMin = 30; 
+    fAlphaBkgMax = 90;
+
+
+    // By default, bining for alpha plots is set to 
+    
+    fNAlphaBins = 54;
+    fAlphaBinLow = -12;
+    fAlphaBinUp = 96;
+
+
+
+    fNormFactorFromAlphaBkg = kTRUE; // By default normalization factor is 
+    // computed using bkg region in alpha histograms (after cuts)
+
+//    fActualCosThetaBinCenter = 0;
+
+    fTuneNormFactor = kTRUE; // Norm factors will be corrected using 
+    //the total amount of OFF events before cuts and the estimated excess events
+    // fNormFactorTrain = fNormFactorTrain - Ngammas/EventsInTrainMatrixOFF
+
+
+    // use quantities computed from the fits
+    // The variable allows the user to NOT use these quantities when there is not 
+    // enough statistics and fit not always is possible.
+    // Default value is kTRUE
+    fUseFittedQuantities = kTRUE;
+
+
+
+
+    // Boolean variable that allows the user to set some limits to the 
+    // some of the Minuit parameters. For the time being, only the limits
+    // for the parameters which do NOT depend in size, dist and theta are set, 
+    // i.e. static limits. The value of this boolean variable is set in the 
+    // constructor of the class.
+    
+    fSetLimitsToSomeMinuitParams = kTRUE;
+    
+    // Limits for the Minuit parameters. For the time being the values are set in the constructor 
+    // of the class. One MUST be very careful to set limits such that the expected final values 
+    // (optimized values) are far away from the limits.
+    
+    // Values in degrees
+    
+
+    fMinuitDistUPUpperLimit = 2.0;
+    fMinuitDistUPLowerLimit = 0.5;
+    fMinuitLengthUPUpperLimit = 0.8;
+    fMinuitLengthUPLowerLimit = 0.0;
+    fMinuitWidthUPUpperLimit = 0.5;
+    fMinuitWidthUPLowerLimit = 0.0;
+    fMinuitLeakage1UPUpperLimit = 1.5;
+    fMinuitLeakage1UPLowerLimit = -0.5;
+    
+    fMinuitDistLOWUpperLimit = 1.0;
+    fMinuitDistLOWLowerLimit = 0.0;
+    fMinuitLengthLOWUpperLimit = 0.5;
+    fMinuitLengthLOWLowerLimit = -0.3;
+    fMinuitWidthLOWUpperLimit = 0.4;
+    fMinuitWidthLOWLowerLimit = -0.3;
+
+
+
+    // Boolean variable that controls wether the optimization of the 
+    // parameters (MMinuitInterface::CallMinuit(..) in function FindParams(..))
+    // takes place or not. kTRUE will skip such optimization.
+    // This variable is useful to test the optmized parameters (previously found 
+    // and stored in root file) on the TRAIN sample.
+    
+    fSkipOptimization = kFALSE;
+
+    // Boolean variable that allows the user to write the initial parameters 
+    // into the root file that will be used to store the optimum cuts.
+    // If fUseInitialSCParams = kTRUE , parameters are written.
+    // In this way, the initial SC parameters can be applied on the data (train/test) 
+    
+    // The initial parameters are ONLY written to the root file if 
+    // there is NO SC params optimization, i.e., if variable 
+    // fSkipOptimization = kTRUE;
+
+    // The default value is obviously kFALSE.
+
+    fUseInitialSCParams = kTRUE;
+    
+
+    // Set wether to use or not hillas dist
+    fUseDist = kTRUE;
+
+
+
+
+    fGammaEfficiency = 0.5; // Fraction of gammas that remain after cuts
+    // Quantity that will have to be determined with MC, yet for the 
+    // time being I set it to 0.5 (standard value)
+
+    fPsFilename = NULL;
+    fPsFilename2 = NULL;
+
+
+    ////////////////////////////////////////////////////
+    // TMP
+
+    // There are quite some problems during the data preprocessing. 
+    // For the time being, I will add some cuts to the functions 
+    // DefineTrainTestMatrixThetaRange and for OFF, so that I can 
+    // make a kind of preprocess on my own. This allows me 
+    // to make a very silly preprocess with wolfgangs macro, which 
+    // might be free of corrupted data, and then I can do on my own.
+
+    fSizeCutLow = 0.1; // To prevent empty events
+    fSizeCutUp = 10000000;
+
+    // Angular cuts are converted to mm, which 
+    // are the units of the preprocessed data....
+
+
+    // Angular cuts not yet implemented ...
+    Double_t ConvMMToDeg = 0.00337034;
+    
+    fDistCutLow = 0.4/ConvMMToDeg;
+    fDistCutUp = 1.5/ConvMMToDeg;
+    
+    fLengthCutLow = 0.1/ConvMMToDeg;
+    fLengthCutUp = 1/ConvMMToDeg;
+
+    fWidthCutLow = 0.07/ConvMMToDeg;
+    fWidthCutUp = 1/ConvMMToDeg;
+
+    // ENDTMP
+    ////////////////////////////////////////////////////
+    
+
+
+
+
+}
+
+// --------------------------------------------------------------------------
+//
+// Default destructor.
+//
+MFindSupercutsONOFF::~MFindSupercutsONOFF()
+{
+
+    *fLog << "destructor of MFindSupercutsONOFF is called" << endl;
+
+    fPsFilename = NULL;
+    fPsFilename2 = NULL;
+
+
+    delete fCam;
+    delete fMatrixTrain;
+    delete fMatrixTest;
+    delete fCalcHadTrain;
+    delete fCalcHadTest;
+    delete fMatrixTrainOFF;
+    delete fMatrixTestOFF;
+    delete fCalcHadTrainOFF;
+    delete fCalcHadTestOFF;
+    
+    *fLog << "destructor of MFindSupercutsONOFF finished successfully" << endl;
+
+}
+
+// --------------------------------------------------------------------------
+//
+// Function that sets the name of the PostScript file where alpha distributions 
+// for the different Theta bins will be stored.
+// It also initializes 
+
+
+
+void MFindSupercutsONOFF::SetPostScriptFile (TPostScript* PsFile)
+{
+    fPsFilename = PsFile;
+
+    *fLog << "MFindSupercutsONOFF : Results (alpha distributions with excess and significances) will be stored in PostScript file " 
+	  << fPsFilename -> GetName() << endl;
+
+}
+
+void MFindSupercutsONOFF::SetPostScriptFile2 (TPostScript &PsFile)
+{
+    fPsFilename2 = new TPostScript (PsFile);
+
+    *fLog << "MFindSupercutsONOFF : Results (alpha distributions with excess and significances) will be stored in PostScript file " 
+	  << fPsFilename2 -> GetName() << endl;
+
+}
+
+void MFindSupercutsONOFF::SetPsFilenameString (const TString filename)
+{
+    fPsFilenameString = filename;
+}
+
+void MFindSupercutsONOFF::SetSkipOptimization(Bool_t b)
+{
+    fSkipOptimization = b;
+    if (fSkipOptimization)
+    {
+	*fLog << "MFindSupercutsONOFF :: SetSkipOptimization " << endl
+	      << "Variable fSkipOptimization is kTRUE, and therefore "
+	      << "the optimization of supercuts is skipped. Hope that's "
+	      << "what you want... " << endl;
+    }
+
+}
+
+
+void MFindSupercutsONOFF::SetUseInitialSCParams(Bool_t b)
+{
+    fUseInitialSCParams = b;
+    if (fUseInitialSCParams)
+    {
+	*fLog << "MFindSupercutsONOFF :: SetUseInitialSCParams " << endl
+	      << "Variable fUseInitialSCParams is kTRUE. " << endl;
+
+	if (fSkipOptimization)
+	{
+	    *fLog << "The Initial SC Parameters will be applied on the selected data."
+		  << endl;
+	}
+
+	else
+	{
+	    *fLog << "However, fSkipOptimization = kFALSE, and therefore, the " 
+		  << "the supercuts will be optimized. The final cuts that " 
+		  << "will be applied to the data will NOT be the initial SC parameters."
+		  << endl;
+
+	}
+
+
+
+    }
+    
+}
+
+
+
+Bool_t MFindSupercutsONOFF::SetAlphaSig(Double_t alphasig)
+{
+    // check that alpha is within the limits 0-90
+    if (alphasig <= 0 || alphasig > 90)
+    {
+	*fLog << "MFindSupercutsONOFF ::SetAlphaSig; " 
+	      << "value " << alphasig << " is not within the the "
+	      << "logical limits of alpha; 0-90" << endl;
+	return kFALSE;
+    }
+    
+
+    fAlphaSig = alphasig;
+
+    return kTRUE;
+}
+
+Bool_t MFindSupercutsONOFF::SetAlphaBkgMin(Double_t alpha)
+{
+    // check that alpha is within the limits 0-90
+    if (alpha <= 0 || alpha >= 90)
+    {
+	*fLog << "MFindSupercutsONOFF ::SetAlphaBkgMin; " 
+	      << "value " << alpha << " is not within the the "
+	      << "logical limits of alpha; 0-90" << endl;
+	return kFALSE;
+    }
+    
+
+    fAlphaBkgMin = alpha;
+
+    return kTRUE;
+}
+
+
+Bool_t MFindSupercutsONOFF::SetAlphaBkgMax(Double_t alpha)
+{
+    // check that alpha is within the limits 0-90
+    if (alpha <= 0 || alpha > 90.001)
+    {
+	*fLog << "MFindSupercutsONOFF ::SetAlphaBkgMax; " 
+	      << "value " << alpha << " is not within the the "
+	      << "logical limits of alpha; 0-90" << endl;
+	return kFALSE;
+    }
+    
+
+    fAlphaBkgMax = alpha;
+
+    return kTRUE;
+}
+
+
+// Function that checks that the values of the member data 
+// fAlphaSig, fAlphaBkgMin and fAlphaBkgMax make sense
+// (ie, fAlphaSig < fAlphaBkgMin < fAlphaBkgMax)
+
+Bool_t MFindSupercutsONOFF::CheckAlphaSigBkg()
+{
+
+    if (fAlphaSig > fAlphaBkgMin)
+    {
+	*fLog << "MFindSupercutsONOFF ::CheckAlphaSigBkg(); " << endl
+	      << "fAlphaSig > fAlphaBkgMin, which should not occur..." << endl
+	      << "fAlphaSig = " << fAlphaSig << ", fAlphaBkgMin = " << fAlphaBkgMin
+	      << endl;
+
+	return kFALSE;
+    }
+    
+    if (fAlphaBkgMax < fAlphaBkgMin)
+    {
+	*fLog << "MFindSupercutsONOFF ::CheckAlphaSigBkg(); " << endl
+	      << "fAlphaBkgMin > fAlphaBkgMax, which should not occur..." << endl
+	      << "fAlphaBkgMin = " << fAlphaBkgMin << ", fAlphaBkgMax = " << fAlphaBkgMax
+	      << endl;
+
+	return kFALSE;
+    }
+
+    return kTRUE;
+
+}
+
+
+/*
+// Function that computes the normalization factor using COUNTED events ON and OFF
+// in alpha region defined by fAlphaBkgMin and fAlphaBkgMax
+
+
+Double_t MFindSupercutsONOFF::ComputeNormFactorFromAlphaBkg(TH1 *histON, TH1 *histOFF)
+{
+
+    Double_t NormFactor = 0.0;
+    Double_t ONEvents = 0.0; 
+    Double_t OFFEvents = 0.0;
+
+    const Double_t SmallQuantity = 0.01;
+    
+    Double_t xlo = 0.0;
+    Double_t xup = 0.0;
+    Double_t width = 0.0;
+
+    Int_t BinCounterOFF = 0;
+    Int_t BinCounterON = 0;
+    
+
+    // I make a copy of the histograms so that nothing happens to the 
+    // histograms used in argument
+
+    TH1* HistON = (TH1*) histON->Clone();
+    TH1* HistOFF = (TH1*) histOFF->Clone();
+
+    if ( !HistON )
+    {
+	*fLog << "MFindSupercutsONOFF::ComputeNormFactorFromAlphaBkg; " << endl
+	      << "Clone of ON histogram could not be generated" 
+	      << endl;
+	return 0.0;
+    }
+
+
+    
+    if ( !HistOFF )
+    {
+	*fLog << "MFindSupercutsONOFF::ComputeNormFactorFromAlphaBkg; " << endl
+	      << " Clone of OFF histogram could not be generated" 
+	      << endl;
+	return 0.0;
+    }
+
+  // Calculate the number of OFF events in the Bkg region 
+  // defined by fAlphaBkgMin and fAlphaBkgMax 
+  // ___________________________________________________
+  
+
+    Int_t nbinsOFF = HistOFF -> GetNbinsX();  
+    Double_t binwidthOFF = HistOFF -> GetBinWidth(1);
+
+    for (Int_t i=1; i<=nbinsOFF; i++)
+    {
+	xlo = HistOFF->GetBinLowEdge(i);
+	xup = HistOFF->GetBinLowEdge(i+1);
+ 
+	// bin must be completely contained in the bkg region
+	if ( xlo >= (fAlphaBkgMin-SmallQuantity)  &&  xup <= (fAlphaBkgMax+SmallQuantity)    )
+	{
+	    width = fabs(xup-xlo);
+	    if (fabs(width-binwidthOFF) > SmallQuantity)
+	    {
+		*fLog << "MFindSupercutsONOFF::ComputeNormFactorFromAlphaBkg; " 
+		      << endl << " HistOFF has variable binning, which is not allowed" 
+		      << endl;
+		return 0.0;
+	    }
+
+	    BinCounterOFF++;
+
+	    OFFEvents  += HistOFF->GetBinContent(i);
+	    
+	}
+    }
+
+
+    // Calculate the number of ON events in the Bkg region 
+  // defined by fAlphaBkgMin and fAlphaBkgMax 
+  // ___________________________________________________
+  
+
+    Int_t nbinsON = HistON -> GetNbinsX();  
+    Double_t binwidthON = HistON -> GetBinWidth(1);
+
+    for (Int_t i=1; i<=nbinsON; i++)
+    {
+	xlo = HistON->GetBinLowEdge(i);
+	xup = HistON->GetBinLowEdge(i+1);
+ 
+	// bin must be completely contained in the bkg region
+	if ( xlo >= (fAlphaBkgMin-SmallQuantity)  &&  xup <= (fAlphaBkgMax+SmallQuantity)    )
+	{
+	    width = fabs(xup-xlo);
+	    if (fabs(width-binwidthON) > SmallQuantity)
+	    {
+		*fLog << "MFindSupercutsONOFF::ComputeNormFactorFromAlphaBkg; " 
+		      << endl << " HistON has variable binning, which is not allowed" 
+		      << endl;
+		return 0.0;
+	    }
+
+	    BinCounterON++;
+	    ONEvents  += HistON->GetBinContent(i);
+	    
+	}
+    }
+
+
+  
+
+    // NormFactor is computed
+
+      if (ONEvents < SmallQuantity || OFFEvents < SmallQuantity)
+      {
+	  *fLog << "MFindSupercutsONOFF::ComputeNormFactorFromAlphaBkg; " 
+		<< endl 
+		<< "ONEvents or OFFEvents computed in bkg region are < " 
+		<< SmallQuantity << endl;
+	  return 0.0;
+	  
+      }
+
+     
+	  
+    
+    NormFactor = ONEvents/OFFEvents;
+
+    Double_t error = 1/ONEvents + 1/OFFEvents;
+    error = TMath::Sqrt(error);
+    error = error * NormFactor;
+
+     // tmp info
+      cout << "MFindSupercutsONOFF::ComputeNormFactorFromAlphaBkg;" << endl
+	   << "ON Events in bkg region = " << ONEvents 
+	   << " (" << BinCounterON << " bins)"
+	   << " , OFF Events in bkg region = " << OFFEvents 
+	   << " (" << BinCounterOFF << " bins)" << endl
+	   <<"NormFactor computed from bkg region = " << NormFactor 
+	   << " +/- " << error << endl;
+      // end temp
+
+    return NormFactor;
+
+}
+
+
+*/
+
+
+// Function that set the values of fThetaMin and fThetaMax and also 
+// fThetaRangeString (with value in miliradians); 
+// data members that are used basically to print/plot
+// information. 
+
+Bool_t MFindSupercutsONOFF::SetThetaRange(Double_t ThetaMin, Double_t ThetaMax)
+{
+
+// Check  that values are reasonable... well ... i guess this was done 
+// in previous functions...
+
+    fThetaMin = int(ThetaMin*1000.0);
+    fThetaMax = int(ThetaMax*1000.0);
+
+    fThetaRangeString = ("ThetaRange");
+    fThetaRangeString += (fThetaMin);
+    fThetaRangeString += ("_");
+    fThetaRangeString += (fThetaMax);
+    fThetaRangeString += ("mRad");
+
+    return kTRUE;
+
+}
+
+// Function that sets Size range
+Bool_t MFindSupercutsONOFF::SetSizeRange(Double_t SizeMin, Double_t SizeMax)
+{
+
+
+    fSizeCutLow = SizeMin;
+    fSizeCutUp = SizeMax;
+
+    *fLog << "MFindSupercutsONOFF::SetSizeRange" << endl
+	  << "Data matrices will be filled with events whose MHillas.fSize " << endl
+	  << "is in the range " 
+	  << fSizeCutLow <<"-"<<fSizeCutUp << endl;
+
+
+
+    return kTRUE;
+}
+
+
+
+// Function that sets the names of all parameter containers 
+// used to store the supercuts applied to ON/OFF Train/Test samples
+
+void MFindSupercutsONOFF::SetSupercutsAppliedTreeNames()
+{
+
+    char* sc = {"SupercutsApplied"};
+
+    fTrainONSupercutsAppliedName = (sc);  
+    fTrainONSupercutsAppliedName += ("TrainON");
+
+    fTrainOFFSupercutsAppliedName = (sc);       
+    fTrainOFFSupercutsAppliedName += ("TrainOFF");
+
+    fTestONSupercutsAppliedName = (sc);
+    fTestONSupercutsAppliedName += ("TestON");
+
+    fTestOFFSupercutsAppliedName = (sc); 
+    fTestOFFSupercutsAppliedName += ("TestOFF");
+    
+
+    if (fThetaRangeString.IsNull())
+    {
+	*fLog << "MFindSupercutsONOFF::SetSupercutsAppliedTreeNames; "
+	      << " fThetaRangeString is NOT defined..." << endl;
+
+	fTrainONSupercutsAppliedName += ("ThetaRangeStringUndefined");
+	fTrainOFFSupercutsAppliedName += ("ThetaRangeStringUndefined");
+	fTestONSupercutsAppliedName += ("ThetaRangeStringUndefined");
+	fTestOFFSupercutsAppliedName += ("ThetaRangeStringUndefined");
+    }
+    else
+    {
+	fTrainONSupercutsAppliedName += (fThetaRangeString);
+	fTrainOFFSupercutsAppliedName += (fThetaRangeString);
+	fTestONSupercutsAppliedName += (fThetaRangeString);
+	fTestOFFSupercutsAppliedName += (fThetaRangeString);
+    }
+     
+    // Info about names
+
+    *fLog << "MFindSupercutsONOFF::SetSupercutsAppliedTreeNames; " << endl
+	  << "Names of the MTSupercutsApplied Trees for Train (ON/OFF) " 
+	  << " and Test (ON/OFF) samples are the following ones: " << endl
+	  << fTrainONSupercutsAppliedName << ", " 
+	  << fTrainOFFSupercutsAppliedName << ", "
+	  << fTestONSupercutsAppliedName << ", "
+	  << fTestOFFSupercutsAppliedName << endl;
+  
+}
+
+
+void MFindSupercutsONOFF::SetUseOrigDistribution(Bool_t b)
+{
+  fUseOrigDistribution = b;
+
+  if (fUseOrigDistribution == kTRUE)
+  {
+ 
+      *fLog << "MFindSupercutsONOFF : when defining training and test matrices use the original distribution" 
+	    << endl;
+  }
+
+  else 
+  {
+      *fLog << "MFindSupercutsONOFF : when defining training and test matrices, events will be selected according to distribution given by a MH3 object" 
+	    << endl;
+  }
+}
+
+
+
+// --------------------------------------------------------------------------
+//
+// 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 MFindSupercutsONOFF::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 (!fUseOrigDistribution)
+    {
+      *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");
+    if (fUseOrigDistribution)
+    {
+	*fLog << "MFindSupercutsONFF; MFEventSelector2::SetUseOrigDistribution(Bool)"
+	      << " DOES NOT EXIST NOW..." << endl;
+	// seltrain.SetUseOrigDistribution(kTRUE);
+    }
+
+
+    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 << "MFindSupercutsONOFF::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 MFindSupercutsONOFF::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 (!fUseOrigDistribution)
+    {
+      *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");
+    if (fUseOrigDistribution)
+    {
+	*fLog << "MFindSupercutsONFF; MFEventSelector2::SetUseOrigDistribution(Bool)"
+	      << " DOES NOT EXIST NOW..." << endl;
+	// seltest.SetUseOrigDistribution(kTRUE);
+    }
+      
+
+    MFillH filltest(fMatrixTest);
+    filltest.SetFilter(&seltest);
+    filltest.SetName("fillMatrixTest");
+
+
+
+    //******************************
+    // 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 << "MFindSupercutsONOFF::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 << "MFindSupercutsONOFF::DefineTestMatrix; Test matrix was written onto file '"
+            << filetest << "'" << endl;
+    }
+
+
+    
+    return kTRUE;
+}
+
+
+
+// --------------------------------------------------------------------------
+//
+// Define the matrices for the training and test sample respectively
+//
+//
+//
+Bool_t MFindSupercutsONOFF::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 (!fUseOrigDistribution)
+    {
+      *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();
+    if (fUseOrigDistribution)
+    {
+	*fLog << "MFindSupercutsONFF; MFEventSelector2::SetUseOrigDistribution(Bool)"
+	      << " DOES NOT EXIST NOW..." << endl;
+	// selector.SetUseOrigDistribution(kTRUE);
+    }
+
+    MContinue cont(&selector);
+    cont.SetName("ContTrainTest");
+
+    Double_t prob =  ( (Double_t) howmanytrain )
+                   / ( (Double_t)(howmanytrain+howmanytest) );
+    MFRandomSplit split(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;
+}
+
+// --------------------------------------------------------------------------
+//
+// Define the matrices for the training and test OFF sample respectively
+//
+//
+//
+
+Bool_t MFindSupercutsONOFF::DefineTrainTestMatrixOFFThetaRange(
+    const TString &name, 
+    const Double_t whichfractiontrain, 
+    const Double_t whichfractiontest,  
+    Double_t ThetaMin, Double_t ThetaMax, 
+    const TString &filetrain, const TString &filetest)
+    
+
+
+{
+    *fLog << "=============================================" << endl;
+    *fLog << "Fill training and testing OFF matrices from file '" << name 
+          << "',   select a fraction of " << whichfractiontrain 
+          << " events for the training and a fraction of " << endl
+	  << whichfractiontest << " for the testing" << endl;
+
+
+    MParList  plist;
+    MTaskList tlist;
+
+    MReadMarsFile read("Events", name);
+    read.DisableAutoScheme();
+
+
+    
+
+    
+    // Cuts in Theta
+
+    // TString ThetaCutMinString ("ThetaOrig.fVal>");
+    TString ThetaCutMinString ("MPointingPos.fZd>"); // new! // for magic
+    ThetaCutMinString += ThetaMin;
+    MContinue ThetaCutMin(ThetaCutMinString);
+    ThetaCutMin.SetInverted();
+
+    //TString ThetaCutMaxString ("ThetaOrig.fVal<");
+    TString ThetaCutMaxString ("MPointingPos.fZd<"); // new! // for magic
+    ThetaCutMaxString += ThetaMax;
+    MContinue ThetaCutMax(ThetaCutMaxString);
+    ThetaCutMax.SetInverted();
+
+
+    // TMP
+    // Cuts in Size,
+
+    TString SizeCutMinString ("MHillas.fSize>"); 
+    SizeCutMinString += fSizeCutLow;
+    MContinue SizeCutMin(SizeCutMinString);
+    SizeCutMin.SetInverted();
+
+    
+    TString SizeCutMaxString ("MHillas.fSize<"); 
+    SizeCutMaxString += fSizeCutUp;
+    MContinue SizeCutMax(SizeCutMaxString);
+    SizeCutMax.SetInverted();
+    
+
+
+
+    // ENDTMP
+
+
+
+
+    Double_t prob = whichfractiontrain /(whichfractiontrain+whichfractiontest);
+                   
+    MFRandomSplit split(prob);
+
+    MFillH filltrain(fMatrixTrainOFF);
+    filltrain.SetName("fillMatrixTrainOFF");
+    filltrain.SetFilter(&split);
+    
+    
+    // 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(fMatrixTestOFF);
+    filltest.SetName("fillMatrixTestOFF");
+    
+
+    //******************************
+    // entries in MParList 
+    
+    plist.AddToList(&tlist);
+    plist.AddToList(fCam);
+    plist.AddToList(fMatrixTrainOFF);
+    plist.AddToList(fMatrixTestOFF);
+
+    //******************************
+    // entries in MTaskList 
+
+    tlist.AddToList(&read);
+//    tlist.AddToList(&ThetaCutMin);
+//    tlist.AddToList(&ThetaCutMax);
+    
+    //TMP
+    tlist.AddToList(&SizeCutMin);
+    tlist.AddToList(&SizeCutMax);
+
+    //ENDTMP
+    tlist.AddToList(&split);
+    tlist.AddToList(&filltrain);
+
+    tlist.AddToList(&conttrain);
+    tlist.AddToList(&filltest);
+
+    //******************************
+
+    MProgressBar bar;
+    MEvtLoop evtloop;
+    evtloop.SetParList(&plist);
+    evtloop.SetName("EvtLoopMatrixTrainTestOFF");
+    evtloop.SetProgressBar(&bar);
+    
+    Int_t maxev = -1;
+    if (!evtloop.Eventloop(maxev))
+      return kFALSE;
+
+    tlist.PrintStatistics(0, kTRUE);
+
+    fMatrixTrainOFF->Print("SizeCols");
+
+    
+    fMatrixTestOFF->Print("SizeCols");
+    
+
+    *fLog << "train and test matrix OFF were filled" << endl;
+    *fLog << "=============================================" << endl;
+    
+    
+    //--------------------------
+    // write out training matrix
+    
+    if (filetrain != "")
+    {
+	TFile filetr(filetrain, "RECREATE");
+	fMatrixTrainOFF->Write();
+	filetr.Close();
+	
+	*fLog << "MFindSupercutsONOFF::DefineTrainTestMatrixOFFThetaRange; Training matrix was written onto file '"
+	      << filetrain << "'" << endl;
+    }
+    
+    //--------------------------
+    // write out test matrix
+
+    if (filetest != "")
+    {
+	TFile filete(filetest, "RECREATE", "");
+	fMatrixTestOFF->Write();
+	filete.Close();
+	
+	*fLog << "MFindSupercutsONOFF::DefineTrainTestMatrixOFFThetaRange; Test matrix was written onto file '"
+	      << filetest << "'" << endl;
+    }
+    
+    return kTRUE;
+}
+
+
+// --------------------------------------------------------------------------
+//
+// Define the matrices for the training and test sample respectively
+//
+//
+//
+Bool_t MFindSupercutsONOFF::DefineTrainTestMatrixThetaRange(
+    const TString &name, 
+    const Double_t whichfractiontrain, 
+    const Double_t whichfractiontest,  
+    Double_t ThetaMin, Double_t ThetaMax, 
+    const TString &filetrain, const TString &filetest)
+
+   
+{
+    *fLog << "=============================================" << endl;
+    *fLog << "Fill training and testing ON matrices from file '" << name 
+          << "',   select a fraction of " << whichfractiontrain 
+          << " events for the training and a fraction of " << endl
+	  << whichfractiontest << " for the testing" << endl;
+
+
+    MParList  plist;
+    MTaskList tlist;
+
+    
+    MReadMarsFile read("Events", name);
+    read.DisableAutoScheme();
+
+
+     // Cuts in Theta
+
+    //TString ThetaCutMinString ("ThetaOrig.fVal>");
+    TString ThetaCutMinString ("MPointingPos.fZd>"); // for magic
+    ThetaCutMinString += ThetaMin;
+    MContinue ThetaCutMin(ThetaCutMinString);
+    ThetaCutMin.SetInverted();
+
+    //TString ThetaCutMaxString ("ThetaOrig.fVal<");
+    TString ThetaCutMaxString ("MPointingPos.fZd<"); // for magic
+    ThetaCutMaxString += ThetaMax;
+    MContinue ThetaCutMax(ThetaCutMaxString);
+    ThetaCutMax.SetInverted();
+
+
+    // TMP
+    // Cuts in Size,
+
+    TString SizeCutMinString ("MHillas.fSize>"); 
+    SizeCutMinString += fSizeCutLow;
+    MContinue SizeCutMin(SizeCutMinString);
+    SizeCutMin.SetInverted();
+
+    
+    TString SizeCutMaxString ("MHillas.fSize<"); 
+    SizeCutMaxString += fSizeCutUp;
+    MContinue SizeCutMax(SizeCutMaxString);
+    SizeCutMax.SetInverted();
+    
+
+
+
+    // ENDTMP
+
+
+
+    
+    Double_t prob = whichfractiontrain/(whichfractiontrain + whichfractiontest);
+                   
+    MFRandomSplit split(prob);
+
+    MFillH filltrain(fMatrixTrain);
+    filltrain.SetName("fillMatrixTrain");
+    filltrain.SetFilter(&split);
+    
+    
+    // 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(&ThetaCutMin);
+//    tlist.AddToList(&ThetaCutMax);
+    
+       
+    //TMP
+    tlist.AddToList(&SizeCutMin);
+    tlist.AddToList(&SizeCutMax);
+
+    //ENDTMP
+
+    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");
+    
+    fMatrixTest->Print("SizeCols");
+    
+
+    *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 << "MFindSupercutsONOFF::DefineTrainTestMatrixThetaRange; Train matrix was written onto file '"
+            << filetrain << "'" << endl;
+    }
+
+
+     //--------------------------
+    // write out test matrix
+
+    if (filetest != "")
+    {
+      TFile filete(filetest, "RECREATE", "");
+      fMatrixTest->Write();
+      filete.Close();
+
+      *fLog << "MFindSupercutsONOFF::DefineTrainTestMatrixThetaRange; Test matrix was written onto file '"
+            << filetest << "'" << endl;
+    }
+
+  return kTRUE;
+}
+
+
+
+
+/// **********///
+
+// --------------------------------------------------------------------------
+//
+// Read training and test matrices from files
+//
+//
+
+Bool_t MFindSupercutsONOFF::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;  
+}
+
+
+// Read training and test matrices OFF from files
+//
+//
+
+Bool_t MFindSupercutsONOFF::ReadMatrixOFF(const TString &filetrain, const TString &filetest)
+{
+  //--------------------------
+  // read in training matrix
+
+  TFile filetr(filetrain);
+  fMatrixTrainOFF->Read("MatrixTrainOFF");
+  fMatrixTrainOFF->Print("SizeCols");
+
+  *fLog << "MFindSupercutsONOFF::ReadMatrixOFF; Training matrix OFF was read in from file '"
+        << filetrain << "'" << endl;
+  filetr.Close();
+
+
+  //--------------------------
+  // read in test matrix
+
+  TFile filete(filetest);
+  fMatrixTestOFF->Read("MatrixTestOFF");
+  fMatrixTestOFF->Print("SizeCols");
+
+  *fLog << "MFindSupercutsONOFF::ReadMatrixONOFF; Test matrix OFF was read in from file '"
+        << filetest << "'" << endl;
+  filete.Close();
+
+  return kTRUE;  
+}
+
+
+
+// Function to compute the normalization factor for Train sample.
+// The normalization factor is defined as the ratio of OFF/ON events.
+
+Bool_t  MFindSupercutsONOFF::ComputeNormFactorTrain()
+{
+   Int_t EventsInTrainMatrixON = fMatrixTrain->GetM().GetNrows(); 
+   Int_t EventsInTrainMatrixOFF = fMatrixTrainOFF->GetM().GetNrows();
+
+   // Info...
+   *fLog << "MFindSupercutsONOFF::ComputeNormFactorTrain; " << endl
+	 << "EventsInTrainMatrixON = " << EventsInTrainMatrixON 
+	 << " , EventsInTrainMatrixOFF = " << EventsInTrainMatrixOFF << endl;
+
+
+   fNormFactorTrain = double(EventsInTrainMatrixON)/double(EventsInTrainMatrixOFF);
+
+   
+   *fLog << "MFindSupercutsONOFF::ComputeNormFactorTrain; fNormFactorTrain is : " 
+	 << fNormFactorTrain << endl;
+   
+   return kTRUE;
+}
+
+
+
+
+// Function to compute the normalization factor for Test sample.
+// The normalization factor is defined as the ratio of OFF/ON events.
+
+Bool_t  MFindSupercutsONOFF::ComputeNormFactorTest()
+{
+   Int_t EventsInTestMatrixON = fMatrixTest->GetM().GetNrows(); 
+   Int_t EventsInTestMatrixOFF = fMatrixTestOFF->GetM().GetNrows();
+
+   // Info...
+   *fLog << "MFindSupercutsONOFF::ComputeNormFactorTest; " << endl
+	 << "EventsInTestMatrixON = " << EventsInTestMatrixON 
+	 << " , EventsInTestMatrixOFF = " << EventsInTestMatrixOFF << endl;
+
+   fNormFactorTest = double(EventsInTestMatrixON)/double(EventsInTestMatrixOFF);
+   
+   *fLog << "MFindSupercutsONOFF::ComputeNormFactorTest; fNormFactorTest is : " 
+	 << fNormFactorTest << endl;
+
+   return kTRUE;
+}
+
+
+Bool_t  MFindSupercutsONOFF::SetGammaEfficiency(Double_t gammaeff)
+{
+
+    if (gammaeff < 0.0 || gammaeff >1.0)
+    {
+	*fLog << "MFindSupercutsONOFF::SetGammaEfficiency; " << endl
+	      << "The argument of SetGammaEfficiency ("
+	      << gammaeff << ") is outside the range 0-1" << endl
+	      << "This is not allowed..." << endl;
+	return kFALSE;
+	    
+    }
+
+    fGammaEfficiency = gammaeff;
+    
+    // TEMP INFO
+    cout << "fGammaEfficiency has been set to : " << fGammaEfficiency << endl;
+    // END TEMP
+    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 2 event loops (ON and OFF) 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 2 alpha plots (ON and OFF) are produced in the 2 event loops, 
+//                   in which the SAME cuts have been applied
+//                 - the significance of the gamma signal is extracted from the 
+//                   the 2 alpha plots (ON OFF) using MHFindSignificanceONOFF::FindSigmaONOFF.
+//                   
+//
+// 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 MSupercutsCalcONOFF will
+//                       put the supercuts hadronness for ON data
+
+// - fHadronnessNameOFF  name of container where MSupercutsCalcONOFF will
+//                       put the supercuts hadronness for OFF data
+//
+// - fAlphaSig, fAlphaBkgMin, fAlphaBkgMax ; Signal and Bkg region in alpha histo. 
+
+// - 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 MFindSupercutsONOFF::FindParams(TString parSCinit,
+					  TArrayD &params, TArrayD &steps)
+{
+    // Setup the event loops 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 << "MFindSupercutsONOFF::FindParams; hadronness name for ON data is not defined... aborting"
+            << endl;
+      return kFALSE;
+    }
+
+
+    if (fHadronnessNameOFF.IsNull())
+    {
+      *fLog << "MFindSupercutsONOFF::FindParams; hadronness name for OFF data 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;
+    }
+
+    
+
+    if (fMatrixTrainOFF == NULL)
+    {
+      *fLog << "MFindSupercutsONOFF::FindParams; training matrix OFF is not defined... aborting"
+            << endl;
+      return kFALSE;
+    }
+
+    if (fMatrixTrainOFF->GetM().GetNrows() <= 0)
+    {
+      *fLog << "MFindSupercutsONOFF::FindParams; training matrix OFF has no entries"
+            << endl;
+      return kFALSE;
+    }
+
+    if (fAlphaDistributionsRootFilename.IsNull())
+    {
+	*fLog << "MFindSupercutsONOFF::FindParams; fAlphaDistributionsRootFilename is not defined... program aborting..." << endl;
+
+	return kFALSE;
+    }
+
+   
+
+    //--------------------------------
+    // 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 << "MFindSupercutsONOFF::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 << "MFindSupercutsONOFF::FindParams; initial values of parameters are taken from 'params'"
+		  << endl;
+	    super.SetParameters(params);
+	}
+	if (steps.GetSize()  != 0)
+	{
+	    *fLog << "MFindSupercutsONOFF::FindParams; initial step sizes are taken from 'steps'"
+		  << endl;
+	    super.SetStepsizes(steps);
+	}
+	
+	/*
+	// TMP
+	// Print parameters
+	if (params.GetSize() == steps.GetSize())
+	{
+	    *fLog << "MFindSupercutsONOFF; SC parameters and Setps are: " << endl;
+	    for (Int_t z = 0; z < params.GetSize(); z++)
+	    {
+		cout << params[z] << setw(20) << steps[z] << endl;
+	    }
+	}
+
+	// ENDTMP
+
+	*/
+
+	/*
+	// TMP2
+
+	TArrayD paramsBis = super.GetParameters();
+	TArrayD stepsBis = super.GetStepsizes();
+	if (paramsBis.GetSize() == stepsBis.GetSize())
+	{
+	    *fLog << "MFindSupercutsONOFF; SC parametersBis and SetpsBis are: " << endl;
+	    for (Int_t z = 0; z < paramsBis.GetSize(); z++)
+	    {
+		cout << paramsBis[z] << setw(20) << stepsBis[z] << endl;
+	    }
+	}
+	
+	// ENDTMP2
+	*/
+
+	else
+	{
+	    *fLog << "MFindSupercutsONOFF; ERROR: params.GetSize() != steps.GetSize() " 
+		  << endl;
+	    
+	}
+
+
+
+    }
+    else
+    {
+        *fLog << "MFindSupercutsONOFF::FindParams; initial values and step sizes are taken from the MSupercuts constructor"
+              << endl;
+    }
+
+
+    // Computation of fNormFactorTrain and creation of a container for 
+    // storing this value and include it  in the MParList for being 
+    // used by function fcnSupercuts
+
+    if (!ComputeNormFactorTrain())
+    {
+	*fLog << "Normalization factor for train sample (ON-OFF) could not be computed. Aborting..." << endl;
+	return kFALSE;
+    }
+
+    
+    *fLog << "MFindSupercutsONOFF::FindParams; fNormFactorTrain = " << fNormFactorTrain << endl;
+
+    
+
+    MDataValue NormFactorCont(fNormFactorTrain);
+    NormFactorCont.SetName("NormFactorTrain");
+                                 
+
+    // Value of fAlphaSig, fAlphaBkgMin and fAlphaBkgMax 
+    // are stored in MDataValue containers,
+    // then they will be passed to the MParList and will be 
+    // accessible to fcnsupercuts
+
+    MDataValue AlphaSigCont(fAlphaSig);
+    AlphaSigCont.SetName("AlphaSigValue");
+
+    MDataValue AlphaBkgMinCont(fAlphaBkgMin);
+    AlphaBkgMinCont.SetName("AlphaBkgMinValue");
+
+    MDataValue AlphaBkgMaxCont(fAlphaBkgMax);
+    AlphaBkgMaxCont.SetName("AlphaBkgMaxValue");
+    
+    
+    // Value of fUseFittedQuantities is stored in container 
+    // and passed to the MParList and will be 
+    // accessible to fcnsupercuts
+
+    
+
+    MDataValue UseFittedQuantitiesCont(fUseFittedQuantities);
+    UseFittedQuantitiesCont.SetName("UseFittedQuantitiesValue");
+
+
+     // Value of fNormFactorFromAlphaBkg is stored in container 
+    // and passed to the MParList and will be 
+    // accessible to fcnsupercuts
+
+    MDataValue UseNormFactorFromAlphaBkgCont(fNormFactorFromAlphaBkg);
+    UseNormFactorFromAlphaBkgCont.SetName("UseNormFactorFromAlphaBkgValue");
+
+
+
+    // A vector of pointers to objects of the class MEvtLoop is defined.
+    // One of the pointed loops will be used to compute ON data alpha plot
+    // and the other for computing OFF data alpha plot.
+
+    MEvtLoop evtloopfcn[2] = {MEvtLoop("ONDataEvtLoopFCN"), 
+			      MEvtLoop("OFFDataEvtLoopFCN")};
+
+
+
+
+    // ******************************************************************
+    // EVENT LOOP FOR COMPUTING ALPHA HISTOGRAM FOR ON DATA IS SET
+    // ******************************************************************
+
+    // -----------------------------------------------------------------
+
+    MParList  parlistfcn;
+    MTaskList tasklistfcn;
+
+    // loop over rows of matrix
+    MMatrixLoop loop(fMatrixTrain);
+
+
+    //--------------------------------
+    // calculate supercuts hadronness
+    fCalcHadTrain->SetHadronnessName(fHadronnessName);
+
+    // Boolean variable that controls in class MSupercutsCalcONOFF
+    // wether the supercuts are stored or not
+    // is set to the default value, kFALSE. (no storage of supercuts)
+
+    fCalcHadTrain -> SetStoreAppliedSupercuts(kFALSE);
+
+
+    
+    // Set boolean variable that controls wether cuts are 
+    // dynamic or static
+
+    fCalcHadTrain -> SetVariableUseStaticCuts(fUseStaticCuts);
+
+    if (!fUseStaticCuts)
+    {
+	// Set boolean variable that controls wether the theta variable 
+	// is used or not in the computation of the dynamical cuts
+	
+	fCalcHadTrain -> SetVariableNotUseTheta(fNotUseTheta);
+    }
+
+    // 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);
+    binsalpha.SetEdges(fNAlphaBins, fAlphaBinLow, fAlphaBinUp);
+     
+     
+    *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 !
+    MHCT1Supercuts plotsuper;
+    plotsuper.SetupFill(&parlistfcn);
+
+    //******************************
+    // entries in MParList (extension of old MParList)
+    
+    parlistfcn.AddToList(&tasklistfcn);
+    parlistfcn.AddToList(&super);
+    parlistfcn.AddToList(&NormFactorCont);
+    parlistfcn.AddToList(&AlphaSigCont);
+    parlistfcn.AddToList(&AlphaBkgMinCont);
+    parlistfcn.AddToList(&AlphaBkgMaxCont);
+    parlistfcn.AddToList(&UseFittedQuantitiesCont);
+    parlistfcn.AddToList(&UseNormFactorFromAlphaBkgCont);
+
+    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);
+
+    //******************************
+
+
+    // &evtloopfcn[0] = new MEvtLoop("ONDataEvtLoopFCN");
+    evtloopfcn[0].SetParList(&parlistfcn);
+    // MEvtLoop evtloopfcn("EvtLoopFCN");
+    // evtloopfcn.SetParList(&parlistfcn);
+    *fLog << "Event loop for computing ON data alpha histo in fcnSupercuts has been setup" << endl;
+
+
+//---- End of setting of loop for compuing ON data alpha plot ---------------
+
+    
+
+     // ******************************************************************
+    // EVENT LOOP FOR COMPUTING ALPHA HISTOGRAM FOR OFF DATA IS SET
+    // ******************************************************************
+
+    // -----------------------------------------------------------------
+
+    MParList  parlistfcnOFF;
+    MTaskList tasklistfcnOFF;
+
+    // loop over rows of matrix
+    MMatrixLoop loopOFF(fMatrixTrainOFF);
+
+
+    //--------------------------------
+    // calculate supercuts hadronness
+    fCalcHadTrainOFF->SetHadronnessName(fHadronnessNameOFF);
+
+
+    // Boolean variable that controls in class MSupercutsCalcONOFF
+    // wether the supercuts are stored or not
+    // is set to the default value, kFALSE. (no storage of supercuts)
+
+    fCalcHadTrainOFF -> SetStoreAppliedSupercuts(kFALSE);
+
+
+    
+    // Set boolean variable that controls wether cuts are 
+    // dynamic or static
+
+    fCalcHadTrainOFF -> SetVariableUseStaticCuts(fUseStaticCuts);
+
+
+    if (!fUseStaticCuts)
+    {
+	// Set boolean variable that controls wether the theta variable 
+	// is used or not in the computation of the dynamica cuts
+	
+	fCalcHadTrainOFF -> SetVariableNotUseTheta(fNotUseTheta);
+    }
+
+    // apply the supercuts
+    MF scfilterOFF(fHadronnessNameOFF+".fHadronness>0.5");
+    MContinue supercutsOFF(&scfilterOFF);
+
+    // plot |alpha|
+    const TString  mh3NameOFF = "AlphaOFFFcn";
+    MBinning binsalphaOFF("Binning"+mh3NameOFF);
+    //binsalphaOFF.SetEdges(54, -12.0, 96.0);
+    binsalphaOFF.SetEdges(fNAlphaBins, fAlphaBinLow, fAlphaBinUp);
+
+
+    *fLog << warn << "WARNING------------>ALPHA IS ASSUMED TO BE IN COLUMN 7!!!!!!!!" << endl;
+
+    // |alpha| is assumed to be in column 7 of the matrix
+    MH3 alphaOFF("MatrixTrainOFF[7]");
+    alphaOFF.SetName(mh3NameOFF);
+
+    MFillH fillalphaOFF(&alphaOFF);
+
+    
+
+    //******************************
+    // entries in MParList (extension of old MParList)
+    
+    parlistfcnOFF.AddToList(&tasklistfcnOFF);
+    parlistfcnOFF.AddToList(&super);
+    parlistfcnOFF.AddToList(fCam);
+    parlistfcnOFF.AddToList(fMatrixTrainOFF);
+
+    parlistfcnOFF.AddToList(&binsalphaOFF);
+    parlistfcnOFF.AddToList(&alphaOFF);
+
+    
+
+    //******************************
+    // entries in MTaskList
+
+    tasklistfcnOFF.AddToList(&loopOFF);
+    tasklistfcnOFF.AddToList(fCalcHadTrainOFF);
+    tasklistfcnOFF.AddToList(&supercutsOFF);
+    tasklistfcnOFF.AddToList(&fillalphaOFF);
+
+    //******************************
+
+
+    // &evtloopfcn[1] = new MEvtLoop("OFFDataEvtLoopFCN");
+    evtloopfcn[1].SetParList(&parlistfcnOFF);
+    // MEvtLoop evtloopfcn("EvtLoopFCN");
+    // evtloopfcn.SetParList(&parlistfcn);
+    *fLog << "Event loop for computing OFF data alpha histo in fcnSupercuts has been setup" << endl;
+
+
+//---- End of setting of loop for compuing OFF data alpha plot ---------------
+
+
+    // 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;
+    }
+
+
+    
+
+
+    if(fSetLimitsToSomeMinuitParams)
+      {
+
+	// Limits for some Minuit parameters are set. For the time being the values are set in the constructor 
+	// of the class. One MUST be very careful to set limits such that the expected final values 
+	// (optimized values) are far away from the limits.
+	// Limits are set to those Minuit parameters not depending in Size,dist and theta (static values). 
+	// Limits are set only to Dist, Length and Width.
+
+	
+	*fLog << endl 
+	      <<"Limits set to hillas parameters Length, Width, Dist and Leakage1 for the optimization with Minuit." 
+	      << endl;
+	
+
+	
+	fLimup[0] = fMinuitLengthUPUpperLimit;
+	fLimlo[0] = fMinuitLengthUPLowerLimit;
+	fLimup[8] = fMinuitLengthLOWUpperLimit;
+	fLimlo[8] = fMinuitLengthLOWLowerLimit;
+	fLimup[16] = fMinuitWidthUPUpperLimit;
+	fLimlo[16] = fMinuitWidthUPLowerLimit;
+	fLimup[24] = fMinuitWidthLOWUpperLimit;
+	fLimlo[24] = fMinuitWidthLOWLowerLimit;
+	fLimup[32] = fMinuitDistUPUpperLimit;
+	fLimlo[32] = fMinuitDistUPLowerLimit;
+	fLimup[40] = fMinuitDistLOWUpperLimit;
+	fLimlo[40] = fMinuitDistLOWLowerLimit;
+
+	fLimup[80] = fMinuitLeakage1UPUpperLimit;
+	fLimlo[80] = fMinuitLeakage1UPLowerLimit;
+
+	
+
+      }
+    
+   
+
+    // Wolfgang sets manyally some parameters.
+    // That might give an error if parameters are changed...
+    // To be changed in future...
+
+    // 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;
+
+
+   
+    // ADDITIONAL PARAMETERS ARE FIXED ACCORDING TO THE 
+    // VALUES OF THE BOOLEAN VARIABLES fUseStaticCuts, AND
+    // fNotUseTheta
+
+
+    if (fUseStaticCuts)
+    {    
+        // Static cuts will be used; all parameters with index 
+	// 1-7 are fixed for ALL variables (width, length, ...)
+	
+       for (UInt_t i=0; i<fNpar; i = i+8)
+       {
+	   // At some point, the number of paraemters in the 
+	   // dynamical cuts parameterezattion (currently 7) 
+           // will become a variable that can be set from 
+	   // outside the class
+
+	   for (UInt_t j=i+1; j<=i+7; j++)
+	   {
+	       fVinit[j] = 0.0;
+	       fStep[j]  = 0.0;
+	       fFix[j]   = 1;
+	   }
+       }
+    }
+    else
+    {
+	if(fNotUseTheta)
+	{
+	    // Theta is not used in the parameterization of the dynamical cut
+	    // Parameters with index 2 and 5 are fixed for all variables 
+	    // (width, length, ...)
+
+	    for (UInt_t i=0; i<fNpar; i = i+8)
+	    {
+		// At some point, the number of paraemters in the 
+		// dynamical cuts parameterezattion (currently 7) 
+		// will become a variable that can be set from 
+		// outside the class
+		
+		for (UInt_t j=i+2; j<=i+7; j = j+3)
+		{
+		    fVinit[j] = 0.0;
+		    fStep[j]  = 0.0;
+		    fFix[j]   = 1;
+		}
+	    }
+
+
+	}
+
+	if(!fUseDist)
+	  {
+	    // parameterization using dist is removed
+	    // Parameters with index 1 and 4 and 7 are fixed for all variables 
+	    // (width, length, ...)
+	     for (UInt_t i=0; i<fNpar; i = i+8)
+	    {
+		// At some point, the number of paraemters in the 
+		// dynamical cuts parameterezattion (currently 7) 
+		// will become a variable that can be set from 
+		// outside the class
+		
+		for (UInt_t j=i+1; j<=i+7; j = j+3)
+		{
+		    fVinit[j] = 0.0;
+		    fStep[j]  = 0.0;
+		    fFix[j]   = 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
+    
+    Bool_t rc;
+
+    if(fSkipOptimization)
+    {
+	*fLog << "Parameter optimization is skipped. Using previously optimized parameters."
+	      << endl;
+	
+
+	rc = kTRUE;
+	
+
+	if(fUseInitialSCParams)
+	{
+
+	    // write Initial parameter values onto root file filenameParam
+	    // so that later they can be applied on the data
+
+	     *fLog << "Initial SC parameter values are written onto file '"
+		  << fFilenameParam << "' :" << endl;
+
+	    
+	    TFile outparam(fFilenameParam, "RECREATE"); 
+	    super.Write();
+	    outparam.Close();
+	    
+
+	    
+	     const TArrayD &check = super.GetParameters();
+	    for (Int_t i=0; i<check.GetSize(); i++)
+		*fLog << check[i] << ",  ";
+	    *fLog << endl;
+
+	
+	}
+
+
+    }
+    else
+    {
+	TStopwatch clock;
+	clock.Start();
+	
+	*fLog << "before calling CallMinuit" << endl;
+    
+	MMinuitInterface inter;               
+	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)
+	{
+	    *fLog << "*************  ERROR !!! *********************" << endl
+		  << "Minimization could not finish properly..." << endl
+		  << "MMinuitInterface.CallMinuit() returned kFALSE" << endl;
+	    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;
+    
+    
+    *fLog << "Applying the optimized supercuts on the TRAIN sample and " 
+	  << "producing plots related to the output results" << endl;
+
+    *fLog << "======================================================" << endl;
+    
+    if (!TestParamsOnTrainSample())
+    {
+	*fLog << "MFindSupercutsONOFF::FindParams;" 
+	      << "TestParamsOnTrainSample failed"
+	      << endl;
+	
+	return kFALSE;
+    }
+    
+    
+    
+    return kTRUE;
+}
+
+
+
+
+
+
+
+// -----------------------------------------------------------------------
+//
+// Test the supercuts on the test sample using ON and OFF data
+// 2 loops are used to fill the 2 alpha distributions
+// Supercuts applied (LengthUp, LengthLow...) 
+// to all the individual events, as well as 
+// the features of the shower images (Length,Width...) are 
+// stored in 2 TTree objects (for ON and OFF data) in the 
+// root file specified by variable "fAlphaDistributionsRootFilename"
+
+
+
+Bool_t MFindSupercutsONOFF::TestParamsOnTestSample()
+{
+    if (fMatrixTest->GetM().GetNrows() <= 0)
+    {
+        *fLog << "MFindSupercutsONOFF::TestParamsOnTestSample; test matrix ON has no entries" 
+              << endl;
+        return kFALSE;
+    }
+
+
+    if (fMatrixTestOFF->GetM().GetNrows() <= 0)
+    {
+        *fLog << "MFindSupercutsONOFF::TestParamsOnTestSample; test matrix OFF has no entries" 
+              << endl;
+        return kFALSE;
+    }
+
+    // -------------   TEST the supercuts    ------------------------------
+    //
+    *fLog << "Test the supercuts on the test sample ON and OFF" << 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 << "MFindSupercutsONOFF::TestParamsONOFF; hadronness name for ON data is not defined... aborting";
+        *fLog << endl;
+        return kFALSE;
+    }
+
+    if (fHadronnessNameOFF.IsNull())
+    {
+        *fLog << "MFindSupercutsONOFF::TestParamsONOFF; hadronness name for OFF data is not defined... aborting";
+        *fLog << endl;
+        return kFALSE;
+    }
+
+    if(fTestONSupercutsAppliedName.IsNull())
+    {
+        *fLog << "MFindSupercutsONOFF::TestParamsONOFF; " 
+	      << " MTSupercutsApplied tree name for ON Test data is not defined... aborting"
+	      << endl;
+        return kFALSE;
+    }
+
+    if(fTestOFFSupercutsAppliedName.IsNull())
+    {
+        *fLog << "MFindSupercutsONOFF::TestParamsONOFF; " 
+	      << " MTSupercutsApplied container name for OFF Test data is not defined... aborting"
+	      << endl;
+        return kFALSE;
+    }
+    
+
+    MSupercuts supercuts;
+    supercuts.SetParameters(supercutsPar);
+
+    // Objects containing the trees used to store supercuts applied
+    // TTree Branches are also created
+    MTSupercutsApplied supapptestON(fTestONSupercutsAppliedName.Data(), "");
+    supapptestON.CreateTreeBranches();
+
+    MTSupercutsApplied supapptestOFF(fTestOFFSupercutsAppliedName.Data(), "");
+    supapptestOFF.CreateTreeBranches();
+
+    
+
+    
+    fCalcHadTestOFF -> SetHadronnessName(fHadronnessNameOFF);
+    fCalcHadTest -> SetHadronnessName(fHadronnessName);
+
+
+    // Settings related to the storage of teh supercuts applied 
+    fCalcHadTest -> SetSupercutsAppliedName(fTestONSupercutsAppliedName);
+    fCalcHadTest -> SetStoreAppliedSupercuts(kTRUE);
+
+    fCalcHadTestOFF -> SetSupercutsAppliedName(fTestOFFSupercutsAppliedName);
+    fCalcHadTestOFF -> SetStoreAppliedSupercuts(kTRUE);
+    
+
+
+    // Set boolean variable that controls wether cuts are 
+    // dynamic or static
+
+    fCalcHadTest -> SetVariableUseStaticCuts(fUseStaticCuts);
+    fCalcHadTestOFF -> SetVariableUseStaticCuts(fUseStaticCuts);
+
+    if (!fUseStaticCuts)
+    {
+	// Set boolean variable that controls wether the theta variable 
+	// is used or not in the computation of the dynamical cuts
+	
+	fCalcHadTest -> SetVariableNotUseTheta(fNotUseTheta);
+	fCalcHadTestOFF -> SetVariableNotUseTheta(fNotUseTheta);
+    }
+
+
+     // apply the supercuts to OFF data
+
+    MF scfilterOFF(fHadronnessNameOFF+".fHadronness>0.5");
+    MContinue applysupercutsOFF(&scfilterOFF);
+
+
+     // apply the supercuts to ON data
+    MF scfilter(fHadronnessName+".fHadronness>0.5");
+    MContinue applysupercuts(&scfilter);
+
+   
+
+    // ****************************************************
+    // Filling OFF alpha distribution 
+
+    MParList parlistOFF;
+    MTaskList tasklistOFF;
+
+    MMatrixLoop loopOFF(fMatrixTestOFF);
+
+    // plot alpha before applying the supercuts
+    const TString  mh3NameOFFB = "AlphaOFFBefore";
+    MBinning binsalphaOFFbef("Binning"+mh3NameOFFB);
+    // binsalphaOFFbef.SetEdges(54, -12.0, 96.0);
+    binsalphaOFFbef.SetEdges(fNAlphaBins, fAlphaBinLow, fAlphaBinUp);
+
+    // |alpha| is assumed to be in column 7 of the matrix
+    MH3 alphaOFFbefore("MatrixTestOFF[7]");
+    alphaOFFbefore.SetName(mh3NameOFFB);
+
+
+    MFillH fillalphaOFFbefore(&alphaOFFbefore);
+    fillalphaOFFbefore.SetName("FillAlphaOFFBefore");
+
+   
+
+    // plot alpha OFF after applying the supercuts
+    const TString  mh3NameOFFA = "AlphaOFFAfter";
+    MBinning binsalphaOFFaft("Binning"+mh3NameOFFA);
+    // binsalphaOFFaft.SetEdges(54, -12.0, 96.0);
+    binsalphaOFFaft.SetEdges(fNAlphaBins, fAlphaBinLow, fAlphaBinUp);
+    
+    MH3 alphaOFFafter("MatrixTestOFF[7]");
+    alphaOFFafter.SetName(mh3NameOFFA);
+
+
+    MFillH fillalphaOFFafter(&alphaOFFafter);
+    fillalphaOFFafter.SetName("FillAlphaOFFAfter");
+
+    //******************************
+    // entries in MParList
+
+    parlistOFF.AddToList(&tasklistOFF);
+
+    parlistOFF.AddToList(&supercuts);
+
+    parlistOFF.AddToList(&supapptestOFF);
+
+    parlistOFF.AddToList(fCam);
+    parlistOFF.AddToList(fMatrixTestOFF);
+
+    parlistOFF.AddToList(&binsalphaOFFbef);
+    parlistOFF.AddToList(&alphaOFFbefore);
+
+    parlistOFF.AddToList(&binsalphaOFFaft);
+    parlistOFF.AddToList(&alphaOFFafter);
+
+
+    //******************************
+    // Entries in MtaskList
+    tasklistOFF.AddToList(&loopOFF);
+    tasklistOFF.AddToList(&fillalphaOFFbefore);
+
+    tasklistOFF.AddToList(fCalcHadTestOFF);
+    tasklistOFF.AddToList(&applysupercutsOFF);
+
+    tasklistOFF.AddToList(&fillalphaOFFafter);
+
+    //******************************
+
+    MProgressBar barOFF;
+    MEvtLoop evtloopOFF;
+    evtloopOFF.SetParList(&parlistOFF);
+    evtloopOFF.SetName("EvtLoopTestParamsOFF");
+    evtloopOFF.SetProgressBar(&barOFF);
+    Int_t maxeventsOFF = -1;
+    if (!evtloopOFF.Eventloop(maxeventsOFF))
+        return kFALSE;
+
+    tasklistOFF.PrintStatistics(0, kTRUE);
+
+
+    //-------------------------------------------
+    // draw the alpha plots
+
+    MH3* alphaOFFBefore = (MH3*)parlistOFF.FindObject(mh3NameOFFB, "MH3");
+    TH1  &alphaOFFHistb = alphaOFFBefore->GetHist();
+    TString alphaOFFHistbName ("TestAlphaOFFBeforeCuts");
+    
+    if (fThetaRangeString.IsNull())
+    {
+	*fLog << "MFindSupercutsONOFF::TestParamsOnTestSample; "
+	      << " fThetaRangeString is NOT defined..." << endl;
+	alphaOFFHistbName += ("ThetaRangeStringUndefined");
+    }
+    else
+    {
+	alphaOFFHistbName += (fThetaRangeString);
+    }
+
+
+    alphaOFFHistb.SetXTitle("|\\alpha|  [\\circ]");
+    alphaOFFHistb.SetName(alphaOFFHistbName);
+
+
+    MH3* alphaOFFAfter = (MH3*)parlistOFF.FindObject(mh3NameOFFA, "MH3");
+    TH1  &alphaOFFHista = alphaOFFAfter->GetHist();
+    TString alphaOFFHistaName ("TestAlphaOFFAfterCuts");
+
+    if (fThetaRangeString.IsNull())
+    {
+	*fLog << "MFindSupercutsONOFF::TestParamsOnTestSample; "
+	      << " fThetaRangeString is NOT defined..." << endl;
+	alphaOFFHistaName += ("ThetaRangeStringUndefined");
+    }
+    else
+    {
+	alphaOFFHistaName += (fThetaRangeString);
+    }
+
+
+    alphaOFFHista.SetXTitle("|\\alpha|  [\\circ]");
+    alphaOFFHista.SetName(alphaOFFHistaName);
+
+    
+
+
+
+    // *****************************************************
+
+
+
+    //-------------------------------------------
+
+
+    MParList  parlist2;
+    MTaskList tasklist2;
+
+    MMatrixLoop loop(fMatrixTest);
+
+    // plot alpha before applying the supercuts
+    const TString  mh3NameB = "AlphaBefore";
+    MBinning binsalphabef("Binning"+mh3NameB);
+    //binsalphabef.SetEdges(54, -12.0, 96.0);
+    binsalphabef.SetEdges(fNAlphaBins, fAlphaBinLow, fAlphaBinUp);
+    
+    // |alpha| is assumed to be in column 7 of the matrix
+    MH3 alphabefore("MatrixTest[7]");
+    alphabefore.SetName(mh3NameB);
+
+
+    MFillH fillalphabefore(&alphabefore);
+    fillalphabefore.SetName("FillAlphaBefore");
+
+
+    // plot alpha after applying the supercuts
+    const TString  mh3NameA = "AlphaAfter";
+    MBinning binsalphaaft("Binning"+mh3NameA);
+    // binsalphaaft.SetEdges(54, -12.0, 96.0);
+    binsalphaaft.SetEdges(fNAlphaBins, fAlphaBinLow, fAlphaBinUp);
+
+    MH3 alphaafter("MatrixTest[7]");
+    alphaafter.SetName(mh3NameA);
+
+
+    MFillH fillalphaafter(&alphaafter);
+    fillalphaafter.SetName("FillAlphaAfter");
+
+    //******************************
+    // entries in MParList
+
+    parlist2.AddToList(&tasklist2);
+
+    parlist2.AddToList(&supercuts);
+
+    parlist2.AddToList(&supapptestON);
+
+    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();
+    TString alphaHist1Name ("TestAlphaBeforeCuts");
+    
+    if (fThetaRangeString.IsNull())
+    {
+	*fLog << "MFindSupercutsONOFF::TestParamsOnTestSample; "
+	      << " fThetaRangeString is NOT defined..." << endl;
+	alphaHist1Name += ("ThetaRangeStringUndefined");
+    }
+    else
+    {
+	alphaHist1Name += (fThetaRangeString);
+    }
+
+
+
+
+    alphaHist1.SetName(alphaHist1Name);
+    alphaHist1.SetXTitle("|\\alpha|  [\\circ]");
+    
+
+
+    MH3* alphaAfter = (MH3*)parlist2.FindObject(mh3NameA, "MH3");
+    TH1  &alphaHist2 = alphaAfter->GetHist();
+    TString alphaHist2Name ("TestAlphaAfterCuts");
+    
+    
+    if (fThetaRangeString.IsNull())
+    {
+	*fLog << "MFindSupercutsONOFF::TestParamsOnTestSample; "
+	      << " fThetaRangeString is NOT defined..." << endl;
+	alphaHist2Name += ("ThetaRangeStringUndefined");
+    }
+    else
+    {
+	alphaHist2Name += (fThetaRangeString);
+    }
+
+    alphaHist2.SetXTitle("|\\alpha|  [\\circ]");
+    alphaHist2.SetName(alphaHist2Name);
+
+
+       
+    //fPsFilename  -> NewPage();
+
+
+    // Canvas is deleted after saving the plot in ps file
+    // This is to allow for GRID analysis
+
+    TCanvas *c = new TCanvas("TestAlphaBeforeAfterSC", 
+			     "TestAlphaBeforeAfterSC", 
+			     600, 600);
+    c->Divide(2,2);
+    
+    
+
+    c->cd(1);
+    alphaOFFHistb.DrawCopy();
+
+    c->cd(2);
+    alphaOFFHista.DrawCopy();
+    
+  
+
+    c->cd(3);
+    alphaHist1.DrawCopy();
+
+    c->cd(4);
+    alphaHist2.DrawCopy();
+
+    c->Modified();
+    c-> Update();
+
+
+    // ********************************************
+    // TMP solutions while the TPostScript thing is not working 
+    // PsFileName for storing these plots is derived 
+    // from PsFilenameString. 
+    
+
+    cout << "Alpha distributions will be saved in PostScript file  " ;
+
+
+    if (!fPsFilenameString.IsNull())
+    {
+	TString filename = (fPsFilenameString);
+	filename += ("AlphaTESTSampleONOFFBeforeAfterCuts.ps");
+	cout << filename << endl;	
+	c -> SaveAs(filename);
+    }
+
+    // END OF TEMPORAL SOLUTION
+    // ********************************************
+    
+    
+    // Canvas is deleted after saving the plot in ps file
+    // This is to allow for GRID analysis
+    delete c;
+
+    //-------------------------------------------
+    // fit alpha distribution to get the number of excess events and
+    // calculate significance of gamma signal in the alpha plot
+  
+    const Double_t alphasig = fAlphaSig;
+    const Double_t alphamin = fAlphaBkgMin; 
+   // alpha min for bkg region in ON data
+    
+    const Double_t alphamax = fAlphaBkgMax;
+    const Int_t    degree   =    2;
+    const Int_t    degreeOFF   =    2;
+    const Bool_t   drawpoly  = kTRUE;
+    const Bool_t   fitgauss  = kTRUE;
+    const Bool_t   print     = kTRUE;
+    
+    const Bool_t saveplots   = kTRUE; // Save plots in Psfile
+   
+     
+
+    if (!ComputeNormFactorTest())
+    {
+	*fLog << "Normalization factor for test sample (ON-OFF) couold not be computed. Aborting..." << endl;
+	return kFALSE;
+    }
+
+
+
+     // Normalization factor factor is corrected using the estimated 
+    // number of excess events and the total number of ON events
+
+
+ 
+    if (fTuneNormFactor)
+    {
+
+
+	// Run MHFindSignificanceONOFF::FindSigmaONOFF
+	// to get estimation of number of excess gamma events. 
+	// This number will be used in the correction of the 
+	// normalization factor 
+	
+	// No plots will be produced this time...
+
+	const Bool_t   drawpolyTest  = kFALSE;
+	const Bool_t   fitgaussTest  = kFALSE;
+	const Bool_t   printTest     = kFALSE;
+	
+	const Bool_t saveplotsTest   = kFALSE; // Save plots in Psfile
+	
+	// TPostScript* DummyPs  = new TPostScript("dummy.ps");
+
+	TString DummyPs = ("Dummy");
+
+	MHFindSignificanceONOFF findsigTest;
+	findsigTest.SetRebin(kTRUE);
+	findsigTest.SetReduceDegree(kFALSE);
+	findsigTest.SetUseFittedQuantities(fUseFittedQuantities);
+	
+
+	if (findsigTest.FindSigmaONOFF(&alphaHist2, &alphaOFFHista, 
+				       fNormFactorTest, 
+        			       alphamin, alphamax, 
+				       degree, degreeOFF,
+				       alphasig, drawpolyTest, 
+				       fitgaussTest, printTest, 
+				       saveplotsTest, DummyPs))
+	{
+	    
+	    // Update values of Nex and SigmaLiMa for Test sammple
+	
+	    fSigmaLiMaTest = double(findsigTest.GetSignificance());
+
+	    if(fUseFittedQuantities)
+	    {
+		fNexTest = double(findsigTest.GetNexONOFFFitted());
+	    }
+	    else
+	    {
+		fNexTest = double(findsigTest.GetNexONOFF());
+	    }
+
+
+	}
+	else
+	{
+
+	    *fLog << "Normalization Factor tuning for Train sample is not possible"
+		  << endl;
+	    fSigmaLiMaTest = 0.0;
+	    fNexTest = 0.0;
+	}
+    
+
+//	DummyPs -> Close();
+	//DummyPs = NULL;
+	//      delete DummyPs;
+
+	
+   
+	
+	
+	Int_t EventsInTestMatrixOFF = fMatrixTestOFF->GetM().GetNrows();
+	Double_t Ngammas = fNexTest/fGammaEfficiency;
+	Double_t GammaFraction = Ngammas/EventsInTestMatrixOFF;
+	
+	
+	*fLog << "MFindSupercutsONOFF::TestParamsOnTestSample; "
+	      << "fNormFactorTest is corrected with fraction of gammas in ON "
+	      << "Data Test sample and the number of OFF events before cuts." 
+	      << endl
+	      << "EventsInTestMatrixOFF = " << EventsInTestMatrixOFF
+	      << " Excess events in Test ON sample = " << fNexTest
+	      << " fGammaEfficiency = " << fGammaEfficiency << endl
+	      << "fNormFactorTest Value before correction is " 
+	      << fNormFactorTest << endl;
+	
+	fNormFactorTest = fNormFactorTest - GammaFraction;
+
+	*fLog << "fNormFactorTest Value after correction is "
+	      << fNormFactorTest << endl;
+	    
+
+    }
+    
+
+    
+   
+    if (fNormFactorFromAlphaBkg)
+    {
+	// Normalization factor computed using alpha bkg region
+	Double_t NewNormFactor = 
+	    ComputeNormFactorFromAlphaBkg(&alphaHist2, &alphaOFFHista, 
+					  fAlphaBkgMin, fAlphaBkgMax);
+	
+	*fLog << "Normalization factor computed from alpha plot (after cuts) " << endl
+	      << "using counted number of ON and OFF events in alpha region " << endl
+	      << "defined by range " << fAlphaBkgMin << "-" << fAlphaBkgMax << endl
+	      << "Normalization factor = " << NewNormFactor << endl;
+
+	*fLog << "Normalization factor used is the one computed in bkg region; " << endl
+	      << "i.e. " << NewNormFactor << " instead of " << fNormFactorTest << endl;
+
+	fNormFactorTest = NewNormFactor;
+
+
+    }
+
+
+
+    // Significance is found using MHFindSignificanceONOFF::FindSigmaONOFF
+
+
+    MHFindSignificanceONOFF findsig;
+    findsig.SetRebin(kTRUE);
+    findsig.SetReduceDegree(kFALSE);
+    findsig.SetUseFittedQuantities(fUseFittedQuantities);
+
+    TString psfilename; // Name of psfile where Alpha plot will be stored
+    if (!fPsFilenameString.IsNull())
+    {
+	psfilename += (fPsFilenameString);
+	psfilename += ("TESTSample"); 
+    }
+    else
+    {
+	psfilename += ("TESTSample");
+    }
+
+
+    findsig.FindSigmaONOFF(&alphaHist2, &alphaOFFHista, 
+			   fNormFactorTest, 
+			   alphamin, alphamax, 
+			   degree, degreeOFF,
+			   alphasig, drawpoly, fitgauss, print, 
+			   saveplots, psfilename);
+    
+    const Double_t significance = findsig.GetSignificance();
+    const Double_t alphasi = findsig.GetAlphasi();
+
+
+    // Update values of Nex and SigmaLiMa for Test sammple
+
+    fSigmaLiMaTest = double(findsig.GetSignificance());
+
+    if(fUseFittedQuantities)
+    {
+	fNexTest = double(findsig.GetNexONOFFFitted());
+    }
+    else
+    {
+	fNexTest = double(findsig.GetNexONOFF());
+    }
+
+
+    // Alpha distributions and containers with teh supercuts applied 
+    // are written into root file 
+
+    TFile rootfile(fAlphaDistributionsRootFilename, "UPDATE",
+		   "Alpha Distributions for several Theta bins");
+
+    alphaHist2.Write();
+    alphaOFFHista.Write();
+    
+    (supapptestON.GetTreePointer())->Write();
+    (supapptestOFF.GetTreePointer())->Write();
+
+    *fLog  << "TTree objects containing supercuts applied to TEST sample are "
+	   << "written into root file " << fAlphaDistributionsRootFilename << endl; 
+ 
+    (supapptestON.GetTreePointer())->Print();
+    (supapptestOFF.GetTreePointer())->Print();
+
+    //rootfile.Close();
+    
+
+    // Boolean variable that controls in class MSupercutsCalcONOFF
+    // wether the supercuts are stored or not
+    // is set to the default value, kFALSE.
+
+    fCalcHadTest -> SetStoreAppliedSupercuts(kFALSE);
+    fCalcHadTestOFF -> SetStoreAppliedSupercuts(kFALSE);
+
+
+
+    *fLog << "Significance of gamma signal after supercuts in Test sample : "
+         << significance << " (for |alpha| < " << alphasi << " degrees)" 
+         << endl;
+    //-------------------------------------------
+
+
+    *fLog << "Test of supercuts on TEST sample finished" << endl;
+    *fLog << "======================================================" << endl;
+
+    return kTRUE;
+}
+
+
+
+
+
+// Function that applies the optimized supercuts on the TEST sample.
+
+// Supercuts applied (LengthUp, LengthLow...) 
+// to all the individual events, as well as 
+// the features of the shower images (Length,Width...) are 
+// stored in 2 TTree objects (for ON and OFF data) in the 
+// root file specified by variable "fAlphaDistributionsRootFilename"
+
+
+Bool_t MFindSupercutsONOFF::TestParamsOnTrainSample()
+{
+    if (fMatrixTrain->GetM().GetNrows() <= 0)
+    {
+        *fLog << "MFindSupercutsONOFF::TestParamsOnTrainSample; train matrix ON has no entries" 
+              << endl;
+        return kFALSE;
+    }
+
+
+    if (fMatrixTrainOFF->GetM().GetNrows() <= 0)
+    {
+        *fLog << "MFindSupercutsONOFF::TestParamsOnTrainSample; train matrix OFF has no entries" 
+              << endl;
+        return kFALSE;
+    }
+
+    // -------------   TEST the supercuts on TRAIN sample  --------------------------
+    //
+    *fLog << "Producing output of the SUPERCUTS ON-OFF optimization " << 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 << "MFindSupercutsONOFF::TestParamsOnTrainSample; hadronness name for ON data is not defined... aborting";
+        *fLog << endl;
+        return kFALSE;
+    }
+
+    if (fHadronnessNameOFF.IsNull())
+    {
+        *fLog << "MFindSupercutsONOFF::TestParamsOnTrainSample; hadronness name for OFF data is not defined... aborting";
+        *fLog << endl;
+        return kFALSE;
+    }
+
+
+    if(fTrainONSupercutsAppliedName.IsNull())
+    {
+        *fLog << "MFindSupercutsONOFF::TestParamsOnTrainSample; " 
+	      << " MTSupercutsApplied Tree name for ON Train data is not defined... aborting"
+	      << endl;
+        return kFALSE;
+    }
+
+    if(fTrainOFFSupercutsAppliedName.IsNull())
+    {
+        *fLog << "MFindSupercutsONOFF::TestParamsOnTrainSample; " 
+	      << " MTSupercutsApplied Tree name for OFF Train data is not defined... aborting"
+	      << endl;
+        return kFALSE;
+    }
+    
+   
+    MSupercuts supercuts;
+    supercuts.SetParameters(supercutsPar);
+
+    // Objects containing the trees used to store supercuts applied
+    // TTree Branches are also created
+    MTSupercutsApplied supapptrainON(fTrainONSupercutsAppliedName,"");
+    supapptrainON.CreateTreeBranches();
+
+    MTSupercutsApplied supapptrainOFF(fTrainOFFSupercutsAppliedName,"");
+    supapptrainOFF.CreateTreeBranches();
+
+    fCalcHadTrainOFF -> SetHadronnessName(fHadronnessNameOFF);
+    fCalcHadTrain -> SetHadronnessName(fHadronnessName);
+
+
+    // Settings related to the storage of teh supercuts applied 
+    fCalcHadTrain -> SetSupercutsAppliedName(fTrainONSupercutsAppliedName);
+    fCalcHadTrain -> SetStoreAppliedSupercuts(kTRUE);
+
+    fCalcHadTrainOFF -> SetSupercutsAppliedName(fTrainOFFSupercutsAppliedName);
+    fCalcHadTrainOFF -> SetStoreAppliedSupercuts(kTRUE);
+    
+
+    // Set boolean variable that controls wether cuts are 
+    // dynamic or static
+
+    fCalcHadTrain -> SetVariableUseStaticCuts(fUseStaticCuts);
+    fCalcHadTrainOFF -> SetVariableUseStaticCuts(fUseStaticCuts);
+
+
+    if (!fUseStaticCuts)
+    {
+	// Set boolean variable that controls wether the theta variable 
+	// is used or not in the computation of the dynamical cuts
+	
+	fCalcHadTrain -> SetVariableNotUseTheta(fNotUseTheta);
+	fCalcHadTrainOFF -> SetVariableNotUseTheta(fNotUseTheta);
+    }
+
+
+    // apply the supercuts to OFF data
+
+    MF scfilterOFF(fHadronnessNameOFF+".fHadronness>0.5");
+    MContinue applysupercutsOFF(&scfilterOFF);
+
+     // apply the supercuts to ON data
+    MF scfilter(fHadronnessName+".fHadronness>0.5");
+    MContinue applysupercuts(&scfilter);
+
+    
+
+
+    // ****************************************************
+    // Filling OFF alpha distribution 
+
+    MParList parlistOFF;
+    MTaskList tasklistOFF;
+
+    MMatrixLoop loopOFF(fMatrixTrainOFF);
+
+    // plot alpha before applying the supercuts
+    const TString  mh3NameOFFB = "AlphaOFFBefore";
+    MBinning binsalphaOFFbef("Binning"+mh3NameOFFB);
+    //binsalphaOFFbef.SetEdges(54, -12.0, 96.0);
+    binsalphaOFFbef.SetEdges(fNAlphaBins, fAlphaBinLow, fAlphaBinUp);
+
+
+    // |alpha| is assumed to be in column 7 of the matrix
+    MH3 alphaOFFbefore("MatrixTrainOFF[7]");
+    alphaOFFbefore.SetName(mh3NameOFFB);
+
+    
+    MFillH fillalphaOFFbefore(&alphaOFFbefore);
+    fillalphaOFFbefore.SetName("FillAlphaOFFBefore");
+
+   
+
+    // fill OFF alpha after applying the supercuts
+    const TString  mh3NameOFFA = "AlphaOFFAfter";
+    MBinning binsalphaOFFaft("Binning"+mh3NameOFFA);
+    //binsalphaOFFaft.SetEdges(54, -12.0, 96.0);
+    binsalphaOFFaft.SetEdges(fNAlphaBins, fAlphaBinLow, fAlphaBinUp);
+
+    MH3 alphaOFFafter("MatrixTrainOFF[7]");
+    alphaOFFafter.SetName(mh3NameOFFA);
+
+    //TH1 &alphaOFFhista = alphaOFFafter.GetHist();
+    //alphaOFFhista.SetName("alphaOFFAfter-OptimizationParamOutput");
+
+    MFillH fillalphaOFFafter(&alphaOFFafter);
+    fillalphaOFFafter.SetName("FillAlphaOFFAfter");
+
+    //******************************
+    // entries in MParList
+
+    parlistOFF.AddToList(&tasklistOFF);
+
+    parlistOFF.AddToList(&supercuts);
+
+    parlistOFF.AddToList(&supapptrainOFF);
+
+    parlistOFF.AddToList(fCam);
+    parlistOFF.AddToList(fMatrixTrainOFF);
+
+    parlistOFF.AddToList(&binsalphaOFFbef);
+    parlistOFF.AddToList(&alphaOFFbefore);
+
+    parlistOFF.AddToList(&binsalphaOFFaft);
+    parlistOFF.AddToList(&alphaOFFafter);
+
+
+    //******************************
+    // Entries in MtaskList
+    tasklistOFF.AddToList(&loopOFF);
+    tasklistOFF.AddToList(&fillalphaOFFbefore);
+
+    tasklistOFF.AddToList(fCalcHadTrainOFF);
+    tasklistOFF.AddToList(&applysupercutsOFF);
+
+    tasklistOFF.AddToList(&fillalphaOFFafter);
+
+    //******************************
+
+    MProgressBar barOFF;
+    MEvtLoop evtloopOFF;
+    evtloopOFF.SetParList(&parlistOFF);
+    evtloopOFF.SetName("EvtLoopOptimizationParamOutputOFF");
+    evtloopOFF.SetProgressBar(&barOFF);
+    Int_t maxeventsOFF = -1;
+    if (!evtloopOFF.Eventloop(maxeventsOFF))
+        return kFALSE;
+
+    tasklistOFF.PrintStatistics(0, kTRUE);
+
+
+    //-------------------------------------------
+    // draw the alpha plots
+
+    MH3* alphaOFFBefore = (MH3*)parlistOFF.FindObject(mh3NameOFFB, "MH3");
+    TH1  &alphaOFFHistb = alphaOFFBefore->GetHist();
+    alphaOFFHistb.SetXTitle("|\\alpha|  [\\circ]");
+
+    TString alphaOFFHistbName ("TrainAlphaOFFBeforeCuts");
+    if (fThetaRangeString.IsNull())
+    {
+	*fLog << "MFindSupercutsONOFF::TestParamsOnTrainSample; "
+	      << " fThetaRangeString is NOT defined..." << endl;
+	alphaOFFHistbName += ("ThetaRangeStringUndefined");
+    }
+    else
+    {
+	alphaOFFHistbName += (fThetaRangeString);
+    }
+
+    alphaOFFHistb.SetName(alphaOFFHistbName);
+
+    MH3* alphaOFFAfter = (MH3*)parlistOFF.FindObject(mh3NameOFFA, "MH3");
+    TH1  &alphaOFFHista = alphaOFFAfter->GetHist();
+    TString alphaOFFHistaName ("TrainAlphaOFFAfterCuts");
+    if (fThetaRangeString.IsNull())
+    {
+	*fLog << "MFindSupercutsONOFF::TestParamsOnTrainSample; "
+	      << " fThetaRangeString is NOT defined..." << endl;
+	alphaOFFHistaName += ("ThetaRangeStringUndefined");
+    }
+    else
+    {
+	alphaOFFHistaName += (fThetaRangeString);
+    }
+
+
+    alphaOFFHista.SetXTitle("|\\alpha|  [\\circ]");
+    alphaOFFHista.SetName(alphaOFFHistaName);
+
+
+    // *****************************************************
+
+
+
+    //-------------------------------------------
+
+
+    MParList  parlist2;
+    MTaskList tasklist2;
+
+    MMatrixLoop loop(fMatrixTrain);
+
+    // plot alpha before applying the supercuts
+    const TString  mh3NameB = "AlphaBefore";
+    MBinning binsalphabef("Binning"+mh3NameB);
+    //binsalphabef.SetEdges(54, -12.0, 96.0);
+    binsalphabef.SetEdges(fNAlphaBins, fAlphaBinLow, fAlphaBinUp);
+    
+    // |alpha| is assumed to be in column 7 of the matrix
+    MH3 alphabefore("MatrixTrain[7]");
+    alphabefore.SetName(mh3NameB);
+
+    MFillH fillalphabefore(&alphabefore);
+    fillalphabefore.SetName("FillAlphaBefore");
+
+
+    // plot alpha after applying the supercuts
+    const TString  mh3NameA = "AlphaAfter";
+    MBinning binsalphaaft("Binning"+mh3NameA);
+    //binsalphaaft.SetEdges(54, -12.0, 96.0);
+    binsalphaaft.SetEdges(fNAlphaBins, fAlphaBinLow, fAlphaBinUp);
+
+    MH3 alphaafter("MatrixTrain[7]");
+    alphaafter.SetName(mh3NameA);
+
+    
+    MFillH fillalphaafter(&alphaafter);
+    fillalphaafter.SetName("FillAlphaAfter");
+
+    //******************************
+    // entries in MParList
+
+    parlist2.AddToList(&tasklist2);
+
+    parlist2.AddToList(&supercuts);
+
+    parlist2.AddToList(&supapptrainON);
+
+    parlist2.AddToList(fCam);
+    parlist2.AddToList(fMatrixTrain);
+
+    parlist2.AddToList(&binsalphabef);
+    parlist2.AddToList(&alphabefore);
+
+    parlist2.AddToList(&binsalphaaft);
+    parlist2.AddToList(&alphaafter);
+
+    //******************************
+    // entries in MTaskList
+
+    tasklist2.AddToList(&loop);
+    tasklist2.AddToList(&fillalphabefore);
+
+    tasklist2.AddToList(fCalcHadTrain);
+    tasklist2.AddToList(&applysupercuts);
+
+    tasklist2.AddToList(&fillalphaafter);
+
+    //******************************
+
+    MProgressBar bar2;
+    MEvtLoop evtloop2;
+    evtloop2.SetParList(&parlist2);
+    evtloop2.SetName("EvtLoopOptimizationParamOutput");
+    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();
+    TString alphaHist1Name ("TrainAlphaBeforeCuts");
+    if (fThetaRangeString.IsNull())
+    {
+	*fLog << "MFindSupercutsONOFF::TestParamsOnTrainSample; "
+	      << " fThetaRangeString is NOT defined..." << endl;
+	alphaHist1Name += ("ThetaRangeStringUndefined");
+    }
+    else
+    {
+	alphaHist1Name += (fThetaRangeString);
+    }
+
+
+    alphaHist1.SetXTitle("|\\alpha|  [\\circ]");
+    alphaHist1.SetName(alphaHist1Name);
+
+    MH3* alphaAfter = (MH3*)parlist2.FindObject(mh3NameA, "MH3");
+    TH1  &alphaHist2 = alphaAfter->GetHist();
+    TString alphaHist2Name ("TrainAlphaAfterCuts");
+    if (fThetaRangeString.IsNull())
+    {
+	*fLog << "MFindSupercutsONOFF::TestParamsOnTrainSample; "
+	      << " fThetaRangeString is NOT defined..." << endl;
+	alphaHist2Name += ("ThetaRangeStringUndefined");
+    }
+    else
+    {
+	alphaHist2Name += (fThetaRangeString);
+    }
+
+    alphaHist2.SetXTitle("|\\alpha|  [\\circ]");
+    alphaHist2.SetName(alphaHist2Name);
+
+
+    // fPsFilename -> NewPage();
+
+    
+    // Canvas is deleted after saving the plot in ps file
+    // This is to allow for GRID analysis
+
+    TCanvas *c = new TCanvas("TrainAlphaBeforeAfterSC", 
+			     "TrainAlphaBeforeAfterSC", 
+			     600, 600);
+
+    c->Divide(2,2);
+
+
+
+    c->cd(1);
+    alphaOFFHistb.DrawCopy();
+
+    c->cd(2);
+    alphaOFFHista.DrawCopy();
+
+
+    //c->Modified();
+    //c-> Update();
+    
+
+    // fPsFilename -> NewPage();
+
+    c->cd(3);
+    alphaHist1.DrawCopy();
+
+    c->cd(4);
+    alphaHist2.DrawCopy();
+
+
+    c -> Modified();
+    c -> Update();
+    
+     // ********************************************
+    // TMP solutions while the TPostScript thing is not working 
+    // PsFileName for storing these plots is derived 
+    // from PsFilenameString. 
+
+    cout << "Alpha distributions will be saved in PostScript file  " ;
+
+    if (!fPsFilenameString.IsNull())
+    {
+	TString filename = (fPsFilenameString);
+	filename += ("AlphaTRAINSampleONOFFBeforeAfterCuts.ps");
+	cout << filename << endl;
+	c -> SaveAs(filename);
+    }
+
+    // END OF TEMPORAL SOLUTION
+    // ********************************************
+	    
+
+
+
+    // fPsFilename -> NewPage();
+
+
+    // Canvas is deleted after saving the plot in ps file
+    // This is to allow for GRID analysis
+
+    delete c;
+
+
+
+
+    //-------------------------------------------
+    // fit alpha distribution to get the number of excess events and
+    // calculate significance of gamma signal in the alpha plot
+  
+    const Double_t alphasig = fAlphaSig;
+    const Double_t alphamin = fAlphaBkgMin; 
+   // alpha min for bkg region in ON data
+    
+    const Double_t alphamax = fAlphaBkgMax;
+    const Int_t    degree   =    2;
+    const Int_t    degreeOFF   =    2;
+    const Bool_t   drawpoly  = kTRUE;
+    const Bool_t   fitgauss  = kTRUE;
+    const Bool_t   print     = kTRUE;
+    
+    Bool_t saveplots   = kTRUE; // Save plots in Psfile
+  
+    
+
+    
+    
+
+    if (!ComputeNormFactorTrain())
+    {
+	*fLog << "Normalization factor for train sample (ON-OFF) could not be computed. Aborting..." << endl;
+	return kFALSE;
+    }
+	    
+
+    // Normalization factor factor is corrected using the estimated 
+    // number of excess events and the total number of OFF events
+    // fNormFactor = fNormFactor - Ngammas/EventsInMatrixOFF
+
+ 
+    if (fTuneNormFactor)
+    {
+
+
+	// Run MHFindSignificanceONOFF::FindSigmaONOFF
+	// to get estimation of number of excess gamma events. 
+	// This number will be used in the correction of the 
+	// normalization factor 
+	
+	// No plots will be produced this time...
+
+	const Bool_t   drawpolyTest  = kFALSE;
+	const Bool_t   fitgaussTest  = kFALSE;
+	const Bool_t   printTest     = kFALSE;
+	
+	const Bool_t saveplotsTest   = kFALSE; // Save plots in Psfile
+	
+	//TPostScript* DummyPs  = new TPostScript("dummy.ps");
+
+	TString DummyPs = ("Dummy");
+
+	MHFindSignificanceONOFF findsigTest;
+	findsigTest.SetRebin(kTRUE);
+	findsigTest.SetReduceDegree(kFALSE);
+	findsigTest.SetUseFittedQuantities(fUseFittedQuantities);
+
+	if(findsigTest.FindSigmaONOFF(&alphaHist2, &alphaOFFHista, 
+				      fNormFactorTrain, 
+				      alphamin, alphamax, 
+				      degree, degreeOFF,
+				      alphasig, drawpolyTest, 
+				      fitgaussTest, printTest, 
+				      saveplotsTest, DummyPs))
+
+	{
+
+	    // Update values of Nex and SigmaLiMa for Test sammple
+	
+	    fSigmaLiMaTrain = double(findsigTest.GetSignificance());
+
+	    if(fUseFittedQuantities)
+	    {
+		fNexTrain = double(findsigTest.GetNexONOFFFitted());
+	    }
+	    else
+	    {
+		fNexTrain = double(findsigTest.GetNexONOFF());
+	    }
+	    
+	}
+
+	else
+	{
+	    *fLog << "Normalization Factor tuning for Train sample is not possible"
+		  << endl;
+
+	    fSigmaLiMaTrain = 0.0;
+	    fNexTrain = 0.0;
+
+	}
+
+	//DummyPs -> Close();
+	//DummyPs = NULL;
+	//delete DummyPs;
+
+	
+
+
+	Int_t EventsInTrainMatrixOFF = fMatrixTrainOFF->GetM().GetNrows();
+	Double_t Ngammas = fNexTrain/fGammaEfficiency;
+	Double_t GammaFraction = Ngammas/EventsInTrainMatrixOFF;
+	
+
+	*fLog << "MFindSupercutsONOFF::TestParamsOnTrainSample; "
+	      << "fNormFactorTrain is corrected with fraction of gammas in ON "
+	      << "Data Train sample and the number of OFF events before cuts." 
+	      << endl
+	      << "EventsInTrainMatrixOFF = " << EventsInTrainMatrixOFF
+	      << " Excess events in Train ON sample = " << fNexTrain
+	      << " fGammaEfficiency = " << fGammaEfficiency << endl
+	      << "fNormFactorTrain Value before correction is " 
+	      << fNormFactorTrain << endl;
+
+	fNormFactorTrain = fNormFactorTrain - GammaFraction;
+
+	*fLog << "fNormFactorTrain Value after correction is "
+	      << fNormFactorTrain << endl;
+       
+	    
+
+    }
+
+    if (fNormFactorFromAlphaBkg)
+    {
+	Double_t NewNormFactor = 
+	    ComputeNormFactorFromAlphaBkg(&alphaHist2, &alphaOFFHista, 
+					  fAlphaBkgMin, fAlphaBkgMax);
+	
+	*fLog << "Normalization factor computed from alpha plot (after cuts) " << endl
+	      << "using counted number of ON and OFF events in alpha region " << endl
+	      << "defined by range " << fAlphaBkgMin << "-" << fAlphaBkgMax << endl
+	      << "Normalization factor = " << NewNormFactor << endl;
+
+	*fLog << "Normalization factor used is the one computed in bkg region; " << endl
+	      << "i.e. " << NewNormFactor << " instead of " << fNormFactorTrain << endl;
+
+	fNormFactorTrain = NewNormFactor;
+
+
+    }
+
+
+    MHFindSignificanceONOFF findsig;
+    findsig.SetRebin(kTRUE);
+    findsig.SetReduceDegree(kFALSE);
+    findsig.SetUseFittedQuantities(fUseFittedQuantities);
+
+    TString psfilename; // Name of psfile where Alpha plot will be stored
+    if (!fPsFilenameString.IsNull())
+    {
+	psfilename += (fPsFilenameString);
+	psfilename += ("TRAINSample"); 
+    }
+    else
+    {
+	psfilename += ("TRAINSample");
+    }
+
+
+    findsig.FindSigmaONOFF(&alphaHist2, &alphaOFFHista, 
+			   fNormFactorTrain, 
+			   alphamin, alphamax, 
+			   degree, degreeOFF,
+			   alphasig, drawpoly, fitgauss, print, 
+			   saveplots, psfilename);
+    
+    const Double_t significance = findsig.GetSignificance();
+    const Double_t alphasi = findsig.GetAlphasi();
+
+    // Update Train values Nex, SigmaLiMa
+
+  fSigmaLiMaTrain = double(findsig.GetSignificance());
+
+  if(fUseFittedQuantities)
+  {
+      fNexTrain = double(findsig.GetNexONOFFFitted()); 
+  }
+  else
+  {
+      fNexTrain = double(findsig.GetNexONOFF()); 
+  }
+  
+
+    // Alpha distributions and containers with the supercuts applied 
+    // are written into root file 
+
+    TFile rootfile(fAlphaDistributionsRootFilename, "UPDATE",
+		   "Alpha Distributions for several Theta bins");
+
+    alphaHist2.Write();
+    alphaOFFHista.Write();
+    
+    (supapptrainON.GetTreePointer())->Write();
+    (supapptrainOFF.GetTreePointer())->Write();
+
+    *fLog  << "TTree objects containing supercuts applied to TEST sample are "
+	   << "written into root file " << fAlphaDistributionsRootFilename << endl; 
+ 
+    (supapptrainON.GetTreePointer())->Print();
+    (supapptrainOFF.GetTreePointer())->Print();
+
+
+    //rootfile.Close();
+    
+
+    // Boolean variable that controls in class MSupercutsCalcONOFF
+    // wether the supercuts are stored or not
+    // is set to the default value, kFALSE.
+
+    fCalcHadTrain -> SetStoreAppliedSupercuts(kFALSE);
+    fCalcHadTrainOFF -> SetStoreAppliedSupercuts(kFALSE);
+    
+
+
+
+
+    *fLog << "Significance of gamma signal after supercuts in train sample : "
+         << significance << " (for |alpha| < " << alphasi << " degrees)" 
+         << endl;
+    //-------------------------------------------
+
+
+    *fLog << "Test of supercuts on TRAIN sample finished" << endl;
+    *fLog << "======================================================" << endl;
+
+    return kTRUE;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MFindSupercutsONOFF.h
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MFindSupercutsONOFF.h	(revision 4411)
+++ trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MFindSupercutsONOFF.h	(revision 4411)
@@ -0,0 +1,466 @@
+#ifndef MARS_MFindSupercutsONOFF
+#define MARS_MFindSupercutsONOFF
+
+#ifndef MARS_MParContainer
+#include "MParContainer.h"
+#endif
+
+#ifndef ROOT_TArrayD
+#include <TArrayD.h>
+#endif
+#ifndef ROOT_TArrayI
+#include <TArrayI.h>
+#endif
+
+#ifndef ROOT_TH1F
+#include <TH1F.h>
+#endif
+
+#ifndef ROOT_TPostScript
+#include <TPostScript.h>
+#endif
+
+
+class MFilter;
+class MEvtLoop;
+class MH3;
+class MSupercutsCalcONOFF;
+
+class MGeomCam;
+class MHMatrix;
+
+
+class MFindSupercutsONOFF : public MParContainer
+{
+ private:
+
+
+     // TMP
+    // There are quite some problems during the data preprocessing. 
+    // For the time being, I will add some cuts to the functions 
+    // DefineTrainTestMatrixThetaRange and for OFF, so that I can 
+    // make a kind of preprocess on my own. This allows me 
+    // to make a very silly preprocess with wolfgangs macro, which 
+    // might be free of corrupted data, and then I can do on my own.
+
+
+    // VARIABLES INITIALIZED IN CONSTRUCTOR
+
+    Double_t fSizeCutLow;
+    Double_t fSizeCutUp;
+
+    Double_t fDistCutLow;
+    Double_t fDistCutUp;
+    
+    Double_t fLengthCutLow;
+    Double_t fLengthCutUp;
+    
+    Double_t  fWidthCutLow;
+    Double_t  fWidthCutUp;
+
+
+    // ENDTMP
+
+
+
+
+
+
+  TString fFilenameTrain;
+  TString fFilenameTest;
+
+  Int_t   fHowManyTrain;
+  Int_t   fHowManyTest;
+
+  Int_t   fHowManyTrainOFF;
+  Int_t   fHowManyTestOFF;
+
+
+  
+  Double_t fAlphaSig; // Max alpha value were signal is expected
+
+  // Background range (in alpha) is defined by the member variables 
+  // fAlphaBkgMin and fAlphaBkgMax
+  Double_t fAlphaBkgMin; 
+  Double_t fAlphaBkgMax; 
+  
+  Int_t fThetaMin; // Cuts in ThetaOrig.fVal (in mili radians!!!)
+  Int_t fThetaMax; // Cuts in ThetaOrig.fVal (in mili radians !!!)
+  TString fThetaRangeString;
+
+ 
+
+  // Variables for binning of alpha plots
+  
+  Int_t fNAlphaBins;
+  Double_t fAlphaBinLow;
+  Double_t fAlphaBinUp;
+
+
+  Bool_t  fUseOrigDistribution;
+
+
+  Double_t fNormFactorTrain;
+  Double_t fNormFactorTest;
+  Double_t fSigmaLiMaTrain;
+  Double_t fSigmaLiMaTest;
+  Double_t fNexTrain; 
+  Double_t fNexTest; 
+  Double_t fGammaEfficiency; // Fraction of gammas that remain after cuts
+  // Quantity that will have to be determined with MC
+
+  Bool_t fTuneNormFactor; // If true, normalization factors are corrected using the estimated number of gammas and the gamma efficiency
+  // fNormFactorTrain = fNormFactorTrain - Ngammas/EventsInTrainMatrixOFF
+
+
+  // Boolean variable used to determine wether the normalization factor is 
+  // computed from method 1) or 2)
+  // 1) Using total number of ON and OFF events before cuts, and tuning the factor 
+  //    correcting for "contamination" of gamma events in ON sample
+  // 2) Using number of ON and OFF events after cuts in the background 
+  //    region determined by variables fAlphaBkgMin-fAlphaBkgMax
+ 
+  Bool_t fNormFactorFromAlphaBkg; // if kTRUE, method 2) is used
+
+
+
+  // Boolean variable used to disable the usage ("serious" usage) of the 
+  // quantities computed from fits. This will be useful in those cases 
+  // where there is too few events to perform a decent fit to the 
+  // alpha histograms. Default value will be kTRUE.
+  
+  Bool_t fUseFittedQuantities;
+
+  // Boolean variable that controls wether the optimization of the 
+  // parameters (MMinuitInterface::CallMinuit(..) in function FindParams(..))
+  // takes place or not. kTRUE will skip such optimization.
+  // This variable is useful to test the optmized parameters (previously found 
+  // and stored in root file) on the TRAIN sample.
+
+  Bool_t fSkipOptimization;
+
+
+
+  // Boolean variable that allows the user to set some limits to the 
+  // some of the Minuit parameters. For the time being, only the limits
+  // for the parameters which do NOT depend in size, dist and theta are set, 
+  // i.e. static limits. The value of this boolean variable is set in the 
+  // constructor of the class.
+
+  Bool_t fSetLimitsToSomeMinuitParams;
+
+  // Limits for the Minuit parameters. For the time being the values are set in the constructor 
+  // of the class. One MUST be very careful to set limits such that the expected final values 
+  // (optimized values) are far away from the limits.
+
+ 
+  
+  Double_t fMinuitDistUPUpperLimit;
+  Double_t fMinuitDistUPLowerLimit;
+  Double_t fMinuitLengthUPUpperLimit;
+  Double_t fMinuitLengthUPLowerLimit;
+  Double_t fMinuitWidthUPUpperLimit;
+  Double_t fMinuitWidthUPLowerLimit;
+  
+  Double_t fMinuitLeakage1UPUpperLimit;
+  Double_t fMinuitLeakage1UPLowerLimit;
+
+
+
+  Double_t fMinuitDistLOWUpperLimit;
+  Double_t fMinuitDistLOWLowerLimit;
+  Double_t fMinuitLengthLOWUpperLimit;
+  Double_t fMinuitLengthLOWLowerLimit;
+  Double_t fMinuitWidthLOWUpperLimit;
+  Double_t fMinuitWidthLOWLowerLimit;
+  
+
+
+  // Boolean variable used to control decide wether to use theta information 
+  // in the computation of teh dynamical cuts.
+  Bool_t fNotUseTheta;
+
+
+  // Boolean variable that allows to use/not use the dist info in the cuts parameterization
+  // kTRUE for use it.
+  // For the time being this variable is set in the constructor
+
+  Bool_t fUseDist;
+
+
+
+ // Boolean variable used to decide wether to use dynamical cuts or static cuts
+  // kTRUE means that static cuts are used. 
+  Bool_t fUseStaticCuts;
+
+  
+  // Boolean variable that allows the user to write the initial parameters 
+  // into the root file that will be used to store the optimum cuts.
+  // If fUseInitialSCParams = kTRUE , parameters are written.
+  // In this way, the initial SC parameters can be applied on the data (train/test) 
+  
+  // The initial parameters are ONLY written to the root file if 
+  // there is NO SC params optimization, i.e., if variable 
+  // fSkipOptimization = kTRUE;
+  
+  // The default value is obviously kFALSE.
+
+  Bool_t fUseInitialSCParams;
+
+  
+  TString  fFilenameParam;
+
+  TString  fHadronnessName;
+  TString  fHadronnessNameOFF;
+
+  // name for the containers to store the 
+  // supercuts applied to Train (ON/OFF) and Test(ON/OFF) samples
+
+  TString  fTrainONSupercutsAppliedName;        
+  TString  fTrainOFFSupercutsAppliedName;       
+
+  TString  fTestONSupercutsAppliedName;        
+  TString  fTestOFFSupercutsAppliedName;       
+
+  
+
+  // Name of Postscript file where, for each theta bin,  alpha ON and OFF distributions 
+  //  after cuts (and hence, Nex and SigmaLiMa computations) will be stored
+  // If fAlphaDistributionsPostScriptFilename is not defined, postscript file is not 
+  // produced. It is an optional variable...
+
+  // NOT WORKING YET !!!!
+  TPostScript* fPsFilename; 
+  TPostScript* fPsFilename2; 
+
+  TString fPsFilenameString; // Name of the file where plots will be stored while the 
+  // TPostScript option is not working 
+
+  TString fAlphaDistributionsRootFilename;
+  // Root file where histograms containing the ON alpha distribution and the 
+  // OFF alpha distribution (non normalized) , AFTER CUTS, are stored.
+  // Histograms containing the normalization factors, Nex and SigmaLiMa for 
+  // each theta bin will be also stored there.
+  // This name MUST be defined, since the histograms stored there will be used by 
+  // function XXX to compute an overall Nex and sigmaLiMa combining all those histograms
+
+
+  MSupercutsCalcONOFF *fCalcHadTrain;
+  MSupercutsCalcONOFF *fCalcHadTest;
+  MSupercutsCalcONOFF *fCalcHadTrainOFF;
+  MSupercutsCalcONOFF *fCalcHadTestOFF;
+  
+
+  MHMatrix          *fMatrixTrain;
+  MHMatrix          *fMatrixTest;
+  MHMatrix          *fMatrixTrainOFF;
+  MHMatrix          *fMatrixTestOFF;
+
+  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:
+  MFindSupercutsONOFF(const char *name=NULL, const char *title=NULL);
+  ~MFindSupercutsONOFF();
+
+  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 SetHadronnessNameOFF(const TString &name)   {fHadronnessNameOFF = name;}
+
+  
+  void SetSupercutsAppliedTreeNames();
+
+
+  void SetAlphaDistributionsRootFilename(const TString &name) 
+      {fAlphaDistributionsRootFilename = name;}
+
+  Bool_t SetAlphaSig (Double_t alphasig);
+  Bool_t SetAlphaBkgMin (Double_t alphabkgmin);
+  Bool_t SetAlphaBkgMax (Double_t alphabkgmax);
+
+  // Function that checks that the values of the member data 
+  // fAlphaSig, fAlphaBkgMin and fAlphaBkgMax make sense
+  // (ie, fAlphaSig < fAlphaBkgMin < fAlphaBkgMax)
+
+  Bool_t CheckAlphaSigBkg();
+
+  void SetUseFittedQuantities (Bool_t b)
+      {fUseFittedQuantities = b;}
+
+
+  void SetPostScriptFile(TPostScript* PsFile);
+  void SetPostScriptFile2(TPostScript &PsFile);
+
+  void SetPsFilenameString (const TString filename);
+
+
+  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);
+
+
+
+  Bool_t DefineTrainTestMatrixThetaRange(const TString &name, 
+					 const Double_t whichfractiontrain, 
+					 const Double_t whichfractiontest,  
+					 Double_t ThetaMin, Double_t ThetaMax, 
+					 const TString &filetrain, const TString &filetest);
+
+
+
+  
+  Bool_t DefineTrainTestMatrixOFFThetaRange(const TString &name, 
+					    const Double_t whichfractiontrain, 
+					    const Double_t whichfractiontest,  
+					    Double_t ThetaMin, Double_t ThetaMax, 
+					    const TString &filetrain, const TString &filetest);
+
+
+  MHMatrix *GetMatrixTrain() { return fMatrixTrain; }
+  MHMatrix *GetMatrixTest()  { return fMatrixTest;  }
+  MHMatrix *GetMatrixTrainOFF() { return fMatrixTrainOFF; }
+  MHMatrix *GetMatrixTestOFF()  { return fMatrixTestOFF;  }
+
+
+  void SetUseOrigDistribution(Bool_t b);
+
+
+  Bool_t ReadMatrix( const TString &filetrain, const TString &filetest);
+  
+  Bool_t ReadMatrixOFF( const TString &filetrainOFF, const TString &filetestOFF);
+
+  Bool_t ComputeNormFactorTrain ();
+  Bool_t ComputeNormFactorTest ();
+
+  Bool_t FindParams(TString parSCinit, TArrayD &params, TArrayD &steps);
+  // Bool_t TestParams();
+
+  // Function used to apply the supercuts on the TEST sample.
+  // Two event loops (one after the other) 
+  // are used to fill the 2 alpha distributions (ON and OFF) 
+  // applying supercuts to the Test sample
+  Bool_t TestParamsOnTestSample(); 
+  
+
+  // Function used to apply the supercuts on the TRAIN sample.
+  // Two event loops (one after the other) 
+  // are used to fill the 2 alpha distributions (ON and OFF) 
+  // applying supercuts to the TRAIN sample
+  Bool_t TestParamsOnTrainSample();
+  
+
+
+  Bool_t SetThetaRange(Double_t ThetaMin, Double_t ThetaMax);
+
+  Bool_t SetSizeRange(Double_t SizeMin, Double_t SizeMax);
+
+
+  void SetAlphaPlotBinining(Int_t nbins, Double_t binlow, Double_t binup)
+    { fNAlphaBins = nbins; fAlphaBinLow = binlow; fAlphaBinUp = binup;}
+
+  Double_t GetNormFactorTrain() {return fNormFactorTrain;}
+  Double_t GetNormFactorTest() {return fNormFactorTest;}
+  Double_t GetSigmaLiMaTrain() {return fSigmaLiMaTrain;}
+  Double_t GetSigmaLiMaTest() {return fSigmaLiMaTest;}
+  Double_t GetNexTrain() {return fNexTrain;}
+  Double_t GetNexTest() {return fNexTest;}
+
+
+  Double_t GetAlphaSig() {return fAlphaSig;}
+  Double_t GetAlphaBkgMin () {return fAlphaBkgMin;}
+  Double_t GetAlphaBkgMax () {return fAlphaBkgMax;}
+  
+  Bool_t GetUseFittedQuantities() {return fUseFittedQuantities;}
+  Bool_t GetSkipOptimization() {return fSkipOptimization;}
+  Bool_t GetUseInitialSCParams() {return fUseInitialSCParams;}
+
+  Bool_t SetGammaEfficiency (Double_t gammaeff);
+  Double_t GetGammaEfficiency() {return fGammaEfficiency;}
+  
+  
+
+  // Double_t ComputeNormFactorFromAlphaBkg(TH1 *histON, TH1 *histOFF);
+           
+  void SetTuneNormFactor(Bool_t b) {fTuneNormFactor = b;}
+
+  void SetNormFactorFromAlphaBkg (Bool_t b) {fNormFactorFromAlphaBkg = b;}
+
+  void SetSkipOptimization(Bool_t b);
+
+  void SetUseInitialSCParams(Bool_t b);
+
+  void SetVariableNotUseTheta(Bool_t b) {fNotUseTheta = b;}
+  Bool_t GetVariableNotUseTheta() { return fNotUseTheta;}
+
+  void SetVariableUseStaticCuts(Bool_t b) {fUseStaticCuts = b;}
+  Bool_t GetVariableUseStaticCuts() { return fUseStaticCuts;}
+
+  
+
+  
+
+
+  ClassDef(MFindSupercutsONOFF, 1) // Class for optimization of the Supercuts
+};
+
+#endif
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MFindSupercutsONOFFThetaLoop.cc
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MFindSupercutsONOFFThetaLoop.cc	(revision 4411)
+++ trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MFindSupercutsONOFFThetaLoop.cc	(revision 4411)
@@ -0,0 +1,4090 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): David Paneque   12/2003 <mailto:dpaneque@mppmu.mpg.de>
+!              
+!
+!   Copyright: MAGIC Software Development, 2000-2003
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MFindSupercutsONOFFThetaLoop                                             //
+//                                                                         //
+// Class for optimizing the parameters of the supercuts                     //
+// Using ON and OFF data runing over data which are subdivided in 
+// several Theta ranges.                                                  //
+//                                                                         //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+
+#include "MFindSupercutsONOFFThetaLoop.h"
+
+
+#include <math.h>            // fabs 
+
+#include <TFile.h>
+#include <TArrayD.h>
+#include <TMinuit.h>
+#include <TCanvas.h>
+#include <TStopwatch.h>
+#include <TVirtualFitter.h>
+
+#include <iostream.h>
+#include <fstream.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "MFindSupercutsONOFF.h"
+#include "MBinning.h"
+#include "MContinue.h"
+#include "MSupercuts.h"
+#include "MSupercutsCalcONOFF.h"
+#include "MDataElement.h"
+#include "MDataMember.h"
+
+
+#include <TPostScript.h>
+
+#include "MEvtLoop.h"
+#include "MFCT1SelFinal.h"
+#include "MF.h"
+#include "MFEventSelector.h"
+#include "MFEventSelector2.h"
+#include "MFillH.h"
+//#include "MGeomCamCT1Daniel.h"
+//#include "MGeomCamCT1.h"
+#include "MGeomCamMagic.h" // only for magic
+#include "MFRandomSplit.h"
+#include "MH3.h"
+#include "MHCT1Supercuts.h"
+#include "MHFindSignificance.h" // To be removed at some point...
+#include "MHFindSignificanceONOFF.h"
+#include "MHMatrix.h"
+#include "MHOnSubtraction.h"
+#include "MDataValue.h"
+// #include "MDataString.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(MFindSupercutsONOFF);
+
+using namespace std;
+
+// --------------------------------------------------------------------------
+//
+// Default constructor.
+//
+MFindSupercutsONOFFThetaLoop::MFindSupercutsONOFFThetaLoop(const char *name, const char *title)
+{
+    fName  = name  ? name  : "MFindSupercutsONOFF";
+    fTitle = title ? title : "Optimizer of the supercuts";
+    
+    //---------------------------
+
+
+    // Cuts (low and up) in variable ThetaOrig.fVal
+    // The default is not cut, i.e. all values (0-1) are taken
+    // fThetaOrig.fVal is measured in Radians; thus 1 = 57 degrees.
+
+    fThetaMin = 0.0;
+    fThetaMax = 1.0;
+
+    fAlphaSig = 20; // By default, signal is expected in alpha<20 for CT1
+
+    // By default, bkg region is set to alpha range 30-90 for CT1
+    fAlphaBkgMin = 30; 
+    fAlphaBkgMax = 90;
+
+    fActualCosThetaBinCenter = 0;
+    
+    fNormFactorTrainHist = NULL;
+    //fNormFactorTrainHist -> SetDirectory(0);
+    fNormFactorTestHist = NULL;
+    //fNormFactorTestHist -> SetDirectory(0);
+    fSigmaLiMaTrainHist = NULL;
+    //fSigmaLiMaTrainHist -> SetDirectory(0);
+    fSigmaLiMaTestHist = NULL;
+    //fSigmaLiMaTestHist -> SetDirectory(0);
+    fNexTrainHist = NULL;
+    //fSigmaLiMaTestHist -> SetDirectory(0);
+    fNexTestHist = NULL;
+    //fNexTestHist -> SetDirectory(0);
+
+
+    fSuccessfulThetaBinsHist = NULL;
+
+    /*
+    fNexVSAlphaSigTrain = NULL;
+    fNexVSAlphaSigTest = NULL;
+    
+    fSignificanceVSAlphaSigTrain = NULL;
+    fSignificanceVSAlphaSigTest = NULL;
+    */
+
+
+    fNEvtsInTrainMatrixONHist = NULL; 
+    fNEvtsInTestMatrixONHist = NULL; 
+    fNEvtsInTrainMatrixOFFHist = NULL; 
+    fNEvtsInTestMatrixOFFHist = NULL; 
+
+
+    fTrainMatrixONFilenameVector = NULL;
+    fTestMatrixONFilenameVector= NULL;
+    fTrainMatrixOFFFilenameVector= NULL;
+    fTestMatrixOFFFilenameVector= NULL;
+
+    
+    fOptSCParamFilenameVector = NULL;
+
+    fThetaRangeStringVector = NULL;
+
+    fPsFilename = NULL;
+
+
+
+    fTuneNormFactor = kTRUE; // Norm factors will be corrected using the total amount of OFF events before cuts and the estimated excess events
+    
+    // fNormFactorTrain = fNormFactorTrain - Ngammas/EventsInTrainMatrixOFF
+    
+    fGammaEfficiency = 0.5; // Fraction of gammas that remain after cuts
+    // Quantity that will have to be determined with MC, yet for the 
+    // time being I set it to 0.5
+
+    // boolean variables are set to kFALSE as default 
+
+    fReadMatricesFromFile = kFALSE;
+    fOptimizeParameters = kFALSE;
+    fTestParameters = kFALSE;
+
+    // Fraction of Train/Test ON/OFF samples is set to 0.5 as default
+
+   fWhichFractionTrain = 0.5;  // number <= 1; specifying fraction of ON Train events
+   fWhichFractionTest = 0.5;  // number <= 1; specifying fraction of ON Test events
+
+   fWhichFractionTrainOFF = 0.5;  // number <= 1; specifying fraction of OFF  Train events
+   fWhichFractionTestOFF = 0.5;  // number <= 1; specifying fraction of OFF Test events
+
+
+
+    // use quantities computed from the fits
+    // The variable allows the user to NOT use these quantities when there is not 
+    // enough statistics and fit not always is possible
+    fUseFittedQuantities = kTRUE;
+
+
+
+    // Boolean variable that controls wether the optimization of the 
+    // parameters (MMinuitInterface::CallMinuit(..) in function FindParams(..))
+    // takes place or not. kTRUE will skip such optimization.
+    // This variable is useful to test the optmized parameters (previously found 
+    // and stored in root file) on the TRAIN sample.
+    
+    fSkipOptimization = kFALSE;
+
+    // Boolean variable that allows the user to write the initial parameters 
+    // into the root file that will be used to store the optimum cuts.
+    // If fUseInitialSCParams = kTRUE , parameters are written.
+    // In this way, the initial SC parameters can be applied on the data (train/test) 
+    
+    // The initial parameters are ONLY written to the root file if 
+    // there is NO SC params optimization, i.e., if variable 
+    // fSkipOptimization = kTRUE;
+
+    // The default value is obviously kFALSE.
+
+    fUseInitialSCParams = kTRUE;
+
+
+
+    // fInitSCPar  and fInitSCParSteps initialized to zero
+    
+    fInitSCPar.Set(0);
+
+    fInitSCParSteps.Set(0);
+        
+}
+
+// --------------------------------------------------------------------------
+//
+// Default destructor.
+//
+MFindSupercutsONOFFThetaLoop::~MFindSupercutsONOFFThetaLoop()
+{
+
+    *fLog << "Destructor of MFindSupercutsONOFFThetaLoop is called" 
+	  << endl;
+
+    fPsFilename = NULL;
+
+    delete fNormFactorTrainHist;
+    delete fNormFactorTestHist;
+    delete fSigmaLiMaTrainHist;
+    delete fSigmaLiMaTestHist;
+    delete fNexTrainHist;
+    delete fNexTestHist;
+
+
+    
+    delete fSuccessfulThetaBinsHist;
+    
+
+    delete fNEvtsInTrainMatrixONHist; 
+    delete fNEvtsInTestMatrixONHist; 
+    delete fNEvtsInTrainMatrixOFFHist; 
+    delete fNEvtsInTestMatrixOFFHist; 
+
+    delete [] fTrainMatrixONFilenameVector;
+    delete [] fTestMatrixONFilenameVector;
+    delete [] fTrainMatrixOFFFilenameVector;
+    delete [] fTestMatrixOFFFilenameVector;
+    
+    delete [] fOptSCParamFilenameVector;
+    
+    delete [] fThetaRangeStringVector;
+
+
+    *fLog << "Destructor of MFindSupercutsONOFFThetaLoop finished " 
+	  << "successfully."  
+	  << endl;
+
+}
+
+
+// --------------------------------------------------------------------------
+//
+// Function that sets the name of the PostScript file where alpha distributions 
+// for the different Theta bins will be stored.
+// It also initializes 
+
+
+
+void MFindSupercutsONOFFThetaLoop::SetPostScriptFile (TPostScript* PsFile)
+{
+    fPsFilename = PsFile;
+
+    *fLog << "MFindSupercutsONOFF : Results (alpha distributions with excess and significances) will be stored in PostScript file " 
+	  << fPsFilename -> GetName() << endl;
+
+}
+
+
+Bool_t MFindSupercutsONOFFThetaLoop::SetGammaEfficiency (Double_t gammaeff)
+{
+    if (gammaeff <= 0.0 || gammaeff > 1)
+    {
+	*fLog << " ******   ERROR  *********"  << endl
+ 	      << "MFindSupercutsONOFFThetaLoop :: SetGammaEfficiency; " << endl
+	      << "The requested Gamma efficiency " << gammaeff << " can not occur" << endl
+	      << "Member data fGammaEfficiency can not be set properly." << endl
+	      << "Default value for fGammaEfficiency, which is " 
+	      << fGammaEfficiency << " will remain." << endl;
+
+
+	return kFALSE;
+    }
+
+    fGammaEfficiency = gammaeff;
+
+    return kTRUE;
+
+}
+
+
+Bool_t MFindSupercutsONOFFThetaLoop::ReadSCParamsFromAsciiFile(const char* filename,
+								  Int_t Nparams)
+{
+    const Int_t NColumns = 2; 
+    
+    Double_t tmp_vector[NColumns];
+    Int_t counter = 0;
+    Double_t tmpdouble = 0.0;
+
+    
+    // File is read and data stored in data_vector
+    
+    ifstream infile (filename, ios::in);
+    
+    if ( !infile )
+    {
+	cout << "Input file could not be opened" << endl; 	
+	return kFALSE;
+      //	exit (1);
+    }
+    
+    counter = 0;
+    while (infile >> tmp_vector [0])
+    {
+	for (Int_t i = 1; i < NColumns; i++)
+	{
+	    infile >> tmp_vector[i];
+	}
+	counter++;
+    }
+    
+    infile.close();
+    
+    
+    // Length of TArray vectors is set to the length of the 
+    // vectors defined in ascii file.
+    // If such length does not match with the specified 
+    // by variable Nparams, the function complains and 
+    // aborts.
+    
+    if (counter != Nparams)
+    {
+	*fLog << "MFindSupercutsONOFFThetaLoop::ReadSCParamsFromAsciiFile" << endl
+	      << "Length of vectors in ascii file " << filename << "  is  " << counter 
+	      << " , which does not match with the expected length " << Nparams << endl  
+	      << " fInitSCPar and fInitSCParSteps are NOT retrieved from ascii file" << endl;
+
+	return kFALSE;
+    }
+    
+    fInitSCPar.Set(counter);
+    fInitSCParSteps.Set(counter);
+    
+    
+  // Vectors are filled
+
+  ifstream infile2 (filename, ios::in);
+  
+  if ( !infile2 )
+    {
+      cout << "Input file could not be opened" << endl; 
+      return kFALSE;
+      // exit (1);
+    }
+  
+  for (Int_t i = 0; i < fInitSCPar.GetSize(); i++)
+    {
+
+	infile2 >> tmpdouble;
+	fInitSCPar[i] = tmpdouble;
+	
+	infile2 >> tmpdouble;
+	fInitSCParSteps[i] = tmpdouble;
+	
+    }
+
+
+  // Print the vectors read 
+
+  *fLog << "*****  INITIAL SC PARAMETERS AND STEPS TAKEN FROM ASCII FILE ********* " << endl;
+  for (Int_t i = 0; i < fInitSCPar.GetSize(); i++)
+    {
+	cout << fInitSCPar[i] << setw(20) <<  fInitSCParSteps[i] << endl;
+    }
+
+  // 
+  
+ // File close 
+  infile2.close();
+  
+  return kTRUE;
+}
+
+
+Bool_t MFindSupercutsONOFFThetaLoop::SetInitSCPar (TArrayD &d)
+{
+    *fLog << "MFindSupercutsONOFFThetaLoop; Initial SC parameters are "
+	  << "set using function SetInitSCPar (TArrayD &d)" << endl;
+
+    fInitSCPar = d;
+
+    return kTRUE;
+}
+
+
+Bool_t MFindSupercutsONOFFThetaLoop::SetInitSCParSteps (TArrayD &d)
+{
+
+    *fLog << "MFindSupercutsONOFFThetaLoop; Initial SC parameters STEPS are "
+	  << "set using function SetInitSCParSteps (TArrayD &d)" << endl;
+
+    fInitSCParSteps = d;
+
+    return kTRUE;
+}
+
+
+
+Bool_t MFindSupercutsONOFFThetaLoop::SetAlphaSig(Double_t alphasig)
+{
+    // check that alpha is within the limits 0-90
+    if (alphasig <= 0 || alphasig > 90)
+    {
+	*fLog << "MFindSupercutsONOFFThetaLoop ::SetAlphaSig; " 
+	      << "value " << alphasig << " is not within the the "
+	      << "logical limits of alpha; 0-90" << endl;
+	return kFALSE;
+    }
+    
+
+    fAlphaSig = alphasig;
+
+    return kTRUE;
+}
+
+Bool_t MFindSupercutsONOFFThetaLoop::SetAlphaBkgMin(Double_t alpha)
+{
+    // check that alpha is within the limits 0-90
+    if (alpha <= 0 || alpha >= 90)
+    {
+	*fLog << "MFindSupercutsONOFFThetaLoop::SetAlphaBkgMin; " 
+	      << "value " << alpha << " is not within the the "
+	      << "logical limits of alpha; 0-90" << endl;
+	return kFALSE;
+    }
+    
+
+    fAlphaBkgMin = alpha;
+
+    return kTRUE;
+}
+
+
+Bool_t MFindSupercutsONOFFThetaLoop::SetAlphaBkgMax(Double_t alpha)
+{
+    // check that alpha is within the limits 0-90
+    if (alpha <= 0 || alpha > 90.001)
+    {
+	*fLog << "MFindSupercutsONOFFThetaLoop ::SetAlphaBkgMax; " 
+	      << "value " << alpha << " is not within the the "
+	      << "logical limits of alpha; 0-90" << endl;
+	return kFALSE;
+    }
+    
+
+    fAlphaBkgMax = alpha;
+
+    return kTRUE;
+}
+
+
+// Function that checks that the values of the member data 
+// fAlphaSig, fAlphaBkgMin and fAlphaBkgMax make sense
+// (ie, fAlphaSig < fAlphaBkgMin < fAlphaBkgMax)
+
+Bool_t MFindSupercutsONOFFThetaLoop::CheckAlphaSigBkg()
+{
+
+    if (fAlphaSig > fAlphaBkgMin)
+    {
+	*fLog << "MFindSupercutsONOFFThetaLoop ::CheckAlphaSigBkg(); " << endl
+	      << "fAlphaSig > fAlphaBkgMin, which should not occur..." << endl
+	      << "fAlphaSig = " << fAlphaSig << ", fAlphaBkgMin = " << fAlphaBkgMin
+	      << endl;
+
+	return kFALSE;
+    }
+    
+    if (fAlphaBkgMax < fAlphaBkgMin)
+    {
+	*fLog << "MFindSupercutsONOFFThetaLoop::CheckAlphaSigBkg(); " << endl
+	      << "fAlphaBkgMin > fAlphaBkgMax, which should not occur..." << endl
+	      << "fAlphaBkgMin = " << fAlphaBkgMin << ", fAlphaBkgMax = " << fAlphaBkgMax
+	      << endl;
+
+	return kFALSE;
+    }
+
+    return kTRUE;
+
+}
+
+
+
+
+// Function that sets the value of fCosThetaRangeVector and 
+// fCosThetaBinCenterVector
+
+Bool_t MFindSupercutsONOFFThetaLoop::SetCosThetaRangeVector(
+    const TArrayD &d)
+{
+    if (d.GetSize() < 2)
+    {
+        *fLog << err 
+	      << "MFindSupercutsONOFFThetaLoop::SetCosThetaRangeVector: " 
+	      << endl
+	      << "Size of d is smaller than 2... "
+	      << "fCosThetaRangeVector can not be defined properly"
+	      << endl;
+        return kFALSE;
+    }
+
+    fCosThetaRangeVector.Set(d.GetSize());
+    fCosThetaRangeVector = d;
+
+
+    // Give a "soft warning" if Vector has increasing values 
+    // of CosThetas; which means decreasing values of Thetas
+    /*
+    if (fCosThetaRangeVector[0] <= fCosThetaRangeVector[1])
+    {
+	*fLog << "MFindSupercutsONOFFThetaLoop::SetCosThetaRangeVector; " 
+	      << endl
+	      << "Values in vector fCosThetaRangeVector are in increasing "
+	      << "order, i.e., values in theta will be in decreasing order"
+	      << endl
+	      << "DO NOT forget it !!" << endl;
+    }
+
+    */
+
+    // fCosThetaBinCenterVector is defined
+
+    Int_t dim = fCosThetaRangeVector.GetSize() - 1;
+    fCosThetaBinCenterVector.Set(dim);
+
+    for (Int_t i = 0; i < dim; i++)
+    {
+	fCosThetaBinCenterVector[i] = 
+	    (fCosThetaRangeVector[i+1]+fCosThetaRangeVector[i])/2;
+    }
+
+    return kTRUE;
+}
+
+// Function that sets the range of Theta (fThetaMin, fThetaMax) 
+// where data will be used in the iteration 
+// thetabin. This theta range is used when geting data from 
+// file and filling matrices. If matrices are already built 
+// and just read from root files, this theta range is useless. 
+
+
+// **** IMPORTANT *********
+// thetabin is an integer  value that goes from 1 to 
+// fCosThetaBinCenterVector.GetSize()
+// ************************
+
+Bool_t MFindSupercutsONOFFThetaLoop::SetThetaRange (Int_t thetabin)
+{
+    // Check that iteration thetabin is smaller than 
+    // components of fCosThetaBinCenterVector
+   
+    if (fCosThetaRangeVector.GetSize() < 2 ||
+	fCosThetaBinCenterVector.GetSize() < 1)
+	
+    {
+	*fLog << "MFindSupercutsONOFFThetaLoop::SetThetaRange; " << endl
+	      << "Dimension of vectors fCosThetaRangeVector or/and " 
+	      << "fCosThetaBinCenterVector are smaller than 2 and 1 " 
+	      << "respectively. Range for theta can not be defined." << endl;
+	
+	return kFALSE;
+    }
+    
+    if (thetabin < 1 || 
+	thetabin > fCosThetaBinCenterVector.GetSize())
+    {
+	*fLog << "MFindSupercutsONOFFThetaLoop::SetThetaRange; " << endl
+	      << "thetabin value is " << thetabin 
+	      << " Is is outside the possible values given by " 
+	      << "vector fCosThetaRangeVector. "
+	      << "Range for theta can not be defined." << endl;
+	
+	return kFALSE;
+    }
+    
+    
+    fThetaMin = fCosThetaRangeVector[thetabin-1];
+    fThetaMax = fCosThetaRangeVector[thetabin];
+    
+
+    // Now costheta values have to be converted to Radians
+    // Function TMath::ACos(x) gives angle in Radians
+
+    
+    fThetaMin = TMath::ACos(fThetaMin);
+    fThetaMax = TMath::ACos(fThetaMax);
+
+    // If fThetaMin > fThetaMax means that fCosThetaRangeVector
+    // is defined with increasing values of CosTheta, which 
+    // means decreasing values of Theta
+
+    // In such case, values of fThetaMin and fThetaMax are swapped
+
+    if (fThetaMin > fThetaMax)
+    {
+	Double_t tmp = fThetaMin;
+	fThetaMin = fThetaMax;
+	fThetaMax = tmp;
+    }
+
+    // Info for user
+    *fLog << "-------------------------------------------------"<< endl
+	  << "MFindSupercutsONOFFThetaLoop::SetThetaRange; " << endl
+	  << "Theta range for this iteration is set to "
+	  << fThetaMin << "-" << fThetaMax << " Radians." << endl 
+	  << "-------------------------------------------------"<< endl;
+    
+    return kTRUE;
+
+
+}
+
+
+Bool_t MFindSupercutsONOFFThetaLoop::SetNormFactorTrainHist()
+{
+    if (fCosThetaRangeVector.GetSize() <= 1)
+    {
+        *fLog << err << "MFindSupercutsONOFFThetaLoop::SetNormFactorTrainHist: " 
+	      << endl
+	      << "Size of fCosThetaRangeVector is <=1 ... fCosThetaRangeVector must exist and have, at least, 2 components defining a single bin"
+	      << endl;
+        return kFALSE;
+    }
+
+    
+    Int_t HistoNbins = fCosThetaRangeVector.GetSize() - 1;
+    Double_t* BinsVector = fCosThetaRangeVector.GetArray();
+
+    fNormFactorTrainHist = new TH1F ("NormFactorTrainHist",
+				     "NormFactorTrainHist",
+				     HistoNbins,BinsVector );
+
+    return kTRUE;
+
+}
+
+
+Bool_t MFindSupercutsONOFFThetaLoop::SetNormFactorTestHist()
+{
+    if (fCosThetaRangeVector.GetSize() <= 1)
+    {
+        *fLog << err << "MFindSupercutsONOFFThetaLoop::SetNormFactorTestHist: " 
+	      << endl
+	      << "Size of fCosThetaRangeVector is <=1 ... fCosThetaRangeVector must exist and have, at least, 2 components defining a single bin"
+	      << endl;
+        return kFALSE;
+    }
+
+
+    Int_t HistoNbins = fCosThetaRangeVector.GetSize() - 1;
+    Double_t* BinsVector = fCosThetaRangeVector.GetArray();
+
+    fNormFactorTestHist = new TH1F ("NormFactorTestHist",
+				     "NormFactorTestHist",
+				     HistoNbins, BinsVector);
+
+    return kTRUE;
+}
+
+
+Bool_t MFindSupercutsONOFFThetaLoop::SetSigmaLiMaTrainHist()
+{
+    if (fCosThetaRangeVector.GetSize() <= 1)
+    {
+        *fLog << err << "MFindSupercutsONOFFThetaLoop::SetSigmaLiMaTrainHist: " 
+	      << endl
+	      << "Size of fCosThetaRangeVector is <=1 ... fCosThetaRangeVector must exist and have, at least, 2 components defining a single bin"
+	      << endl;
+        return kFALSE;
+    }
+
+
+    // At some point, definition of bins should be able to 
+    // contain variable bins...
+
+    Int_t HistoNbins = fCosThetaRangeVector.GetSize() - 1;
+    
+    Double_t* BinsVector = fCosThetaRangeVector.GetArray();
+
+    fSigmaLiMaTrainHist = new TH1F ("SigmaLiMaTrainHist",
+				     "SigmaLiMaTrainHist",
+				     HistoNbins, BinsVector);
+
+    return kTRUE;
+}
+
+
+
+Bool_t MFindSupercutsONOFFThetaLoop::SetSigmaLiMaTestHist()
+{
+    if (fCosThetaRangeVector.GetSize() <= 1)
+    {
+        *fLog << err << "MFindSupercutsONOFFThetaLoop::SetSigmaLiMaTestHist: " 
+	      << endl
+	      << "Size of fCosThetaRangeVector is <=1 ... fCosThetaRangeVector must exist and have, at least, 2 components defining a single bin"
+	      << endl;
+        return kFALSE;
+    }
+
+
+   
+    Int_t HistoNbins = fCosThetaRangeVector.GetSize() - 1;
+    
+    Double_t* BinsVector = fCosThetaRangeVector.GetArray();
+    fSigmaLiMaTestHist = new TH1F ("SigmaLiMaTestHist",
+				     "SigmaLiMaTestHist",
+				     HistoNbins, BinsVector);
+
+    return kTRUE;
+
+}
+
+
+Bool_t MFindSupercutsONOFFThetaLoop::SetNexTrainHist()
+{
+    if (fCosThetaRangeVector.GetSize() <= 1)
+    {
+        *fLog << err << "MFindSupercutsONOFFThetaLoop::SetNexTrainHist: " 
+	      << endl
+	      << "Size of fCosThetaRangeVector is <=1 ... fCosThetaRangeVector must exist and have, at least, 2 components defining a single bin"
+	      << endl;
+        return kFALSE;
+    }
+
+
+    Int_t HistoNbins = fCosThetaRangeVector.GetSize() - 1;
+    
+    Double_t* BinsVector = fCosThetaRangeVector.GetArray();
+
+    fNexTrainHist = new TH1F ("NexTrainHist",
+			      "NexTrainHist",
+			      HistoNbins, BinsVector);
+
+    return kTRUE;
+
+}
+
+
+Bool_t MFindSupercutsONOFFThetaLoop::SetNexTestHist()
+{
+    if (fCosThetaRangeVector.GetSize() <= 1)
+    {
+        *fLog << err << "MFindSupercutsONOFFThetaLoop::SetNexTestHist: " 
+	      << endl
+	      << "Size of fCosThetaRangeVector is <=1 ... fCosThetaRangeVector must exist and have, at least, 2 components defining a single bin"
+	      << endl;
+        return kFALSE;
+    }
+
+
+    Int_t HistoNbins = fCosThetaRangeVector.GetSize() - 1;
+    Double_t* BinsVector = fCosThetaRangeVector.GetArray();
+
+    fNexTestHist = new TH1F ("NexTestHist",
+			     "NexTestHist",
+			     HistoNbins, BinsVector);
+
+    return kTRUE;
+
+}
+
+Bool_t MFindSupercutsONOFFThetaLoop::SetSuccessfulThetaBinsHist()
+{
+    if (fCosThetaRangeVector.GetSize() <= 1)
+    {
+        *fLog << err << "MFindSupercutsONOFFThetaLoop::SetSuccessfulThetaBinsHist(): " 
+	      << endl
+	      << "Size of fCosThetaRangeVector is <=1 ... "
+	      << "fCosThetaRangeVector must exist and have >= 2 components (defining a single bin)"
+	      << endl;
+        return kFALSE;
+    }
+
+
+    Int_t HistoNbins = fCosThetaRangeVector.GetSize() - 1;
+    Double_t* BinsVector = fCosThetaRangeVector.GetArray();
+
+    fSuccessfulThetaBinsHist = new TH1F ("SuccessfulThetaBinsHist",
+					 "SuccessfulThetaBinsHist",
+					 HistoNbins, BinsVector);
+
+    return kTRUE;
+
+}
+
+
+
+
+Bool_t MFindSupercutsONOFFThetaLoop::SetNexSigmaLiMaNormFactorNEvtsTrainTestHist()
+{
+    if (fCosThetaRangeVector.GetSize() <= 1)
+    {
+        *fLog << err 
+	      << "MFindSupercutsONOFFThetaLoop::SetNexSigmaLiMaNormFactorTrainTestHist: " 
+	      << endl
+	      << "Size of fCosThetaRangeVector is <=1 ... " 
+	      << "fCosThetaRangeVector must exist and have, at least, "
+	      << "2 components defining a single bin"
+	      << endl;
+        return kFALSE;
+    }
+
+
+    Int_t HistoNbins = fCosThetaRangeVector.GetSize() - 1;
+    
+    Double_t* BinsVector = fCosThetaRangeVector.GetArray();
+
+    char* x_axis_title = {"Cos(Theta)"};
+
+    fNormFactorTrainHist = new TH1F ("NormFactorTrainHist",
+				     "NormFactorTrainHist",
+				     HistoNbins, BinsVector);
+
+    
+    fNormFactorTrainHist -> SetXTitle(x_axis_title);
+    fNormFactorTrainHist -> SetYTitle("Normalization Factor (Non/Noff)");
+    
+
+    fNormFactorTestHist = new TH1F ("NormFactorTestHist",
+				     "NormFactorTestHist",
+				     HistoNbins, BinsVector);
+
+    fNormFactorTestHist -> SetXTitle(x_axis_title);
+    fNormFactorTestHist -> SetYTitle("Normalization Factor (Non/Noff)");
+
+    fSigmaLiMaTrainHist = new TH1F ("SigmaLiMaTrainHist",
+				     "SigmaLiMaTrainHist",
+				     HistoNbins, BinsVector);
+
+    fSigmaLiMaTrainHist -> SetXTitle(x_axis_title);
+    fSigmaLiMaTrainHist -> SetYTitle("Significance");
+
+
+    fSigmaLiMaTestHist = new TH1F ("SigmaLiMaTestHist",
+				   "SigmaLiMaTestHist",
+				   HistoNbins, BinsVector);
+
+    fSigmaLiMaTestHist -> SetXTitle(x_axis_title);
+    fSigmaLiMaTestHist -> SetYTitle("Significance");
+
+
+
+    fNexTrainHist = new TH1F ("NexTrainHist",
+			      "NexTrainHist",
+			      HistoNbins, BinsVector);
+
+    fNexTrainHist -> SetXTitle(x_axis_title);
+    fNexTrainHist -> SetYTitle("Excess Events");
+
+
+    fNexTestHist = new TH1F ("NexTestHist",
+			     "NexTestHist",
+			     HistoNbins, BinsVector);
+
+    fNexTestHist -> SetXTitle(x_axis_title);
+    fNexTestHist -> SetYTitle("Excess Events");
+
+
+
+    fNEvtsInTrainMatrixONHist = new TH1F("NEvtsInTrainMatrixONHist",
+					 "NEvtsInTrainMatrixONHist", 
+					 HistoNbins, BinsVector);
+
+
+    fNEvtsInTrainMatrixONHist -> SetXTitle(x_axis_title);
+    fNEvtsInTrainMatrixONHist -> SetYTitle("Number of ON Events");
+    
+
+    fNEvtsInTestMatrixONHist = new TH1F("NEvtsInTestMatrixONHist",
+					 "NEvtsInTestMatrixONHist", 
+					 HistoNbins, BinsVector);
+
+    fNEvtsInTestMatrixONHist -> SetXTitle(x_axis_title);
+    fNEvtsInTestMatrixONHist -> SetYTitle("Number of ON Events");
+    
+
+    fNEvtsInTrainMatrixOFFHist = new TH1F("NEvtsInTrainMatrixOFFHist",
+					  "NEvtsInTrainMatrixOFFHist", 
+					  HistoNbins, BinsVector);
+
+    fNEvtsInTrainMatrixOFFHist -> SetXTitle(x_axis_title);
+    fNEvtsInTrainMatrixOFFHist -> SetYTitle("Number of OFF Events");
+
+
+    fNEvtsInTestMatrixOFFHist = new TH1F("NEvtsInTestMatrixOFFHist",
+					 "NEvtsInTestMatrixOFFHist", 
+					 HistoNbins, BinsVector);
+
+    fNEvtsInTestMatrixOFFHist -> SetXTitle(x_axis_title);
+    fNEvtsInTestMatrixOFFHist -> SetYTitle("Number of OFF Events");
+    
+
+    // Histograms references are removed from the current directory
+
+    /* IT DOES NOT WORK !!! THESE STATEMENTS PRODUCE SEGMENTATION FAULT.
+    fNormFactorTrainHist -> SetDirectory(NULL);
+    
+    fNormFactorTestHist -> SetDirectory(NULL);
+    
+    fSigmaLiMaTrainHist -> SetDirectory(NULL);
+    
+    fSigmaLiMaTestHist -> SetDirectory(NULL);
+    
+    fSigmaLiMaTestHist -> SetDirectory(NULL);
+    
+    fNexTestHist -> SetDirectory(NULL);
+    */
+
+
+    return kTRUE;
+
+}
+
+void MFindSupercutsONOFFThetaLoop::WriteSuccessfulThetaBinsHistToFile()
+{
+    *fLog << "MFindSupercutsONOFFThetaLoop : Writing histogram "
+	  << " 'SuccessfulThetaBinsHist'"
+	  << " (if contents != 0) into root file " 
+	  << fAlphaDistributionsRootFilename << endl;
+
+    TFile rootfile(fAlphaDistributionsRootFilename, "UPDATE",
+		   "Alpha Distributions for several Theta bins");
+
+
+    if (fSuccessfulThetaBinsHist)
+    {
+	if (fSuccessfulThetaBinsHist->GetEntries() > 0.5)
+	    fSuccessfulThetaBinsHist -> Write();
+    }
+
+
+    rootfile.Close();
+
+}
+
+void MFindSupercutsONOFFThetaLoop::WriteNexSigmaLiMaNormFactorNEvtsTrainTestHistToFile()
+{
+
+    *fLog << "MFindSupercutsONOFFThetaLoop : Writing histograms 'NexSigmaLiMaNormFactorNEvtsTrainTest'"
+	  << " (if they have contents != 0) into root file " 
+	  << fAlphaDistributionsRootFilename << endl;
+
+    TFile rootfile(fAlphaDistributionsRootFilename, "UPDATE",
+		   "Alpha Distributions for several Theta bins");
+
+
+    if (fNormFactorTrainHist)
+    {
+	if (fNormFactorTrainHist->GetEntries() > 0.5)
+	    fNormFactorTrainHist -> Write();
+    }
+
+    if (fNormFactorTestHist)
+    {
+	if (fNormFactorTestHist->GetEntries() > 0.5)
+	    fNormFactorTestHist -> Write();
+    }
+
+    if (fSigmaLiMaTrainHist)
+    {
+	if (fSigmaLiMaTrainHist->GetEntries() > 0.5)
+	    fSigmaLiMaTrainHist -> Write();
+    }
+
+    if (fSigmaLiMaTestHist)
+    {
+	if (fSigmaLiMaTestHist->GetEntries() > 0.5)
+	    fSigmaLiMaTestHist -> Write();
+    }
+
+    if (fNexTrainHist)
+    {
+	if (fNexTrainHist->GetEntries() > 0.5)
+	    fNexTrainHist -> Write();
+    }
+
+    if (fNexTestHist)
+    {
+	if (fNexTestHist->GetEntries() > 0.5)
+	    fNexTestHist -> Write();
+    }
+   
+
+    if (fNEvtsInTrainMatrixONHist)
+    {
+	if (fNEvtsInTrainMatrixONHist->GetEntries() > 0.5)
+	    fNEvtsInTrainMatrixONHist -> Write();
+    }
+
+    if (fNEvtsInTestMatrixONHist)
+    {
+	if (fNEvtsInTestMatrixONHist->GetEntries() > 0.5)
+	    fNEvtsInTestMatrixONHist -> Write();
+    }
+    
+    if (fNEvtsInTrainMatrixOFFHist)
+    {
+	if (fNEvtsInTrainMatrixOFFHist->GetEntries() > 0.5)
+	    fNEvtsInTrainMatrixOFFHist -> Write();
+    }
+
+
+    if (fNEvtsInTestMatrixOFFHist)
+    {
+	if (fNEvtsInTestMatrixOFFHist->GetEntries() > 0.5)
+	    fNEvtsInTestMatrixOFFHist -> Write();
+    }
+
+
+    rootfile.Close();
+
+}
+
+void  MFindSupercutsONOFFThetaLoop::SetFractionTrainTestOnOffEvents(
+    Double_t fontrain, 
+    Double_t fontest, 
+    Double_t fofftrain,
+    Double_t fofftest)
+{
+
+    fWhichFractionTrain = fontrain;
+    fWhichFractionTest = fontest;
+    fWhichFractionTrainOFF = fofftrain;
+    fWhichFractionTestOFF = fofftest;
+
+
+}
+
+void MFindSupercutsONOFFThetaLoop::SetReadMatricesFromFile (Bool_t b)
+{
+
+    *fLog << "---------------------------------------------------" << endl
+	  << "MFindSupercutsONOFFThetaLoop: " << endl;
+
+    if (b)
+    {	*fLog  << "Matrices are read from root files." << endl;}
+    else
+    {   *fLog  << "Matrices are produced and stored into root files." 
+	       << endl;
+    }
+
+
+    fReadMatricesFromFile = b;
+}
+
+Bool_t MFindSupercutsONOFFThetaLoop::SetAlphaDistributionsRootFilename(
+    const TString &name)
+{
+
+    if (fPathForFiles.IsNull())
+    {
+	*fLog << err 
+	      << "MFindSupercutsONOFFThetaLoop::SetAlphaDistributionsRootFilename; " 
+	      << endl
+	      << "fPathForFiles is not defined yet, hence "
+	      << "name for rootfile containing alpha distributions " 
+	      << "can not be defined properly" << endl;
+
+	return kFALSE;
+    }
+
+    
+    fAlphaDistributionsRootFilename = (fPathForFiles);
+    fAlphaDistributionsRootFilename += (name);
+
+
+    *fLog << "MFindSupercutsONOFFThetaLoop: fAlphaDistributionsRootFilename = "
+	  << fAlphaDistributionsRootFilename << endl;
+
+
+    return kTRUE;
+
+
+}
+
+// Function to set Names of root files containing matrices and  
+// optimizedparameters and also fThetaRangeStringVector vector
+
+Bool_t MFindSupercutsONOFFThetaLoop::SetALLNames()
+{
+    // Names for files only possible if CosThetaRangeVector 
+    // is defined properly
+    if (fCosThetaRangeVector.GetSize() < 2)
+    {
+        *fLog << err 
+	      << "MFindSupercutsONOFFThetaLoop::SetALLNames; " 
+	      << endl
+	      << "Size of fCosThetaRangeVector is smaller than 2... "
+	      << "fCosThetaRangeVector is not defined properly, "
+	      << "and thus, names for rootfiles containing data matrices "
+	      << "and optimized parameters for the different theta "
+	      << "ranges can not defined properly." << endl;
+ 
+        return kFALSE;
+    }
+
+    if (fPathForFiles.IsNull())
+    {
+	*fLog << err 
+	      << "MFindSupercutsONOFFThetaLoop::Setnames; " 
+	      << endl
+	      << "fPathForFiles is not defined yet, hence "
+	      << "names for rootfiles containing data matrices "
+	      << "and optimized parameters for the different theta "
+	      << "ranges can not defined properly." << endl;
+
+	return kFALSE;
+    }
+
+
+     // Name of rootfiles for Supercuts parameters follow the 
+    // follwing structure
+
+    // Path + "OptSCParametersONOFF" + "ThetaRange" 
+    // + int {(fThetaMin_fThetaMax)*1000} + ".root"
+
+
+    // Name of rootfiles for Matrices follow the follwing structure
+
+    // Path + "ON(OFF)Data" + "Train(Test)" + "Matrix" + Fraction 
+    // + "ThetaRange" + int {(fThetaMin_fThetaMax)*1000} + ".root"
+
+
+    Int_t tmpdim = fCosThetaRangeVector.GetSize() - 1;
+    const Int_t VectorDimension = tmpdim;
+
+    fThetaRangeStringVector = new TString[VectorDimension];
+
+    fOptSCParamFilenameVector = new TString[VectorDimension];
+
+    fTrainMatrixONFilenameVector = new TString[VectorDimension];
+    fTestMatrixONFilenameVector = new TString[VectorDimension];
+    fTrainMatrixOFFFilenameVector = new TString[VectorDimension];
+    fTestMatrixOFFFilenameVector = new TString[VectorDimension];
+
+
+    Int_t ThetaMinTimes1000 = 0;
+    Int_t ThetaMaxTimes1000 = 0;
+    Int_t FractionONTrainTimes100 = 0;
+    Int_t FractionONTestTimes100 = 0;
+    Int_t FractionOFFTrainTimes100 = 0;
+    Int_t FractionOFFTestTimes100 = 0;
+
+    char ThetaRangeString[100];
+
+    for (Int_t i = 0; i < VectorDimension; i++)
+    {
+	if (!SetThetaRange(i+1))
+	{
+	    *fLog << "MFindSupercutsONOFFThetaLoop::SetALLNames; " 
+		  << endl
+		  << "Values for fThetaMin and fThetaMax could NOT "
+		  << "be computed for theta bin " 
+		  << (i+1) << "; SetNames can not go on successfully."
+		  << endl;
+
+	    return kFALSE;
+	}
+	
+	
+	ThetaMinTimes1000 = int(fThetaMin*1000);
+	ThetaMaxTimes1000 = int(fThetaMax*1000);
+	sprintf(ThetaRangeString, "ThetaRange%d_%dmRad", 
+		ThetaMinTimes1000, ThetaMaxTimes1000);
+
+	fThetaRangeStringVector[i] = (ThetaRangeString);
+	
+	// tmp
+	*fLog << "ThetaRangeString = " << fThetaRangeStringVector[i] << endl;
+	// endtmp
+
+	Double_t tmpdouble = 0.0;
+	tmpdouble = fWhichFractionTrain*100 - int(fWhichFractionTrain*100); 
+	
+	FractionONTrainTimes100 = tmpdouble < 0.5 ? int(fWhichFractionTrain*100):
+	    int(fWhichFractionTrain*100) + 1;
+	
+
+	tmpdouble = fWhichFractionTest*100 - int(fWhichFractionTest*100);
+
+	FractionONTestTimes100 = tmpdouble < 0.5 ? int(fWhichFractionTest*100):
+	    int(fWhichFractionTest*100) + 1;
+	
+	tmpdouble = fWhichFractionTrainOFF*100 - int(fWhichFractionTrainOFF*100);
+
+	FractionOFFTrainTimes100 = tmpdouble < 0.5 ? int(fWhichFractionTrainOFF*100):
+	    int(fWhichFractionTrainOFF*100) + 1;
+
+	tmpdouble = fWhichFractionTestOFF*100 - int(fWhichFractionTestOFF*100);
+	FractionOFFTestTimes100 = tmpdouble < 0.5 ? int(fWhichFractionTestOFF*100):
+	    int(fWhichFractionTestOFF*100) + 1;
+	
+	
+
+	// File for SC parameters 
+	fOptSCParamFilenameVector[i] = (fPathForFiles);
+	fOptSCParamFilenameVector[i] += ("OptSCParametersONOFF");
+	fOptSCParamFilenameVector[i] += (fThetaRangeStringVector[i]);
+	fOptSCParamFilenameVector[i] += (".root");
+	
+	
+	
+	// File for Data Matrices
+
+	fTrainMatrixONFilenameVector[i] = (fPathForFiles);
+	fTrainMatrixONFilenameVector[i] += ("ONDataTrainMatrixFraction");
+	fTrainMatrixONFilenameVector[i] += (FractionONTrainTimes100);
+	fTrainMatrixONFilenameVector[i] += (fThetaRangeStringVector[i]);
+	fTrainMatrixONFilenameVector[i] += (".root");
+
+	fTestMatrixONFilenameVector[i] = (fPathForFiles);
+	fTestMatrixONFilenameVector[i] += ("ONDataTestMatrixFraction");
+	fTestMatrixONFilenameVector[i] += (FractionONTestTimes100);
+	fTestMatrixONFilenameVector[i] += (fThetaRangeStringVector[i]);
+	fTestMatrixONFilenameVector[i] += (".root");
+
+
+	fTrainMatrixOFFFilenameVector[i] = (fPathForFiles);
+	fTrainMatrixOFFFilenameVector[i] += ("OFFDataTrainMatrixFraction");
+	fTrainMatrixOFFFilenameVector[i] += (FractionOFFTrainTimes100);
+	fTrainMatrixOFFFilenameVector[i] += (fThetaRangeStringVector[i]);
+	fTrainMatrixOFFFilenameVector[i] += (".root");
+
+	fTestMatrixOFFFilenameVector[i] = (fPathForFiles);
+	fTestMatrixOFFFilenameVector[i] += ("OFFDataTestMatrixFraction");
+	fTestMatrixOFFFilenameVector[i] += (FractionOFFTestTimes100);
+	fTestMatrixOFFFilenameVector[i] += (fThetaRangeStringVector[i]);
+	fTestMatrixOFFFilenameVector[i] += (".root");
+
+    }
+    // Info concerning names is printed
+    
+    *fLog << "--------------------------------------------------" << endl
+	  << "MFindSupercutsONOFFThetaLoop::Setnames; " 
+	  << endl
+	  << "Names for root files containing Opt SC Param. and Data "
+	  << "matrices for the different theta bins are the "
+	  << "following ones: " << endl
+	  << "MeanCosTheta, OptSCParm, ONDataTrainMatrix, ..." << endl;
+    
+    for (Int_t i = 0; i < VectorDimension; i++)
+    {
+	*fLog << fCosThetaBinCenterVector[i] << ",  " << endl
+	      << fOptSCParamFilenameVector[i] << ",  "<< endl
+	      << fTrainMatrixONFilenameVector[i] << ",  " << endl
+	      << fTestMatrixONFilenameVector[i] << ",  " << endl
+	      << fTrainMatrixOFFFilenameVector[i] << ",  " << endl
+	      << fTestMatrixOFFFilenameVector[i] << ",  " << endl
+	      << endl << endl;
+    }
+    
+    *fLog << "--------------------------------------------------" << endl;
+    
+    return kTRUE;
+    
+}
+
+
+
+Bool_t MFindSupercutsONOFFThetaLoop::LoopOverThetaRanges()
+{
+
+
+    *fLog << "--------------------------------------------------------------" << endl
+	  << "MFindSupercutsONOFFThetaLoop::LoopOverThetaRanges function starts " 
+	  << endl;
+	  
+
+
+    if (fDataONRootFilename.IsNull())
+    {
+      *fLog << "MFindSupercutsONOFF::LoopOverThetaRanges; root file for ON data is not defined... " 
+	    << "aborting..."
+            << endl;
+      return kFALSE;
+    }
+
+
+    if (fDataOFFRootFilename.IsNull())
+    {
+      *fLog << "MFindSupercutsONOFF:: LoopOverThetaRanges; root file for OFF data is not defined... aborting"
+            << endl;
+      return kFALSE;
+    }
+
+    
+    if (fHadronnessName.IsNull())
+    {
+      *fLog << "MFindSupercutsONOFF::LoopOverThetaRanges; hadronness name for ON data is not defined... aborting"
+            << endl;
+      return kFALSE;
+    }
+
+
+    if (fHadronnessNameOFF.IsNull())
+    {
+      *fLog << "MFindSupercutsONOFF::LoopOverThetaRanges; hadronness name for OFF data is not defined... aborting"
+            << endl;
+      return kFALSE;
+    }
+
+
+    if (fCosThetaRangeVector.GetSize() < 2)
+	
+    {
+	*fLog << "MFindSupercutsONOFFThetaLoop::LoopOverThetaRanges; " << endl
+	      << "Dimension of vector fCosThetaRangeVector " 
+	      << "is smaller than 2" 
+	      << "Theta ranges are not well defined... aborting ..." << endl;
+	
+	return kFALSE;
+    }
+
+
+    // Check if pointers to root file names (opt SC parameters and matrices) 
+    // are empty
+
+
+    if (!fTrainMatrixONFilenameVector || 
+	!fTestMatrixONFilenameVector ||
+	!fTrainMatrixOFFFilenameVector ||
+	!fTestMatrixOFFFilenameVector ||
+	!fOptSCParamFilenameVector)
+    {
+	*fLog << "MFindSupercutsONOFFThetaLoop::LoopOverThetaRanges; " << endl
+	      << "Pointers to root files names for Opt SC parameters and data "
+	      << "matrices are not well defined. Aborting... " << endl;
+
+	return kFALSE;
+    }
+
+
+    if (fAlphaDistributionsRootFilename.IsNull())
+    {
+	*fLog << "MFindSupercutsONOFFThetaLoop::LoopOverThetaRanges; " << endl
+	      << "Root filename where to store alpha distributions "
+	      << "(fAlphaDistributionsRootFilename) is not defined." << endl
+	      << "Loop over theta angles can not go on..." << endl;
+
+	return kTRUE;
+    }
+
+
+    
+	
+    if (!fPsFilename)
+    {
+	*fLog << "MFindSupercutsONOFFThetaLoop::LoopOverThetaRanges; " << endl
+	      << "Object from Class TPostScript is not defined. "
+	      << "Plots will be stored in a a file named 'PsFilesTmp.ps' located "
+	      << "in current directory" << endl;
+
+	// fPsFilename = new TPostScript("PsFilesTmp.ps" ,111);
+
+
+    }
+
+
+    
+
+
+
+    // All drinks are in house... the party starts !!
+
+    Int_t ThetaLoopIterations = fCosThetaRangeVector.GetSize() - 1;
+                                
+    *fLog << "looping over the following Cos Theta Angle Ranges : "<< endl;
+    for (Int_t i = 0; i < ThetaLoopIterations; i++)
+    {
+	*fLog << i+1 << " -> " 
+	      << fCosThetaRangeVector[i] << "-" << fCosThetaRangeVector[i+1] 
+	      << endl;
+    }
+	  
+    *fLog << "--------------------------------------------------------------------" 
+	  << endl;
+
+
+
+    // Let's create histograms where SigmaLiMa, Nex and Normfactors will be stored
+
+    if (!SetNexSigmaLiMaNormFactorNEvtsTrainTestHist())
+    {
+	*fLog << "MFindSupercutsONOFFThetaLoop::LoopOverThetaRanges; " << endl
+	      << "Histograms where to store Significances, Nex and Normalization "
+	      << "factors, NEvts for all theta bins could not be created... Aborting."
+	      << endl;
+
+	return kFALSE;
+    }
+
+
+    // Let's create histogram where successfully optimized theta bins will be stored
+
+    if (!SetSuccessfulThetaBinsHist())
+    {
+	*fLog << "MFindSupercutsONOFFThetaLoop::LoopOverThetaRanges; " << endl
+	      << "Histogram where to store successfully optimized theta bins "
+	      << " could not be created... Aborting."
+	      << endl;
+
+	return kFALSE;
+    }
+
+
+    
+
+
+    Double_t NormFactor = 0.0;
+    Double_t Nex = 0.0;
+    Double_t SigmaLiMa = 0.0;
+    Int_t NEvtsON = 0;
+    Int_t NEvtsOFF = 0;
+    
+    Bool_t MinimizationSuccessful = kTRUE;
+    Double_t MinimizationValue = 1.0; // Value quantifying the minimization, and stored in 
+    // histogram fSuccessfulThetaBinsHist. For the time being it is 0.0 (minimization failed). 
+    // and 1.0 (minimization succeeded). Yet in future it may take other values quantifying 
+    // other aspects...
+
+
+    for (Int_t i = 0; i < ThetaLoopIterations; i++)
+    {
+
+	// Get the Theta range that will be used in this iteration
+	// Remember that argument of the function is iteration number, 
+	// and it starts at 1...
+
+	if (!SetThetaRange(i+1))
+	{
+	    *fLog << "MFindSupercutsONOFFThetaLoop::LoopOverThetaRanges; " 
+		  << endl
+		  << "Values for fThetaMin and fThetaMax could NOT "
+		  << "be computed for theta bin " 
+		  << (i+1) << ";  LoopOverThetaRanges is aborting."
+		  << endl;
+
+	    return kFALSE;
+	}
+	
+
+
+	// Object of class MFindSupercutsONOFF will be created and used 
+
+
+	MFindSupercutsONOFF FindSupercuts("MFindSupercutsONOFF", 
+					     "Optimizer for the supercuts");
+
+	
+	// Set Theta range that will be used
+	FindSupercuts.SetThetaRange(fThetaMin, fThetaMax);
+
+
+	// Alphamax where signal is expected is set
+	FindSupercuts.SetAlphaSig(fAlphaSig);
+
+	// Bkg alpha region is set 
+	FindSupercuts.SetAlphaBkgMin(fAlphaBkgMin);
+	FindSupercuts.SetAlphaBkgMax(fAlphaBkgMax);
+
+	// alpha bkg and signal region set in object FindSupercuts
+	// are re-checked in order to be sure that make sense
+	
+	FindSupercuts.CheckAlphaSigBkg();
+
+
+	// bining for alpha plots is set 
+	
+	FindSupercuts.SetAlphaPlotBinining(fNAlphaBins, fAlphaBinLow, fAlphaBinUp);
+
+
+
+	
+	// Bool variable NormFactorFromAlphaBkg is set in FindSupercuts
+	// in order to decide the way in which mormalization factors
+	// for TRAIN and TEST samples are computed
+
+
+	FindSupercuts.SetNormFactorFromAlphaBkg(fNormFactorFromAlphaBkg);
+
+
+	// Define size range of events used to fill the data matrices
+
+	FindSupercuts.SetSizeRange(fSizeCutLow, fSizeCutUp);
+
+
+
+	
+	// Boolean variable that controls wether the optimization of the 
+	// parameters (MMinuitInterface::CallMinuit(..) in function FindParams(..))
+	// takes place or not. kTRUE will skip such optimization.
+	// This variable is useful to test the optmized parameters (previously found 
+	// and stored in root file) on the TRAIN sample.
+
+	FindSupercuts.SetSkipOptimization(fSkipOptimization);
+
+	// Boolean variable that allows the user to write the initial parameters 
+	// into the root file that will be used to store the optimum cuts.
+	// If fUseInitialSCParams = kTRUE , parameters are written.
+	// In this way, the initial SC parameters can be applied on the data (train/test)
+
+	FindSupercuts.SetUseInitialSCParams(fUseInitialSCParams);
+
+
+        // Set boolean variable that controls wether the theta variable 
+	// is used or not in the computation of the dynamica cuts
+
+	FindSupercuts.SetVariableNotUseTheta(fNotUseTheta);
+
+	// Set boolean variable that controls wether cuts are dynamical 
+	// or static.
+
+	FindSupercuts.SetVariableUseStaticCuts(fUseStaticCuts);
+
+	
+	FindSupercuts.SetUseFittedQuantities(fUseFittedQuantities);
+
+	                                        
+	// fGammaEfficiency is set in object FindSupercuts
+
+	FindSupercuts.SetGammaEfficiency (fGammaEfficiency);
+
+
+	// Filename with SuperCuts parameters is set
+
+	FindSupercuts.SetFilenameParam(fOptSCParamFilenameVector[i]);
+
+	// Hadroness containers are set
+	
+	FindSupercuts.SetHadronnessName(fHadronnessName);
+	FindSupercuts.SetHadronnessNameOFF(fHadronnessNameOFF);
+    
+	// Rootfilename where to store alpha distribution histograms is set
+
+	FindSupercuts.SetAlphaDistributionsRootFilename(fAlphaDistributionsRootFilename);
+
+
+	// Set the names of all trees 
+        // used to store the supercuts applied to ON/OFF Train/Test samples
+
+	// In future, names might be controlled by user, but for the time 
+	// being I'll make things simple, and names are set to some defaults 
+	// taking into account the theta range used
+	
+	// Containers will be stored in rootfile specified by variable 
+	// fAlphaDistributionsRootFilename
+
+	FindSupercuts.SetSupercutsAppliedTreeNames();
+
+
+
+
+
+	// Object of the class TPostScritp is set...
+	// BUT THAT'S NOT WORKING PROPERLY !!!!!
+
+	// FindSupercuts.SetPostScriptFile (fPsFilename);
+
+	// ********************************************************
+	// Due to the failure of the use of object TPostScript
+	// to make a Ps document with all plots, I decided to use the 
+	// standard way (SaveAs(filename.ps)) to store plots related 
+	// to alpha distributions 
+	// for ON and OFF and BEFORE and AFTER cuts (VERY IMPORTANT
+	// TO COMPUTE EFFICIENCIES IN CUTS) 
+
+	// Psfilename is set inside function LoopOverThetaRanges()
+	// and given to the object MFindSupercutsONOFF created 
+	// within this loop.
+
+	// This will have to be removed as soon as the TPostScript
+	// solutions works...
+	// ********************************************************
+
+	TString PsFilenameString = (fPathForFiles);
+	PsFilenameString += ("SC");
+	PsFilenameString += (fThetaRangeStringVector[i]);
+	// Name to be completed inside object MFindSupercutsONOFF
+
+	FindSupercuts.SetPsFilenameString(PsFilenameString);
+
+
+	if (fReadMatricesFromFile)
+	{
+	    *fLog << "MFindSupercutsONOFFThetaLoop::LoopOverThetaRanges; " << endl
+		  << "Reading Data matrices from root files... " << endl;
+
+	    FindSupercuts.ReadMatrix(fTrainMatrixONFilenameVector[i], 
+				     fTestMatrixONFilenameVector[i]);
+	    FindSupercuts.ReadMatrixOFF(fTrainMatrixOFFFilenameVector[i], 
+					fTestMatrixOFFFilenameVector[i]);
+
+	}
+
+	else
+	{
+	    *fLog << "MFindSupercutsONOFFThetaLoop::LoopOverThetaRanges; " << endl
+		  << "Reading Data from files " << fDataONRootFilename 
+		  << " and " << fDataOFFRootFilename << "(for ON and OFF data "
+		  << "respectively " 
+		  << " and producing data matrices that will be stored "
+		  << "in root files. " << endl;
+
+	    // ON data 
+	    
+	    FindSupercuts.DefineTrainTestMatrixThetaRange(
+		fDataONRootFilename,
+		fWhichFractionTrain,
+		fWhichFractionTest, 
+		fThetaMin, fThetaMax, 
+		fTrainMatrixONFilenameVector[i], 
+		fTestMatrixONFilenameVector[i]);
+
+	    // OFF data
+	    
+	    FindSupercuts.DefineTrainTestMatrixOFFThetaRange(
+		fDataOFFRootFilename,
+		fWhichFractionTrainOFF,
+		fWhichFractionTestOFF, 
+		fThetaMin, fThetaMax, 
+		fTrainMatrixOFFFilenameVector[i], 
+		fTestMatrixOFFFilenameVector[i]);
+	    
+	}
+
+
+	MinimizationSuccessful = kTRUE;
+	
+	if (fOptimizeParameters)
+	{
+	    MinimizationSuccessful = 
+		FindSupercuts.FindParams("",fInitSCPar, fInitSCParSteps); 
+	    
+	    if (MinimizationSuccessful)
+	    {
+		// Minimization was successful	
+		// NormFactor, Nex, SigmaLiMa and NEvts Train histograms are updated 
+
+		*fLog << "MFindSupercutsONOFFThetaLoop::LoopOverThetaRanges; " 
+		      << endl
+		      << "Minimization was successful" << endl
+		      << "Updating values for NormFactor, Nex, SigmaLiMa and NEvts " 
+		      << "Train histograms for " <<  fThetaRangeStringVector[i] << endl;
+		
+		
+		NormFactor = FindSupercuts.GetNormFactorTrain();
+		SigmaLiMa = FindSupercuts.GetSigmaLiMaTrain();
+		Nex = FindSupercuts.GetNexTrain();
+		
+		NEvtsON = FindSupercuts.GetMatrixTrain()->GetM().GetNrows();
+		NEvtsOFF = FindSupercuts.GetMatrixTrainOFF()->GetM().GetNrows();
+
+		// MinimizationValue is updated...
+
+		MinimizationValue = 1.0;		
+
+	    }
+	    else
+	    {
+		// Minimization was NOT successful	
+		// NormFactor, Nex, SigmaLiMa and NEvts Train histograms are updated 
+
+		*fLog << "MFindSupercutsONOFFThetaLoop::LoopOverThetaRanges; " 
+		      << endl
+		      << "Minimization was NOT successful" << endl
+		      << "Updating values for NormFactor, and NEvts " 
+		      << "Train histograms for " <<  fThetaRangeStringVector[i] << endl
+		      << "Nex and SigmaLiMa are set to ZERO" << endl;
+		
+		
+		NormFactor = FindSupercuts.GetNormFactorTrain();
+		
+		NEvtsON = FindSupercuts.GetMatrixTrain()->GetM().GetNrows();
+		NEvtsOFF = FindSupercuts.GetMatrixTrainOFF()->GetM().GetNrows();
+
+		SigmaLiMa = 0.0;
+		Nex = 0.0;
+		
+		// MinimizationValue is updated...
+
+		MinimizationValue = 0.0;
+
+	    }
+
+
+	    
+	    cout << "---- Train Histograms will be updated with the following numbers: ------ " 
+		 << endl
+		 << "Mean CosTheta for this Thetabin = " 
+		 << fCosThetaBinCenterVector[i] << endl
+		 << "Minimization status (1.0 is successful, 0.0 is UNsuccessful) = "
+		 << MinimizationValue << endl
+		 << "Number of ON Events in Train sample used = "
+		 << NEvtsON << endl
+		 << "Number of OFF Events in Train sample used = "
+		 << NEvtsOFF << endl
+		 << "Normalization factor (Non/Noff) for Train sample = "
+		 << NormFactor << endl 
+		 << "Excess events and SigmaLiMa: "
+		 << Nex << "; " << SigmaLiMa << endl << endl;
+		 
+	    
+
+	    fNormFactorTrainHist -> Fill(fCosThetaBinCenterVector[i], 
+					  NormFactor);
+	    
+	    fNexTrainHist -> Fill(fCosThetaBinCenterVector[i], 
+				   Nex);
+
+	    fSigmaLiMaTrainHist -> Fill(fCosThetaBinCenterVector[i], 
+					 SigmaLiMa);
+
+
+	    fNEvtsInTrainMatrixONHist -> Fill(fCosThetaBinCenterVector[i], 
+					 NEvtsON);
+
+	    fNEvtsInTrainMatrixOFFHist -> Fill(fCosThetaBinCenterVector[i], 
+						NEvtsOFF);
+
+	    
+	    fSuccessfulThetaBinsHist -> Fill(fCosThetaBinCenterVector[i],
+					     MinimizationValue);
+	    
+	    cout << "Histograms (TRAIN) updated successfully " << endl;
+	    
+
+	    
+	    
+	}
+	
+	
+	if (fTestParameters && MinimizationSuccessful)
+	{
+	    
+	    // Cuts are applied to test sample
+	    
+	    FindSupercuts.TestParamsOnTestSample();
+
+	    // NormFactor, Nex and SigmaLiMa Test histograms are updated 
+
+	    *fLog << "MFindSupercutsONOFFThetaLoop::LoopOverThetaRanges; " << endl
+		  << "Updating values for NormFactor, Nex, SigmaLiMa and NEvts " 		  
+		  << "Test histograms for " <<  fThetaRangeStringVector[i] << endl;
+
+
+	    NormFactor = FindSupercuts.GetNormFactorTest();
+	    SigmaLiMa = FindSupercuts.GetSigmaLiMaTest();
+	    Nex = FindSupercuts.GetNexTest();
+
+	    NEvtsON = FindSupercuts.GetMatrixTest()->GetM().GetNrows();
+	    NEvtsOFF = FindSupercuts.GetMatrixTestOFF()->GetM().GetNrows();
+
+
+       cout << "---- Test Histograms will be updated with the following numbers: ------ " 
+	    << endl
+		 << "Mean CosTheta for this Thetabin = " 
+		 << fCosThetaBinCenterVector[i] << endl
+		 << "Number of ON Events in Test sample used = "
+		 << NEvtsON << endl
+		 << "Number of OFF Events in Test sample used = "
+		 << NEvtsOFF << endl
+		 << "Normalization factor (Non/Noff) for Test sample = "
+		 << NormFactor << endl 
+		 << "Excess events and SigmaLiMa: "
+		 << Nex << "; " << SigmaLiMa << endl << endl;
+		 
+
+
+
+	    fNormFactorTestHist -> Fill(fCosThetaBinCenterVector[i], 
+					 NormFactor);
+	    
+	    fNexTestHist -> Fill(fCosThetaBinCenterVector[i], 
+				  Nex);
+
+	    fSigmaLiMaTestHist -> Fill(fCosThetaBinCenterVector[i], 
+				       SigmaLiMa);
+
+
+	    fNEvtsInTestMatrixONHist -> Fill(fCosThetaBinCenterVector[i], 
+					    NEvtsON);
+
+	    fNEvtsInTestMatrixOFFHist -> Fill(fCosThetaBinCenterVector[i], 
+					      NEvtsOFF);
+
+	    
+	    cout << "Histograms (TEST) updated successfully " << endl;
+	    
+
+
+
+	}
+
+    }
+
+
+    // PsFile is closed
+
+
+    //*fLog << "Closing PsFile ";
+    //*fLog << fPsFilename -> GetName() << endl;
+    
+    //fPsFilename -> Close();
+
+    
+
+    if (fOptimizeParameters || fTestParameters)
+    {
+	// Histograms cotanining SigmaLiMa, Nex and NormFactors and NEvts are written 
+	// in the same root file where alpha distributions where stored
+	// i.e. fAlphaDistributionsRootFilename
+	
+	*fLog << "MFindSupercutsONOFFThetaLoop::LoopOverThetaRanges; " << endl
+	      << "Executing WriteNexSigmaLiMaNormFactorNEvtsTrainTestHistToFile()"
+	      << endl;
+
+	WriteNexSigmaLiMaNormFactorNEvtsTrainTestHistToFile();
+
+
+	if (fOptimizeParameters)
+	{   // Histogram containing minimization status for all theta bins defined 
+	    // in vector fCosThetaVector is stored in file fAlphaDistributionsRootFilename
+
+	    *fLog << "MFindSupercutsONOFFThetaLoop::LoopOverThetaRanges; " << endl
+	      << "Executing WriteSuccessfulThetaBinsHistToFile()"
+	      << endl;
+
+	    WriteSuccessfulThetaBinsHistToFile();
+	    
+	}
+
+    }
+
+
+    return kTRUE;
+}
+
+
+
+
+
+ // Function that loops over the alpha distributions (ON-OFF)
+   // stored in root file defined by fAlphaDistributionsRootFilename
+   // and computes the significance and Nex (using MHFindSignificanceONOFF::FindSigma)
+   // for several cuts in alpha (0-fAlphaSig; in bins defined for alpha distributions 
+   // by user).
+
+   // It initializes the histograms (memeber data), fills them and store them 
+   // in root file defined by fAlphaDistributionsRootFilename. A single histogram 
+   // for each theta bin.
+
+
+
+Bool_t MFindSupercutsONOFFThetaLoop::ComputeNexSignificanceVSAlphaSig()
+{
+
+
+  *fLog << endl << endl 
+	<< "****************************************************************************" << endl
+	<< "Computing number of excess events and significance vs " << endl
+	<< " the cut in alpha parameter (fAlphaSig) using function " << endl
+	<< " MFindSupercutsONOFFThetaLoop::ComputeNexSignificanceVSAlphaSig() " << endl
+	<< "****************************************************************************" << endl
+	<< endl;
+  
+
+  // Check that all elements needed by the function are available
+ 
+
+  if (fAlphaDistributionsRootFilename.IsNull())
+    {
+	*fLog << err 
+	      << "MFindSupercutsONOFFThetaLoop::ComputeNexSignificanceVSAlphaSig; " 
+	      << endl
+	      << "fAlphaDistributionsRootFilename is not defined yet, hence "
+	      << "histograms  containing alpha distributions for the different theta "
+	      << "ranges can not be retrieved. " << endl;
+
+	return kFALSE;
+    }
+
+
+
+    if (fCosThetaRangeVector.GetSize() < 2)
+    {
+        *fLog << err 
+	      << "MFindSupercutsONOFFThetaLoop::ComputeNexSignificanceVSAlphaSig; " 
+	      << endl
+	      << "Size of fCosThetaRangeVector is smaller than 2... "
+	      << "fCosThetaRangeVector is not defined properly, "
+	      << "and thus, number of theta loops and names "
+	      << " of the histograms  containing alpha distributions "
+	      << "for the different theta "
+	      << "ranges can not defined properly." << endl;
+ 
+        return kFALSE;
+    }
+
+   
+
+    // It seems that i have all I need for the time being. Let's start the party...
+
+
+    Int_t tmpint =  0; // variable that will be used to store temporally integers 
+    Double_t tmpdouble = 0.0; // variable that will be used to store temporally doubles
+
+    tmpint = fCosThetaRangeVector.GetSize() - 1;
+    const Int_t NThetaBins = tmpint;
+ 
+
+    // Definition of the bins for Nex and Significance vs Alpha histograms
+    // The bins in Alpha will start with ZERO  and will end 
+    // with 5 bins further after fAlphaSig.
+
+    Double_t AlphaBinWidth = double((fAlphaBinUp-fAlphaBinLow)/fNAlphaBins);
+    Double_t FirstBinLow = 0.0;
+    tmpint = int((fAlphaSig/AlphaBinWidth) + 5.0);
+
+    while ((FirstBinLow + AlphaBinWidth*tmpint) > fAlphaBkgMin)
+      {
+	tmpint--;
+      }
+	
+    *fLog << "Information about the binning of the histograms Nex and Significance vs alphasig " 
+	  << endl
+	  << "FirstBinLow, AlphaBinWidth, NBins : " 
+	  << FirstBinLow << ", " << AlphaBinWidth << ", " << tmpint-1 << endl;
+
+
+
+    const Int_t NexSignVSAlphaXBinsVectorDimension = tmpint;
+                
+ 
+    Double_t* XBinsVector = new Double_t [NexSignVSAlphaXBinsVectorDimension];
+    
+    for (Int_t i = 0; i < NexSignVSAlphaXBinsVectorDimension; i++)
+      {
+	XBinsVector[i] = FirstBinLow + i*AlphaBinWidth;
+	// cout << XBinsVector[i] << endl;
+      }
+
+
+   
+    // Axis labels for Nex and Significance vs Alpha histograms
+
+    TString x_axis_label = ("Cut in alpha [\\circ]");
+    TString y_axis_label_nex = ("Excess Events");
+    TString y_axis_label_significance = ("Significance (LiMa formula 17)");
+
+
+    // Arguments for function MHFindSignificanceONOFF::FindSigmaONOFF()
+    // are defined in here. The same arguments (obviously) will be used 
+    // in all theta bins and TRAIN and TEST samples.
+
+    // variable alphasig will be defined and varied withing the theta loop
+
+    Double_t alphasig = 0.0;
+
+    // Minimum value of alpha for bkg region in ON data
+    const Double_t alphabkgmin = fAlphaBkgMin;
+    
+    // Maximum value of alpha for bkg region in ON data
+    const Double_t alphabkgmax = fAlphaBkgMax;
+    
+    // degree of polynomial function used to fit ON data in background region
+    const Int_t    degree   =    2;
+    
+    // degree of polynomial function used to fit OFF data in all alpha region (0-90)
+    const Int_t    degreeOFF   =    2;
+    
+    const Bool_t   drawpoly  = kFALSE;
+    const Bool_t   fitgauss  = kFALSE;
+    const Bool_t   print     = kFALSE;
+    
+    const Bool_t saveplots   = kFALSE; // No plots are saved
+   
+    const Bool_t RebinHistograms = kTRUE;
+    const Bool_t ReduceDegree = kFALSE;
+
+
+
+    Double_t Nex = 0.0;
+    Double_t Significance = 0.0;
+
+
+    // Names of histograms containing Nex and Significance vs alphasig
+
+    TString NexVSAlphaName = ("NexVSAlpha"); // Names to be completed in theta loop
+    TString SignificanceVSAlphaName = ("SignificanceVSAlpha");// Names to be completed in theta loop
+    
+
+
+    // Names of histograms to be retrieved from root file 
+    // fAlphaDistributionsRootFilename
+
+    TString NormFactorTrainHistoName = ("NormFactorTrainHist");
+    TString NormFactorTestHistoName = ("NormFactorTestHist");
+    
+    TString SuccessfulThetaBinsHistoName = ("SuccessfulThetaBinsHist");
+
+ 
+
+    // Histogram containing information about the success of the optimization
+    // for the several theta bins. The content of those bins where optimization was not 
+    // successful, are set to ZERO.
+
+    
+    TH1F* SuccessfulThetaBinsHisto;
+ 
+
+
+    // Histograms to store the normalization factors
+
+    TH1F* NormFactorTrainHisto;
+    TH1F* NormFactorTestHisto;
+
+
+
+    // Histograms that will be used to store the alpha distributions 
+    // retrieved from   fAlphaDistributionsRootFilename, and that will be use as arguments in 
+    // function MHFindSignificanceONOFF::FindSigma
+
+    // The same histograms (pointer to histograms actually) will be used for TRAIN and TEST 
+    // and for the different ThetaNBinsUsed.
+
+    TH1F* AlphaONAfterCuts;
+    TH1F* AlphaOFFAfterCuts;
+
+
+
+   
+      // Vector containing the histogram index of the successfully 
+    // optimized theta bins. 
+    // It is filled with the contents of the histogram 
+    // fSuccessfulThetaBinsHist retrieved from the root 
+    // file fAlphaDistributionsRootFilename
+    // Remember that histogram index START AT 1 !!!
+    TArrayI SuccessfulThetaBinsVector; 
+   
+
+
+    
+
+
+
+     // Open root file for retrieving information
+ 
+    *fLog << "MFindSupercutsONOFFThetaLoop::ComputeNexSignificanceVSAlphaSig()" << endl
+	  << "Opening root file " << fAlphaDistributionsRootFilename << endl;
+
+    TFile rootfile (fAlphaDistributionsRootFilename, "READ");
+
+    // Retrieving SuccessfulThetaBinsHisto from root file. 
+    
+    *fLog << "MFindSupercutsONOFFThetaLoop::ComputeNexSignificanceVSAlphaSig()" << endl
+	  << "Retrieving SuccessfulThetaBinsHisto from root file and filling vector "
+	  << " SuccessfulThetaBinsVector" << endl;
+
+                                    
+    cout << "Getting histogram with name " << SuccessfulThetaBinsHistoName << endl;
+
+    SuccessfulThetaBinsHisto = (TH1F*) rootfile.Get(SuccessfulThetaBinsHistoName);
+    
+
+
+    // Check that bins in this histo correspond with the 
+    // CosTheta intervals defined by vector fCosThetaRangeVector
+
+	
+    if (SuccessfulThetaBinsHisto -> GetNbinsX() != NThetaBins)
+    {
+	*fLog << "MFindSupercutsONOFFThetaLoop::ComputeNexSignificanceVSAlphaSig()" 
+	      << endl
+	      << "Number of theta bins defined by vector fCosThetaRangeVector (" 
+	      << NThetaBins << ") does not match with the bins in histogram "
+	      << SuccessfulThetaBinsHistoName << "(" 
+	      << SuccessfulThetaBinsHisto -> GetNbinsX() << ")" << endl
+	      << "Function execution will be ABORTED." << endl;
+	return kFALSE;
+    }
+
+
+    // Filling vector SuccessfulThetaBinsVector
+
+    tmpint = 0;
+    for (Int_t i = 0; i < NThetaBins; i++)
+    {
+	if ((SuccessfulThetaBinsHisto -> GetBinContent(i+1)) > 0.5)
+	{
+	    tmpint++;
+	}
+    }
+
+    SuccessfulThetaBinsVector.Set(tmpint);
+    
+    tmpint = 0;
+    for (Int_t i = 0; i < NThetaBins; i++)
+    {
+	if ((SuccessfulThetaBinsHisto -> GetBinContent(i+1)) > 0.5)
+	{
+	    if(tmpint < SuccessfulThetaBinsVector.GetSize())
+	    {
+		SuccessfulThetaBinsVector[tmpint] = i+1;
+		tmpint++;
+	    }
+	    else
+	    {
+		*fLog << "MFindSupercutsONOFFThetaLoop::ComputeNexSignificanceVSAlphaSig()" 
+		      << endl
+		      << "Problem when filling vector 'SuccessfulThetaBinsVector'" 
+		      << endl
+		      << "Function execution will be ABORTED." << endl;
+		return kFALSE;
+	    }
+	    
+
+	}
+    }
+
+    // variable defining the theta bins where optimization was successful, and 
+    // hence, alpha distributions stored in root file are meaningful (up to some extent)
+   
+    tmpint = SuccessfulThetaBinsVector.GetSize();
+    const Int_t SuccessfulNThetaBins = tmpint;
+    
+    // TEMP
+    //  cout << "const Int_t SuccessfulNThetaBins = " << SuccessfulNThetaBins << endl;
+    // ENDTEMP
+
+    // Vectors of pointers to histograms are defined to store the histograms 
+    // containing Nex and significance for TRAIN and TEST sample for all the 
+    // successful theta bins
+
+    // Histograms will be initialized in the loop over theta bins
+          
+    TH1F* NexVSAlphaSigTrainVector[SuccessfulNThetaBins];
+    TH1F* NexVSAlphaSigTestVector[SuccessfulNThetaBins];
+
+    
+    TH1F* SignificanceVSAlphaSigTrainVector[SuccessfulNThetaBins];
+    TH1F* SignificanceVSAlphaSigTestVector[SuccessfulNThetaBins];
+    
+    
+    // ***************************************************
+    // HISTOGRAMS FOR TRAIN SAMPLE ARE COMPUTED
+    // ***************************************************
+
+    
+
+    if (fOptimizeParameters)
+      { // Computation for TRAIN sample
+
+
+	*fLog << endl << endl
+	      << "****************************************************************************" << endl
+	      << "Computing Nex and significance vs cut in alpha (alphasig)  for TRAIN sample" << endl
+	      << "****************************************************************************" << endl
+	      << endl << endl;
+
+
+	// Retrieving NormFactorTrainHisto from root file. 
+
+	 cout << "Getting histogram with name " << NormFactorTrainHistoName << endl;
+
+	NormFactorTrainHisto = (TH1F*) rootfile.Get(NormFactorTrainHistoName);
+	
+
+	// Check that bins in this histo correspond with the 
+	// CosTheta intervals defined by vector fCosThetaRangeVector
+
+	////////////////// START CHECK  //////////////////////////////////////
+	
+	if (NormFactorTrainHisto -> GetNbinsX() != NThetaBins)
+	{
+	    *fLog << "MFindSupercutsONOFFThetaLoop::ComputeNexSignificanceVSAlphaSig()" 
+		  << endl
+		  << "Number of theta bins defined by vector fCosThetaRangeVector (" 
+		  << NThetaBins << ") does not match with the bins in histogram "
+		  << NormFactorTrainHistoName << "(" 
+		  << NormFactorTrainHisto -> GetNbinsX() << ")" << endl
+		  << "Function execution will be ABORTED." << endl;
+	    return kFALSE;
+	}
+
+	// histo test 
+	/*
+	cout << "NORMFACTORTRAINHIST  Test: BinCenter and Value" << endl;
+	for (Int_t k = 0; k < NThetaBins; k++)
+	{
+	    
+	    cout << NormFactorTrainHisto -> GetBinCenter(k+1) 
+		 << ";  " << NormFactorTrainHisto -> GetBinContent(k+1)<< endl;
+	}
+	*/
+
+	for (Int_t i = 0; i < SuccessfulThetaBinsVector.GetSize(); i++)
+	{
+	    tmpdouble = NormFactorTrainHisto -> GetBinCenter(SuccessfulThetaBinsVector[i]);
+	    if (fCosThetaRangeVector[SuccessfulThetaBinsVector[i]-1] > tmpdouble || 
+		fCosThetaRangeVector[SuccessfulThetaBinsVector[i]] < tmpdouble)
+	    {
+		*fLog << "MFindSupercutsONOFFThetaLoop::ComputeNexSignificanceVSAlphaSig()" 
+		      << endl
+		      << "Bins defined by vector fCosThetaRangeVector " 
+		      << "do not match with the bins of histogram "
+		      << NormFactorTrainHistoName << endl
+		      << "CosTheta: " << fCosThetaRangeVector[SuccessfulThetaBinsVector[i]-1]
+		      << "-" << fCosThetaRangeVector[SuccessfulThetaBinsVector[i]] << endl
+		      << "NormFactorHist Bin: " <<  tmpdouble << endl
+		      << "Function execution will be ABORTED." << endl;
+
+		return kFALSE;
+	    }
+	    
+	}
+
+	////////////////// END CHECK  //////////////////////////////////////
+
+
+
+	
+	// Check that the theta range string (needed to compute names for alpha histograms)
+	// is well defined
+	
+	for (Int_t i = 0; i < SuccessfulThetaBinsVector.GetSize(); i++)
+	  {
+	    if (fThetaRangeStringVector[SuccessfulThetaBinsVector[i]-1].IsNull())
+	      {
+		*fLog << "MFindSupercutsONOFFThetaLoop::ComputeNexSignificanceVSAlphaSig()" 
+		      << endl
+		      << "Component " << SuccessfulThetaBinsVector[i]-1 
+		      << " of fThetaRangeStringVector is EMPTY"
+		      << endl
+		      << "Function execution will be ABORTED." << endl;
+
+		return kFALSE;
+
+		
+	    }
+	  }
+
+
+	// *************************************************************
+	// *************************************************************
+	
+	// Normfactors and successfultheta bins are ok. 
+	// I can now compute the Nex and Sigma for train sample (ON-OFF) 
+	
+	// *************************************************************
+	// *************************************************************
+
+
+	
+
+	// Loop over the several successful theta bins doing the following 
+
+	// 0) Initializing histograms Nex and Significance (with names!!)
+	// 1) Retrieving alpha histograms (ON-OFF), and normalization factor
+	// 2) Computing Nex and Signficance vs alpha and filling histograms
+
+
+	*fLog << endl
+	      << "Starting loop over the successfully optimized theta ranges " << endl
+	      << endl;
+
+	Double_t NormalizationFactor = 0.0;
+	
+	for (Int_t i = 0; i < SuccessfulThetaBinsVector.GetSize(); i++)
+	  {
+
+	    *fLog << fThetaRangeStringVector[SuccessfulThetaBinsVector[i]-1] << endl << endl;
+	
+	    // 0) Initializing histograms Nex and Significance (with names!!)
+
+	    TString NexVSAlphaNameTmp = (NexVSAlphaName);
+	    TString SignificanceVSAlphaNameTmp = (SignificanceVSAlphaName);
+
+	    NexVSAlphaNameTmp += "Train";
+	    NexVSAlphaNameTmp += fThetaRangeStringVector[SuccessfulThetaBinsVector[i]-1];
+
+	    SignificanceVSAlphaNameTmp += "Train";
+	    SignificanceVSAlphaNameTmp += fThetaRangeStringVector[SuccessfulThetaBinsVector[i]-1];
+
+	
+	    // TEMP    
+	    // cout << NexVSAlphaNameTmp << endl;
+	    // cout << SignificanceVSAlphaNameTmp << endl;
+	    // ENDTEMP
+	      
+
+
+    
+	    NexVSAlphaSigTrainVector[i] = new TH1F (NexVSAlphaNameTmp.Data(), 
+						    NexVSAlphaNameTmp.Data(), 
+						    NexSignVSAlphaXBinsVectorDimension - 1,
+						    XBinsVector);
+	    
+	    // It is important to unlink the the created histograms from 
+	    // the current directory (defined now by "rootfile"), 
+	    // so that we can do whatever we want to 
+	    // with them regardless of such directory is opened or closed 
+	    // The reference of the histogram is removed from the current 
+	    // directory by means of the member function  "SetDirectory(0)"
+
+
+	    NexVSAlphaSigTrainVector[i] -> SetDirectory(0);
+
+
+	    SignificanceVSAlphaSigTrainVector[i] = new TH1F (SignificanceVSAlphaNameTmp.Data(), 
+							     SignificanceVSAlphaNameTmp.Data(),
+							     NexSignVSAlphaXBinsVectorDimension - 1,
+							     XBinsVector);
+	    
+	    SignificanceVSAlphaSigTrainVector[i] -> SetDirectory(0);
+	    
+	    
+
+	    // axis are defined
+
+	    NexVSAlphaSigTrainVector[i] -> SetXTitle(x_axis_label.Data());
+	    NexVSAlphaSigTrainVector[i] -> SetYTitle(y_axis_label_nex.Data());
+	    
+	    SignificanceVSAlphaSigTrainVector[i] ->SetXTitle(x_axis_label.Data());
+	    SignificanceVSAlphaSigTrainVector[i] ->SetYTitle(y_axis_label_significance.Data());
+
+	
+	    // 1) Retrieving alpha histograms (ON-OFF) and normalization factor
+
+	    NormalizationFactor = 
+	      NormFactorTrainHisto -> GetBinContent(SuccessfulThetaBinsVector[i]);
+
+
+	    TString TmpAlphaHistoName = ("TrainAlphaAfterCuts");
+	    TmpAlphaHistoName += fThetaRangeStringVector[SuccessfulThetaBinsVector[i]-1];
+
+	    *fLog << "Getting Histogram with name " << endl
+		  << TmpAlphaHistoName << endl;
+
+	    AlphaONAfterCuts = (TH1F*) rootfile.Get(TmpAlphaHistoName);
+
+	    
+	    TString TmpAlphaOFFHistoName = ("TrainAlphaOFFAfterCuts");
+	    TmpAlphaOFFHistoName += fThetaRangeStringVector[SuccessfulThetaBinsVector[i]-1];
+
+	    *fLog << "Getting Histogram with name " << endl
+		  << TmpAlphaOFFHistoName << endl;
+
+	    AlphaOFFAfterCuts = (TH1F*) rootfile.Get(TmpAlphaOFFHistoName);
+	    
+
+	 // 2) Computing Nex and Signficance vs alpha and filling histograms
+	    // Significance is found using MHFindSignificanceONOFF::FindSigmaONOFF  
+
+
+	    *fLog  << endl << endl
+		   << "Starting loop to compute Nex and Significance vs alphasig " << endl
+		   << "for TRAIN sample and " 
+		   << fThetaRangeStringVector[SuccessfulThetaBinsVector[i]-1] 
+		   << " :" << endl;
+	    
+	   	    
+	    for (Int_t j = 1; j < NexSignVSAlphaXBinsVectorDimension; j++)
+	      {
+		
+
+		alphasig = XBinsVector[j];
+		
+		MHFindSignificanceONOFF findsig;
+		findsig.SetRebin(RebinHistograms);
+		findsig.SetReduceDegree(ReduceDegree);	
+		findsig.SetUseFittedQuantities(fUseFittedQuantities);
+
+		// Dummy name for psfile 
+		TString psfilename = ("DummyPs"); 
+	    
+		findsig.FindSigmaONOFF(AlphaONAfterCuts, AlphaOFFAfterCuts, 
+				       NormalizationFactor, 
+				       alphabkgmin, alphabkgmax, 
+				       degree, degreeOFF,
+				       alphasig, 
+				       drawpoly, fitgauss, print, 
+				       saveplots, psfilename);
+
+		
+		Significance = double(findsig.GetSignificance());
+
+		// so far there is not a variable that contains 
+		// NexONOFF or NexONOFFFitted (in class MHFindSignificanceONOFF) 
+		// according to the value of the variable fUseFittedQuantities.
+		// As soon as I have some time I will implement it (with the 
+		// corresponging GET member function) and will change 
+		// MFindSignificanceONOFF accordingly to make use of it.
+		
+		// For the time being, I will survive with an "if statement".
+
+		
+		if(fUseFittedQuantities)
+		  {
+		    Nex = double(findsig.GetNexONOFFFitted()); 
+		  }
+		else
+		  {
+		    Nex = double(findsig.GetNexONOFF()); 
+		  }
+
+
+				
+		*fLog << endl << "Cut in alpha, Nex and significance : " 
+		      << alphasig << ", " << Nex << ", " << Significance << endl << endl;
+		
+	      
+		// updating histograms
+
+		tmpdouble = alphasig - AlphaBinWidth/2.0;
+
+		NexVSAlphaSigTrainVector[i] -> Fill(tmpdouble, Nex);
+		SignificanceVSAlphaSigTrainVector[i] -> Fill(tmpdouble, Significance);
+		
+	  
+
+		
+
+
+
+	      }	  
+	
+
+	    // Dynamic memory allocated in this loop is released
+	    
+    
+	    *fLog  << "Memory allocated by temporal alpha histograms "
+		   << "will be released" << endl;
+	    
+	    delete AlphaONAfterCuts;
+	    delete AlphaOFFAfterCuts;
+	    
+	  }
+
+
+      }
+
+    
+    
+     // ***************************************************
+    // HISTOGRAMS FOR TEST SAMPLE ARE COMPUTED
+    // ***************************************************
+
+
+ 
+
+    if(fTestParameters)
+      {// computation for TEST sample
+	
+	*fLog << endl << endl
+	      << "**************************************************************************" << endl
+	      << "Computing Nex and significance vs cut in alpha (alphasig) for TEST sample" << endl
+	      << "**************************************************************************" << endl
+	      << endl << endl;
+
+	// Retrieving NormFactorTestHisto from root file. 
+
+	 *fLog << "Getting histogram with name " << NormFactorTestHistoName << endl;
+
+	NormFactorTestHisto = (TH1F*) rootfile.Get(NormFactorTestHistoName);
+	
+
+	// Check that bins in this histo correspond with the 
+	// CosTheta intervals defined by vector fCosThetaRangeVector
+
+	////////////////// START CHECK  //////////////////////////////////////
+	
+	if (NormFactorTestHisto -> GetNbinsX() != NThetaBins)
+	{
+	    *fLog << "MFindSupercutsONOFFThetaLoop::ComputeNexSignificanceVSAlphaSig()" 
+		  << endl
+		  << "Number of theta bins defined by vector fCosThetaRangeVector (" 
+		  << NThetaBins << ") does not match with the bins in histogram "
+		  << NormFactorTestHistoName << "(" 
+		  << NormFactorTestHisto -> GetNbinsX() << ")" << endl
+		  << "Function execution will be ABORTED." << endl;
+	    return kFALSE;
+	}
+
+	// histo test 
+	/*
+	cout << "NORMFACTORTRAINHIST  Test: BinCenter and Value" << endl;
+	for (Int_t k = 0; k < NThetaBins; k++)
+	{
+	    
+	    cout << NormFactorTestHisto -> GetBinCenter(k+1) 
+		 << ";  " << NormFactorTestHisto -> GetBinContent(k+1)<< endl;
+	}
+	*/
+
+	for (Int_t i = 0; i < SuccessfulThetaBinsVector.GetSize(); i++)
+	{
+	    tmpdouble = NormFactorTestHisto -> GetBinCenter(SuccessfulThetaBinsVector[i]);
+	    if (fCosThetaRangeVector[SuccessfulThetaBinsVector[i]-1] > tmpdouble || 
+		fCosThetaRangeVector[SuccessfulThetaBinsVector[i]] < tmpdouble)
+	    {
+		*fLog << "MFindSupercutsONOFFThetaLoop::ComputeNexSignificanceVSAlphaSig()" 
+		      << endl
+		      << "Bins defined by vector fCosThetaRangeVector " 
+		      << "do not match with the bins of histogram "
+		      << NormFactorTestHistoName << endl
+		      << "CosTheta: " << fCosThetaRangeVector[SuccessfulThetaBinsVector[i]-1]
+		      << "-" << fCosThetaRangeVector[SuccessfulThetaBinsVector[i]] << endl
+		      << "NormFactorHist Bin: " <<  tmpdouble << endl
+		      << "Function execution will be ABORTED." << endl;
+
+		return kFALSE;
+	    }
+	    
+	}
+
+	////////////////// END CHECK  //////////////////////////////////////
+
+
+
+	
+	// Check that the theta range string (needed to compute names for alpha histograms)
+	// is well defined
+	
+	for (Int_t i = 0; i < SuccessfulThetaBinsVector.GetSize(); i++)
+	  {
+	    if (fThetaRangeStringVector[SuccessfulThetaBinsVector[i]-1].IsNull())
+	      {
+		*fLog << "MFindSupercutsONOFFThetaLoop::ComputeNexSignificanceVSAlphaSig()" 
+		      << endl
+		      << "Component " << SuccessfulThetaBinsVector[i]-1 
+		      << " of fThetaRangeStringVector is EMPTY"
+		      << endl
+		      << "Function execution will be ABORTED." << endl;
+
+		return kFALSE;
+
+		
+	    }
+	  }
+
+
+	// *************************************************************
+	// *************************************************************
+	
+	// Normfactors and successfultheta bins are ok. 
+	// I can now compute the Nex and Sigma for test sample (ON-OFF) 
+	
+	// *************************************************************
+	// *************************************************************
+
+	// Loop over the several successful theta bins doing the following 
+
+	// 0) Initializing histograms Nex and Significance (with names!!)
+	// 1) Retrieving alpha histograms (ON-OFF), and normalization factor
+	// 2) Computing Nex and Signficance vs alpha and filling histograms
+
+
+	*fLog << endl
+	      << "Starting loop over the successfully optimized theta ranges " << endl
+	      << endl;
+
+	
+	Double_t NormalizationFactor = 0.0;
+	
+	for (Int_t i = 0; i < SuccessfulThetaBinsVector.GetSize(); i++)
+	  {
+
+	    *fLog << fThetaRangeStringVector[SuccessfulThetaBinsVector[i]-1] << endl << endl;
+
+	    // 0) Initializing histograms Nex and Significance (with names!!)
+
+	    TString NexVSAlphaNameTmp = (NexVSAlphaName);
+	    TString SignificanceVSAlphaNameTmp = (SignificanceVSAlphaName);
+
+	    NexVSAlphaNameTmp += "Test";
+	    NexVSAlphaNameTmp += fThetaRangeStringVector[SuccessfulThetaBinsVector[i]-1];
+
+	    SignificanceVSAlphaNameTmp += "Test";
+	    SignificanceVSAlphaNameTmp += fThetaRangeStringVector[SuccessfulThetaBinsVector[i]-1];
+
+	
+	    // TEMP    
+	    // cout << NexVSAlphaNameTmp << endl;
+	    // cout << SignificanceVSAlphaNameTmp << endl;
+	    // ENDTEMP
+	      
+
+
+    
+	    NexVSAlphaSigTestVector[i] = new TH1F (NexVSAlphaNameTmp.Data(), 
+						    NexVSAlphaNameTmp.Data(), 
+						    NexSignVSAlphaXBinsVectorDimension - 1,
+						    XBinsVector);
+	    
+	    // It is important to unlink the the created histograms from 
+	    // the current directory (defined now by "rootfile"), 
+	    // so that we can do whatever we want to 
+	    // with them regardless of such directory is opened or closed 
+	    // The reference of the histogram is removed from the current 
+	    // directory by means of the member function  "SetDirectory(0)"
+
+
+	    NexVSAlphaSigTestVector[i] -> SetDirectory(0);
+
+
+	    SignificanceVSAlphaSigTestVector[i] = new TH1F (SignificanceVSAlphaNameTmp.Data(), 
+							     SignificanceVSAlphaNameTmp.Data(),
+							     NexSignVSAlphaXBinsVectorDimension - 1,
+							     XBinsVector);
+	    
+	    SignificanceVSAlphaSigTestVector[i] -> SetDirectory(0);
+	    
+	    
+
+	    // axis are defined
+
+	    NexVSAlphaSigTestVector[i] -> SetXTitle(x_axis_label.Data());
+	    NexVSAlphaSigTestVector[i] -> SetYTitle(y_axis_label_nex.Data());
+	    
+	    SignificanceVSAlphaSigTestVector[i] ->SetXTitle(x_axis_label.Data());
+	    SignificanceVSAlphaSigTestVector[i] ->SetYTitle(y_axis_label_significance.Data());
+
+	
+	    // 1) Retrieving alpha histograms (ON-OFF) and normalization factor
+
+	    NormalizationFactor = 
+	      NormFactorTestHisto -> GetBinContent(SuccessfulThetaBinsVector[i]);
+
+
+	    TString TmpAlphaHistoName = ("TestAlphaAfterCuts");
+	    TmpAlphaHistoName += fThetaRangeStringVector[SuccessfulThetaBinsVector[i]-1];
+
+	    *fLog << "Getting Histogram with name " << endl
+		  << TmpAlphaHistoName << endl;
+
+	    AlphaONAfterCuts = (TH1F*) rootfile.Get(TmpAlphaHistoName);
+
+	    
+	    TString TmpAlphaOFFHistoName = ("TestAlphaOFFAfterCuts");
+	    TmpAlphaOFFHistoName += fThetaRangeStringVector[SuccessfulThetaBinsVector[i]-1];
+
+	    *fLog << "Getting Histogram with name " << endl
+		  << TmpAlphaOFFHistoName << endl;
+
+	    AlphaOFFAfterCuts = (TH1F*) rootfile.Get(TmpAlphaOFFHistoName);
+	    
+
+	 // 2) Computing Nex and Signficance vs alpha and filling histograms
+	    // Significance is found using MHFindSignificanceONOFF::FindSigmaONOFF  
+
+
+	    *fLog  << endl << endl
+		   << "Starting loop to compute Nex and Significance vs alphasig " << endl
+		   << "for TRAIN sample and " 
+		   << fThetaRangeStringVector[SuccessfulThetaBinsVector[i]-1] 
+		   << " :" << endl;
+	    
+	   	    
+	    for (Int_t j = 1; j < NexSignVSAlphaXBinsVectorDimension; j++)
+	      {
+		
+
+		alphasig = XBinsVector[j];
+		
+		MHFindSignificanceONOFF findsig;
+		findsig.SetRebin(RebinHistograms);
+		findsig.SetReduceDegree(ReduceDegree);	
+		findsig.SetUseFittedQuantities(fUseFittedQuantities);
+
+		// Dummy name for psfile 
+		TString psfilename = ("DummyPs"); 
+	    
+		findsig.FindSigmaONOFF(AlphaONAfterCuts, AlphaOFFAfterCuts, 
+				       NormalizationFactor, 
+				       alphabkgmin, alphabkgmax, 
+				       degree, degreeOFF,
+				       alphasig, 
+				       drawpoly, fitgauss, print, 
+				       saveplots, psfilename);
+
+
+
+		Significance = double(findsig.GetSignificance());
+
+		// so far there is not a variable that contains 
+		// NexONOFF or NexONOFFFitted (in class MHFindSignificanceONOFF) 
+		// according to the value of the variable fUseFittedQuantities.
+		// As soon as I have some time I will implement it (with the 
+		// corresponging GET member function) and will change 
+		// MFindSignificanceONOFF accordingly to make use of it.
+		
+		// For the time being, I will survive with an "if statement".
+
+		
+		if(fUseFittedQuantities)
+		  {
+		    Nex = double(findsig.GetNexONOFFFitted()); 
+		  }
+		else
+		  {
+		    Nex = double(findsig.GetNexONOFF()); 
+		  }
+
+
+		*fLog << endl << "Cut in alpha, Nex and significance : " 
+		      << alphasig << ", " << Nex << ", " << Significance << endl << endl;
+		
+	      
+		// updating histograms
+
+		tmpdouble = alphasig - AlphaBinWidth/2.0;
+
+		NexVSAlphaSigTestVector[i] -> Fill(tmpdouble, Nex);
+		SignificanceVSAlphaSigTestVector[i] -> Fill(tmpdouble, Significance);
+		
+	  
+
+		
+
+
+
+	      }	  
+	
+
+	    // Dynamic memory allocated in this loop is released
+	    
+    
+	    *fLog  << "Memory allocated by temporal alpha histograms "
+		   << "will be released" << endl;
+	    
+	    delete AlphaONAfterCuts;
+	    delete AlphaOFFAfterCuts;
+	    
+	  }
+
+
+
+
+
+
+
+
+      }
+    
+    rootfile.Close();
+
+
+   
+     // *************************************************************
+    // Histograms Nex and Significance vs alpha are written into 
+    // root file fAlphaDistributionsRootFilename
+
+    
+
+
+     *fLog <<"Histograms containing Nex and significance vs alphasig " 
+	  << " are saved into root file " << endl 
+	  << fAlphaDistributionsRootFilename << endl;
+    
+
+    TFile rootfiletowrite (fAlphaDistributionsRootFilename, "UPDATE", 
+			   "Alpha Distributions for several Theta bins");
+
+ 
+   for (Int_t i = 0; i < SuccessfulThetaBinsVector.GetSize(); i++)
+    {
+
+      if (fOptimizeParameters)
+	{// Histograms for train sample are written to root file
+
+	  if(NexVSAlphaSigTrainVector[i])
+	    {
+	      if(NexVSAlphaSigTrainVector[i]-> GetEntries() > 0.5)
+		NexVSAlphaSigTrainVector[i]-> Write();
+
+	    }
+
+	   if(SignificanceVSAlphaSigTrainVector[i])
+	    {
+	      if(SignificanceVSAlphaSigTrainVector[i]-> GetEntries() > 0.5)
+		SignificanceVSAlphaSigTrainVector[i]-> Write();
+	      
+	    }
+	}
+
+
+
+      if (fTestParameters)
+	{// Histograms for test sample are written to root file
+
+	  if(NexVSAlphaSigTestVector[i])
+	    {
+	      if(NexVSAlphaSigTestVector[i]-> GetEntries() > 0.5)
+		NexVSAlphaSigTestVector[i]-> Write();
+
+	    }
+
+	   if(SignificanceVSAlphaSigTestVector[i])
+	    {
+	      if(SignificanceVSAlphaSigTestVector[i]-> GetEntries() > 0.5)
+		SignificanceVSAlphaSigTestVector[i]-> Write();
+	      
+	    }
+	}
+	  
+
+
+    }
+    
+
+    rootfiletowrite.Close();
+
+ 
+
+
+    // Dynamic memory allocated is released 
+    
+    delete  XBinsVector; 
+
+    // function finished successfully... hopefully...
+    return kTRUE;
+
+}
+
+
+
+// Function that gets the histograms with the alpha distributions
+// (for all the theta bins specified by fCosThetaRangeVector)
+// stored in fAlphaDistributionsRootFilename, and combine them
+// (correcting OFF histograms with the normalization factors stored 
+// in NormFactorTrain or NormFactorTest) to get one single 
+// Alpha distribution for ON and another one for OFF. 
+// Then these histograms are given as arguments to 
+// the function MHFindSignificanceONOFF::FindSigmaONOFF, 
+// (Object of this class is created) to compute the 
+// Overall Excess events and  significance, that will be 
+// stored in variables fOverallNexTrain/Test and fOverallSigmaLiMaTrain/Test
+
+
+
+
+Bool_t MFindSupercutsONOFFThetaLoop::ComputeOverallSignificance(Bool_t CombineTrainData,
+								   Bool_t CombineTestData)
+{
+
+    // First of all let's check that we have the proper the "drinks" for the party
+
+    if (fAlphaDistributionsRootFilename.IsNull())
+    {
+	*fLog << "MFindSupercutsONOFFThetaLoop::ComputeOverallSignificance()" << endl
+	      << "Root file containing all alpha distributions "
+	      <<" (fAlphaDistributionsRootFilename) is not well defined." << endl
+	      << "Execution of the function is ABORTED" << endl;
+	return kFALSE;
+    }
+
+
+    if (fCosThetaRangeVector.GetSize() < 2)
+	
+    {
+	*fLog << "MFindSupercutsONOFFThetaLoop::ComputeOverallSignificance()" << endl
+	      << "Dimension of vector fCosThetaRangeVector is smaller than 2." 
+	      << "So, vector fCosThetaRangeVector is NOT properly defined" << endl
+	      << "Function execution will be ABORTED" << endl;
+
+	return kFALSE;
+    }
+
+    
+    TArrayI SuccessfulThetaBinsVector; 
+    // Vector containing the histogram index of the successfully 
+    // optimized theta bins. 
+    // It is filled with the contents of the histogram 
+    // fSuccessfulThetaBinsHist retrieved from the root 
+    // file fAlphaDistributionsRootFilename
+    // Remember that histogram index START AT 1 !!!
+
+    TH1F* CombinedAlphaTrainON = NULL;
+    TString CombinedAlphaTrainONName = ("CombinedAlphaTrainON");
+    TH1F* CombinedAlphaTrainOFF = NULL;
+    TString CombinedAlphaTrainOFFName = ("CombinedAlphaTrainOFF");
+   
+    TH1F* CombinedAlphaTestON = NULL;
+    TString CombinedAlphaTestONName = ("CombinedAlphaTestON");
+   
+    TH1F* CombinedAlphaTestOFF = NULL;
+    TString CombinedAlphaTestOFFName = ("CombinedAlphaTestOFF");
+   
+
+    
+
+    
+    Int_t NAlphaBins = 0; // Amount of bins of alpha histograms is expected to 
+    // be equal for all alpha histograms
+
+    // Vectors storing the computed error for each of the NAlphaBins 
+    // Only 2 vectors are needed for OFF Train and OFF Test sample, whose 
+    // alpha distributions are corrected with normalization factors. 
+
+    // The ON sample is just added (no normalization factors are applied) 
+    // and therefore, the error of the bin is the assumed by default 
+    // (i.e Sqrt(BinContent)
+
+    TArrayD ErrorInCombinedAlphaTrainOFF;
+    TArrayD ErrorInCombinedAlphaTestOFF;
+
+    TArrayD CombinedAlphaTrainOFFWithoutNormalization;
+    TArrayD CombinedAlphaTestOFFWithoutNormalization;
+    
+
+
+    const Double_t SmallQuantity = 0.01; // This quantity will be used as the 
+    // maximum difference between quantities (double) that are expected to be equal, 
+    // as the center of the bins in the several alpha distributions 
+
+    TH1F* NormFactorTrainHisto;
+    TString NormFactorTrainHistoName = ("NormFactorTrainHist");
+    TH1F* NormFactorTestHisto;
+    TString NormFactorTestHistoName = ("NormFactorTestHist");
+    TString SuccessfulThetaBinsHistoName = ("SuccessfulThetaBinsHist");
+    
+
+    TH1F* SuccessfulThetaBinsHisto;
+
+    TH1F* TmpTH1FHisto;
+
+    
+    // Retrieve number of theta bins that have to be combined
+    // from TArrayD fCosThetaRangeVector
+
+    Int_t tmpdim = fCosThetaRangeVector.GetSize() - 1;
+    const Int_t NThetaBins = tmpdim;
+
+    // Variables to store the mean normalization factor of the 
+    // combined OFF sample. 
+    // MeanNormFactor = Sum (NormFactor_i*Noff_i)/Sum (Noff_i)
+    
+
+    Double_t MeanNormFactorTrain = 0.0;
+    Double_t MeanNormFactorTest = 0.0;
+    
+    Double_t TotalNumberOFFTrain = 0.0;
+    Double_t TotalNumberOFFTest = 0.0;
+    
+
+
+    Double_t EventCounter = 0.0;// variable used to count events used to fill histograms
+    // it is double (and not Int) because the contents of an histogram bin might not 
+    // be an integer value... due to normalization factors !!
+    Int_t tmpint = 0;
+    Double_t tmpdouble = 0.0; // tmp variable double
+    Double_t tmpdouble2 = 0.0; // tmp variable double
+    Double_t tmperror = 0.0; // quantity used to store 
+    // temporaly the bin error in OFF histogram
+    Double_t tmpnormfactor = 0.0; // variable used to store normalization factor 
+    // of the theta bin i (used for TRAIN and TEST sample)
+             
+
+
+
+    // Open root file
+
+    
+
+    
+    *fLog << "MFindSupercutsONOFFThetaLoop::ComputeOverallSignificance()" << endl
+	  << "Opening root file " << fAlphaDistributionsRootFilename << endl;
+
+
+
+    TFile rootfile (fAlphaDistributionsRootFilename, "READ");
+
+    // Retrieving SuccessfulThetaBinsHisto from root file. 
+    
+
+    *fLog << "MFindSupercutsONOFFThetaLoop::ComputeOverallSignificance()" << endl
+	  << "Retrieving SuccessfulThetaBinsHisto from root file and filling vector "
+	  << " SuccessfulThetaBinsVector" << endl;
+
+
+    cout << "Getting histogram " << SuccessfulThetaBinsHistoName << endl;
+
+    SuccessfulThetaBinsHisto = (TH1F*) rootfile.Get(SuccessfulThetaBinsHistoName);
+    
+
+
+    // Check that bins in this histo correspond with the 
+    // CosTheta intervals defined by vector fCosThetaRangeVector
+
+	
+    if (SuccessfulThetaBinsHisto -> GetNbinsX() != NThetaBins)
+    {
+	*fLog << "MFindSupercutsONOFFThetaLoop::ComputeOverallSignificance()" 
+	      << endl
+	      << "Number of theta bins defined by vector fCosThetaRangeVector (" 
+	      << NThetaBins << ") does not match with the bins in histogram "
+	      << SuccessfulThetaBinsHistoName << "(" 
+	      << SuccessfulThetaBinsHisto -> GetNbinsX() << ")" << endl
+	      << "Function execution will be ABORTED." << endl;
+	return kFALSE;
+    }
+
+
+    // Filling vector SuccessfulThetaBinsVector
+
+    tmpint = 0;
+    for (Int_t i = 0; i < NThetaBins; i++)
+    {
+	if ((SuccessfulThetaBinsHisto -> GetBinContent(i+1)) > 0.5)
+	{
+	    tmpint++;
+	}
+    }
+
+    SuccessfulThetaBinsVector.Set(tmpint);
+    
+    tmpint = 0;
+    for (Int_t i = 0; i < NThetaBins; i++)
+    {
+	if ((SuccessfulThetaBinsHisto -> GetBinContent(i+1)) > 0.5)
+	{
+	    if(tmpint < SuccessfulThetaBinsVector.GetSize())
+	    {
+		SuccessfulThetaBinsVector[tmpint] = i+1;
+		tmpint++;
+	    }
+	    else
+	    {
+		*fLog << "MFindSupercutsONOFFThetaLoop::ComputeOverallSignificance()" 
+		      << endl
+		      << "Problem when filling vector 'SuccessfulThetaBinsVector'" 
+		      << endl
+		      << "Function execution will be ABORTED." << endl;
+		return kFALSE;
+	    }
+	    
+
+	}
+    }
+
+
+   
+
+
+    // *********  HISTOGRAMS FOR TRAIN SAMPLE WILL BE FILLED *********///
+
+    if (CombineTrainData)
+    {
+
+	// Retrieving NormFactorTrainHisto from root file. 
+	
+	NormFactorTrainHisto = (TH1F*) rootfile.Get(NormFactorTrainHistoName);
+	// NormFactorTrainHisto-> DrawCopy();
+
+	// Check that bins in this histo correspond with the 
+	// CosTheta intervals defined by vector fCosThetaRangeVector
+
+	
+	if (NormFactorTrainHisto -> GetNbinsX() != NThetaBins)
+	{
+	    *fLog << "MFindSupercutsONOFFThetaLoop::ComputeOverallSignificance()" 
+		  << endl
+		  << "Number of theta bins defined by vector fCosThetaRangeVector (" 
+		  << NThetaBins << ") does not match with the bins in histogram "
+		  << NormFactorTrainHistoName << "(" 
+		  << NormFactorTrainHisto -> GetNbinsX() << ")" << endl
+		  << "Function execution will be ABORTED." << endl;
+	    return kFALSE;
+	}
+
+	// histo test 
+	/*
+	cout << "NORMFACTORTRAINHIST  TEST: BinCenter and Value" << endl;
+	for (Int_t k = 0; k < NThetaBins; k++)
+	{
+	    
+	    cout << NormFactorTrainHisto -> GetBinCenter(k+1) 
+		 << ";  " << NormFactorTrainHisto -> GetBinContent(k+1)<< endl;
+	}
+	*/
+
+	for (Int_t i = 0; i < SuccessfulThetaBinsVector.GetSize(); i++)
+	{
+	    tmpdouble = NormFactorTrainHisto -> GetBinCenter(SuccessfulThetaBinsVector[i]);
+	    if (fCosThetaRangeVector[SuccessfulThetaBinsVector[i]-1] > tmpdouble || 
+		fCosThetaRangeVector[SuccessfulThetaBinsVector[i]] < tmpdouble)
+	    {
+		*fLog << "MFindSupercutsONOFFThetaLoop::ComputeOverallSignificance()" 
+		      << endl
+		      << "Bins defined by vector fCosThetaRangeVector " 
+		      << "do not match with the bins of histogram "
+		      << NormFactorTrainHistoName << endl
+		      << "CosTheta: " << fCosThetaRangeVector[SuccessfulThetaBinsVector[i]-1]
+		      << "-" << fCosThetaRangeVector[SuccessfulThetaBinsVector[i]] << endl
+		      << "NormFactorHist Bin: " <<  tmpdouble << endl
+		      << "Function execution will be ABORTED." << endl;
+
+		return kFALSE;
+	    }
+	    
+	}
+
+
+	// Let's summ up all ON alpha distributions
+	
+	EventCounter = 0;
+
+	for (Int_t i = 0; i < SuccessfulThetaBinsVector.GetSize(); i++)
+	{
+	    if (fThetaRangeStringVector[SuccessfulThetaBinsVector[i]-1].IsNull())
+	    {
+		*fLog << "MFindSupercutsONOFFThetaLoop::ComputeOverallSignificance()" 
+		      << endl
+		      << "Component " << SuccessfulThetaBinsVector[i]-1 
+		      << " of fThetaRangeStringVector is EMPTY"
+		      << endl
+		      << "Function execution will be ABORTED." << endl;
+		return kFALSE;
+
+		
+	    }
+
+	
+
+	    TString TmpHistoName = ("TrainAlphaAfterCuts");
+	    TmpHistoName += fThetaRangeStringVector[SuccessfulThetaBinsVector[i]-1];
+
+	    *fLog << "Getting Histogram with name " << endl
+		  << TmpHistoName << endl;
+
+	    if (i == 0)
+	    {      
+		CombinedAlphaTrainON = (TH1F*) rootfile.Get(TmpHistoName);
+		NAlphaBins = CombinedAlphaTrainON -> GetNbinsX();
+
+		// Name of histogram is set
+		CombinedAlphaTrainON -> SetName(CombinedAlphaTrainONName);
+
+		// update EventCounter
+		EventCounter += CombinedAlphaTrainON -> GetEntries();
+
+		// tmp
+		cout << "NAlphaBins in histo CombinedAlphaTrainON: "
+		     << NAlphaBins << endl;
+		// endtmp
+	    }
+	    else
+	    {
+		TmpTH1FHisto = (TH1F*) rootfile.Get(TmpHistoName);
+		
+		// update EventCounter
+		EventCounter += TmpTH1FHisto -> GetEntries();
+		
+		for (Int_t j = 1; j <= NAlphaBins; j++)
+		{
+		    // At some time alpha bins might not be the same for 
+		    // the different alpha distributions. That's why
+		    // I will check it before summing the alpha histo contents
+		    tmpdouble =  CombinedAlphaTrainON->GetBinCenter(j) -
+			TmpTH1FHisto->GetBinCenter(j);
+		    tmpdouble = TMath::Abs(tmpdouble);
+		    
+
+		    if (tmpdouble > SmallQuantity)
+		    {
+			*fLog << "MFindSupercutsONOFFThetaLoop::ComputeOverallSignificance()" 
+			      << endl
+			      << "Bins among the several alpha ON histograms "
+			      << "for TRAIN sample do not match"
+			      << endl
+			      << "Function execution will be ABORTED." << endl;
+			return kFALSE;
+		    }
+		    
+		    tmpdouble = CombinedAlphaTrainON->GetBinContent(j) + 
+			TmpTH1FHisto->GetBinContent(j);
+
+		    
+		    CombinedAlphaTrainON-> SetBinContent(j,tmpdouble);
+
+		}
+		
+		// Dynamic memory allocated for TmpTH1FHisto is released
+
+
+		//tmp
+		cout << "Memory allocated by temporal histogram TmpTH1FHisto "
+		     << "will be released" << endl;
+		//endtmp
+		delete TmpTH1FHisto;
+	    
+	    }
+
+
+	}
+
+	// Entries of histogram CombinedAlphaTrainON is set to 
+	// the events counted in EventCounter
+
+	tmpint = int (EventCounter);
+	CombinedAlphaTrainON->SetEntries(tmpint);
+
+	// Let's summ up all OFF alpha distributions
+	
+	EventCounter = 0;
+
+	for (Int_t i = 0; i < SuccessfulThetaBinsVector.GetSize(); i++)
+	{
+	    if (fThetaRangeStringVector[SuccessfulThetaBinsVector[i]-1].IsNull())
+	    {
+		*fLog << "MFindSupercutsONOFFThetaLoop::ComputeOverallSignificance()" 
+		      << endl
+		      << "Component " << SuccessfulThetaBinsVector[i]-1 
+		      << " of fThetaRangeStringVector is EMPTY"
+		      << endl
+		      << "Function execution will be ABORTED." << endl;
+		return kFALSE;
+
+		
+	    }
+
+	    TString TmpHistoName = ("TrainAlphaOFFAfterCuts");
+	    TmpHistoName += fThetaRangeStringVector[SuccessfulThetaBinsVector[i]-1];
+
+	    // Normalization constant for this theta bin is stored now in tmpnormfactor
+	    tmpnormfactor = NormFactorTrainHisto -> GetBinContent(SuccessfulThetaBinsVector[i]);
+
+	    // temp 
+	    cout << "Normalization factor for bin "
+		 << SuccessfulThetaBinsVector[i] << " is "
+		 << tmpnormfactor << endl;
+
+	    // endtemp
+
+	    if (i == 0)
+	    {
+		CombinedAlphaTrainOFF = (TH1F*) rootfile.Get(TmpHistoName);
+		NAlphaBins = CombinedAlphaTrainOFF -> GetNbinsX();
+		
+
+		// Name of histogram is set
+		CombinedAlphaTrainOFF -> SetName(CombinedAlphaTrainOFFName);
+
+		// Event counter is updated taking into account the 
+		// normalization factor
+
+		EventCounter += tmpnormfactor * CombinedAlphaTrainOFF -> GetEntries();
+
+		// Contribution to total number of OFF events and mean normfactor
+		// of this theta bin is computed
+
+		TotalNumberOFFTrain = CombinedAlphaTrainOFF -> GetEntries();
+		MeanNormFactorTrain = tmpnormfactor *
+		    CombinedAlphaTrainOFF -> GetEntries();
+		    
+		
+		
+		// ****
+		// Dimension of ErrorInCombinedAlphaTrainOFF is set
+		ErrorInCombinedAlphaTrainOFF.Set(NAlphaBins);
+		
+		CombinedAlphaTrainOFFWithoutNormalization.Set(NAlphaBins);
+
+		// Histogram now is normalized (to the respective ON data)
+		// by using the normalization constants stored in 
+		// histogram NormFactorTrainHisto
+
+		// Error of the normalized bins is computed and stored in 
+		// vector ErrorInCombinedAlphaTrainOFF
+		
+		for (Int_t j = 1; j <= NAlphaBins; j++)
+		{
+
+		    // Number of events (without normalization) are 
+		    // stored in vector CombinedAlphaTrainOFFWithoutNormalization
+
+			CombinedAlphaTrainOFFWithoutNormalization[j-1] = 
+			    CombinedAlphaTrainOFF -> GetBinContent(j);
+		   
+		    // Bin content is set
+		    tmpdouble2 = tmpnormfactor * 
+			CombinedAlphaTrainOFF -> GetBinContent(j);
+
+		    CombinedAlphaTrainOFF -> SetBinContent(j,tmpdouble2);
+
+		    // (Bin Error)^2 is computed and stored in 
+		    // ErrorInCombinedAlphaTrainOFF
+		    // Bin error = Sqrt(BinContent) X Normalization Factor
+
+		    tmperror = tmpdouble2*tmpnormfactor;
+		    ErrorInCombinedAlphaTrainOFF[j-1] = tmperror;
+
+		}
+
+	    }
+	    else
+	    {
+		TmpTH1FHisto = (TH1F*) rootfile.Get(TmpHistoName);
+
+
+		// Event counter is updated taking into account the 
+		// normalization factor
+
+		EventCounter += tmpnormfactor * TmpTH1FHisto -> GetEntries();
+
+		// Contribution to total number of OFF events and mean normfactor
+		// of this theta bin is computed
+
+		TotalNumberOFFTrain += TmpTH1FHisto -> GetEntries();
+		MeanNormFactorTrain += tmpnormfactor *
+		    TmpTH1FHisto -> GetEntries();
+
+		
+
+		for (Int_t j = 1; j <= NAlphaBins; j++)
+		{
+		    // At some time alpha bins might not be the same for 
+		    // the different alpha distributions. That's why
+		    // I will check it before summing the alpha histo contents
+		    tmpdouble2 =  CombinedAlphaTrainOFF->GetBinCenter(j) -
+			TmpTH1FHisto->GetBinCenter(j);
+		    tmpdouble2 = TMath::Abs(tmpdouble2);
+
+		    if (tmpdouble2 > SmallQuantity)
+		    {
+			*fLog << "MFindSupercutsONOFFThetaLoop::ComputeOverallSignificance()" 
+			      << endl
+			      << "Bins among the several alpha OFF histograms "
+			      << "for TRAIN sample do not match"
+			      << endl
+			      << "Function execution will be ABORTED." << endl;
+			return kFALSE;
+		    }
+		    
+
+		     // Number of events (without normalization) are 
+		    // added in vector CombinedAlphaTrainOFFWithoutNormalization
+		    
+		    CombinedAlphaTrainOFFWithoutNormalization[j-1] += 
+			TmpTH1FHisto -> GetBinContent(j);
+
+		    // Histogram bin contents must be normalized (to the respective ON data)
+		    // by using the normalization constants stored in 
+		    // histogram NormFactorTrainHisto before being added 
+		    // to CombinedAlphaTrainOFF
+
+		   
+		    tmpdouble2 = CombinedAlphaTrainOFF->GetBinContent(j) + 
+			(TmpTH1FHisto->GetBinContent(j) * tmpnormfactor);
+
+		    
+		    CombinedAlphaTrainOFF-> SetBinContent(j,tmpdouble2);
+
+
+		    // (Bin Error)^2 is computed and added to  
+		    // ErrorInCombinedAlphaTrainOFF 
+		    // Bin error = Sqrt(BinContent) X Normalization Factor
+
+		    tmperror = TmpTH1FHisto->GetBinContent(j) * tmpnormfactor;
+		    ErrorInCombinedAlphaTrainOFF[j-1] += tmperror;
+
+		}
+		
+		// Dynamic memory allocated for TmpTH1FHisto is released
+
+		delete TmpTH1FHisto;
+	    
+	    }
+
+	    
+
+
+
+	}
+
+	
+
+
+	// Mean Normalization factor is computed for the combined OFF histogram. 
+	// This factor will be used when computing the significance via 
+	// MHFindSignificance::FindSigmaONOFF().
+
+	// The bin contents (and errors) of teh combined OFF TRAIN histo will be 
+	// normalized (divided) by teh mean norm constant, so that 
+	// the histogram for OFF data given as argument in FindSigmaONOFF
+	// is equivalent to a non-normalized histogram. 
+	
+	MeanNormFactorTrain = MeanNormFactorTrain/TotalNumberOFFTrain;
+
+
+
+	// Sqrt(Contents) is performed in ErrorInCombinedAlphaTrainOFF, 
+	// in order to compute the real error in the bin content of histogram 
+	// CombinedAlphaTrainOFF.
+
+	// Then error and contents (normalized with mean normfctor) are
+	// set to histogram bin 	
+
+	for (Int_t j = 1; j <= NAlphaBins; j++)
+	{	    
+	    tmpdouble2 = 
+		(CombinedAlphaTrainOFF -> GetBinContent(j))/MeanNormFactorTrain;
+
+	    CombinedAlphaTrainOFF -> SetBinContent(j,tmpdouble2);
+
+	    ErrorInCombinedAlphaTrainOFF[j-1] = 
+		TMath::Sqrt(ErrorInCombinedAlphaTrainOFF[j-1])/MeanNormFactorTrain;
+	    // Proper error treatment when adding quantities to histogram bin 
+
+	    CombinedAlphaTrainOFF -> SetBinError(j,ErrorInCombinedAlphaTrainOFF[j-1]);
+
+	    // ******  TMP **************
+	    /*
+	    // Error computation assuming a given (no normalized) bin content
+
+	    tmpdouble = CombinedAlphaTrainOFF -> GetBinContent(j);
+
+	    if (CombinedAlphaTrainOFFWithoutNormalization[j-1] < SmallQuantity)
+	    {tmpnormfactor = 0;}
+	    else
+	    {tmpnormfactor = tmpdouble/CombinedAlphaTrainOFFWithoutNormalization[j-1];}
+
+	    tmperror = TMath::Sqrt(CombinedAlphaTrainOFFWithoutNormalization[j-1]) *
+		tmpnormfactor;
+
+	    CombinedAlphaTrainOFF -> SetBinError(j,tmperror);
+	    
+	    */
+	    // ******  END TMP **************			 
+
+	    // tmp
+	    /*
+	    cout << CombinedAlphaTrainOFF -> GetBinContent(j) << " +/-  " 
+		 << CombinedAlphaTrainOFF -> GetBinError(j)
+		 << "  Number Events without normalization: " 
+		 << CombinedAlphaTrainOFFWithoutNormalization[j-1] << endl;
+	    */
+	    // endtmp
+	    
+	}
+
+
+	// Entries of histogram CombinedAlphaTrainON is set to 
+	// the events counted during histogram filling
+
+	EventCounter = EventCounter/MeanNormFactorTrain;
+	tmpint = int (EventCounter);
+	CombinedAlphaTrainOFF->SetEntries(tmpint);
+
+
+	cout << "SILLY INFO FOR TRAIN SAMPLE: Total number of events Before nomralization and " 
+	     << " re-re normalized" << endl
+	     << TotalNumberOFFTrain << " - " << EventCounter << endl;
+
+    }
+
+    // *********  COMBINED  HISTOGRAMS FOR TRAIN SAMPLE ALREADY FILLED ********* ///
+
+
+
+
+    // *********  HISTOGRAMS FOR TEST SAMPLE WILL BE FILLED *********  ///
+
+
+    if (CombineTestData)
+    {
+
+	// Retrieving NormFactorTestHisto from root file. 
+	
+	NormFactorTestHisto = (TH1F*) rootfile.Get(NormFactorTestHistoName);
+	// NormFactorTestHisto-> DrawCopy();
+
+	// Check that bins in this histo correspond with the 
+	// CosTheta intervals defined by vector fCosThetaRangeVector
+
+	
+	if (NormFactorTestHisto -> GetNbinsX() != NThetaBins)
+	{
+	    *fLog << "MFindSupercutsONOFFThetaLoop::ComputeOverallSignificance()" 
+		  << endl
+		  << "Number of theta bins defined by vector fCosThetaRangeVector (" 
+		  << NThetaBins << ") does not match with the bins in histogram "
+		  << NormFactorTestHistoName << "(" 
+		  << NormFactorTestHisto -> GetNbinsX() << ")" << endl
+		  << "Function execution will be ABORTED." << endl;
+	    return kFALSE;
+	}
+
+	// histo test 
+	/*
+	cout << "NORMFACTORTRAINHIST  TEST: BinCenter and Value" << endl;
+	for (Int_t k = 0; k < NThetaBins; k++)
+	{
+	    
+	    cout << NormFactorTestHisto -> GetBinCenter(k+1) 
+		 << ";  " << NormFactorTestHisto -> GetBinContent(k+1)<< endl;
+	}
+	*/
+
+	
+
+	for (Int_t i = 0; i < SuccessfulThetaBinsVector.GetSize(); i++)
+	{
+	    tmpdouble = NormFactorTestHisto -> GetBinCenter(SuccessfulThetaBinsVector[i]);
+	    if (fCosThetaRangeVector[SuccessfulThetaBinsVector[i]-1] > tmpdouble || 
+		fCosThetaRangeVector[SuccessfulThetaBinsVector[i]] < tmpdouble)
+	    {
+		*fLog << "MFindSupercutsONOFFThetaLoop::ComputeOverallSignificance()" 
+		      << endl
+		      << "Bins defined by vector fCosThetaRangeVector " 
+		      << "do not match with the bins of histogram "
+		      << NormFactorTestHistoName << endl
+		      << "CosTheta: " << fCosThetaRangeVector[SuccessfulThetaBinsVector[i]-1]
+		      << "-" << fCosThetaRangeVector[SuccessfulThetaBinsVector[i]] << endl
+		      << "NormFactorHist Bin: " <<  tmpdouble << endl
+		      << "Function execution will be ABORTED." << endl;
+
+		return kFALSE;
+	    }
+	    
+	}
+
+
+	// Let's summ up all ON alpha distributions
+
+	// Event counter (counts events used in the histogram filling) is 
+	// initialized to zero
+
+	EventCounter = 0;
+
+	for (Int_t i = 0; i < SuccessfulThetaBinsVector.GetSize(); i++)
+	{
+	    if (fThetaRangeStringVector[SuccessfulThetaBinsVector[i]-1].IsNull())
+	    {
+		*fLog << "MFindSupercutsONOFFThetaLoop::ComputeOverallSignificance()" 
+		      << endl
+		      << "Component " << SuccessfulThetaBinsVector[i]-1 
+		      << " of fThetaRangeStringVector is EMPTY"
+		      << endl
+		      << "Function execution will be ABORTED." << endl;
+		return kFALSE;
+
+		
+	    }
+
+	
+
+	    TString TmpHistoName = ("TestAlphaAfterCuts");
+	    TmpHistoName += fThetaRangeStringVector[SuccessfulThetaBinsVector[i]-1];
+
+	    *fLog << "Getting Histogram with name " << endl
+		  << TmpHistoName << endl;
+
+	    if (i == 0)
+	    {      
+		CombinedAlphaTestON = (TH1F*) rootfile.Get(TmpHistoName);
+		NAlphaBins = CombinedAlphaTestON -> GetNbinsX();
+
+		// Name of histogram is set
+		CombinedAlphaTestON -> SetName(CombinedAlphaTestONName);
+
+		// EventCounter is updated
+		
+		EventCounter += CombinedAlphaTestON -> GetEntries();
+
+		// tmp
+		cout << "NAlphaBins in histo CombinedAlphaTestON: "
+		     << NAlphaBins << endl;
+		// endtmp
+	    }
+	    else
+	    {
+		TmpTH1FHisto = (TH1F*) rootfile.Get(TmpHistoName);
+
+		// EventCounter is updated
+		
+		EventCounter += TmpTH1FHisto -> GetEntries();
+
+		for (Int_t j = 1; j <= NAlphaBins; j++)
+		{
+		    // At some time alpha bins might not be the same for 
+		    // the different alpha distributions. That's why
+		    // I will check it before summing the alpha histo contents
+		    tmpdouble =  CombinedAlphaTestON->GetBinCenter(j) -
+			TmpTH1FHisto->GetBinCenter(j);
+		    tmpdouble = TMath::Abs(tmpdouble);
+		    
+
+		    if (tmpdouble > SmallQuantity)
+		    {
+			*fLog << "MFindSupercutsONOFFThetaLoop::ComputeOverallSignificance()" 
+			      << endl
+			      << "Bins among the several alpha ON histograms "
+			      << "for TEST sample do not match"
+			      << endl
+			      << "Function execution will be ABORTED." << endl;
+			return kFALSE;
+		    }
+		    
+		    tmpdouble = CombinedAlphaTestON->GetBinContent(j) + 
+			TmpTH1FHisto->GetBinContent(j);
+
+		    
+		    CombinedAlphaTestON-> SetBinContent(j,tmpdouble);
+
+		}
+		
+		// Dynamic memory allocated for TmpTH1FHisto is released
+
+
+		//tmp
+		cout << "Memory allocated by temporal histogram TmpTH1FHisto "
+		     << "will be released" << endl;
+		//endtmp
+		delete TmpTH1FHisto;
+	    
+	    }
+
+
+
+
+	}
+
+	// Entries of histogram CombinedAlphaTestON is set to 
+	// the events counted during histogram filling
+	tmpint = int (EventCounter);
+	CombinedAlphaTestON->SetEntries(tmpint);
+
+
+	// Let's summ up all OFF alpha distributions
+
+	EventCounter = 0;
+
+	for (Int_t i = 0; i < SuccessfulThetaBinsVector.GetSize(); i++)
+	{
+	    if (fThetaRangeStringVector[SuccessfulThetaBinsVector[i]-1].IsNull())
+	    {
+		*fLog << "MFindSupercutsONOFFThetaLoop::ComputeOverallSignificance()" 
+		      << endl
+		      << "Component " << SuccessfulThetaBinsVector[i]-1 
+		      << " of fThetaRangeStringVector is EMPTY"
+		      << endl
+		      << "Function execution will be ABORTED." << endl;
+		return kFALSE;
+
+		
+	    }
+
+	    TString TmpHistoName = ("TestAlphaOFFAfterCuts");
+	    TmpHistoName += fThetaRangeStringVector[SuccessfulThetaBinsVector[i]-1];
+
+	    // Normalization constant for this theta bin is stored now in tmpnormfactor
+	    tmpnormfactor = NormFactorTestHisto -> GetBinContent(SuccessfulThetaBinsVector[i]);
+
+	    // temp 
+	    cout << "Normalization factor for bin "
+		 << SuccessfulThetaBinsVector[i] << " is "
+		 << tmpnormfactor << endl;
+
+	    // endtemp
+
+	    if (i == 0)
+	    {
+		CombinedAlphaTestOFF = (TH1F*) rootfile.Get(TmpHistoName);
+		NAlphaBins = CombinedAlphaTestOFF -> GetNbinsX();
+	       
+
+		// Name of histogram is set
+		CombinedAlphaTestOFF -> SetName(CombinedAlphaTestOFFName);
+
+		// EventCounter is updated taking into account 
+		// normalization factor
+		
+		EventCounter += tmpnormfactor*CombinedAlphaTestOFF -> GetEntries();
+
+		
+		// Contribution to total number of OFF events and mean normfactor
+		// of this theta bin is computed
+
+		TotalNumberOFFTest = CombinedAlphaTestOFF -> GetEntries();
+		MeanNormFactorTest = tmpnormfactor *
+		    CombinedAlphaTestOFF -> GetEntries();
+
+
+		// Dimension of ErrorInCombinedAlphaTrainOFF is set
+		ErrorInCombinedAlphaTestOFF.Set(NAlphaBins);
+
+		CombinedAlphaTestOFFWithoutNormalization.Set(NAlphaBins);
+
+
+		// Histogram now is normalized (to the respective ON data)
+		// by using the normalization constants stored in 
+		// histogram NormFactorTestHisto
+
+		
+		for (Int_t j = 1; j <= NAlphaBins; j++)
+		{
+
+		    // Vector containing number of events without 
+		    // normalization is filled
+		   
+			CombinedAlphaTestOFFWithoutNormalization[j-1] = 
+			    CombinedAlphaTestOFF -> GetBinContent(j);
+		   
+
+
+		    tmpdouble2 = tmpnormfactor * 
+			CombinedAlphaTestOFF -> GetBinContent(j);
+
+		    CombinedAlphaTestOFF -> SetBinContent(j,tmpdouble2);
+
+		    // (Bin Error)^2 is computed and stored in 
+		    // ErrorInCombinedAlphaTestOFF
+		    // Bin error = Sqrt(BinContent) X Normalization Factor
+
+		    tmperror = tmpdouble2*tmpnormfactor;
+		    ErrorInCombinedAlphaTestOFF[j-1] = tmperror;
+
+
+		}
+
+	    }
+	    else
+	    {
+		TmpTH1FHisto = (TH1F*) rootfile.Get(TmpHistoName);
+
+
+		// EventCounter is updated taking into account 
+		// normalization factor
+		
+		EventCounter += tmpnormfactor* TmpTH1FHisto-> GetEntries();
+
+		// Contribution to total number of OFF events and mean normfactor
+		// of this theta bin is computed
+
+
+		TotalNumberOFFTest += TmpTH1FHisto -> GetEntries();
+		MeanNormFactorTest += tmpnormfactor *
+		    TmpTH1FHisto -> GetEntries();
+
+
+
+		for (Int_t j = 1; j <= NAlphaBins; j++)
+		{
+		    // At some time alpha bins might not be the same for 
+		    // the different alpha distributions. That's why
+		    // I will check it before summing the alpha histo contents
+		    tmpdouble2 =  CombinedAlphaTestOFF->GetBinCenter(j) -
+			TmpTH1FHisto->GetBinCenter(j);
+		    tmpdouble2 = TMath::Abs(tmpdouble2);
+
+		    if (tmpdouble2 > SmallQuantity)
+		    {
+			*fLog << "MFindSupercutsONOFFThetaLoop::ComputeOverallSignificance()" 
+			      << endl
+			      << "Bins among the several alpha OFF histograms "
+			      << "for TRAIN sample do not match"
+			      << endl
+			      << "Function execution will be ABORTED." << endl;
+			return kFALSE;
+		    }
+		    
+
+		    // Vector containing number of events without 
+		    // normalization is updated
+
+		    // Vector containing number of events without 
+		    // normalization is filled
+		   
+			CombinedAlphaTestOFFWithoutNormalization[j-1] += 
+			    TmpTH1FHisto -> GetBinContent(j);
+		   
+
+
+
+		    
+		    
+		    // Histogram bin contents must be normalized (to the respective ON data)
+		    // by using the normalization constants stored in 
+		    // histogram NormFactorTestHisto before being added 
+		    // to CombinedAlphaTestOFF
+
+		   
+		    tmpdouble2 = CombinedAlphaTestOFF->GetBinContent(j) + 
+			(TmpTH1FHisto->GetBinContent(j) * tmpnormfactor);
+
+		    
+		    CombinedAlphaTestOFF-> SetBinContent(j,tmpdouble2);
+
+
+		     // (Bin Error)^2 is computed and added to  
+		    // ErrorInCombinedAlphaTestOFF 
+		    // Bin error = Sqrt(BinContent) X Normalization Factor
+
+		    tmperror = TmpTH1FHisto->GetBinContent(j) * tmpnormfactor;
+		    ErrorInCombinedAlphaTestOFF[j-1] += tmperror;
+
+
+		}
+		
+		// Dynamic memory allocated for TmpTH1FHisto is released
+
+		delete TmpTH1FHisto;
+	    
+	    }
+
+	    
+
+
+
+	}
+
+
+
+	// Mean Normalization factor is computed for the combined OFF histogram. 
+	// This factor will be used when computing the significance via 
+	// MHFindSignificance::FindSigmaONOFF().
+
+	// The bin contents (and errors) of teh combined OFF TEST histo will be 
+	// normalized (divided) by teh mean norm constant, so that 
+	// the histogram for OFF data given as argument in FindSigmaONOFF
+	// is equivalent to a non-normalized histogram. 
+	
+	MeanNormFactorTest = MeanNormFactorTest/TotalNumberOFFTest;
+
+
+
+	// Sqrt(Contents) is performed in ErrorInCombinedAlphaTestOFF, 
+	// in order to compute the real error in the bin content of histogram 
+	// CombinedAlphaTestOFF.
+
+	// Then error and contents (normalized with mean normfctor) are
+	// set to histogram bin 	
+
+
+
+
+	
+	for (Int_t j = 1; j <= NAlphaBins; j++)
+	{
+
+	    tmpdouble2 = 
+		(CombinedAlphaTestOFF -> GetBinContent(j))/MeanNormFactorTest;
+
+	    CombinedAlphaTestOFF -> SetBinContent(j,tmpdouble2);
+
+	    ErrorInCombinedAlphaTestOFF[j-1] = 
+		TMath::Sqrt(ErrorInCombinedAlphaTestOFF[j-1])/MeanNormFactorTest;
+
+	    // Proper error treatment for the bin contents 
+	    CombinedAlphaTestOFF -> SetBinError(j,ErrorInCombinedAlphaTestOFF[j-1]);
+	    
+	    
+	    // ******  TMP **************
+	    /*
+	    // Error computation assuming a given (no normalized) bin content
+	    
+	    tmpdouble = CombinedAlphaTestOFF -> GetBinContent(j);
+
+	    if (CombinedAlphaTestOFFWithoutNormalization[j-1] < SmallQuantity)
+	    {tmpnormfactor = 0;}
+	    else
+	    {tmpnormfactor = tmpdouble/CombinedAlphaTestOFFWithoutNormalization[j-1];}
+	   
+	    tmperror = (TMath::Sqrt(CombinedAlphaTestOFFWithoutNormalization[j-1])) * tmpnormfactor;
+	    
+	    CombinedAlphaTestOFF -> SetBinError(j,tmperror);
+	    
+	    */
+	    
+	    // ******  ENDTMP **************
+	    
+	    // tmp
+	    // cout << CombinedAlphaTestOFF -> GetBinContent(j) << " +/-  " 
+	    //	 << CombinedAlphaTestOFF -> GetBinError(j) << endl;
+	    
+	    // endtmp
+
+	}
+
+
+	
+	// Entries of histogram CombinedAlphaTestOFF is set to 
+	// the events counted during histogram filling
+	
+	EventCounter = EventCounter/MeanNormFactorTest;
+	tmpint = int(EventCounter);
+	CombinedAlphaTestOFF->SetEntries(tmpint);
+
+
+	cout << "SILLY INFO FOR TEST SAMPLE: Total number of events Before nomralization and " 
+	     << " re-re normalized" << endl
+	     << TotalNumberOFFTest << " - " << EventCounter << endl;
+
+	/*
+	// Sumw2() test
+
+	cout << "********   TEST   ********* " << endl;
+	cout << "Sumw2() is executed: " << endl;
+	CombinedAlphaTestOFF -> Sumw2();
+	for (Int_t j = 1; j <= NAlphaBins; j++)
+	{
+	     // tmp
+	    cout << CombinedAlphaTestOFF -> GetBinContent(j) << " +/-  " 
+		 << CombinedAlphaTestOFF -> GetBinError(j) << endl;
+	    
+	    // endtmp
+
+	}
+	  
+	*/
+	
+	
+
+    }
+
+
+
+     // *********  COMBINED  HISTOGRAMS FOR TEST SAMPLE ALREADY FILLED ********* ///
+
+
+    /*
+    CombinedAlphaTrainON-> DrawCopy();
+    gPad -> SaveAs("tmpONTrain.ps");
+
+    CombinedAlphaTrainOFF-> DrawCopy();
+    gPad -> SaveAs("tmpOFFTrain.ps");
+
+
+    CombinedAlphaTestON-> DrawCopy();
+    gPad -> SaveAs("tmpONTest.ps");
+
+    CombinedAlphaTestOFF-> DrawCopy();
+    gPad -> SaveAs("tmpOFFTest.ps");
+
+    */
+    
+
+    // ****  COMPUTATION OF SIGNIFICANCES FOR COMBINED ALPHA HISTOGRAMS  ****** ///
+    
+    if (SuccessfulThetaBinsVector.GetSize() >= 1)
+    {
+	// There is, at least, ONE theta bin for which optimization of 
+	// supercuts was SUCCESSFUL, and thus, it is worth to 
+	// compute significance of signal
+
+		
+	// Significance is found using MHFindSignificanceONOFF::FindSigmaONOFF
+	
+
+	
+	// Maximum value of alpha below which signal is expected
+	const Double_t alphasig = fAlphaSig; 
+
+	// Minimum value of alpha for bkg region in ON data
+	const Double_t alphabkgmin = fAlphaBkgMin;
+	
+	// Maximum value of alpha for bkg region in ON data
+	const Double_t alphabkgmax = fAlphaBkgMax;
+	
+	// degree of polynomial function used to fit ON data in background region
+	const Int_t    degree   =    2;
+
+	// degree of polynomial function used to fit OFF data in all alpha region (0-90)
+	const Int_t    degreeOFF   =    2;
+
+	const Bool_t   drawpoly  = kTRUE;
+	const Bool_t   fitgauss  = kTRUE;
+	const Bool_t   print     = kTRUE;
+    
+	const Bool_t saveplots   = kTRUE; // Save final alpha plot for ON and OFF 
+	// (with Nex and significance) in Psfile
+   
+
+
+
+	MHFindSignificanceONOFF findsig;
+	findsig.SetRebin(kTRUE);
+	findsig.SetReduceDegree(kFALSE);
+
+	
+
+	if (CombineTrainData)
+	{
+
+	    // Name of psfile where Alpha plot will be stored
+	    TString psfilename = ("TRAINSampleCombined"); 
+	    
+	    findsig.FindSigmaONOFF(CombinedAlphaTrainON, CombinedAlphaTrainOFF, 
+				   MeanNormFactorTrain, 
+				   alphabkgmin, alphabkgmax, 
+				   degree, degreeOFF,
+				   alphasig, 
+				   drawpoly, fitgauss, print, 
+				   saveplots, psfilename);
+
+
+	  fOverallSigmaLiMaTrain = double(findsig.GetSignificance());
+	  fOverallNexTrain = double(findsig.GetNexONOFF());
+
+	  *fLog << "MFindSupercutsONOFFThetaLoop::ComputeOverallSignificance" << endl
+		<< "After performing the combined analysis for TRAIN sample it was found " 
+		<< "the following Nex and Significance: " <<  fOverallNexTrain 
+		<< ", " << fOverallSigmaLiMaTrain << endl;
+	      
+
+	}
+
+
+	if (CombineTestData)
+	{
+
+	    // Name of psfile where Alpha plot will be stored
+	    TString psfilename = ("TESTSampleCombined"); 
+	    
+	    findsig.FindSigmaONOFF(CombinedAlphaTestON, CombinedAlphaTestOFF, 
+				   MeanNormFactorTest, 
+				   alphabkgmin, alphabkgmax, 
+				   degree, degreeOFF,
+				   alphasig, 
+				   drawpoly, fitgauss, print, 
+				   saveplots, psfilename);
+
+	    fOverallSigmaLiMaTest = double(findsig.GetSignificance());
+	    fOverallNexTest = double(findsig.GetNexONOFF());
+	    
+	    *fLog << "MFindSupercutsONOFFThetaLoop::ComputeOverallSignificance" << endl
+		  << "After performing the combined analysis for TEST sample it was found " 
+		  << "the following Nex and Significance: " <<  fOverallNexTest 
+		  << ", " << fOverallSigmaLiMaTest << endl;
+	    
+	}
+	
+	
+
+	
+    }
+
+
+    return kTRUE;
+}
+
+    
+    
+
+
+
+
+
Index: trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MFindSupercutsONOFFThetaLoop.h
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MFindSupercutsONOFFThetaLoop.h	(revision 4411)
+++ trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MFindSupercutsONOFFThetaLoop.h	(revision 4411)
@@ -0,0 +1,443 @@
+#ifndef MARS_MFindSupercutsONOFFThetaLoop
+#define MARS_MFindSupercutsONOFFThetaLoop
+
+#ifndef MARS_MParContainer
+#include "MParContainer.h"
+#endif
+
+#ifndef ROOT_TArrayD
+#include <TArrayD.h>
+#endif
+#ifndef ROOT_TArrayI
+#include <TArrayI.h>
+#endif
+
+#ifndef ROOT_TH1F
+#include <TH1F.h>
+#endif
+
+#ifndef ROOT_TPostScript
+#include <TPostScript.h>
+#endif
+
+
+class MFilter;
+class MEvtLoop;
+class MH3;
+class MSupercutsCalcONOFF;
+class MFindSupercutsONOFF;
+class MGeomCam;
+class MHMatrix;
+
+
+class MFindSupercutsONOFFThetaLoop : public MParContainer
+{
+private:
+
+  TString fDataONRootFilename;
+  TString fDataOFFRootFilename;
+
+
+  TString fPathForFiles; // Path to directory where files (PsFiles, rootfiles) will be stored
+
+  
+  TString*  fOptSCParamFilenameVector; // Pointer to vector of TStrings containing name of the root files where optimized supercuts will be stored. To be created and filled once Vector of Costheta ranges is defined
+
+  
+
+
+  // Vectors containing the names of the root files where matrices 
+  // will be stored for Train/Test ON/OFF samples.
+  // To be defined and filled once vector fCosThetaRangeVector is 
+  // defined
+
+  TString* fTrainMatrixONFilenameVector;
+  TString* fTestMatrixONFilenameVector;
+  TString* fTrainMatrixOFFFilenameVector;
+  TString* fTestMatrixOFFFilenameVector;
+  
+
+  Double_t fAlphaSig; // Max alpha value were signal is expected
+
+
+  // Background range (in alpha) is defined by the member variables 
+  // fAlphaBkgMin and fAlphaBkgMax
+  Double_t fAlphaBkgMin; 
+  Double_t fAlphaBkgMax; 
+
+
+  // Size range of events used to fill the data matrices  
+  // is defined by the following variables
+
+  Double_t fSizeCutLow;
+  Double_t fSizeCutUp;
+
+  
+ // Variables for binning of alpha plots
+  
+  Int_t fNAlphaBins;
+  Double_t fAlphaBinLow;
+  Double_t fAlphaBinUp;
+
+
+
+  // Boolean variable used to disable the usage ("serious" usage) of the 
+  // quantities computed from fits. This will be useful in those cases 
+  // where there is too few events to perform a decent fit to the 
+  // alpha histograms. In general this variable will be always kTRUE
+  
+  Bool_t fUseFittedQuantities;
+
+
+  Double_t fPolyGaussFitAlphaSigma;
+
+
+  Double_t fWhichFractionTrain;  // number <= 1; specifying fraction of ON Train events
+  Double_t fWhichFractionTest;  // number <= 1; specifying fraction of ON Test events
+
+   Double_t fWhichFractionTrainOFF;  // number <= 1; specifying fraction of OFF  Train events
+  Double_t fWhichFractionTestOFF;  // number <= 1; specifying fraction of OFF Test events
+
+  Double_t fThetaMin; // Cuts in ThetaOrig.fVal (in rad!!!)
+  Double_t fThetaMax; // Cuts in ThetaOrig.fVal (in rad !!!)
+  TArrayD fCosThetaRangeVector; // vector containing the 
+  // theta ranges that will be used in the 
+  // optimization
+
+  TString* fThetaRangeStringVector; // Pointer to vector of TStrings that contain Cos theta ranges specified in fCosThetaRangeVector. It will be used to identify alpha distributions stored in fAlphaDistributionsRootFilename
+
+  TArrayD fCosThetaBinCenterVector; // vector containing the 
+  // theta bin centers of the theta ranges/bins contained in 
+  // fCosThetaRangeVector
+
+  Double_t fActualCosThetaBinCenter; // Theta value used to fill 
+  // the histograms fNormFactorTrainHist, fNormFactorTestHist, 
+  // fSigmaLiMaTrainHist ...
+
+  
+
+  Double_t fOverallNexTrain;
+  Double_t fOverallNexTest;
+
+  Double_t fOverallSigmaLiMaTrain;
+  Double_t fOverallSigmaLiMaTest;
+  
+
+  TH1F* fSuccessfulThetaBinsHist; // Hist containing theta bins were optimization was successful
+
+  TH1F* fNormFactorTrainHist; // Hist containing norm factors train for all Cos theta ranges
+  TH1F* fNormFactorTestHist; // Hist containing norm factors test for all Cos theta ranges
+  TH1F* fSigmaLiMaTrainHist; // Hist containing SigmaLiMa for Train samples for all Cos theta ranges
+  TH1F* fSigmaLiMaTestHist; // Hist containing SigmaLiMa for Test samples for all Cos theta ranges
+  TH1F* fNexTrainHist; // Hist containing Number os excess events for Train sample for all Cos thetas
+  TH1F* fNexTestHist; // Hist containing Number os excess events for Test sample for all Cos theta
+
+  TH1F* fNEvtsInTrainMatrixONHist; // Hist containing total number of events in Train Matrices of ON data for all Cos theta ranges
+  TH1F* fNEvtsInTestMatrixONHist; // Hist containing total number of events in Test Matrices of ON data for all Cos theta ranges
+  TH1F* fNEvtsInTrainMatrixOFFHist; // Hist containing total number of events in Train Matrices of OFF data for all Cos theta ranges
+  TH1F* fNEvtsInTestMatrixOFFHist; // Hist containing total number of events in Test Matrices of OFF data for all Cos theta ranges
+  
+
+
+ 
+  // Boolean variable that controls wether the optimization of the 
+  // parameters (MMinuitInterface::CallMinuit(..) in function FindParams(..))
+  // takes place or not. kTRUE will skip such optimization.
+  // This variable is useful to test the optmized parameters (previously found 
+  // and stored in root file) on the TRAIN sample.
+
+  Bool_t fSkipOptimization;
+
+
+
+
+  // Boolean variable that allows the user to write the initial parameters 
+  // into the root file that will be used to store the optimum cuts.
+  // If fUseInitialSCParams = kTRUE , parameters are written.
+  // In this way, the initial SC parameters can be applied on the data (train/test) 
+  
+  // The initial parameters are ONLY written to the root file if 
+  // there is NO SC params optimization, i.e., if variable 
+  // fSkipOptimization = kTRUE;
+  
+  // The default value is obviously kFALSE.
+
+  Bool_t fUseInitialSCParams;
+
+
+  Double_t fGammaEfficiency; // Fraction of gammas that remain after cuts
+  // Quantity that will have to be determined with MC
+
+  Bool_t fTuneNormFactor; // If true, normalization factors are corrected 
+  // using the estimated number of gammas and the gamma efficiency
+  // fNormFactor = fNormFactor - Ngammas/EventsInMatrixOFF
+
+
+  // Boolean variable used to determine wether the normalization factor is 
+  // computed from method 1) or 2)
+  // 1) Using total number of ON and OFF events before cuts, and tuning the factor 
+  //    correcting for "contamination" of gamma events in ON sample
+  // 2) Using number of ON and OFF events after cuts in the background 
+  //    region determined by variables fAlphaBkgMin-fAlphaBkgMax
+ 
+  Bool_t fNormFactorFromAlphaBkg; // if kTRUE, method 2) is used
+
+
+  // Boolean variable used to control decide wether to use theta information 
+  // in the computation of teh dynamical cuts.
+  Bool_t fNotUseTheta;
+  
+  // Boolean variable used to decide wether to use dynamical cuts or static cuts
+  // kTRUE means that static cuts are used. 
+  Bool_t fUseStaticCuts;
+
+
+  // Names for the Hadronness containers for ON and OFF data
+
+  TString  fHadronnessName;
+  TString  fHadronnessNameOFF;
+
+  // Vectors where initial SC parameters and steps are stored. 
+  // If these vectors are empty, initial SC parameters and steps 
+  // are taken from Supercuts container. 
+  // They will be intialized to empty vectors in constructor
+
+  TArrayD fInitSCPar;
+  TArrayD fInitSCParSteps;
+
+  
+
+  // Name of Postscript file where, for each theta bin,  alpha ON and OFF distributions 
+  //  after cuts (and hence, Nex and SigmaLiMa computations) will be stored
+  // If fAlphaDistributionsPostScriptFilename is not defined, postscript file is not 
+  // produced. It is an optional variable...
+
+  // Still not working...
+ 
+  TPostScript* fPsFilename; 
+
+
+  // ********************************************************
+  // Due to the failure of the use of object TPostScript
+  // to make a Ps document with all plots, I decided to use the 
+  // standard way (SaveAs(filename.ps)) to store plots related 
+  // to alpha distributions 
+  // for ON and OFF and BEFORE and AFTER cuts (VERY IMPORTANT
+  // TO COMPUTE EFFICIENCIES IN CUTS) 
+  
+  // Psfilename is set inside function LoopOverThetaRanges()
+  // and given to the object MFindSupercutsONOFF created 
+  // within this loop.
+
+  // This will have to be removed as soon as the TPostScript
+  // solutions works...
+  // ********************************************************
+  
+
+  TString fAlphaDistributionsRootFilename;
+  // Root file where histograms containing the ON alpha distribution and the 
+  // OFF alpha distribution (non normalized) , AFTER CUTS, are stored.
+  // Histograms containing the normalization factors, Nex and SigmaLiMa for 
+  // each theta bin will be also stored there.
+  // This name MUST be defined, since the histograms 
+  // stored there will be used by 
+  // function XXX to compute an overall Nex and sigmaLiMa 
+  // combining all those histograms
+
+  // Boolean variables seting flags for loop over theta ranges
+
+  Bool_t fReadMatricesFromFile;
+  Bool_t fOptimizeParameters;
+  Bool_t fTestParameters;
+  
+   //--------------------------------------------
+
+
+public:
+  MFindSupercutsONOFFThetaLoop(const char *name=NULL, 
+				  const char *title=NULL);
+  ~MFindSupercutsONOFFThetaLoop();
+
+  void SetHadronnessName(const TString &name)   
+      {fHadronnessName = name;}
+  void SetHadronnessNameOFF(const TString &name)   
+      {fHadronnessNameOFF = name;}
+
+  void SetPathForFiles(const TString &path)
+      {fPathForFiles = path;}
+
+  void SetDataONOFFRootFilenames(const TString &name1, const TString &name2 ) 
+      {fDataONRootFilename = name1;  fDataOFFRootFilename = name2; }
+
+
+
+  // Names of root files containing matrices and  optimizedparameters 
+   Bool_t SetALLNames(); 
+
+  // Function to set names manually... in case matrices are 
+  // already defined...
+
+  Bool_t SetNamesManually(TString* OptSCParamFilenameVector, 
+			  TString* ThetaRangeStringVector,
+			  TString* TrainMatrixONFilenameVector,
+			  TString* TestMatrixONFilenameVector,
+			  TString* TrainMatrixOFFFilenameVector,
+			  TString* TestMatrixOFFFilenameVector) 
+
+      {   
+	  fOptSCParamFilenameVector = OptSCParamFilenameVector;
+	  fThetaRangeStringVector = ThetaRangeStringVector;
+	  fTrainMatrixONFilenameVector = TrainMatrixONFilenameVector;
+	  fTestMatrixONFilenameVector = TestMatrixONFilenameVector;
+	  fTrainMatrixOFFFilenameVector = TrainMatrixOFFFilenameVector;
+	  fTestMatrixOFFFilenameVector = TestMatrixOFFFilenameVector; 
+
+	  return kTRUE;
+      }
+  
+  Bool_t SetAlphaDistributionsRootFilename(const TString &name); 
+
+
+  Bool_t SetAlphaSig (Double_t alphasig);
+
+  Bool_t SetAlphaBkgMin (Double_t alphabkgmin);
+  Bool_t SetAlphaBkgMax (Double_t alphabkgmax);
+
+  Bool_t CheckAlphaSigBkg();
+
+  void SetPostScriptFile(TPostScript* PsFile);
+
+
+  Bool_t SetCosThetaRangeVector (const TArrayD &d);
+  
+  Bool_t SetThetaRange (Int_t thetabin);
+
+
+  void SetAlphaPlotBinining(Int_t nbins, Double_t binlow, Double_t binup)
+    { fNAlphaBins = nbins; fAlphaBinLow = binlow; fAlphaBinUp = binup;}
+
+  Bool_t SetNormFactorTrainHist();
+  Bool_t SetNormFactorTestHist();
+  Bool_t SetSigmaLiMaTrainHist();
+  Bool_t SetSigmaLiMaTestHist();
+  Bool_t SetNexTrainHist();
+  Bool_t SetNexTestHist();
+  Bool_t SetNexSigmaLiMaNormFactorNEvtsTrainTestHist();
+  Bool_t SetSuccessfulThetaBinsHist();
+  void WriteNexSigmaLiMaNormFactorNEvtsTrainTestHistToFile();
+
+  void WriteSuccessfulThetaBinsHistToFile();
+  
+  
+  Bool_t SetInitSCPar (TArrayD &d);
+  Bool_t SetInitSCParSteps (TArrayD &d);
+
+  
+
+  Bool_t ReadSCParamsFromAsciiFile(const char* filename, Int_t Nparams);
+
+
+  void SetFractionTrainTestOnOffEvents(Double_t fontrain, 
+				       Double_t fontest, 
+				       Double_t fofftrain,
+				       Double_t fofftest);
+
+   void SetTuneNormFactor(Bool_t b) {fTuneNormFactor = b;}
+   Bool_t SetGammaEfficiency (Double_t gammaeff);
+   
+
+
+   void SetNormFactorFromAlphaBkg (Bool_t b) {fNormFactorFromAlphaBkg = b;}
+
+   void SetUseFittedQuantities (Bool_t b)
+      {fUseFittedQuantities = b;}
+
+   void SetReadMatricesFromFile(Bool_t b);
+   void SetTrainParameters(Bool_t b) {fOptimizeParameters = b;}
+   void SetTestParameters(Bool_t b) {fTestParameters = b;}
+
+
+   void SetSkipOptimization(Bool_t b) {fSkipOptimization = b;}
+
+   void SetUseInitialSCParams(Bool_t b) {fUseInitialSCParams = b;}
+
+
+   void SetVariableNotUseTheta(Bool_t b) {fNotUseTheta = b;}
+   Bool_t GetVariableNotUseTheta() { return fNotUseTheta;}
+
+
+   void SetVariableUseStaticCuts(Bool_t b) {fUseStaticCuts = b;}
+   Bool_t GetVariableUseStaticCuts() { return fUseStaticCuts;}
+
+
+   void SetSizeRange(Double_t SizeMin, Double_t SizeMax)
+	{fSizeCutLow = SizeMin; fSizeCutUp = SizeMax; }
+
+   // Function that loops over the theta ranges defined by 
+   // fCosThetaRangeVector optimizing parameter and/or testing
+   // parameters
+
+   Bool_t LoopOverThetaRanges();
+
+
+   // Function that loops over the alpha distributions (ON-OFF)
+   // stored in root file defined by fAlphaDistributionsRootFilename
+   // and computes the significance and Nex (using MHFindSignificanceONOFF::FindSigma)
+   // for several cuts in alpha (0-fAlphaSig; in bins defined for alpha distributions 
+   // by user).
+
+   // It creates the histograms, fills them and store them 
+   // in root file defined by fAlphaDistributionsRootFilename. A single histogram 
+   // for each theta bin.
+
+   // The function returns kFALSE if it could not accomplish its duty
+
+   Bool_t ComputeNexSignificanceVSAlphaSig();
+
+   
+
+
+   // Function that gets the histograms with the alpha distributions
+   // (for all the theta bins specified by fCosThetaRangeVector)
+   // stored in fAlphaDistributionsRootFilename, and combine them
+   // (correcting OFF histograms with the normalization factors stored 
+   // in NormFactorTrain or NormFactorTest) to get one single 
+   // Alpha distribution for ON and another one for OFF. 
+   // Then these histograms are given as arguments to 
+   // the function MHFindSignificanceONOFF::FindSigmaONOFF, 
+   // (Object of this class is created) to compute the 
+   // Overall Excess events and  significance, that will be 
+   // stored in variables fOverallNexTrain and fOverallSigmaLiMaTrain
+   // and Test.
+
+ 
+
+   Bool_t ComputeOverallSignificance(Bool_t CombineTrainData,
+				     Bool_t CombineTestData);
+
+
+   Double_t GetOverallNexTrain() {return fOverallNexTrain;}
+   Double_t GetOverallNexTest() {return fOverallNexTest;}
+   
+   Double_t GetOverallSigmaLiMaTrain() {return fOverallSigmaLiMaTrain;}
+   Double_t GetOverallSigmaLiMaTest() {return fOverallSigmaLiMaTest;}
+
+   Double_t GetGammaEfficiency() {return fGammaEfficiency;}
+
+   Double_t GetAlphaSig() {return fAlphaSig;}
+  Double_t GetAlphaBkgMin () {return fAlphaBkgMin;}
+  Double_t GetAlphaBkgMax () {return fAlphaBkgMax;}
+   
+  Bool_t GetSkipOptimization() {return fSkipOptimization;}
+
+  Bool_t GetUseFittedQuantities() {return fUseFittedQuantities;}
+ 
+   ClassDef(MFindSupercutsONOFFThetaLoop, 1) 
+  // Class for optimization of the Supercuts
+};
+
+#endif
+
+
+
+
Index: trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MHFindSignificanceONOFF.cc
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MHFindSignificanceONOFF.cc	(revision 4411)
+++ trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MHFindSignificanceONOFF.cc	(revision 4411)
@@ -0,0 +1,3720 @@
+/* ======================================================================== *\
+!
+! *
+! * 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,  July 2003      <mailto:wittek@mppmu.mpg.de>
+!              David Paneque,    Nov 2003       <mailto:dpaneque@mppmu.mpg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2003
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// MHFindSignificanceONOFF
+//
+// determines the significance of a gamma signal in an |alpha| plot
+// it uses real OFF events in the computation of excess events
+//
+// Input :  2 TH1 histogram (ON and OFF) of |alpha| : with 0 < |alpha| < 90 degrees
+//  
+//************TEMP ************************************************
+
+
+//         alphamin, alphamax :     defining the background region
+//         alphasig           :     defining the signal region for which
+//                                  the significance is calculated
+//         degree : the degree of the polynomial to be fitted to the background
+//                  ( a0 + a1*x + a2*x**2 + a3*x**3 + ...) 
+//
+// Output : 
+//
+//
+//   - the number of events in the signal region (Non)
+//     the number of background events in the signal region (Nbg)
+//     (counted number of events 'NoffSig' and fitted number of events 'NoffSigFitted 
+//   - the number of excess events in the signal region (Nex = Non - Nbg)
+//     (again, counted 'NexONOFF' and fitted 'NexONOFFFitted'
+//   - thew effective number of background events (Noff), and gamma :
+//     Nbg = gamma * Noff
+//   - 
+//   - the significance of the gamma signal according to Li & Ma               
+//     3 significances are computed 
+//        a) LiMa formula (17) using fitted quantities; fSigLiMa
+//        b) LiMa formula (17) using counted quantities; fSigLiMa2
+//        c) LiMa formula (5) using counted quantities.
+//
+// call member function 'FindSigmaONOFF' 
+//      to fit the background and to determine the significance  
+//
+//
+//
+/////////////////////////////////////////////////////////////////////////////
+
+////////// ***********  ENDTEMPORAL  *************************
+
+
+#include "MHFindSignificanceONOFF.h"
+
+#include <fstream>
+#include <math.h>
+
+#include <TArrayD.h>
+#include <TArrayI.h>
+#include <TH1.h>
+#include <TF1.h>
+#include <TCanvas.h>
+#include <TFitter.h>
+#include <TMinuit.h>
+#include <TPaveText.h>
+#include <TStyle.h>
+#include <TPostScript.h>
+
+#include "MLog.h"
+#include "MLogManip.h"
+#include "MMinuitInterface.h"
+
+
+ClassImp(MHFindSignificanceONOFF);
+
+using namespace std;
+
+const TString MHFindSignificanceONOFF::gsDefName  = "MHFindSignificanceONOFF";
+const TString MHFindSignificanceONOFF::gsDefTitle = "Find Significance in alpha plot";
+
+
+
+// --------------------------------------------------------------------------
+//
+// fcnpoly
+//
+// calculates the chi2 for the fit of the polynomial function 'poly' 
+// to the histogram 'fhist'
+//
+// it is called by CallMinuit() (which is called in FitPolynomial()) 
+//
+// bins of fhist with huge errors are ignored in the calculation of the chi2
+// (the huge errors were set in 'FitPolynomial()')
+//
+
+static void fcnpoly(Int_t &npar, Double_t *gin, Double_t &f, 
+                    Double_t *par, Int_t iflag)
+{
+    TH1 *fhist = (TH1*)gMinuit->GetObjectFit();
+    TF1 *fpoly = fhist->GetFunction("Poly");    
+
+
+    //-------------------------------------------
+
+    Double_t chi2 = 0.0;
+
+    Int_t nbins = fhist->GetNbinsX();
+    Int_t mbins = 0;
+    for (Int_t i=1; i<=nbins; i++)
+    {
+      Double_t content = fhist->GetBinContent(i);
+      Double_t error   = fhist->GetBinError(i);
+      Double_t center  = fhist->GetBinCenter(i);
+
+      //-----------------------------
+      // ignore unwanted points
+      if (error > 1.e19)
+        continue;
+
+      if (content <= 0.0)
+      {
+        gLog << "fcnpoly : bin with zero content; i, content, error = "
+             << i << ",  " << content << ",  " << error << endl;
+        continue;
+      }        
+
+      if (error <= 0.0)
+      {
+        gLog << "fcnpoly : bin with zero error; i, content, error = "
+             << i << ",  " << content << ",  " << error << endl;
+        continue;
+      }        
+
+      //-----------------------------
+      mbins++;
+
+      Double_t fu;
+      fu = fpoly->EvalPar(&center, par);
+
+      // the fitted function must not be negative
+      if (fu <= 0.0)
+      {
+        chi2 = 1.e10;
+        break;
+      }
+
+      Double_t temp = (content - fu) / error;
+      chi2 += temp*temp;
+    }
+
+    //-------------------------------------------
+
+    f = chi2;
+
+    //-------------------------------------------
+    // final calculations
+    //if (iflag == 3)
+    //{
+    //}    
+
+    //-------------------------------------------------------------
+}
+
+
+// --------------------------------------------------------------------------
+//
+// fcnpolyOFF
+//
+// calculates the chi2 for the fit of the polynomial function 'poly' 
+// to the histogram 'fhist'
+//
+// it is called by CallMinuit() (which is called in FitPolynomial()) 
+//
+// bins of fhist with huge errors are ignored in the calculation of the chi2
+// (the huge errors were set in 'FitPolynomial()')
+//
+
+static void fcnpolyOFF(Int_t &npar, Double_t *gin, Double_t &f, 
+		       Double_t *par, Int_t iflag)
+{
+    TH1 *fhist = (TH1*)gMinuit->GetObjectFit();
+    TF1 *fpoly = fhist->GetFunction("PolyOFF");    
+
+
+    //-------------------------------------------
+
+    Double_t chi2 = 0.0;
+
+    Int_t nbins = fhist->GetNbinsX();
+    Int_t mbins = 0;
+    for (Int_t i=1; i<=nbins; i++)
+    {
+      Double_t content = fhist->GetBinContent(i);
+      Double_t error   = fhist->GetBinError(i);
+      Double_t center  = fhist->GetBinCenter(i);
+
+      //-----------------------------
+      // ignore unwanted points
+      if (error > 1.e19)
+        continue;
+
+      if (content <= 0.0)
+      {
+        gLog << "fcnpoly : bin with zero content; i, content, error = "
+             << i << ",  " << content << ",  " << error << endl;
+        continue;
+      }        
+
+      if (error <= 0.0)
+      {
+        gLog << "fcnpoly : bin with zero error; i, content, error = "
+             << i << ",  " << content << ",  " << error << endl;
+        continue;
+      }        
+
+      //-----------------------------
+      mbins++;
+
+      Double_t fu;
+      fu = fpoly->EvalPar(&center, par);
+
+      // the fitted function must not be negative
+      if (fu <= 0.0)
+      {
+        chi2 = 1.e10;
+        break;
+      }
+
+      Double_t temp = (content - fu) / error;
+      chi2 += temp*temp;
+    }
+
+    //-------------------------------------------
+
+    f = chi2;
+
+    //-------------------------------------------
+    // final calculations
+    //if (iflag == 3)
+    //{
+    //}    
+
+    //-------------------------------------------------------------
+}
+
+
+
+
+// --------------------------------------------------------------------------
+//
+// fcnpolygauss
+//
+// calculates the chi2 for the fit of the (polynomial+Gauss) function 
+// 'PolyGauss' to the histogram 'fhist'
+//
+// it is called by CallMinuit() (which is called in FitGaussPoly()) 
+//
+// bins of fhist with huge errors are ignored in the calculation of the chi2
+// (the huge errors were set in 'FitGaussPoly()')
+//
+
+static void fcnpolygauss(Int_t &npar, Double_t *gin, Double_t &f, 
+                         Double_t *par, Int_t iflag)
+{
+    TH1 *fhist = (TH1*)gMinuit->GetObjectFit();
+    TF1 *fpolygauss = fhist->GetFunction("PolyGauss");    
+
+
+    //-------------------------------------------
+
+    Double_t chi2 = 0.0;
+
+    Int_t nbins = fhist->GetNbinsX();
+    Int_t mbins = 0;
+    for (Int_t i=1; i<=nbins; i++)
+    {
+      Double_t content = fhist->GetBinContent(i);
+      Double_t error   = fhist->GetBinError(i);
+      Double_t center  = fhist->GetBinCenter(i);
+
+      //-----------------------------
+      // ignore unwanted points
+      if (error > 1.e19)
+        continue;
+
+      if (content <= 0.0)
+      {
+        gLog << "fcnpolygauss : bin with zero content; i, content, error = "
+             << i << ",  " << content << ",  " << error << endl;
+        continue;
+      }        
+
+      if (error <= 0.0)
+      {
+        gLog << "fcnpolygauss : bin with zero error; i, content, error = "
+             << i << ",  " << content << ",  " << error << endl;
+        continue;
+      }        
+
+      //-----------------------------
+      mbins++;
+
+      Double_t fu;
+      fu = fpolygauss->EvalPar(&center, par);
+
+      // the fitted function must not be negative
+      if (fu <= 0.0)
+      {
+        chi2 = 1.e10;
+        break;
+      }
+
+      Double_t temp = (content - fu) / error;
+      chi2 += temp*temp;
+    }
+
+    //-------------------------------------------
+
+    f = chi2;
+
+    //-------------------------------------------
+    // final calculations
+    //if (iflag == 3)
+    //{
+    //}    
+
+    //-------------------------------------------------------------
+}
+
+
+
+// --------------------------------------------------------------------------
+//
+//  Constructor
+//
+MHFindSignificanceONOFF::MHFindSignificanceONOFF(const char *name, const char *title)
+{
+    fName  = name  ? name  : gsDefName.Data();
+    fTitle = title ? title : gsDefTitle.Data();
+
+//    fSigVsAlpha = NULL;
+
+    fPoly   = NULL;
+    fPolyOFF   = NULL;
+    fPolyOFFNormalized   = NULL;
+    fGPoly  = NULL;
+    fGBackg = NULL;
+
+    fHist     = NULL;
+    fHistOrig = NULL;
+
+    fHistOFF     = NULL;
+    fHistOrigOFF = NULL;
+    fHistOFFNormalized = NULL;
+
+    // allow rebinning of the alpha plot
+    fRebin = kTRUE;
+
+    // allow reducing the degree of the polynomial
+    fReduceDegree = kTRUE;
+
+    // Low and Upper limits for the OFF alpha distribution fit
+    // are set to 0 and 90 degrees respectively
+
+    fAlphaminOFF = 0.0;
+    fAlphamaxOFF = 90.0;
+    
+    // use quantities computed from the fits
+    // The variable allows the user to NOT use these quantities when there is not 
+    // enough statistics and fit not always is possible.
+    // Default value is kTRUE.
+    fUseFittedQuantities = kTRUE;
+
+    // Bool variable used to decide wether to print or not the results 
+    // of the fit, significance, Nex... onto the final alpha plot. 
+    // for the time being, this variable is set in the constructor. 
+    // At some point, I might make it such it can be set externally...
+
+    fPrintResultsOntoAlphaPlot = kTRUE;
+
+
+
+    fCanvas = NULL;
+    
+    fSavePlots = kFALSE; // By default plots are not saved in Postscriptfiles
+
+    fPsFilename = NULL;
+
+   
+
+}
+
+// --------------------------------------------------------------------------
+//
+//  Destructor. 
+//
+// =====>  it is not clear why one obtains sometimes a segmentation violation
+//         when the destructor is active     <=======================
+//
+// therefore the 'return'statement
+//
+
+MHFindSignificanceONOFF::~MHFindSignificanceONOFF()
+{
+
+
+    
+     return;
+    
+    *fLog << "destructor of MHFindSignificanceONOFF is called" << endl;
+    
+
+    fPsFilename = NULL;
+  
+    cout << "PS set to null... " << endl;
+
+    delete fHist;
+    delete fHistOFF;
+
+    delete fHistOFFNormalized;
+
+    cout << "Histos removed..." << endl;
+
+    delete fPoly;
+    delete fPolyOFF;
+    delete fPolyOFFNormalized;
+    delete fGPoly;
+    delete fGBackg;
+  
+    cout << "Functions are also removed..." << endl;
+    
+    // delete fCanvas; if I removed fCanvas pointed memory address the 
+    // program crashes  ???
+
+    *fLog << "destructor of MHFindSignificanceONOFF finished successfully" << endl;
+
+   
+}
+
+// --------------------------------------------------------------------------
+//
+//  Set flag fRebin 
+//
+//  if flag is kTRUE rebinning of the alpha plot is allowed
+//
+//
+void MHFindSignificanceONOFF::SetRebin(Bool_t b)
+{
+  fRebin = b;
+
+  *fLog << "MHFindSignificanceONOFF::SetRebin; flag fRebin set to " 
+        << (b? "kTRUE" : "kFALSE") << endl;
+}
+
+// --------------------------------------------------------------------------
+//
+//  Set flag fReduceDegree 
+//
+//  if flag is kTRUE reducing of the degree of the polynomial is allowed
+//
+//
+void MHFindSignificanceONOFF::SetReduceDegree(Bool_t b)
+{
+  fReduceDegree = b;
+
+  *fLog << "MHFindSignificanceONOFF::SetReduceDegree; flag fReduceDegree set to " 
+        << (b? "kTRUE" : "kFALSE") << endl;
+}
+
+// Function that returns one of the 3 LiMa sigmas. 
+// The returned value is the one used in the optimization 
+// and final alpha plots. 
+
+// For the time being, if fUseFittedQuantities = kTRUE (default)
+// fSigLiMa is used, otherwise, fSigLiMa2 is used. 
+
+Double_t MHFindSignificanceONOFF::GetSignificance()
+{
+
+    if(fUseFittedQuantities)
+    {   
+	return fSigLiMa;
+    }
+
+    return fSigLiMa2;
+
+
+    
+}
+
+
+// --------------------------------------------------------------------------
+//
+//  FindSigmaONOFF
+//
+//  calls FitPolynomialOFF  it gets bkg events in "signal" region 
+//                          from histogram histOFF which is the alpha 
+//                          distribution of OFF data NON normalized. 
+//                          Normalization factor is also one of the 
+//                          arguments.
+//  calls DetExcess         to determine the number of excess events
+//                          using the previously computed bkg events
+
+//  calls SigmaLiMa         to determine the significance of the gamma signal
+//                          in the range |alpha| < alphasig
+//  calls FitGaussPoly      to fit a (polynomial+Gauss) function in the
+//                          whole |alpha| region of ON - OFF diagram 
+//
+//
+
+Bool_t MHFindSignificanceONOFF::FindSigmaONOFF(TH1 *fhistON,  
+					       TH1 *fhistOFF,
+					       Double_t NormFactor,
+					       Double_t alphamin,
+					       Double_t alphamax,
+					       Int_t degreeON, 
+					       Int_t degreeOFF,
+					       Double_t alphasig, 
+					       Bool_t drawpoly,   
+					       Bool_t fitgauss, 
+					       Bool_t print, 
+					       Bool_t saveplots, 
+					       //TPostScript* PsFile
+					       const TString psfilename)
+{
+    
+    //*fLog << "MHFindSignificanceONOFF::FindSigma;" << endl;
+ 
+
+    // Pointer to object TPostScript where plots will be stored 
+    // is copied into member varialbe 
+    // NOT WORKING !!!
+    // fPsFilename = PsFile;
+
+    // Temporally (while TPostSctipt option is not working) psfiles 
+    // will be produced by the standard way (Canvas.SaveAs())
+
+    fPsFilenameString = psfilename;
+
+
+
+    // "3 Li and Ma significances" are initialized to 0.0
+
+    fSigLiMa = 0.0;
+    fSigLiMa2 = 0.0;
+    fSigLiMa3 = 0.0;
+   
+    
+    // fNormFactor is set 
+    
+    fNormFactor = NormFactor;
+
+    // Report when this histograms given in the 
+    // arguments are empty
+    
+    Double_t tmpdouble= -1.0;
+    
+    tmpdouble = double(fhistON->GetEntries());
+    if (tmpdouble < 0.5)
+    {
+	cout << "MHFindSignificanceONOFF::FindSigmaONOFF; ERROR " << endl
+	     << "fhistON has ZERO entries" << endl;
+   } 
+
+    tmpdouble = double(fhistOFF->GetEntries());
+    if (tmpdouble < 0.5)
+    {
+	cout << "MHFindSignificanceONOFF::FindSigmaONOFF; ERROR " << endl
+	     << "fhistOFF has ZERO entries" << endl;
+    } 
+
+
+
+   
+    // Variables set for alpha from ON events
+    fHistOrig = fhistON;
+    fHist = (TH1*)fHistOrig->Clone();
+    fHist->SetName(fhistON->GetName());
+    fDegree   = degreeON;
+
+
+     // Variables set for alpha from OFF events
+
+    fHistOrigOFF = fhistOFF;    
+    fHistOFF = (TH1*)fHistOrigOFF->Clone();
+    fHistOFF->SetName(fhistOFF->GetName());
+    fDegreeOFF   = degreeOFF;
+
+    if ( !fHist )
+    {
+	*fLog << "MHFindSignificanceONOFF::FindSigmaONOFF; Clone of histogram could not be generated" 
+	      << endl;
+	return kFALSE;
+    }
+
+
+    
+    if ( !fHistOFF )
+    {
+	*fLog << "MHFindSignificanceONOFF::FindSigmaONOFF; Clone of OFF histogram could not be generated" 
+	      << endl;
+	return kFALSE;
+    }
+
+
+
+  
+  fHist->Sumw2();
+  fHist->SetXTitle("|alpha|  [\\circ]");
+  fHist->SetYTitle("Counts");
+  fHist->UseCurrentStyle();
+  
+
+  fHistOFF->Sumw2(); // if error has been set (via function SetBinError(j))
+   // the errors set remain, i.e. are not overwritten with the sum of the square of weights.
+  // Which means that this function will not have any effect.
+
+  fHistOFF->SetXTitle("|alpha|  [\\circ]");
+  fHistOFF->SetYTitle("Counts");
+  fHistOFF->UseCurrentStyle();
+  
+
+  
+
+
+/////////////////////////////////////
+
+  fAlphamin = alphamin;
+  fAlphamax = alphamax;
+  fAlphammm = (alphamin+alphamax)/2.0;
+  fAlphasig = alphasig;
+
+
+
+
+  // UYpper limits for fit to OFF data set are taken also from alphamax
+  // fAlphaminOFF is set in constructor. Inn principle, it WILL ALWAYS BE ZERO.
+
+  fAlphamaxOFF = alphamax;
+
+  
+  fDraw     = drawpoly;
+  fSavePlots = saveplots;
+  fFitGauss = fitgauss;
+  
+
+  //--------------------------------------------
+  // fit a polynomial in the backgr  region
+  
+  //*fLog << "MHFindSignificanceONOFF::FindSigma;  calling FitPolynomial()" << endl;
+  if ( !FitPolynomialOFF())
+  {
+      *fLog << "MHFindSignificanceONOFF::FindSigmaONOFF; PolynomialOFF failed"
+	    << endl;  
+      return kFALSE;
+  }
+      
+      
+  //--------------------------------------------
+  // calculate the number of excess events in the signal region
+  
+  //*fLog << "MHFindSignificanceONOFF::FindSigma;  calling DetExcess()" << endl;
+  if ( !DetExcessONOFF())
+  {
+      *fLog << "MHFindSignificanceONOFF::FindSigmaONOFF; DetExcessONOFF failed"
+	    << endl;  
+      return kFALSE;
+  }
+
+  
+
+
+
+  //--------------------------------------------
+  // calculate the significance of the excess
+
+  //*fLog << "MHFindSignificanceONOFF::FindSigma;  calling SigmaLiMa()" << endl;
+
+  // For testing purposes "3 Li&Ma significances" will be computed
+  // At some point, only one will remain
+
+
+  Double_t siglima = 0.0;
+  
+
+  // Significance computed using effective number of OFF events  in signal 
+  // region (fNoff) and gamma factor (fGama).
+  // This is Wolfgang approach to the calulation of significance 
+  // using Li&Ma formula and estimated OFF events from polynomial fit.
+  
+  if(fUseFittedQuantities) 
+  {
+      if ( !SigmaLiMa(fNon, fNoff, fGamma, &siglima) )
+      {
+	  *fLog << "MHFindSignificanceONOFF::FindSigmaONOFF; SigmaLiMa failed"
+		<< endl;  
+	  return kFALSE;
+      }
+
+      fSigLiMa = siglima;
+  }
+  else
+  {
+      fSigLiMa = 0.0;
+  }
+
+
+
+  // Significance computed using counted number of OFF events in signal 
+  // region (fNoffSig) and normalization factor (fNormFactor).
+  // This is the strictly speaking the significance in Li&Ma paper...
+  
+  
+  if ( !SigmaLiMa(fNon, fNoffSig, fNormFactor, &siglima) )
+  {
+      *fLog << "MHFindSignificanceONOFF::FindSigmaONOFF; SigmaLiMa2 failed"
+	    << endl;  
+      return kFALSE;
+  }
+  fSigLiMa2 = siglima;
+  
+  
+  // Significance computed using counted number of OFF events in signal 
+  // region (fNoffSig) and normalization factor (fNormFactor). 
+  // significance of gamma signal according to Li & Ma using  
+  // formula (5)
+
+
+
+  if ( !SigmaLiMaForm5(fNon, fNoffSig, fNormFactor, &siglima) )
+      {
+	  *fLog << "MHFindSignificanceONOFF::FindSigmaONOFF; SigmaLiMa failed"
+		<< endl;  
+	  return kFALSE;
+      }
+
+  fSigLiMa3 = siglima;
+  
+    
+  
+ 
+ 
+//--------------------------------------------
+// calculate the error of the number of excess events
+// using fitted quantities and counted quantities
+ 
+ 
+// from fit to OFF histogram
+
+ if (fSigLiMa > 0.0) 
+ {fdNexONOFFFitted = fNexONOFFFitted / fSigLiMa;}
+ else
+ {fdNexONOFFFitted = 0.0;}
+
+
+ // from counted OFF events
+ if (fSigLiMa2 > 0.0) 
+ {
+     fdNexONOFF = fNexONOFF / fSigLiMa2;
+ }
+ else
+ {
+     fdNexONOFF = 0.0;
+ }
+
+  if (fDraw || fFitGauss)
+  {
+      
+      // ------------------------------------------------
+      // Polynomial fit to bkg region from ON data is performed, 
+      // Because some of the quantities will be used as 
+      // initial values in the PolyGAuss fit.
+      
+      // Besides, this function will modify the binning of fHist 
+      // so that the number of events in each bin is big enough
+      
+      // This might change in future...
+      
+      if ( !FitPolynomial())
+      {
+	  *fLog << "MHFindSignificanceONOFF::FindSigmaONOFF; Polynomial fit failed"
+		<< endl;  
+	  return kFALSE;
+      }
+  }
+
+
+  if (fDraw)
+  {
+
+      // Compute fHistOFFNormalized
+
+      if (!ComputeHistOFFNormalized())
+      {
+	  *fLog << "MHFindSignificanceONOFF::ComputeHistOFFNormalized; Normalization of fHistOFF was not possible"
+		<< endl;  
+	  return kFALSE;
+	  
+      }
+  }
+
+
+ 
+
+
+  //--------------------------------------------
+
+  //*fLog << "MHFindSignificanceONOFF::FindSigma;  calling PrintPoly()" << endl;
+  if (print)
+    PrintPolyOFF();
+
+
+
+  
+  
+
+
+
+
+  //--------------------------------------------
+  // fit a (polynomial + Gauss) function to the ON-OFF alpha distribution 
+
+  if (fFitGauss)
+  {
+
+    //--------------------------------------------------
+    // delete objects from this fit
+    // in order to have independent starting conditions for the next fit
+
+      delete gMinuit;
+      gMinuit = NULL;
+    //--------------------------------------------------
+
+       //*fLog << "MHFindSignificanceONOFF::FindSigma;  calling FitGaussPoly()" 
+      //      << endl;
+    if ( !FitGaussPoly() )
+    {
+      *fLog << "MHFindSignificanceONOFF::FindSigmaONOFF; FitGaussPoly failed"  
+      	    << endl;  
+      return kFALSE;
+    }
+
+    if (print)
+    {
+      //*fLog << "MHFindSignificanceONOFF::FindSigma;  calling PrintPolyGauss()" 
+      //      << endl;
+      PrintPolyGauss();
+    }
+  }
+
+  //--------------------------------------------------
+  // draw the histogram if requested
+
+  if (fDraw)
+  {
+
+
+       // TEMPORALLY I will plot fHistOFF and fHistOFFNormalized (with the fits)
+
+      
+      if (!DrawHistOFF())
+      {
+	  *fLog << "MHFindSignificanceONOFF::DrawHistOFF; Drawing  of fHistOFF was not possible"
+		<< endl;  
+	  // return kFALSE;
+	  
+      }
+      
+     
+      if (!DrawHistOFFNormalized())
+      {
+	  *fLog << "MHFindSignificanceONOFF::DrawHistOFFNormalized; Drawing  of fHistOFFNormalized was not possible"
+		<< endl;  
+	  // return kFALSE;
+	  
+      }
+
+
+
+
+    //*fLog << "MHFindSignificanceONOFF::FindSigma;  calling DrawFit()" << endl;
+      if ( !DrawFit() )
+      {
+	  *fLog << "MHFindSignificanceONOFF::FindSigmaONOFF; DrawFit failed"  
+		<< endl;  
+	  return kFALSE;
+      }
+  }
+  
+
+  //--------------------------------------------------
+  // delete objects from this fit
+  // in order to have independent starting conditions for the next fit
+
+  delete gMinuit;
+  gMinuit = NULL;
+  //--------------------------------------------------
+  
+  return kTRUE;
+
+}
+
+ 
+//// ********************* end sigmaonoff ************************
+
+
+
+
+
+
+
+// UNDER CONSTRUCTION
+
+Bool_t MHFindSignificanceONOFF::SigmaVsAlphaONOFF(TH1 *fhistON, TH1 *fhistOFF,  
+					   Double_t alphamin, Double_t alphamax, 
+					   Int_t degree, Bool_t print)
+{
+    *fLog << "   MHFindSignificanceONOFF::SigmaVsAlphaONOFF still under construction !!!" << endl;
+
+    return kFALSE;
+
+}
+
+
+
+
+// --------------------------------------------------------------------------
+//
+//  FitPolynomialOFF
+//  - create a clone 'fHistOFF' of the |alpha| distribution 'fHistOrigOFF'
+//  - fit a polynomial of degree 'fDegreeOFF' to the alpha distribution 
+//    'fHistOFF' in the region alphaminOFF < |alpha| < alphamaxOFF
+
+
+
+Bool_t MHFindSignificanceONOFF::FitPolynomialOFF()
+
+{
+  //--------------------------------------------------
+  // check the histogram :
+  //       - calculate initial values of the parameters
+  //       - check for bins with zero entries
+  //       - set minimum errors
+  //       - save the original errors
+  //       - set errors huge outside the fit range
+  //         (in 'fcnpolyOFF' points with huge errors will be ignored)
+
+
+  Double_t dummy = 1.e20;
+
+  Double_t mean;
+  Double_t rms;
+  Double_t nclose;
+  Double_t nfar;
+  Double_t a2init = 0.0;
+  TArrayD  saveError;
+
+  Int_t nbins;
+  Int_t nrebin = 1;
+
+
+ //----------------   start while loop for rebinning   -----------------
+  while(1)
+  {
+
+  fNzeroOFF   = 0;
+  fMbinsOFF   = 0;
+  fMlowOFF   = 0;
+  fNoffTot = 0.0;
+
+  // same variables (as in fitpoly to ON data) are used
+  // here for naming the actual values for low/up limit for fit
+  fAlphami =  10000.0;
+  fAlphamm =  10000.0;
+  fAlphama = -10000.0;
+
+  mean   = 0.0;
+  rms    = 0.0;
+  nclose = 0.0;
+  nfar   = 0.0;
+
+  nbins = fHistOFF->GetNbinsX();
+  saveError.Set(nbins);
+
+  for (Int_t i=1; i<=nbins; i++)
+  {
+    saveError[i-1] = fHistOFF->GetBinError(i);
+
+    // bin should be completely contained in the fit range
+    // (fAlphaminOFF, fAlphamaxOFF)
+    Double_t  xlo = fHistOFF->GetBinLowEdge(i);
+    Double_t  xup = fHistOFF->GetBinLowEdge(i+1);
+
+    if ( xlo >= fAlphaminOFF-fEps  &&  xlo <= fAlphamaxOFF+fEps  &&
+	 xup >= fAlphaminOFF-fEps  &&  xup <= fAlphamaxOFF+fEps     )
+    {
+      fMbinsOFF++;
+
+      if ( xlo < fAlphami )
+        fAlphami = xlo;
+
+      if ( xup > fAlphama )
+        fAlphama = xup;
+
+      Double_t content = fHistOFF->GetBinContent(i);
+      // fNoffTot += content;
+
+      mean += content;
+      rms  += content*content;
+
+// count events in low-alpha and high-alpha region
+      if ( xlo >= fAlphammm-fEps  &&  xup >= fAlphammm-fEps)
+      {
+        nfar   += content;
+        if ( xlo < fAlphamm )
+          fAlphamm = xlo;
+        if ( xup < fAlphamm )
+          fAlphamm = xup; 
+      }
+      else
+      {
+        nclose += content;
+        if ( xlo > fAlphamm )
+          fAlphamm = xlo;
+        if ( xup > fAlphamm )
+          fAlphamm = xup; 
+      }
+
+      // count bins with zero entry
+      if (content <= 0.0)
+        fNzeroOFF++;
+     
+      // set minimum error
+      if (content < 9.0)
+      {
+        fMlowOFF += 1;
+        fHistOFF->SetBinError(i, 3.0);
+      }
+
+      //*fLog << "Take : i, content, error = " << i << ",  " 
+      //      << fHist->GetBinContent(i) << ",  "
+      //      << fHist->GetBinError(i)   << endl;
+
+      continue;
+    }    
+    // bin is not completely contained in the fit range : set error huge
+
+    fHistOFF->SetBinError(i, dummy);
+
+    //*fLog << "Omit : i, content, error = " << i << ",  " 
+    //      << fHist->GetBinContent(i) << ",  " << fHist->GetBinError(i) 
+    //      << endl;
+
+  }
+
+  // mean of entries/bin in the fit range
+  if (fMbinsOFF > 0)
+  {
+    mean /= ((Double_t) fMbinsOFF);
+    rms  /= ((Double_t) fMbinsOFF);
+  }
+
+  rms = sqrt( rms - mean*mean );
+
+  // if there are no events in the background region
+  //    there is no reason for rebinning
+  //    and this is the condition for assuming a constant background (= 0)
+  if (mean <= 0.0)
+    break;
+
+  Double_t helpmi = fAlphami*fAlphami*fAlphami;
+  Double_t helpmm = fAlphamm*fAlphamm*fAlphamm;
+  Double_t helpma = fAlphama*fAlphama*fAlphama;
+  Double_t help   =   (helpma-helpmm) * (fAlphamm-fAlphami)    
+	            - (helpmm-helpmi) * (fAlphama-fAlphamm);
+  if (help != 0.0)
+    a2init =  ( (fAlphamm-fAlphami)*nfar - (fAlphama-fAlphamm)*nclose )
+                * 1.5 * fHistOFF->GetBinWidth(1) / help;
+  else
+    a2init = 0.0;
+
+
+  //--------------------------------------------
+  // rebin the histogram
+  //   - if a bin has no entries 
+  //   - or if there are too many bins with too few entries
+  //   - or if the new bin width would exceed half the size of the 
+  //     signal region
+
+  if ( !fRebin  ||
+       ( fNzeroOFF <= 0 && (Double_t)fMlowOFF<0.05*(Double_t)fMbinsOFF )  || 
+       (Double_t)(nrebin+1)/(Double_t)nrebin * fHistOFF->GetBinWidth(1) 
+                                                           > fAlphasig/2.0 )
+  {
+    //*fLog << "before break" << endl;
+    break;
+  }
+
+  nrebin += 1;
+  TString histname = fHistOFF->GetName();
+  delete fHistOFF;
+  fHistOFF = NULL;
+
+  *fLog << "MHFindSignificanceONOFF::FitPolynomialOFF; rebin the |alpha|OFF plot, grouping "
+        << nrebin << " bins together" << endl;
+
+  // TH1::Rebin doesn't work properly
+  //fHist = fHistOrig->Rebin(nrebin, "Rebinned");
+  // use private routine RebinHistogram()
+  fHistOFF = new TH1F;
+  fHistOFF->Sumw2();
+  fHistOFF->SetNameTitle(histname, histname);
+  fHistOFF->UseCurrentStyle();
+
+  // do rebinning such that x0 remains a lower bin edge
+  Double_t x0 = 0.0;
+  if ( !RebinHistogramOFF(x0, nrebin) )
+  {
+    *fLog << "MHFindSignificanceONOFF::FitPolynomialOFF; RebinHistgramOFF() failed" 
+          << endl;
+    return kFALSE;
+  }
+
+  fHistOFF->SetXTitle("|alpha|  [\\circ]");
+  fHistOFF->SetYTitle("Counts");
+  
+  }
+  //----------------   end of while loop for rebinning   -----------------
+
+
+  // if there are still too many bins with too few entries don't fit
+  // and assume a constant background
+
+  fConstantBackg = kFALSE;
+  if ( fNzeroOFF > 0  ||  (Double_t)fMlowOFF>0.05*(Double_t)fMbinsOFF ) 
+  {
+    *fLog << "MHFindSignificanceONOFF::FitPolynomialOFF; polynomial fit not possible,  fNzeroOFF, fMlowOFF, fMbinsOFF = "
+          << fNzeroOFF << ",  " << fMlowOFF << ",  " << fMbinsOFF << endl;
+    *fLog << "                    assume a constant background" << endl;
+
+    fConstantBackg = kTRUE;
+    fDegreeOFF        = 0;
+
+    TString funcname = "PolyOFF";
+    Double_t xmin =   0.0;
+    Double_t xmax =  90.0;
+
+    TString formula = "[0]";
+
+    fPolyOFF = new TF1(funcname, formula, xmin, xmax);
+    TList *funclist = fHistOFF->GetListOfFunctions();
+    funclist->Add(fPolyOFF);
+
+    //--------------------
+    Int_t nparfree = 1;
+    fChisqOFF         = 0.0; 
+    fNdfOFF           = fMbinsOFF - nparfree;
+    fProbOFF          = 0.0;
+    fIstatOFF         = 0;
+
+    fValuesOFF.Set(1);
+    fErrorsOFF.Set(1);
+
+    Double_t val, err;
+    val = mean;
+    err = sqrt( mean / (Double_t)fMbinsOFF );
+
+    fPolyOFF->SetParameter(0, val);
+    fPolyOFF->SetParError (0, err);
+
+    fValuesOFF[0] = val;
+    fErrorsOFF[0] = err; 
+
+    fEmaOFF[0][0]  = err*err;
+    fCorrOFF[0][0] = 1.0;
+    //--------------------
+    //--------------------------------------------------
+    // reset the errors of the points in the histogram
+    for (Int_t i=1; i<=nbins; i++)
+    {
+      fHistOFF->SetBinError(i, saveError[i-1]);
+    }
+
+
+    return kTRUE;
+  }
+
+
+  //===========   start loop for reducing the degree   ==================
+  //              of the polynomial
+  while (1)
+  {
+      //--------------------------------------------------
+      // prepare fit of a polynomial :   (a0 + a1*x + a2*x**2 + a3*x**3 + ...)
+
+      TString funcname = "PolyOFF";
+      Double_t xmin =   0.0;
+      Double_t xmax =  90.0;
+
+      TString formula = "[0]";
+      TString bra1     = "+[";
+      TString bra2     =    "]";
+      TString xpower   = "*x";
+      TString newpower = "*x";
+      for (Int_t i=1; i<=fDegreeOFF; i++)
+      {
+          formula += bra1;
+          formula += i;
+          formula += bra2;
+          formula += xpower;
+
+          xpower += newpower;
+      }
+
+      //*fLog << "FitPolynomial : formula = " << formula << endl;
+
+      fPolyOFF = new TF1(funcname, formula, xmin, xmax);
+      TList *funclist = fHistOFF->GetListOfFunctions();
+      funclist->Add(fPolyOFF);
+
+      //------------------------
+      // attention : the dimensions must agree with those in CallMinuit()
+      const UInt_t npar = fDegreeOFF+1;
+
+      TString parname[npar];
+      TArrayD vinit(npar);
+      TArrayD  step(npar);
+      TArrayD limlo(npar);
+      TArrayD limup(npar);
+      TArrayI   fix(npar);
+
+      vinit[0] =   mean;
+      vinit[2] = a2init;
+
+      for (UInt_t j=0; j<npar; j++)
+      {
+          parname[j]  = "p";
+          parname[j] += j+1;
+
+          step[j] = vinit[j] != 0.0 ? TMath::Abs(vinit[j]) / 10.0 : 0.000001;
+      }
+
+      // limit the first coefficient of the polynomial to positive values
+      // because the background must not be negative
+      limup[0] = fHistOFF->GetEntries();
+
+      // use the subsequernt loop if you want to apply the
+      // constraint : uneven derivatives (at alpha=0) = zero
+      for (UInt_t j=1; j<npar; j+=2)
+      {
+          vinit[j] = 0;
+          step[j]  = 0;
+          fix[j]   = 1;
+      }
+
+      //*fLog << "FitPolynomial : before CallMinuit()" << endl;
+
+      MMinuitInterface inter;
+      const Bool_t rc = inter.CallMinuit(fcnpolyOFF, parname, vinit, step,
+                                         limlo, limup, fix, fHistOFF, "Migrad",
+                                         kFALSE);
+
+      //*fLog << "FitPolynomial : after CallMinuit()" << endl;
+
+      if (rc != 0)
+      {
+          //  *fLog << "MHFindSignificanceONOFF::FitPolynomial; polynomial fit failed"
+          //        << endl;
+          //  return kFALSE;
+      }
+
+      //-------------------
+      // get status of minimization
+      Double_t fmin   = 0;
+      Double_t fedm   = 0;
+      Double_t errdef = 0;
+      Int_t    npari  = 0;
+      Int_t    nparx  = 0;
+
+      if (gMinuit)
+          gMinuit->mnstat(fmin, fedm, errdef, npari, nparx, fIstatOFF);
+
+      *fLog << "MHFindSignificanceONOFF::FitPolynomialOFF; fmin, fedm, errdef, npari, nparx, fIstat = "
+            << fmin << ",  " << fedm << ",  " << errdef << ",  " << npari
+            << ",  " << nparx << ",  " << fIstatOFF << endl;
+
+
+      //-------------------
+      // store the results
+
+      Int_t nparfree = gMinuit!=NULL ? gMinuit->GetNumFreePars() : 0;
+      fChisqOFF         = fmin;
+      fNdfOFF          = fMbinsOFF - nparfree;
+      fProbOFF          = TMath::Prob(fChisqOFF, fNdfOFF);
+
+
+      // get fitted parameter values and errors
+      fValuesOFF.Set(npar);
+      fErrorsOFF.Set(npar);
+
+      for (Int_t j=0; j<=fDegreeOFF; j++)
+      {
+          Double_t val, err;
+          if (gMinuit)
+              gMinuit->GetParameter(j, val, err);
+
+          fPolyOFF->SetParameter(j, val);
+          fPolyOFF->SetParError(j, err);
+
+          fValuesOFF[j] = val;
+          fErrorsOFF[j] = err;
+      }
+
+      // if the highest coefficient (j0) of the polynomial
+      // is consistent with zero reduce the degree of the polynomial
+
+      Int_t j0 = 0;
+      for (Int_t j=fDegreeOFF; j>1; j--)
+      {
+          // ignore fixed parameters
+          if (fErrorsOFF[j] == 0)
+              continue;
+
+          // this is the highest coefficient
+          j0 = j;
+          break;
+      }
+
+      if (!fReduceDegree || j0==0 || TMath::Abs(fValuesOFF[j0]) > fErrorsOFF[j0])
+          break;
+
+      // reduce the degree of the polynomial
+      *fLog << "MHFindSignificanceONOFF::FitPolynomialOFF; reduce the degree of the polynomial from "
+          << fDegreeOFF << " to " << (j0-2) << endl;
+      fDegreeOFF = j0 - 2;
+
+      funclist->Remove(fPolyOFF);
+      //if (fPoly)
+      delete fPolyOFF;
+      fPolyOFF = NULL;
+
+      // delete the Minuit object in order to have independent starting
+      // conditions for the next minimization
+      //if (gMinuit)
+      delete gMinuit;
+      gMinuit = NULL;
+  }
+  //===========   end of loop for reducing the degree   ==================
+  //              of the polynomial
+
+
+  //--------------------------------------------------
+  // get the error matrix of the fitted parameters
+
+  if (fIstatOFF >= 1)
+  {
+      // error matrix was calculated
+      if (gMinuit)
+          gMinuit->mnemat(&fEmatOFF[0][0], fNdimOFF);
+
+      // copy covariance matrix into a matrix which includes also the fixed
+      // parameters
+      TString  name;
+      Double_t bnd1, bnd2, val, err;
+      Int_t    jvarbl;
+      Int_t    kvarbl;
+      for (Int_t j=0; j<=fDegreeOFF; j++)
+      {
+          if (gMinuit)
+              gMinuit->mnpout(j, name, val, err, bnd1, bnd2, jvarbl);
+
+          for (Int_t k=0; k<=fDegreeOFF; k++)
+          {
+              if (gMinuit)
+                  gMinuit->mnpout(k, name, val, err, bnd1, bnd2, kvarbl);
+
+              fEmaOFF[j][k] = jvarbl==0 || kvarbl==0 ? 0 : fEmatOFF[jvarbl-1][kvarbl-1];
+          }
+      }
+  }
+  else
+  {
+      // error matrix was not calculated, construct it
+      *fLog << "MHFindSignificanceONOFF::FitPolynomialOFF; error matrix not defined"
+          << endl;
+      for (Int_t j=0; j<=fDegreeOFF; j++)
+      {
+          for (Int_t k=0; k<=fDegreeOFF; k++)
+              fEmaOFF[j][k] = 0;
+
+          fEmaOFF[j][j] = fErrorsOFF[j]*fErrorsOFF[j];
+      }
+  }
+
+
+
+  
+  //--------------------------------------------------
+  // calculate correlation matrix
+  for (Int_t j=0; j<=fDegreeOFF; j++)
+  {
+      for (Int_t k=0; k<=fDegreeOFF; k++)
+      {
+          const Double_t sq = fEmaOFF[j][j]*fEmaOFF[k][k];
+          fCorrOFF[j][k] = 
+	      sq == 0 ? 0 : (fEmaOFF[j][k] / TMath::Sqrt(fEmaOFF[j][j]*fEmaOFF[k][k]));
+      }
+  }
+  
+  //--------------------------------------------------
+  // reset the errors of the points in the histogram
+  for (Int_t i=1; i<=nbins; i++)
+  {
+      fHistOFF->SetBinError(i, saveError[i-1]);
+  }
+  
+  return kTRUE;
+
+
+}
+
+
+
+
+
+
+
+
+// --------------------------------------------------------------------------
+//
+//  FitPolynomial
+//
+//  - create a clone 'fHist' of the |alpha| distribution 'fHistOrig'
+//  - fit a polynomial of degree 'fDegree' to the alpha distribution 
+//    'fHist' in the region alphamin < |alpha| < alphamax
+//
+//  in pathological cases the histogram is rebinned before fitting
+//     (this is done only if fRebin is kTRUE)
+//
+//  if the highest coefficient of the polynomial is compatible with zero
+//     the fit is repeated with a polynomial of lower degree
+//     (this is done only if fReduceDegree is kTRUE)
+//
+//
+
+Bool_t MHFindSignificanceONOFF::FitPolynomial()
+{
+  //--------------------------------------------------
+  // check the histogram :
+  //       - calculate initial values of the parameters
+  //       - check for bins with zero entries
+  //       - set minimum errors
+  //       - save the original errors
+  //       - set errors huge outside the fit range
+  //         (in 'fcnpoly' points with huge errors will be ignored)
+
+
+  Double_t dummy = 1.e20;
+
+  Double_t mean;
+  Double_t rms;
+  Double_t nclose;
+  Double_t nfar;
+  Double_t a2init = 0.0;
+  TArrayD  saveError;
+
+  Int_t nbins;
+  Int_t nrebin = 1;
+
+  //----------------   start while loop for rebinning   -----------------
+  while(1)
+  {
+
+  fNzero   = 0;
+  fMbins   = 0;
+  fMlow    = 0;
+  fNbgtot  = 0.0;
+
+  fAlphami =  10000.0;
+  fAlphamm =  10000.0;
+  fAlphama = -10000.0;
+
+  mean   = 0.0;
+  rms    = 0.0;
+  nclose = 0.0;
+  nfar   = 0.0;
+
+  nbins = fHist->GetNbinsX();
+  saveError.Set(nbins);
+
+  for (Int_t i=1; i<=nbins; i++)
+  {
+    saveError[i-1] = fHist->GetBinError(i);
+
+    // bin should be completely contained in the fit range
+    // (fAlphamin, fAlphamax)
+    Double_t  xlo = fHist->GetBinLowEdge(i);
+    Double_t  xup = fHist->GetBinLowEdge(i+1);
+
+    if ( xlo >= fAlphamin-fEps  &&  xlo <= fAlphamax+fEps  &&
+	 xup >= fAlphamin-fEps  &&  xup <= fAlphamax+fEps     )
+    {
+      fMbins++;
+
+      if ( xlo < fAlphami )
+        fAlphami = xlo;
+
+      if ( xup > fAlphama )
+        fAlphama = xup;
+
+      Double_t content = fHist->GetBinContent(i);
+      fNbgtot += content;
+
+      mean += content;
+      rms  += content*content;
+
+      // count events in low-alpha and high-alpha region
+      if ( xlo >= fAlphammm-fEps  &&  xup >= fAlphammm-fEps)
+      {
+        nfar   += content;
+        if ( xlo < fAlphamm )
+          fAlphamm = xlo;
+        if ( xup < fAlphamm )
+          fAlphamm = xup; 
+      }
+      else
+      {
+        nclose += content;
+        if ( xlo > fAlphamm )
+          fAlphamm = xlo;
+        if ( xup > fAlphamm )
+          fAlphamm = xup; 
+      }
+
+      // count bins with zero entry
+      if (content <= 0.0)
+        fNzero++;
+     
+      // set minimum error
+      if (content < 9.0)
+      {
+        fMlow += 1;
+        fHist->SetBinError(i, 3.0);
+      }
+
+      //*fLog << "Take : i, content, error = " << i << ",  " 
+      //      << fHist->GetBinContent(i) << ",  "
+      //      << fHist->GetBinError(i)   << endl;
+
+      continue;
+    }    
+    // bin is not completely contained in the fit range : set error huge
+
+    fHist->SetBinError(i, dummy);
+
+    //*fLog << "Omit : i, content, error = " << i << ",  " 
+    //      << fHist->GetBinContent(i) << ",  " << fHist->GetBinError(i) 
+    //      << endl;
+
+  }
+
+  // mean of entries/bin in the fit range
+  if (fMbins > 0)
+  {
+    mean /= ((Double_t) fMbins);
+    rms  /= ((Double_t) fMbins);
+  }
+
+  rms = sqrt( rms - mean*mean );
+
+  // if there are no events in the background region
+  //    there is no reason for rebinning
+  //    and this is the condition for assuming a constant background (= 0)
+  if (mean <= 0.0)
+    break;
+
+  Double_t helpmi = fAlphami*fAlphami*fAlphami;
+  Double_t helpmm = fAlphamm*fAlphamm*fAlphamm;
+  Double_t helpma = fAlphama*fAlphama*fAlphama;
+  Double_t help   =   (helpma-helpmm) * (fAlphamm-fAlphami)    
+	            - (helpmm-helpmi) * (fAlphama-fAlphamm);
+  if (help != 0.0)
+    a2init =  ( (fAlphamm-fAlphami)*nfar - (fAlphama-fAlphamm)*nclose )
+                * 1.5 * fHist->GetBinWidth(1) / help;
+  else
+    a2init = 0.0;
+
+
+  //--------------------------------------------
+  // rebin the histogram
+  //   - if a bin has no entries 
+  //   - or if there are too many bins with too few entries
+  //   - or if the new bin width would exceed half the size of the 
+  //     signal region
+
+  if ( !fRebin  ||
+       ( fNzero <= 0 && (Double_t)fMlow<0.05*(Double_t)fMbins )  || 
+       (Double_t)(nrebin+1)/(Double_t)nrebin * fHist->GetBinWidth(1) 
+                                                           > fAlphasig/2.0 )
+  {
+    //*fLog << "before break" << endl;
+    break;
+  }
+
+  nrebin += 1;
+  TString histname = fHist->GetName();
+  delete fHist;
+  fHist = NULL;
+
+  *fLog << "MHFindSignificanceONOFF::FitPolynomial; rebin the |alpha| plot, grouping "
+        << nrebin << " bins together" << endl;
+
+  // TH1::Rebin doesn't work properly
+  //fHist = fHistOrig->Rebin(nrebin, "Rebinned");
+  // use private routine RebinHistogram()
+  fHist = new TH1F;
+  fHist->Sumw2();
+  fHist->SetNameTitle(histname, histname);
+  fHist->UseCurrentStyle();
+
+  // do rebinning such that x0 remains a lower bin edge
+  Double_t x0 = 0.0;
+  if ( !RebinHistogram(x0, nrebin) )
+  {
+    *fLog << "MHFindSignificanceONOFF::FitPolynomial; RebinHistgram() failed" 
+          << endl;
+    return kFALSE;
+  }
+
+  fHist->SetXTitle("|alpha|  [\\circ]");
+  fHist->SetYTitle("Counts");
+
+  }
+  //----------------   end of while loop for rebinning   -----------------
+
+
+  // if there are still too many bins with too few entries don't fit
+  // and assume a constant background
+
+  fConstantBackg = kFALSE;
+  if ( fNzero > 0  ||  (Double_t)fMlow>0.05*(Double_t)fMbins ) 
+  {
+    *fLog << "MHFindSignificanceONOFF::FitPolynomial; polynomial fit not possible,  fNzero, fMlow, fMbins = "
+          << fNzero << ",  " << fMlow << ",  " << fMbins << endl;
+    *fLog << "                    assume a constant background" << endl;
+
+    fConstantBackg = kTRUE;
+    fDegree        = 0;
+
+    TString funcname = "Poly";
+    Double_t xmin =   0.0;
+    Double_t xmax =  90.0;
+
+    TString formula = "[0]";
+
+    fPoly = new TF1(funcname, formula, xmin, xmax);
+    TList *funclist = fHist->GetListOfFunctions();
+    funclist->Add(fPoly);
+
+    //--------------------
+    Int_t nparfree = 1;
+    fChisq         = 0.0; 
+    fNdf           = fMbins - nparfree;
+    fProb          = 0.0;
+    fIstat         = 0;
+
+    fValues.Set(1);
+    fErrors.Set(1);
+
+    Double_t val, err;
+    val = mean;
+    err = sqrt( mean / (Double_t)fMbins );
+
+    fPoly->SetParameter(0, val);
+    fPoly->SetParError (0, err);
+
+    fValues[0] = val;
+    fErrors[0] = err; 
+
+    fEma[0][0]  = err*err;
+    fCorr[0][0] = 1.0;
+    //--------------------
+
+    //--------------------------------------------------
+    // reset the errors of the points in the histogram
+    for (Int_t i=1; i<=nbins; i++)
+    {
+      fHist->SetBinError(i, saveError[i-1]);
+    }
+
+
+    return kTRUE;
+  }
+
+
+  //===========   start loop for reducing the degree   ==================
+  //              of the polynomial
+  while (1)
+  {
+      //--------------------------------------------------
+      // prepare fit of a polynomial :   (a0 + a1*x + a2*x**2 + a3*x**3 + ...)
+
+      TString funcname = "Poly";
+      Double_t xmin =   0.0;
+      Double_t xmax =  90.0;
+
+      TString formula = "[0]";
+      TString bra1     = "+[";
+      TString bra2     =    "]";
+      TString xpower   = "*x";
+      TString newpower = "*x";
+      for (Int_t i=1; i<=fDegree; i++)
+      {
+          formula += bra1;
+          formula += i;
+          formula += bra2;
+          formula += xpower;
+
+          xpower += newpower;
+      }
+
+      //*fLog << "FitPolynomial : formula = " << formula << endl;
+
+      fPoly = new TF1(funcname, formula, xmin, xmax);
+      TList *funclist = fHist->GetListOfFunctions();
+      funclist->Add(fPoly);
+
+      //------------------------
+      // attention : the dimensions must agree with those in CallMinuit()
+      const UInt_t npar = fDegree+1;
+
+      TString parname[npar];
+      TArrayD vinit(npar);
+      TArrayD  step(npar);
+      TArrayD limlo(npar);
+      TArrayD limup(npar);
+      TArrayI   fix(npar);
+
+      vinit[0] =   mean;
+      vinit[2] = a2init;
+
+      for (UInt_t j=0; j<npar; j++)
+      {
+          parname[j]  = "p";
+          parname[j] += j+1;
+
+          step[j] = vinit[j] != 0.0 ? TMath::Abs(vinit[j]) / 10.0 : 0.000001;
+      }
+
+      // limit the first coefficient of the polynomial to positive values
+      // because the background must not be negative
+      limup[0] = fHist->GetEntries();
+
+      // use the subsequernt loop if you want to apply the
+      // constraint : uneven derivatives (at alpha=0) = zero
+      for (UInt_t j=1; j<npar; j+=2)
+      {
+          vinit[j] = 0;
+          step[j]  = 0;
+          fix[j]   = 1;
+      }
+
+      //*fLog << "FitPolynomial : before CallMinuit()" << endl;
+
+      MMinuitInterface inter;
+      const Bool_t rc = inter.CallMinuit(fcnpoly, parname, vinit, step,
+                                         limlo, limup, fix, fHist, "Migrad",
+                                         kFALSE);
+
+      //*fLog << "FitPolynomial : after CallMinuit()" << endl;
+
+      if (rc != 0)
+      {
+          //  *fLog << "MHFindSignificanceONOFF::FitPolynomial; polynomial fit failed"
+          //        << endl;
+          //  return kFALSE;
+      }
+
+
+      //-------------------
+      // get status of minimization
+      Double_t fmin   = 0;
+      Double_t fedm   = 0;
+      Double_t errdef = 0;
+      Int_t    npari  = 0;
+      Int_t    nparx  = 0;
+
+      if (gMinuit)
+          gMinuit->mnstat(fmin, fedm, errdef, npari, nparx, fIstat);
+
+      *fLog << "MHFindSignificanceONOFF::FitPolynomial; fmin, fedm, errdef, npari, nparx, fIstat = "
+            << fmin << ",  " << fedm << ",  " << errdef << ",  " << npari
+            << ",  " << nparx << ",  " << fIstat << endl;
+
+
+      //-------------------
+      // store the results
+
+      Int_t nparfree = gMinuit!=NULL ? gMinuit->GetNumFreePars() : 0;
+      fChisq         = fmin;
+      fNdf           = fMbins - nparfree;
+      fProb          = TMath::Prob(fChisq, fNdf);
+
+
+      // get fitted parameter values and errors
+      fValues.Set(npar);
+      fErrors.Set(npar);
+
+      for (Int_t j=0; j<=fDegree; j++)
+      {
+          Double_t val, err;
+          if (gMinuit)
+              gMinuit->GetParameter(j, val, err);
+
+          fPoly->SetParameter(j, val);
+          fPoly->SetParError(j, err);
+
+          fValues[j] = val;
+          fErrors[j] = err;
+      }
+
+
+      //--------------------------------------------------
+      // if the highest coefficient (j0) of the polynomial
+      // is consistent with zero reduce the degree of the polynomial
+
+      Int_t j0 = 0;
+      for (Int_t j=fDegree; j>1; j--)
+      {
+          // ignore fixed parameters
+          if (fErrors[j] == 0)
+              continue;
+
+          // this is the highest coefficient
+          j0 = j;
+          break;
+      }
+
+      if (!fReduceDegree || j0==0 || TMath::Abs(fValues[j0]) > fErrors[j0])
+          break;
+
+      // reduce the degree of the polynomial
+      *fLog << "MHFindSignificanceONOFF::FitPolynomial; reduce the degree of the polynomial from "
+          << fDegree << " to " << (j0-2) << endl;
+      fDegree = j0 - 2;
+
+      funclist->Remove(fPoly);
+      //if (fPoly)
+      delete fPoly;
+      fPoly = NULL;
+
+      // delete the Minuit object in order to have independent starting
+      // conditions for the next minimization
+      //if (gMinuit)
+      delete gMinuit;
+      gMinuit = NULL;
+  }
+  //===========   end of loop for reducing the degree   ==================
+  //              of the polynomial
+
+
+  //--------------------------------------------------
+  // get the error matrix of the fitted parameters
+
+
+  if (fIstat >= 1)
+  {
+      // error matrix was calculated
+      if (gMinuit)
+          gMinuit->mnemat(&fEmat[0][0], fNdim);
+
+      // copy covariance matrix into a matrix which includes also the fixed
+      // parameters
+      TString  name;
+      Double_t bnd1, bnd2, val, err;
+      Int_t    jvarbl;
+      Int_t    kvarbl;
+      for (Int_t j=0; j<=fDegree; j++)
+      {
+          if (gMinuit)
+              gMinuit->mnpout(j, name, val, err, bnd1, bnd2, jvarbl);
+
+          for (Int_t k=0; k<=fDegree; k++)
+          {
+              if (gMinuit)
+                  gMinuit->mnpout(k, name, val, err, bnd1, bnd2, kvarbl);
+
+              fEma[j][k] = jvarbl==0 || kvarbl==0 ? 0 : fEmat[jvarbl-1][kvarbl-1];
+          }
+      }
+  }
+  else
+  {
+      // error matrix was not calculated, construct it
+      *fLog << "MHFindSignificanceONOFF::FitPolynomial; error matrix not defined"
+          << endl;
+      for (Int_t j=0; j<=fDegree; j++)
+      {
+          for (Int_t k=0; k<=fDegree; k++)
+              fEma[j][k] = 0;
+
+          fEma[j][j] = fErrors[j]*fErrors[j];
+      }
+  }
+
+
+  //--------------------------------------------------
+  // calculate correlation matrix
+  for (Int_t j=0; j<=fDegree; j++)
+      for (Int_t k=0; k<=fDegree; k++)
+      {
+          const Double_t sq = fEma[j][j]*fEma[k][k];
+          fCorr[j][k] = sq==0 ? 0 : fEma[j][k] / TMath::Sqrt(fEma[j][j]*fEma[k][k]);
+      }
+
+
+  //--------------------------------------------------
+  // reset the errors of the points in the histogram
+  for (Int_t i=1; i<=nbins; i++)
+      fHist->SetBinError(i, saveError[i-1]);
+
+
+  return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// ReBinHistogramOFF
+//
+// rebin the histogram 'fHistOrig' by grouping 'nrebin' bins together 
+// put the result into the histogram 'fHist'
+// the rebinning is made such that 'x0' remains a lower bound of a bin
+//
+
+Bool_t MHFindSignificanceONOFF::RebinHistogramOFF(Double_t x0, Int_t nrebin)
+{
+  //-----------------------------------------
+  // search bin i0 which has x0 as lower edge
+
+  Int_t i0 = -1;
+  Int_t nbold = fHistOrigOFF->GetNbinsX();
+  for (Int_t i=1; i<=nbold; i++)
+  {
+      if (TMath::Abs(fHistOrigOFF->GetBinLowEdge(i) - x0) < 1.e-4 )
+      {
+          i0 = i;
+          break;
+      }
+  }
+
+  if (i0 == -1)
+  {
+    i0 = 1;
+    *fLog << "MHFindsignificanceOFF::RebinOFF; no bin found with " << x0
+          << " as lower edge,  start rebinning with bin 1" << endl;
+  }
+
+  Int_t istart = i0 - nrebin * ( (i0-1)/nrebin );
+
+  //-----------------------------------------
+  // get new bin edges
+
+  const Int_t    nbnew = (nbold-istart+1) / nrebin;
+  const Double_t xmin  = fHistOrigOFF->GetBinLowEdge(istart);
+  const Double_t xmax  = xmin + (Double_t)nbnew * nrebin * fHistOrigOFF->GetBinWidth(1);
+  fHistOFF->SetBins(nbnew, xmin, xmax);
+
+  *fLog << "MHFindSignificanceONOFF::ReBinOFF; x0, i0, nbold, nbnew, xmin, xmax = "
+        << x0 << ",  " << i0 << ",  " << nbold << ",  " << nbnew << ",  "
+        << xmin << ",  " << xmax << endl;
+
+  //-----------------------------------------
+  // get new bin entries
+
+  for (Int_t i=1; i<=nbnew; i++)
+  {
+      Int_t j = nrebin*(i-1) + istart;
+
+      Double_t content = 0;
+      Double_t error2  = 0;
+      for (Int_t k=0; k<nrebin; k++)
+      {
+          content += fHistOrigOFF->GetBinContent(j+k);
+          error2  += fHistOrigOFF->GetBinError(j+k) * fHistOrigOFF->GetBinError(j+k);
+      }
+      fHistOFF->SetBinContent(i, content);
+      fHistOFF->SetBinError  (i, sqrt(error2));
+  }
+  fHistOFF->SetEntries( fHistOrigOFF->GetEntries() );
+
+  return kTRUE;
+}
+
+
+
+
+// --------------------------------------------------------------------------
+
+
+
+//
+// ReBinHistogram
+//
+// rebin the histogram 'fHistOrig' by grouping 'nrebin' bins together 
+// put the result into the histogram 'fHist'
+// the rebinning is made such that 'x0' remains a lower bound of a bin
+//
+
+Bool_t MHFindSignificanceONOFF::RebinHistogram(Double_t x0, Int_t nrebin)
+{
+  //-----------------------------------------
+  // search bin i0 which has x0 as lower edge
+
+  Int_t i0 = -1;
+  Int_t nbold = fHistOrig->GetNbinsX();
+  for (Int_t i=1; i<=nbold; i++)
+  {
+      if (TMath::Abs(fHistOrig->GetBinLowEdge(i) - x0) < 1.e-4 )
+      {
+          i0 = i;
+          break;
+      }
+  }
+
+  if (i0 == -1)
+  {
+    i0 = 1;
+    *fLog << "MHFindsignificance::Rebin; no bin found with " << x0
+          << " as lower edge,  start rebinning with bin 1" << endl;
+  }
+
+  Int_t istart = i0 - nrebin * ( (i0-1)/nrebin );
+
+  //-----------------------------------------
+  // get new bin edges
+
+  const Int_t    nbnew = (nbold-istart+1) / nrebin;
+  const Double_t xmin  = fHistOrig->GetBinLowEdge(istart);
+  const Double_t xmax  = xmin + (Double_t)nbnew * nrebin * fHistOrig->GetBinWidth(1);
+  fHist->SetBins(nbnew, xmin, xmax);
+
+  *fLog << "MHFindSignificanceONOFF::ReBin; x0, i0, nbold, nbnew, xmin, xmax = "
+        << x0 << ",  " << i0 << ",  " << nbold << ",  " << nbnew << ",  "
+        << xmin << ",  " << xmax << endl;
+
+  //-----------------------------------------
+  // get new bin entries
+
+  for (Int_t i=1; i<=nbnew; i++)
+  {
+      Int_t j = nrebin*(i-1) + istart;
+
+      Double_t content = 0;
+      Double_t error2  = 0;
+      for (Int_t k=0; k<nrebin; k++)
+      {
+          content += fHistOrig->GetBinContent(j+k);
+          error2  += fHistOrig->GetBinError(j+k) * fHistOrig->GetBinError(j+k);
+      }
+      fHist->SetBinContent(i, content);
+      fHist->SetBinError  (i, sqrt(error2));
+  }
+  fHist->SetEntries( fHistOrig->GetEntries() );
+
+  return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+//  FitGaussPoly
+//
+//  fits a (Gauss + polynomial function) to the alpha distribution 'fhist' 
+//
+//
+Bool_t MHFindSignificanceONOFF::FitGaussPoly()
+{
+  *fLog << "Entry FitGaussPoly" << endl;
+
+  //--------------------------------------------------
+  // check the histogram :
+  //       - calculate initial values of the parameters
+  //       - check for bins with zero entries
+  //       - set minimum errors
+  //       - save the original errors
+  //       - set errors huge outside the fit range
+  //         (in 'fcnpoly' points with huge errors will be ignored)
+
+
+  Double_t dummy = 1.e20;
+
+  fGNzero   = 0;
+  fGMbins   = 0;
+
+  //------------------------------------------
+  // if a constant background has been assumed (due to low statistics)
+  // fit only in the signal region
+  if ( !fConstantBackg )
+  {
+    fAlphalow = 0.0;
+    fAlphahig = fAlphamax;
+  }
+  else
+  {
+    fAlphalow = 0.0;
+    fAlphahig = 2.0*fAlphasig>25.0 ? 25.0 : 2.0*fAlphasig;
+  }
+  //------------------------------------------
+
+
+  fAlphalo =  10000.0;
+  fAlphahi = -10000.0;
+
+
+  Int_t nbins = fHist->GetNbinsX();
+  TArrayD saveError(nbins);
+
+  for (Int_t i=1; i<=nbins; i++)
+  {
+    saveError[i-1] = fHist->GetBinError(i);
+
+    // bin should be completely contained in the fit range
+    // (fAlphalow, fAlphahig)
+    Double_t  xlo = fHist->GetBinLowEdge(i);
+    Double_t  xup = fHist->GetBinLowEdge(i+1);
+
+    if ( xlo >= fAlphalow-fEps  &&  xlo <= fAlphahig+fEps  &&
+	 xup >= fAlphalow-fEps  &&  xup <= fAlphahig+fEps     )
+    {
+      fGMbins++;
+
+      if ( xlo < fAlphalo )
+        fAlphalo = xlo;
+
+      if ( xup > fAlphahi )
+        fAlphahi = xup;
+
+      Double_t content = fHist->GetBinContent(i);
+
+
+      // count bins with zero entry
+      if (content <= 0.0)
+        fGNzero++;
+     
+      // set minimum error
+      if (content < 9.0)
+        fHist->SetBinError(i, 3.0);
+
+      //*fLog << "Take : i, content, error = " << i << ",  " 
+      //      << fHist->GetBinContent(i) << ",  "
+      //      << fHist->GetBinError(i)   << endl;
+
+      continue;
+    }    
+    // bin is not completely contained in the fit range : set error huge
+
+    fHist->SetBinError(i, dummy);
+
+    //*fLog << "Omit : i, content, error = " << i << ",  " 
+    //      << fHist->GetBinContent(i) << ",  " << fHist->GetBinError(i) 
+    //      << endl;
+
+  }
+
+
+  // if a bin has no entries don't fit
+  if (fGNzero > 0)
+  {
+    *fLog << "MHFindSignificanceONOFF::FitGaussPoly; out of " << fGMbins 
+          << " bins there are " << fGNzero
+          << " bins with zero entry" << endl;
+
+    fGPoly = NULL;
+    return kFALSE;
+  }
+
+
+  //--------------------------------------------------
+  // prepare fit of a (polynomial+Gauss) :   
+  // (a0 + a1*x + a2*x**2 + a3*x**3 + ...) + A*exp( -0.5*((x-x0)/sigma)**2 )
+
+  TString funcname = "PolyGauss";
+  Double_t xmin =   0.0;
+  Double_t xmax =  90.0;
+
+  TString xpower   = "*x";
+  TString newpower = "*x";
+
+  TString formulaBackg = "[0]";
+  for (Int_t i=1; i<=fDegree; i++)
+      formulaBackg += Form("+[%d]*x^%d", i, i);
+
+  const TString formulaGauss = 
+        Form("[%d]/[%d]*exp(-0.5*((x-[%d])/[%d])^2)",
+             fDegree+1, fDegree+3, fDegree+2, fDegree+3);
+
+  TString formula = formulaBackg;
+  formula += "+";
+  formula += formulaGauss;
+
+  *fLog << "FitGaussPoly : formulaBackg = " << formulaBackg << endl;
+  *fLog << "FitGaussPoly : formulaGauss = " << formulaGauss << endl;
+  *fLog << "FitGaussPoly : formula = " << formula << endl;
+
+  fGPoly = new TF1(funcname, formula, xmin, xmax);
+  TList *funclist = fHist->GetListOfFunctions();
+  funclist->Add(fGPoly);
+
+  fGBackg = new TF1("Backg", formulaBackg, xmin, xmax);
+  //funclist->Add(fGBackg); 
+
+  //------------------------
+  // attention : the dimensions must agree with those in CallMinuit()
+  Int_t npar = fDegree+1 + 3;
+
+  TString parname[npar];
+  TArrayD vinit(npar);
+  TArrayD  step(npar); 
+  TArrayD limlo(npar); 
+  TArrayD limup(npar); 
+  TArrayI   fix(npar);
+
+
+  // take as initial values for the polynomial 
+  // the result from the polynomial fit
+  for (Int_t j=0; j<=fDegree; j++)
+    vinit[j] = fPoly->GetParameter(j);
+
+  Double_t sigma = 8;
+  vinit[fDegree+1] = 2.0 * fNexONOFF * fHist->GetBinWidth(1) / TMath::Sqrt(TMath::Pi()*2);
+  vinit[fDegree+2] = 0;
+  vinit[fDegree+3] = sigma;
+
+  *fLog << "FitGaussPoly : starting value for Gauss-amplitude = " 
+        << vinit[fDegree+1] << endl;
+
+  for (Int_t j=0; j<npar; j++)
+  {
+      parname[j]  = "p";
+      parname[j] += j+1;
+
+      step[j] = vinit[j]!=0 ? TMath::Abs(vinit[j]) / 10.0 : 0.000001;
+  }
+
+  // limit the first coefficient of the polynomial to positive values
+  // because the background must not be negative
+  limup[0] = fHist->GetEntries()*10;
+
+  // limit the sigma of the Gauss function
+  limup[fDegree+3] = 20;
+
+
+  // use the subsequernt loop if you want to apply the
+  // constraint : uneven derivatives (at alpha=0) = zero
+  for (Int_t j=1; j<=fDegree; j+=2)
+  {
+      vinit[j] = 0;
+      step[j]  = 0;
+      fix[j]   = 1;
+  }
+
+  // fix position of Gauss function
+  vinit[fDegree+2] = 0;
+  step[fDegree+2]  = 0;
+  fix[fDegree+2]   = 1;
+   
+  // if a constant background has been assumed (due to low statistics)
+  // fix the background
+  if (fConstantBackg)
+  {
+      step[0] = 0;
+      fix[0]  = 1;
+  }
+
+  MMinuitInterface inter;
+  const Bool_t rc = inter.CallMinuit(fcnpolygauss, parname, vinit, step,
+                                     limlo, limup, fix, fHist, "Migrad",
+                                     kFALSE);
+
+  if (rc != 0)
+  {
+  //  *fLog << "MHFindSignificanceONOFF::FitGaussPoly; (polynomial+Gauss) fit failed"
+  //        << endl;
+  //  return kFALSE;
+  }
+
+
+  //-------------------
+  // get status of the minimization
+  Double_t fmin;
+  Double_t fedm;
+  Double_t errdef;
+  Int_t    npari;
+  Int_t    nparx;
+
+  if (gMinuit)
+    gMinuit->mnstat(fmin, fedm, errdef, npari, nparx, fGIstat);
+
+  *fLog << "MHFindSignificanceONOFF::FitGaussPoly; fmin, fedm, errdef, npari, nparx, fGIstat = "
+        << fmin << ",  " << fedm << ",  " << errdef << ",  " << npari
+        << ",  " << nparx << ",  " << fGIstat << endl;
+
+
+  //-------------------
+  // store the results
+
+  Int_t nparfree  = gMinuit!=NULL ? gMinuit->GetNumFreePars() : 0;
+  fGChisq         = fmin; 
+  fGNdf           = fGMbins - nparfree;
+  fGProb          = TMath::Prob(fGChisq, fGNdf);
+
+
+  // get fitted parameter values and errors
+  fGValues.Set(npar);
+  fGErrors.Set(npar);
+
+  for (Int_t j=0; j<npar; j++)
+  {
+    Double_t val, err;
+    if (gMinuit)
+      gMinuit->GetParameter(j, val, err);
+
+    fGPoly->SetParameter(j, val);
+    fGPoly->SetParError(j, err);
+
+    fGValues[j] = val;
+    fGErrors[j] = err; 
+
+    if (j <=fDegree)
+    {
+      fGBackg->SetParameter(j, val);
+      fGBackg->SetParError(j, err);
+    }
+  }
+
+  fSigmaGauss  = fGValues[fDegree+3];
+  fdSigmaGauss = fGErrors[fDegree+3];
+  // fitted total number of excess events 
+  fNexGauss = fGValues[fDegree+1] * TMath::Sqrt(TMath::Pi()*2) /
+                                         (fHist->GetBinWidth(1)*2 );
+  fdNexGauss = fNexGauss * fGErrors[fDegree+1]/fGValues[fDegree+1];
+
+  //--------------------------------------------------
+  // get the error matrix of the fitted parameters
+
+
+  if (fGIstat >= 1)
+  {
+    // error matrix was calculated
+    if (gMinuit)
+      gMinuit->mnemat(&fGEmat[0][0], fGNdim);
+
+    // copy covariance matrix into a matrix which includes also the fixed
+    // parameters
+    TString  name;
+    Double_t bnd1, bnd2, val, err;
+    Int_t    jvarbl;
+    Int_t    kvarbl;
+    for (Int_t j=0; j<npar; j++)
+    {
+        if (gMinuit)
+            gMinuit->mnpout(j, name, val, err, bnd1, bnd2, jvarbl);
+
+        for (Int_t k=0; k<npar; k++)
+        {
+            if (gMinuit)
+                gMinuit->mnpout(k, name, val, err, bnd1, bnd2, kvarbl);
+
+            fGEma[j][k] = jvarbl==0 || kvarbl==0 ? 0 : fGEmat[jvarbl-1][kvarbl-1];
+        }
+    }
+  }
+  else
+  {
+    // error matrix was not calculated, construct it
+    *fLog << "MHFindSignificanceONOFF::FitPolynomial; error matrix not defined" 
+          << endl;
+    for (Int_t j=0; j<npar; j++)
+    {
+        for (Int_t k=0; k<npar; k++)
+            fGEma[j][k] = 0;
+
+        fGEma[j][j] = fGErrors[j]*fGErrors[j];
+    }
+  }
+
+
+  //--------------------------------------------------
+  // calculate correlation matrix
+  for (Int_t j=0; j<npar; j++)
+  {
+    for (Int_t k=0; k<npar; k++)
+    {
+        const Double_t sq = fGEma[j][j]*fGEma[k][k];
+        fGCorr[j][k] = sq==0 ? 0 : fGEma[j][k] / sqrt( fGEma[j][j]*fGEma[k][k] );
+    }
+  }
+
+
+  //--------------------------------------------------
+  // reset the errors of the points in the histogram
+  for (Int_t i=1; i<=nbins; i++)
+    fHist->SetBinError(i, saveError[i-1]);
+
+  return kTRUE;
+
+}
+
+
+
+// --------------------------------------------------------------------------
+//
+//  DetExcessONOFF
+//
+//  using the result of the polynomial fit (fValuesOFF), DetExcessONOFF determines
+//
+//  - the total number of events in the signal region (fNon)
+//  - the number of backgound events (fitted) in the signal region (fNoffSigFitted)
+//  - the number of OFF (normalized evetns) in the alpha OFF distribution (fNoffSig)
+//  - the number of excess events (fNexONOFF)
+//  - the number of excess events using the fitted OFF (fNexONOFFFitted)
+//  - the effective number of background events (fNoff), and fGamma :
+//    fNoffSigFitted = fGamma * fNoff;  fdNoffSigFitted = fGamma * sqrt(fNoff);
+//
+//  It assumed that the polynomial is defined as
+//               a0 + a1*x + a2*x**2 + a3*x**3 + ..
+//
+//  and that the alpha distribution has the range 0 < alpha < 90 degrees
+//
+
+Bool_t MHFindSignificanceONOFF::DetExcessONOFF()
+{
+  //*fLog << "MHFindSignificanceONOFF::DetExcessONOFF;" << endl;
+
+//--------------------------------------------
+  // calculate the total number of events (fNon) in the signal region
+
+  fNon  = 0.0;
+  fdNon = 0.0;
+
+  Double_t alphaup = -1000.0; 
+  Double_t binwidth = fHist->GetBinWidth(1);
+
+  Int_t nbins = fHist->GetNbinsX();
+  for (Int_t i=1; i<=nbins; i++)
+  {
+    Double_t  xlo = fHist->GetBinLowEdge(i);
+    Double_t  xup = fHist->GetBinLowEdge(i+1);
+ 
+    // bin must be completely contained in the signal region
+    if ( xlo <= (fAlphasig+fEps)  &&  xup <= (fAlphasig+fEps)    )
+    {
+      Double_t width = fabs(xup-xlo);
+      if (fabs(width-binwidth) > fEps)
+      {
+        *fLog << "MHFindSignificanceONOFF::DetExcessONOFF; alpha plot has variable binning, which is not allowed" 
+          << endl;
+        return kFALSE;
+      }
+
+      if (xup > alphaup)
+        alphaup = xup;
+
+      fNon  += fHist->GetBinContent(i);
+      fdNon += fHist->GetBinError(i) * fHist->GetBinError(i);
+    }
+  }
+  fdNon = sqrt(fdNon);
+
+  *fLog << "MHFindSignificamceONOFF::DetExcessONOFF:" << endl
+	<< "fNon = " << fNon << " ; fdNon = " << fdNon << endl;
+
+
+  // tmp
+  //if (fNon == 0)
+  //{
+  //    cout << "ERROR... WITH COUNTED OF ON EVETNS: fAlphasig, fEps = "
+//	   << fAlphasig << ", " << fEps << endl;
+  //    fHist-> DrawCopy();
+  //   gPad -> SaveAs("HistON.ps");
+  //}
+  // endtmp
+
+
+  // the actual signal range is :
+  if (alphaup == -1000.0)
+    return kFALSE;
+
+  fAlphasi = alphaup;
+
+
+  //*fLog << "fAlphasi, fNon, fdNon, binwidth, fDegree = " << fAlphasi << ",  "
+  //      << fNon << ",  " << fdNon << ",  " << binwidth << ",  "
+  //      << fDegree << endl;
+
+
+  // Calculate the number of OFF events in the signal region
+  // ___________________________________________________
+  
+
+  fNoffSig = 0.0;
+  fdNoffSig = 0.0;
+
+  Double_t alphaupOFF = -1000.0; 
+  Double_t binwidthOFF = fHistOFF->GetBinWidth(1);
+
+  Int_t nbinsOFF = fHistOFF->GetNbinsX();
+
+  for (Int_t i=1; i<=nbinsOFF; i++)
+  {
+    Double_t xlo = fHistOFF->GetBinLowEdge(i);
+    Double_t xup = fHistOFF->GetBinLowEdge(i+1);
+ 
+    // bin must be completely contained in the signal region
+    if ( xlo <= (fAlphasig+fEps)  &&  xup <= (fAlphasig+fEps)    )
+    {
+      Double_t width = fabs(xup-xlo);
+      if (fabs(width-binwidthOFF) > fEps)
+      {
+        *fLog << "MHFindSignificanceONOFF::DetExcessONOFF; alphaOFF plot has variable binning, which is not allowed" 
+          << endl;
+        return kFALSE;
+      }
+
+      if (xup > alphaupOFF)
+        alphaup = xup;
+
+      fNoffSig  += fHistOFF->GetBinContent(i);
+      fdNoffSig += fHistOFF->GetBinError(i) * fHistOFF->GetBinError(i);
+    }
+  }
+  fdNoffSig = sqrt(fdNoffSig);
+
+  // tmp
+  //if (fNoffSig == 0)
+  //{
+  //   cout << "ERROR... WITH COUNTED OF OFF EVETNS: fAlphasig, fEps = "
+//	   << fAlphasig << ", " << fEps << endl;
+  //     fHistOFF-> DrawCopy();
+  //   gPad -> SaveAs("HistOFF.ps");
+  //}
+  //endtmp
+
+  // the actual signal range is :
+  if (alphaup == -1000.0)
+    return kFALSE;
+
+  fAlphasiOFF = alphaup;
+
+  if (fabs(fAlphasiOFF - fAlphasi) > fEps)
+  {
+      *fLog << "MHFindSignificanceONOFF::DetExcessONOFF; fAlphasiOFF ("
+	    << fAlphasiOFF << ") is not equal to fAlphasi (" 
+	    << fAlphasi << "), this is something that should not happen" 
+	    << endl;
+
+    //return kFALSE; It might happen in pathological cases (very few OFF)
+      // and I want to see the results, anyhow
+  }
+
+
+
+   // Calculate the number of OFF events in the total OFF region 
+  // defined by fAlphaminOFF and fAlphamaxOFF 
+  // ___________________________________________________
+  
+  fNoffTot = 0.0;
+  fdNoffTot = 0.0;
+
+  
+ 
+  for (Int_t i=1; i<=nbinsOFF; i++)
+  {
+    Double_t xlo = fHistOFF->GetBinLowEdge(i);
+    Double_t xup = fHistOFF->GetBinLowEdge(i+1);
+ 
+    // bin must be completely contained in the signal region
+    if ( xlo >= (fAlphaminOFF-fEps)  &&  xup <= (fAlphamaxOFF+fEps)    )
+    {
+      Double_t width = fabs(xup-xlo);
+      if (fabs(width-binwidthOFF) > fEps)
+      {
+        *fLog << "MHFindSignificanceONOFF::DetExcessONOFF; alphaOFF plot has variable binning, which is not allowed" 
+          << endl;
+        return kFALSE;
+      }
+
+      fNoffTot  += fHistOFF->GetBinContent(i);
+      fdNoffTot += fHistOFF->GetBinError(i) * fHistOFF->GetBinError(i);
+    }
+  }
+  fdNoffTot = sqrt(fdNoffTot);
+
+
+
+
+
+
+
+
+
+  //--------------------------------------------
+  // calculate the number of OFF fitted events (fNoffSigFitted) in the signal region
+  // and its error (fdNoffSigFitted) 
+
+ 
+
+ if (fUseFittedQuantities) 
+ {
+     //--------------------------------------------
+     // calculate the number of OFF fitted events (fNoffSigFitted) in the signal region
+     // and its error (fdNoffSigFitted) 
+     
+     Double_t fac = 1.0/binwidthOFF;
+     
+     fNoffSigFitted        = 0.0;
+     Double_t altothejplus1 = fAlphasi; // Limit for signal found for ON data is used. 
+     for (Int_t j=0; j<=fDegreeOFF; j++)
+     {
+	 fNoffSigFitted += fValuesOFF[j] * altothejplus1 / ((Double_t)(j+1));
+	 altothejplus1 *= fAlphasi;
+     }
+     fNoffSigFitted *= fac;
+     
+     // derivative of fNoffSigFitted 
+     Double_t facj;
+     Double_t fack;
+     
+     Double_t sum = 0.0;
+     altothejplus1 = fAlphasi;
+     for (Int_t j=0; j<=fDegreeOFF; j++)
+     {
+	 facj = altothejplus1 / ((Double_t)(j+1));
+	 
+	 Double_t altothekplus1 = fAlphasi;    
+	 for (Int_t k=0; k<=fDegreeOFF; k++)
+	 {
+	     fack = altothekplus1 / ((Double_t)(k+1));
+	     sum   += facj * fack * fEmaOFF[j][k];
+	     altothekplus1 *= fAlphasi;
+	 }
+	 altothejplus1 *= fAlphasi;
+     }
+     sum  *= fac*fac;
+     
+     if (sum < 0.0)
+     {
+	 *fLog << "MHFindsignificanceONOFF::DetExcessONOFF; error squared is negative" 
+	       << endl;
+	 return kFALSE;
+     }
+     
+     fdNoffSigFitted = sqrt(sum);
+     
+     
+     // We can now compare fNoffSig with fNoffSigFitted (and their errors)
+     // NUmbers should agree within 10 % (errors within 20%)
+     
+     if (fabs(fNoffSig - fNoffSigFitted) > 0.1 * fNoffSigFitted)
+     {
+	 *fLog << "MHFindsignificanceONOFF::DetExcessONOFF; number of OFF events and Fitted number of OFF events in signal region do not agree (within 10 %)" << endl;
+	 
+	 *fLog << "fNoffSig = " << fNoffSig << " ; fNoffSigFitted = " << fNoffSigFitted << endl;
+	 
+	 
+	 // return kFALSE; NOt yet...
+     }
+     
+     /*
+       if (fabs(fdNoffSig - fdNoffSigFitted) > 0.2 * fdNoffSigFitted)
+       {
+       *fLog << "MHFindsignificanceONOFF::DetExcessONOFF; error in number of OFF events and error in Fitted number of OFF events in signal region do not agree (within 20 %)" 
+       << endl;
+       
+       
+       *fLog << "fdNoffSig = " << fdNoffSig << " ; fdNoffSigFitted = " << fdNoffSigFitted << endl;
+       
+       
+       //return kFALSE; NOt yet...
+       }
+       
+     */
+     
+    
+     
+     // Calculate the number of OFF events in the whole fit region (fAlphaminOFF-fAlphamaxOFF)
+     // ___________________________________________________
+     
+     
+     
+     fNoffTotFitted = 0.0;
+     
+     altothejplus1 = fAlphamaxOFF; // Limit for OFF data fit 
+     for (Int_t j=0; j<=fDegreeOFF; j++)
+     {
+	 fNoffTotFitted += fValuesOFF[j] * altothejplus1 / ((Double_t)(j+1));
+	 altothejplus1 *= fAlphamaxOFF;
+     }
+     fNoffTotFitted *= fac;
+     
+     // derivative of fdNoffTotFitted 
+     
+     
+     sum = 0.0;
+     altothejplus1 = fAlphamaxOFF;
+     for (Int_t j=0; j<=fDegreeOFF; j++)
+     {
+	 facj = altothejplus1 / ((Double_t)(j+1));
+	 
+	 Double_t altothekplus1 = fAlphamaxOFF;    
+	 for (Int_t k=0; k<=fDegreeOFF; k++)
+	 {
+	     fack = altothekplus1 / ((Double_t)(k+1));
+	     
+	     sum   += facj * fack * fEmaOFF[j][k];
+	     altothekplus1 *= fAlphamaxOFF;
+	 }
+	 altothejplus1 *= fAlphamaxOFF;
+     }
+     sum  *= fac*fac;
+     
+     if (sum < 0.0)
+     {
+	 *fLog << "MHFindsignificanceONOFF::DetExcessONOFF; error squared is negative" 
+	       << endl;
+	 return kFALSE;
+     }
+     
+     fdNoffTotFitted = sqrt(sum);
+     
+
+
+ }
+
+else
+ {
+     fNoffSigFitted = 0.0;
+     fdNoffSigFitted = 0.0;
+     fNoffTotFitted = 0.0;
+     fdNoffTotFitted = 0.0;
+ }
+
+
+
+ *fLog << "MHFindSignificamceONOFF::DetExcessONOFF; INFO ABOOUT COMPUTED OFF EVENTS..." << endl
+       << "fNoffSig = " << fNoffSig << "; fdNoffSig =  " << fdNoffSig << endl
+       << "fNoffSigFitted = " << fNoffSigFitted 
+       << "; fdNoffSigFitted =  " << fdNoffSigFitted << endl;
+ 
+
+
+
+
+  //--------------------------------------------
+  // calculate the number of excess events in the signal region
+
+  fNexONOFF = fNon - fNoffSig*fNormFactor;
+  fNexONOFFFitted = fNon - fNoffSigFitted*fNormFactor;
+  
+  
+  *fLog << "MHFindSignificamceONOFF::DetExcessONOFF;" << endl
+	<< "fNexONOFF (= fNon - fNoffSig*fNormFactor)  = " << fNexONOFF << endl
+	<< "fNexONOFFFitted (= fNon - fNoffSigFitted*fNormFactor)  = " << fNexONOFFFitted << endl;
+
+
+  //--------------------------------------------
+  // calculate the effective number of background events (fNoff) , and fGamma :
+  // fNbg = fGamma * fNoff = fNormFactor* fNoffSigFitted;   
+  // dfNbg = fGamma * sqrt(fNoff) = fNormFactor * fdNoffSigFitted;
+  
+  if (fNoffSigFitted < 0.0)
+  {
+      *fLog << "MHFindSignificamceONOFF::DetExcessONOFF; number of fitted OFF events in signal region is negative,  fNoffSigFitted, fdNoffSigFitted = "
+	    << fNoffSigFitted   << ",  " << fdNoffSigFitted << endl;
+      
+      fGamma = 1.0;
+      fNoff  = 0.0;
+      return kFALSE;
+  }
+  
+  if (fNoffSigFitted > 0.0)
+  {
+      fGamma = fNormFactor * fdNoffSigFitted*fdNoffSigFitted/fNoffSigFitted;
+      fNoff  = fNormFactor * fNoffSigFitted/fGamma; 
+  }
+  else
+  {
+      fGamma = 1.0;
+      fNoff  = 0.0;
+  }
+  
+   *fLog << "MHFindSignificamceONOFF::DetExcessONOFF: " << endl
+	 << "fGamma = " << fGamma << " ; fNoff = " << fNoff << endl;
+
+  
+  return kTRUE;
+}
+
+
+
+
+
+// --------------------------------------------------------------------------
+//
+//  SigmaLiMa
+//
+//  calculates the significance according to Li & Ma
+//  ApJ 272 (1983) 317; formula 17
+//
+Bool_t MHFindSignificanceONOFF::SigmaLiMa(Double_t non,   Double_t noff, 
+                                     Double_t gamma, Double_t *siglima)
+{
+  if (gamma <= 0.0  ||  non <= 0.0  ||  noff <= 0.0)
+  {
+    *siglima = 0.0;
+    return kFALSE;
+  }
+
+  Double_t help1 = non  * log( (1.0+gamma)*non  / (gamma*(non+noff)) );
+  Double_t help2 = noff * log( (1.0+gamma)*noff / (       non+noff ) );
+  *siglima = sqrt( 2.0 * (help1+help2) );
+
+  Double_t nex = non - gamma*noff;
+  if (nex < 0.0)
+    *siglima = - *siglima;
+
+  //*fLog << "MHFindSignificanceONOFF::SigmaLiMa; non, noff, gamma, *siglima = "
+  //      << non << ",  " << noff << ",  " << gamma << ",  " << *siglima << endl;
+
+  return kTRUE;
+}
+
+
+
+//  calculates the significance according to Li & Ma
+//  ApJ 272 (1983) 317; formula 5
+//
+Bool_t MHFindSignificanceONOFF::SigmaLiMaForm5(Double_t non,   Double_t noff, 
+					       Double_t gamma, Double_t *siglima)
+{
+  if (gamma <= 0.0  ||  non <= 0.0  ||  noff <= 0.0)
+  {
+    *siglima = 0.0;
+    return kFALSE;
+  }
+
+  Double_t nex = non - (gamma*noff);
+  Double_t tmp = non + (gamma*gamma)*noff;
+  tmp = TMath::Sqrt(tmp);
+
+  *siglima = nex/tmp;
+
+  if (nex < 0.0)
+    *siglima = - *siglima;
+
+  //*fLog << "MHFindSignificanceONOFF::SigmaLiMa; non, noff, gamma, *siglima = "
+  //      << non << ",  " << noff << ",  " << gamma << ",  " << *siglima << endl;
+
+  return kTRUE;
+}
+
+
+
+
+// --------------------------------------------------------------------------
+//
+
+// Following function computes a clone of fHistOFF and normalizes 
+// contents, errors and fPolyOFF (if exists) with the fNormFactor. 
+// This normalized OFF hist will be used when plotting OFF data 
+// together with ON data.
+
+Bool_t MHFindSignificanceONOFF::ComputeHistOFFNormalized()
+{
+
+    
+    if (!fHist)
+    {
+	*fLog << "MHFindsignificanceONOFF::ComputeHistOFFNormalized; fHist does not exist, normalization of HistOFF can not be performed properly..."
+	      << endl;
+	return kFALSE;
+	
+    }
+
+    
+
+    if (!fHistOFF)
+    {
+	*fLog << "MHFindsignificanceONOFF::ComputeHistOFFNormalized; fHistOFF does not exist, hence can not be normalized" 
+          << endl;
+    return kFALSE;
+	
+    }
+
+
+    if (fNormFactor <= 0)
+    {
+	*fLog << "MHFindsignificanceONOFF::ComputeHistOFFNormalized; fNormFactor is ZERO or NEGATIVE, it might have not been defined yet..."
+          << endl;
+    return kFALSE;
+
+    }
+
+
+    Double_t BinWidthAlphaON = fHist -> GetBinWidth(1);
+    Double_t BinWidthAlphaOFF = fHistOFF -> GetBinWidth(1);
+    Double_t BinWidthRatioONOFF = BinWidthAlphaON/BinWidthAlphaOFF;
+
+
+    *fLog << "MHFindsignificanceONOFF::ComputeHistOFFNormalized; INFO about alpha ON, OFF histo bins"
+	  << endl
+	//  << "fHist bin width = " << BinWidthAlphaON 
+	  << " fHistOFF bin width = " << BinWidthAlphaOFF << endl;
+
+
+
+    TString fHistOFFNormalizedName = fHistOFF -> GetName();
+    fHistOFFNormalizedName += (" (Normalized)");
+    // fHistOFFNormalized = (TH1*) fHistOFF -> Clone();
+    // fHistOFFNormalized -> SetNameTitle(fHistOFFNormalizedName, fHistOFFNormalizedName);
+
+
+    Int_t nbinsOFFNormalized = 0;
+    Int_t nbinsOFF = 0;
+    Double_t xlow = 0.0;
+    Double_t xup = 0.0;
+    Double_t content = 0.0;
+    Double_t error = 0.0;
+    Double_t BinCenter = 0.0;
+    
+
+    // Bins for normalized OFF histo will be the ones of ON histo
+
+    
+    nbinsOFF = fHistOFF -> GetNbinsX();
+    nbinsOFFNormalized = nbinsOFF;
+    xlow = fHistOFF -> GetBinLowEdge(1);
+    xup = fHistOFF -> GetBinLowEdge(nbinsOFFNormalized);
+    xup = xup + BinWidthAlphaON;
+
+    *fLog << "MHFindsignificanceONOFF::ComputeHistOFFNormalized; Limits for fHistOFFNormalized: " 
+	  << "nbins, xlow, xup: " << nbinsOFFNormalized << ", " 
+	  <<  xlow << ", " << xup << endl;
+    
+    fHistOFFNormalized = new TH1F (fHistOFFNormalizedName, fHistOFFNormalizedName, 
+				  nbinsOFFNormalized, xlow, xup);
+    
+
+    // fHistOFFNormalized is filled with data from fHistOFF, 
+    // taken into account the possible bin difference
+
+    
+    for (Int_t i = 1; i <= nbinsOFF; i++)
+    {
+	BinCenter = fHistOFF -> GetBinCenter(i);
+	fHistOFFNormalized -> Fill (BinCenter, fHistOFF -> GetBinContent(i));
+	fHistOFFNormalized -> SetBinError(i, fHistOFF -> GetBinError(i));
+    }
+	    
+
+    
+
+    for (Int_t i = 1; i <= nbinsOFFNormalized; i++)
+    {
+	content = fNormFactor * fHistOFFNormalized -> GetBinContent(i);
+	error = fNormFactor * fHistOFFNormalized -> GetBinError(i);
+	
+	fHistOFFNormalized -> SetBinContent (i, content);
+	fHistOFFNormalized -> SetBinError (i, error);
+    }
+	
+
+    // Number of entries is obtained from histOFF.
+    // and set to histOFFNoramlized; otherwise, the number 
+    // of entries in  histOFFNoramlized would be "nbins"
+
+    Double_t entries = fNormFactor * (fHistOFF -> GetEntries());
+    fHistOFFNormalized -> SetEntries(entries);
+
+
+
+
+    // If polynomial fit has been performed for fHistOFF, 
+    // it is defined a new polyfunction for fHistOFFNormalized, 
+    // which will be the polyfunction of fHistOFF normalized.
+    // Function will be added to the function list of fHistOFFNormalized
+
+
+    
+    if (fPolyOFF == NULL)
+    {
+	*fLog << "MHFindsignificanceONOFF::ComputeHistOFFNormalized; fPolyOFF does not exist..."
+	      << endl;
+    }
+
+    if (fPolyOFF)
+    {
+	*fLog << "MHFindsignificanceONOFF::ComputeHistOFFNormalized; fPolyOFF exists... will be also normalized and included in the list of functions of fHistOFFNormalized"
+	      << endl;
+	
+	
+
+	
+	// Normalization of the function using fNormFactor and 
+	// BinWidthON/BinWidthOFF relation of alpha ON/OFF histograms
+	// This makes possible to plot it together with ON alpha histo
+
+	TString FunctionName("PolyOFFNormalized");
+
+	Double_t xmin = fAlphaminOFF;
+	Double_t xmax = fAlphamaxOFF;
+
+	TString formula = "[0]";
+	TString bra1     = "+[";
+	TString bra2     =    "]";
+	TString xpower   = "*x";
+	TString newpower = "*x";
+	for (Int_t i=1; i<=fDegreeOFF; i++)
+	{
+	    formula += bra1;
+	    formula += i;
+	    formula += bra2;
+	    formula += xpower;
+	    
+	    xpower += newpower;
+	}
+
+      *fLog << "MHFindsignificanceONOFF::ComputeHistOFFNormalized; formula = " << formula << endl;
+
+
+	
+	fPolyOFFNormalized = new TF1 (FunctionName, formula, xmin, xmax);
+	
+	
+	Double_t Parameter = 0.0;
+	Double_t ParameterError = 0.0;
+
+	*fLog << " MHFindsignificanceONOFF::ComputeHistOFFNormalized; Fit parameters info: " << endl;
+	for (Int_t i = 0; i <= fDegreeOFF; i++)
+	{
+	    Parameter = fNormFactor * BinWidthRatioONOFF * fValuesOFF[i];
+	    ParameterError = fNormFactor * BinWidthRatioONOFF * fErrorsOFF[i];
+
+	    fPolyOFFNormalized -> SetParameter(i, Parameter);
+	    fPolyOFFNormalized -> SetParError(i,ParameterError);
+
+	   
+
+	    // Parameters are shown :
+	    
+	    *fLog  << " fValuesOFF[" << i<< "] = " << fValuesOFF[i] 
+		   << " ; Parameter for  fPolyOFFNormalized = " << Parameter  << endl;
+
+	}
+	    
+
+	TList *funclist = fHistOFFNormalized->GetListOfFunctions();
+	
+	// temporal...
+	//*fLog << "INFO concerning list of functions of fHistOFFNormalized :" << endl
+	//       << "List before adding OFF Normal., after adding it and after removing fPolyOFF..." 
+	//       << endl;
+	
+	//funclist-> Print();
+	funclist-> Add(fPolyOFFNormalized);
+	
+	//funclist-> Print();
+	
+		
+
+    }
+
+    return kTRUE;
+
+}
+
+// --------------------------------------------------------------------------
+//
+
+Bool_t MHFindSignificanceONOFF::DrawHistOFF()
+{
+    if (fHistOFF == NULL )
+    {
+	*fLog << "MHFindSignificanceONOFF::DrawHistOFF; fHistOFF = NULL" << endl;
+	return kFALSE;
+    }
+
+//    fPsFilename -> NewPage();
+
+    // PLOT DISABLE
+    /*
+    TCanvas* CanvasHistOFF = new TCanvas(fHistOFF->GetName(), fHistOFF->GetName(), 600, 600);
+
+    //gStyle->SetOptFit(1011);
+
+    gROOT->SetSelectedPad(NULL);    
+    gStyle->SetPadLeftMargin(0.1);
+    gStyle -> SetOptStat(1);
+
+    CanvasHistOFF->cd();
+
+
+    if (fHistOFF)
+    {
+      fHistOFF->DrawCopy();
+    }
+
+    // TF1 *fpolyOFF = fHistOFF->GetFunction("PolyOFF");    
+    if (fPolyOFF == NULL)
+	*fLog << "MHFindSignificanceONOFF::DrawHistOFF; fpolyOFF = NULL" << endl;
+
+    if (fPolyOFF)
+    {
+      // 2, 1 is red and solid
+      fPolyOFF->SetLineColor(2);
+      fPolyOFF->SetLineStyle(1);
+      fPolyOFF->SetLineWidth(2);
+      fPolyOFF->DrawCopy("same");
+    }
+
+    CanvasHistOFF -> Update();
+
+    
+    */
+
+    return kTRUE;
+}
+
+
+// --------------------------------------------------------------------------
+//
+
+Bool_t MHFindSignificanceONOFF::DrawHistOFFNormalized()
+{
+    if (fHistOFFNormalized == NULL )
+    {
+	*fLog << "MHFindSignificanceONOFF::DrawHistOFF; fHistOFFNormalized = NULL" << endl;
+	return kFALSE;
+    }
+
+    //   fPsFilename -> NewPage();
+
+    // PLOT DISABLE TO PERFORM GRID ANALYSIS
+    /*
+    TCanvas* CanvasHistOFFNormalized = new TCanvas(fHistOFFNormalized->GetName(), 
+						   fHistOFFNormalized->GetName(), 600, 600);
+
+    //gStyle->SetOptFit(1011);
+
+    // gROOT->SetSelectedPad(NULL);    
+    gStyle->SetPadLeftMargin(0.1);
+    gStyle -> SetOptStat(1);
+
+    CanvasHistOFFNormalized->cd();
+    
+
+    if (fHistOFFNormalized)
+    {
+      fHistOFFNormalized->DrawCopy();
+    }       
+
+    // TF1 *fpolyOFFNormalized = fHistOFFNormalized->GetFunction("PolyOFFNormalized");    
+    if (fPolyOFFNormalized == NULL)
+	*fLog << "MHFindSignificanceONOFF::DrawHistOFF; fPolyOFFNormalized = NULL" << endl;
+
+    if (fPolyOFFNormalized)
+    {
+      // 2, 1 is red and solid
+      fPolyOFFNormalized->SetLineColor(2);
+      fPolyOFFNormalized->SetLineStyle(1);
+      fPolyOFFNormalized->SetLineWidth(2);
+      fPolyOFFNormalized->DrawCopy("same");
+    }
+
+    CanvasHistOFFNormalized -> Update();
+
+
+    */
+
+    return kTRUE;
+    
+}
+
+
+// --------------------------------------------------------------------------
+//
+
+Bool_t MHFindSignificanceONOFF::DrawFit(const Option_t *opt)
+{
+    if (fHistOFFNormalized == NULL ||  fHist == NULL)
+      *fLog << "MHFindSignificanceONOFF::DrawFit; fHistOFFNormalized = NULL or fHist == NULL" << endl;
+
+    //fPsFilename -> NewPage();
+
+
+    // PLOT DISABLE TO PERFORM GRID ANALYSIS
+    // I DO SAVE PS FILE, BUT CANVAS IS DELETED AFTERWARDS
+
+    fCanvas = new TCanvas("Alpha", "Alpha plot", 600, 600);
+    fCanvas -> SetFillColor(10);
+    
+
+
+
+    //gStyle->SetOptFit(1011);
+
+    gROOT->SetSelectedPad(NULL);    
+    gStyle -> SetFrameFillColor(10);
+    gStyle->SetPadLeftMargin(0.15);
+    gStyle -> SetOptStat(1);
+    
+    fCanvas->cd();
+    
+    if (fHist)
+      {
+	fHist -> SetTitle("Alpha Plot");
+	fHist-> SetTitleOffset(1.5, "Y");
+	fHist-> DrawCopy();
+	
+      }
+
+
+    if (fHistOFFNormalized)
+    {
+	TF1 *fpoly = fHistOFFNormalized->GetFunction("PolyOFFNormalized");    
+	if (fpoly == NULL)
+	    *fLog << "MHFindSignificanceONOFF::DrawFit; fPolyOFFNormalized = NULL" << endl;
+
+	if (fpoly)
+	{
+	    // 2, 1 is red and solid
+	    fpoly->SetLineColor(2);
+	    fpoly->SetLineStyle(1);
+	    fpoly->SetLineWidth(2);
+	    fpoly->DrawCopy("same");
+	}
+    }
+
+    if (fFitGauss)
+    {
+      TF1 *fpolygauss = fHist->GetFunction("PolyGauss");    
+      if (fpolygauss == NULL)
+        *fLog << "MHFindSignificanceONOFF::DrawFit; fpolygauss = NULL" << endl;
+
+      if (fpolygauss)
+      {
+        // 4, 1 is blue and solid
+        fpolygauss->SetLineColor(4);
+        fpolygauss->SetLineStyle(1);
+        fpolygauss->SetLineWidth(4);
+        fpolygauss->DrawCopy("same");
+      }
+ 
+      TF1 *fbackg = fHist->GetFunction("Backg");    
+      if (fbackg == NULL)
+        *fLog << "MHFindSignificanceONOFF::DrawFit; fbackg = NULL" << endl;
+
+      if (fbackg)
+      {
+        // 10, 1 is white and solid
+        fbackg->SetLineColor(10);
+        fbackg->SetLineStyle(1);
+        fbackg->SetLineWidth(4);
+        // fbackg->DrawCopy("same"); I do not want to draw it... already too many things.
+      }
+    }
+
+
+    //-------------------------------
+    // print results onto the figure
+    
+    
+    
+    TPaveText *pt = new TPaveText(0.30, 0.35, 0.70, 0.90, "NDC");
+    char tx[100];
+    
+    sprintf(tx, "Results of polynomial fit to OFF (order %2d) :", fDegreeOFF);
+    TText *t1 = pt->AddText(tx);
+    t1->SetTextSize(0.03);
+    t1->SetTextColor(2);
+    
+    sprintf(tx, "   (%6.2f< |alpha| <%6.2f [\\circ])", fAlphaminOFF, fAlphamaxOFF);
+    pt->AddText(tx);
+    
+    sprintf(tx, "   chi2 = %8.2f,  Ndof = %4d,  Prob = %6.2f", 
+	    fChisqOFF, fNdfOFF, fProbOFF);
+    pt->AddText(tx);
+    
+    sprintf(tx, "   OFF events (fit)= %8.1f #pm %8.1f", 
+	    fNoffTotFitted, fdNoffTotFitted);
+    pt->AddText(tx);
+    
+    sprintf(tx, "   OFF events (meas) = %8.1f #pm %8.1f", fNoffTot, fdNoffTot);
+    pt->AddText(tx);
+    
+    sprintf(tx, "   OFF Normalization Factor (= Non/Noff) = %4.4f", fNormFactor);
+    pt->AddText(tx);
+    
+    
+    
+    
+    //sprintf(tx, "     ");
+    //pt->AddText(tx);
+    
+    //--------------
+    sprintf(tx, "Results for |alpha|< %6.2f [\\circ] :", fAlphasi);
+    TText *t6 = pt->AddText(tx);
+    t6->SetTextSize(0.03);
+    t6->SetTextColor(8);
+    
+    sprintf(tx, "   Non = %8.1f #pm %8.1f", fNon, fdNon);
+    pt->AddText(tx);
+    
+    
+    if(fUseFittedQuantities)
+      {
+	//// **************************************************
+	///// PRINT INFORMATION ABOUT FITTED QUANTITIES  /////////
+	
+	
+	
+	Double_t NoffFitNormalized = fNoffSigFitted * fNormFactor;
+	Double_t ErrorNoffFitNormalized = fdNoffSigFitted * fNormFactor;
+	Double_t SignificanceUsed = GetSignificance();
+	
+	sprintf(tx, "   Noff Fitted (Normalized)  = %8.1f #pm %8.1f", 
+		NoffFitNormalized, ErrorNoffFitNormalized);
+	pt->AddText(tx);
+	
+	
+	sprintf(tx, "   Nex (ON - OFF Fitted) = %8.1f #pm %8.1f", 
+		fNexONOFFFitted, fdNexONOFFFitted);
+	pt->AddText(tx);
+	
+	
+	sprintf(tx, "   Gamma = %4.4f,   Effective Noff (i.e. fNoff) = %6.1f", 
+		fGamma, fNoff);
+	pt->AddText(tx);
+	
+	
+	Double_t ratio = fNoffSigFitted>0.0 ? fNexONOFFFitted/(fNoffSigFitted*fNormFactor) : 0.0;
+	sprintf(tx, "   Significance = %6.2f,    Nex/(Nbg*NormFactor) = %6.2f", 
+		SignificanceUsed, ratio);
+	pt->AddText(tx);
+	
+	
+      }
+    
+    else
+      {
+	//// **************************************************
+	///// PRINT INFORMATION ABOUT MEASURED QUANTITIES  /////////
+	
+	
+	Double_t NoffNormalized = fNoffSig * fNormFactor;
+	Double_t ErrorNoffNormalized = fdNoffSig * fNormFactor;
+	Double_t SignificanceUsed = GetSignificance();
+	
+	sprintf(tx, "   Noff measured (Normalized)  = %8.1f #pm %8.1f", 
+		NoffNormalized, ErrorNoffNormalized);
+	pt->AddText(tx);
+	
+	sprintf(tx, "   Nex (ON - OFF measured) = %8.1f #pm %8.1f", 
+		fNexONOFF, fdNexONOFF);
+	pt->AddText(tx);
+	
+	Double_t ratio = fNoffSig>0.0 ? fNexONOFF/(fNoffSig*fNormFactor) : 0.0;
+	sprintf(tx, "   Significance = %6.2f,    Nex/(Nbg*NormFactor) = %6.2f", 
+		SignificanceUsed, ratio);
+	pt->AddText(tx);
+	
+      }
+    
+    /*
+      // Temporally I will also show ALL SIGMALIMA COMPUTED.
+      
+      sprintf(tx, 
+      "  fSigLiMa1 =  %6.2f, fSigLiMa2 =  %6.2f, fSigLiMa3 =  %6.2f", 
+      fSigLiMa,fSigLiMa2, fSigLiMa3);
+      pt->AddText(tx);
+    */
+    
+    
+    //--------------
+    if (fFitGauss)
+      {
+	sprintf(tx, "Results of (polynomial+Gauss) fit  :");
+	TText *t7 = pt->AddText(tx);
+	t7->SetTextSize(0.03);
+	t7->SetTextColor(4);
+	
+	sprintf(tx, "   chi2 = %8.2f,  Ndof = %4d,  Prob = %6.2f", 
+		fGChisq, fGNdf, fGProb);
+	pt->AddText(tx);
+	
+	sprintf(tx, "   Sigma of Gauss = %8.1f #pm %8.1f  [\\circ]", 
+		fSigmaGauss, fdSigmaGauss);
+	pt->AddText(tx);
+	
+	sprintf(tx, "   total no.of excess events = %8.1f #pm %8.1f", 
+		fNexGauss, fdNexGauss);
+	pt->AddText(tx);
+      }
+    //--------------
+    
+    pt->SetFillStyle(0);
+    pt->SetBorderSize(0);
+    pt->SetTextAlign(12);
+    
+    
+    if(fPrintResultsOntoAlphaPlot)
+      {
+	pt->Draw();
+      }
+    fCanvas->Modified();
+    fCanvas->Update();
+    
+    //    fPsFilename -> NewPage();
+
+
+
+    if (fSavePlots)
+    {
+	// ********************************************
+	// TMP solution while the TPostScript thing is not working. 
+	// PsFileName for storing these histograms is derived 
+	// from fPsFilenameString. 
+	
+	
+	cout << "Alpha plot with ON-OFF data will be saved in PostScript file  " ;
+	
+	
+	if (!fPsFilenameString.IsNull())
+	{
+	    TString filename = (fPsFilenameString);
+	    // Train or Test Sample is specified outside 
+	    // class MHFindSignificanceONOFF, and included in 
+	    // fPsFilenameString
+	    
+	    filename += ("AlphaPlotAfterSupercuts.ps");
+	    cout << filename << endl;	
+	    fCanvas -> SaveAs(filename);
+	}
+	
+	// END OF TEMPORAL SOLUTION
+	// ********************************************
+	
+    }
+    
+    // Canvvas deleted to allow for GRID analysis
+
+    delete fCanvas;
+	
+
+    return kTRUE;
+}
+
+
+// --------------------------------------------------------------------------
+//
+// Print the results of the polynomial fit to the alpha OFF distribution
+// 
+//
+void MHFindSignificanceONOFF::PrintPolyOFF(Option_t *o) 
+{
+  *fLog << "---------------------------" << endl;
+  *fLog << "MHFindSignificanceONOFF::PrintPolyOFF :" << endl; 
+
+  *fLog << "fAlphaminOFF, fAlphamaxOFF, fDegreeOFF "
+        << fAlphaminOFF << ",  " << fAlphamaxOFF << ",  " << fDegreeOFF <<  endl;
+
+  *fLog << "fMbinsOFF, fNzeroOFF, fIstatOFF = " << fMbinsOFF << ",  "
+        << fNzeroOFF << ",  " << fIstatOFF << endl;
+
+  *fLog << "fChisqOFF, fNdfOFF, fProbOFF = " << fChisqOFF << ",  " 
+        << fNdfOFF << ",  " << fProbOFF << endl; 
+
+  *fLog << "fNon; fNoffSigFitted, fdNoffSigFitted; fNoffSig, fdNoffSig = "
+        << fNon << ";  " << fNoffSigFitted << ",  " << fdNoffSigFitted 
+	<< ";  " << fNoffSig << ",  " << fdNoffSig <<  endl;
+
+  Double_t sigtoback = fNoffSigFitted >0.0 ? fNexONOFFFitted/(fNoffSigFitted*fNormFactor) : 0.0;
+
+  
+  *fLog << "fNexONOFFFitted, fdNexONOFFFitted, fGamma, fNoff, fSigLiMa, sigtoback = "
+        << fNexONOFFFitted << ",  " << fdNexONOFFFitted << ",  " 
+	<< fGamma << ",  " << fNoff 
+        << ",  " << fSigLiMa << ",  "
+	<< sigtoback << endl;
+
+
+  Double_t sigtoback2 = fNoffSig >0.0 ? fNexONOFF/(fNoffSig*fNormFactor) : 0.0;
+  
+  *fLog << "fNexONOFF, fdNexONOFF, fNormFactor, fNoffSig, fSigLiMa2, sigtoback2 = "
+        << fNexONOFF << ",  " << fdNexONOFF << ",  " 
+	<< fNormFactor << ",  " << fNoffSig 
+        << ",  " << fSigLiMa2 << ",  "
+	<< sigtoback2 << endl;
+
+ *fLog << "---------------------------" << endl;
+}
+
+// --------------------------------------------------------------------------
+//
+// Print the results of the polynomial fit to the alpha distribution
+// 
+//
+void MHFindSignificanceONOFF::PrintPoly(Option_t *o) 
+{
+  *fLog << "---------------------------" << endl;
+  *fLog << "MHFindSignificanceONOFF::PrintPoly :" << endl; 
+
+  *fLog << "fAlphami, fAlphama, fDegree, fAlphasi = "
+        << fAlphami << ",  " << fAlphama << ",  " << fDegree << ",  " 
+        << fAlphasi << endl;
+
+  *fLog << "fMbins, fNzero, fIstat = " << fMbins << ",  "
+        << fNzero << ",  " << fIstat << endl;
+
+  *fLog << "fChisq, fNdf, fProb = " << fChisq << ",  " 
+        << fNdf << ",  " << fProb << endl; 
+
+  *fLog << "fNon, fNbg, fdNbg, fNbgtot, fNbgtotFitted, fdNbgtotFitted = "
+        << fNon << ",  " << fNbg << ",  " << fdNbg << ",  " << fNbgtot 
+        << ",  " << fNbgtotFitted << ",  " << fdNbgtotFitted << endl;
+
+  Double_t sigtoback = fNbg>0.0 ? fNex/fNbg : 0.0;
+  *fLog << "fNex, fdNex, fGamma, fNoff, fSigLiMa, sigtoback = "
+        << fNex << ",  " << fdNex << ",  " << fGamma << ",  " << fNoff 
+        << ",  " << fSigLiMa << ",  " << sigtoback << endl;
+
+  //------------------------------------
+  // get errors
+
+  /*
+  Double_t eplus; 
+  Double_t eminus; 
+  Double_t eparab; 
+  Double_t gcc;
+  Double_t errdiag;
+
+
+  if ( !fConstantBackg )
+  {
+    *fLog << "parameter value     error     eplus     eminus    eparab   errdiag   gcc"
+          << endl; 
+
+    for (Int_t j=0; j<=fDegree; j++)
+    {
+      if (gMinuit)
+        gMinuit->mnerrs(j, eplus, eminus, eparab, gcc);
+      errdiag = sqrt(fEma[j][j]);
+      *fLog << j << "  " << fValues[j] << "  "   << fErrors[j] << "  "
+            << eplus     << "  "       << eminus << "  " << eparab     << "  " 
+            <<  errdiag  << "  "       << gcc    << endl;
+    }
+  }  
+  else
+  {
+    *fLog << "parameter value     error     errdiag "
+          << endl; 
+
+    for (Int_t j=0; j<=fDegree; j++)
+    {
+      errdiag = sqrt(fEma[j][j]);
+      *fLog << j << "  " << fValues[j] << "  "   << fErrors[j] << "  "
+            <<  errdiag  << endl;
+    }
+  }  
+  */
+
+  //----------------------------------------
+  /*
+  *fLog << "Covariance matrix :" << endl;
+  for (Int_t j=0; j<=fDegree; j++)
+  {
+    *fLog << "j = " << j << " :   ";
+    for (Int_t k=0; k<=fDegree; k++)
+    {
+      *fLog << fEma[j][k] << "   ";
+    }
+    *fLog << endl;
+  }
+
+  *fLog << "Correlation matrix :" << endl;
+  for (Int_t j=0; j<=fDegree; j++)
+  {
+    *fLog << "j = " << j << " :   ";
+    for (Int_t k=0; k<=fDegree; k++)
+    {
+      *fLog << fCorr[j][k] << "   ";
+    }
+    *fLog << endl;
+  }
+  */
+
+  *fLog << "---------------------------" << endl;
+}
+
+// --------------------------------------------------------------------------
+//
+// Print the results of the (polynomial+Gauss) fit to the alpha distribution
+// 
+//
+void MHFindSignificanceONOFF::PrintPolyGauss(Option_t *o) 
+{
+  *fLog << "---------------------------" << endl;
+  *fLog << "MHFindSignificanceONOFF::PrintPolyGauss :" << endl; 
+
+  *fLog << "fAlphalo, fAlphahi = "
+        << fAlphalo << ",  " << fAlphahi << endl;
+
+  *fLog << "fGMbins, fGNzero, fGIstat = " << fGMbins << ",  "
+        << fGNzero << ",  " << fGIstat << endl;
+
+  *fLog << "fGChisq, fGNdf, fGProb = " << fGChisq << ",  " 
+        << fGNdf << ",  " << fGProb << endl; 
+
+
+  //------------------------------------
+  // get errors
+
+  Double_t eplus; 
+  Double_t eminus; 
+  Double_t eparab; 
+  Double_t gcc;
+  Double_t errdiag;
+
+  *fLog << "parameter value     error     eplus     eminus    eparab   errdiag   gcc"
+        << endl; 
+  for (Int_t j=0; j<=(fDegree+3); j++)
+  {
+    if (gMinuit)
+      gMinuit->mnerrs(j, eplus, eminus, eparab, gcc);
+    errdiag = sqrt(fGEma[j][j]);
+    *fLog << j << "  " << fGValues[j] << "  "   << fGErrors[j] << "  "
+          << eplus     << "  "       << eminus << "  " << eparab     << "  " 
+          <<  errdiag  << "  "       << gcc    << endl;
+  }
+
+  
+  *fLog << "Covariance matrix :" << endl;
+  for (Int_t j=0; j<=(fDegree+3); j++)
+  {
+    *fLog << "j = " << j << " :   ";
+    for (Int_t k=0; k<=(fDegree+3); k++)
+    {
+      *fLog << fGEma[j][k] << "   ";
+    }
+    *fLog << endl;
+  }
+
+  *fLog << "Correlation matrix :" << endl;
+  for (Int_t j=0; j<=(fDegree+3); j++)
+  {
+    *fLog << "j = " << j << " :   ";
+    for (Int_t k=0; k<=(fDegree+3); k++)
+    {
+      *fLog << fGCorr[j][k] << "   ";
+    }
+    *fLog << endl;
+  }
+
+  *fLog << "---------------------------" << endl;
+}
+
+//============================================================================
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MHFindSignificanceONOFF.h
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MHFindSignificanceONOFF.h	(revision 4411)
+++ trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MHFindSignificanceONOFF.h	(revision 4411)
@@ -0,0 +1,400 @@
+#ifndef MARS_MHFindSignificanceONOFF
+#define MARS_MHFindSignificanceONOFF
+
+#ifndef MARS_MH
+#include "MH.h"
+#endif
+
+#ifndef ROOT_TArrayD
+#include <TArrayD.h>
+#endif
+
+#ifndef ROOT_TPostScript
+#include <TPostScript.h>
+#endif
+
+
+class TF1;
+class TH1;
+class TCanvas;
+
+class MHFindSignificanceONOFF : public MH
+{
+private:
+
+    TH1  *fHistOrig;  // original plot of |alpha| (0.0 to 90.0 degrees)
+    TH1  *fHist;      // copy of fHistOrig or rebinned histogram
+
+
+    
+   TH1  *fHistOrigOFF;  // original plot of |alpha| (0.0 to 90.0 degrees)
+   TH1  *fHistOFF;      // copy of fHistOrig or rebinned histogram
+   TH1  *fHistOFFNormalized;   //  fHistOFF normalized (contents and errors) with 
+                               //   with fNormFactor; useful when plotting OFF 
+                               //  Data together with ON data
+
+ 
+  // Postscript file where, for each theta bin,  
+   // alpha ON and OFF distributions 
+  //  after cuts (and hence, Nex and SigmaLiMa computations) will be stored
+   // This TPostScript object has to be initialized and closed finally 
+   // outside this class.
+ 
+   // NOT WORKING WELL !!!
+   
+   TPostScript* fPsFilename;
+   
+
+   TString fPsFilenameString; // Name of the file where plots will be stored while the 
+  // TPostScript option is not working 
+
+
+
+    Double_t fAlphamin;  // requested lower limit of fit range
+    Double_t fAlphammm;  // center of fit range
+    Double_t fAlphamax;  // requested lower limit of fit range
+
+    Double_t fAlphaminOFF; // requested lower limit of fit range for OFF data
+    Double_t fAlphamaxOFF;  // requested lower limit of fit range for OFF data
+
+
+    Double_t fAlphami;  // actual lower limit of fit range 
+    Double_t fAlphamm;  // actual center of fit range 
+    Double_t fAlphama;  // actual upper limit of fit range
+
+    Double_t fAlphasig; // requested signal range
+    Double_t fAlphasi;  // actual signal range
+    Double_t fAlphasiOFF;  // actual signal range for OFF data
+
+
+    Double_t fAlphalow; // requested lower edge of signal range
+    Double_t fAlphalo;  // actual lower edge of signal range
+
+    Double_t fAlphahig; // requested upper edge of background range
+    Double_t fAlphahi;  // actual upper edge of background range
+ 
+    // number of events in signal region
+    Double_t fNon;     // total number of events in signal region
+    Double_t fNbg;     // number of background events in signal region
+    Double_t fNex;     // number of excess events in signal region
+
+    Double_t fdNon;
+    Double_t fdNbg;
+    Double_t fdNex;
+
+    // number of events in background region
+    Double_t fNbgtot;  // total number of events in background region
+    Double_t fNbgtotFitted;  // fitted total no. of events in background region
+    Double_t fdNbgtotFitted; // fitted error of this number
+
+    // Variables related to OFF data. 
+    // Many variables are defined for similarity with 
+    // existing program. Many of them might be removed in future...
+
+
+    Double_t fNexONOFF;     // number of excess events (ON-OFF) 
+                            // in signal region
+    Double_t fNexONOFFFitted;     // number of excess events (ON-OFF fitted) 
+                                  // in signal region
+
+    Double_t fdNexONOFF;     // error in number of excess events (ON-OFF) 
+                            // in signal region
+    Double_t fdNexONOFFFitted;     // error in number of excess events (ON-OFF fitted) 
+                                  // in signal region
+
+
+    
+    Double_t fNoffTot;       // Total number of OFF events
+    Double_t fNoffSig;    // Number of OFF events in "signal" region 
+    Double_t fNoffBg;     // Number of OFF events in "background" region
+    
+    // errors for previous quantities
+
+    Double_t fdNoffTot;       
+    Double_t fdNoffSig;    
+    Double_t fdNoffBg;     
+
+    // Fitted quantities for OFF alpha distribution
+
+    Double_t fNoffTotFitted;       // Total number of OFF events
+    Double_t fNoffSigFitted;    // Number of OFF events in "signal" region 
+    Double_t fNoffBgFitted;     // Number of OFF events in "background" region
+    
+    // errors for previous quantities
+
+    Double_t fdNoffTotFitted;       
+    Double_t fdNoffSigFitted;    
+    Double_t fdNoffBgFitted;     
+
+    
+    // Boolean variable used to disable the usage ("serious" usage) of the 
+    // quantities computed from fits. This will be useful in those cases 
+    // where there is too few events to perform a decent fit to the 
+    // alpha histograms.
+    
+    Bool_t fUseFittedQuantities;
+
+
+
+    // Bool variable used to decide wether to print or not the results 
+    // of the fit, significance, Nex... onto the final alpha plot. 
+    // for the time being, this variable is set in the constructor. 
+    // At some point, I might make it such it can be set externally...
+
+    Bool_t fPrintResultsOntoAlphaPlot;
+
+
+    // effective number of background events
+    Double_t fNoff; // fNoff = fNoffSig * fNormFactor
+    Double_t fGamma;   // 
+    Double_t fNormFactor; // = TotalNon/TotalNoff)
+
+    Double_t fSigLiMa; // significance of gamma signal according to Li & Ma
+                       // Computed using quantities fGama and Noff
+                       // and formula (17) 
+
+
+    Double_t fSigLiMa2; // significance of gamma signal according to Li & Ma
+                        // Computed using quantities  fNormFactor and fNoffSig
+                        // and formula (17)
+
+    Double_t fSigLiMa3; // significance of gamma signal according to Li & Ma
+                        // Computed using quantities  fNormFactor and fNoffSig
+                        // and formula (5)
+
+                       
+
+
+    const static Double_t fEps = 1.e-4;  // tolerance for floating point comparisons
+
+    Bool_t fDraw;          // if true : draw plots
+    Bool_t fSavePlots;     // if true : Save plots in Psfile
+    Bool_t fFitGauss;      // if true : do the (polynomial+Gauss fit)
+    Bool_t fRebin;         // if true : allow rebinning of the alpha plot    
+    Bool_t fReduceDegree;  // if true : allow reducing of the order of the polynomial
+
+    Bool_t fConstantBackg; // if set true if background fit is not possible
+                           // due to low statistics
+
+    TCanvas  *fCanvas;
+
+    Double_t fNexGauss;    // total number of excess events 
+                           // (from fitted Gauss function)
+    Double_t fdNexGauss;   // error of the total number of excess events
+ 
+    Double_t fSigmaGauss;  // sigma of fitted Gauss function
+    Double_t fdSigmaGauss; // error of this sigma
+
+    //--------------------
+    TF1      *fPoly;   // polynomial function
+    Int_t    fFitBad;  // if != 0 fit failed
+    Int_t    fDegree;  // degree of polynomial to be fitted to the background
+    Int_t    fNdf;     // number of degrees of freedom of polynomial fit
+    Double_t fChisq;   // chi squared of polynomial fit
+    Double_t fProb;    // chi squared probability ofg polynomial fit 
+
+    TArrayD fValues;
+    TArrayD fErrors;
+
+    const static Int_t    fNdim = 6;
+    Double_t fEmat[fNdim][fNdim];
+    Double_t fEma [fNdim][fNdim];
+    Double_t fCorr[fNdim][fNdim];
+
+    Int_t  fMbins;     // number of bins in the fit range
+    Int_t  fMlow;      // number of bins in the fit range with too few entries
+    Int_t  fNzero;     // number of bins in the fit range with zero entry
+    Int_t  fIstat;
+
+    //--------------------
+
+    // Fit to OFF data
+
+    
+    TF1      *fPolyOFF;   // polynomial function for OFF data
+    
+    TF1      *fPolyOFFNormalized;  //  polynomial function for OFF data normalized with fNormFactor*(BinWidthON/BinWidthOFF)
+
+    Int_t    fFitBadOFF;  // if != 0 fit failed
+    Int_t    fDegreeOFF;  // degree of polynomial to be fitted to the background
+    Int_t    fNdfOFF;     // number of degrees of freedom of polynomial fit
+    Double_t fChisqOFF;   // chi squared of polynomial fit
+    Double_t fProbOFF;    // chi squared probability ofg polynomial fit 
+
+    TArrayD fValuesOFF;
+    TArrayD fErrorsOFF;
+    TArrayD fValuesOFFNormalized;
+    TArrayD fErrorsOFFNormalized;
+
+    const static Int_t    fNdimOFF = 6;
+    Double_t fEmatOFF[fNdim][fNdim];
+    Double_t fEmaOFF [fNdim][fNdim];
+    Double_t fCorrOFF[fNdim][fNdim];
+
+    Int_t  fMbinsOFF;     // number of bins in the fit range
+    Int_t  fMlowOFF;      // number of bins in the fit range with too few entries
+    Int_t  fNzeroOFF;     // number of bins in the fit range with zero entry
+    Int_t  fIstatOFF;
+
+
+    //--------------------
+    TF1      *fGPoly;   // (Gauss+polynomial) function
+    TF1      *fGBackg;  // polynomial part of (Gauss+polynomial) function
+    Int_t    fGFitBad;  // if != 0 fit failed
+    Int_t    fGDegree;  // degree of polynomial to be fitted to the background
+    Int_t    fGNdf;     // number of degrees of freedom of polynomial fit
+    Double_t fGChisq;   // chi squared of polynomial fit
+    Double_t fGProb;    // chi squared probability ofg polynomial fit 
+
+    TArrayD fGValues;
+    TArrayD fGErrors;
+
+    const static Int_t    fGNdim = 9;
+    Double_t fGEmat[fGNdim][fGNdim];
+    Double_t fGEma[fGNdim][fGNdim];
+    Double_t fGCorr[fGNdim][fGNdim];
+
+    Int_t  fGMbins;     // number of bins in the fit range
+    Int_t  fGNzero;     // numnber of bins in the fit range with zero entry
+    Int_t  fGIstat;
+
+    //--------------------
+
+    static const TString gsDefName;  //! Default Name
+    static const TString gsDefTitle; //! Default Title
+
+    Bool_t DetExcess(); 
+    Bool_t DetExcessONOFF(); 
+    Bool_t FitPolynomial();
+    Bool_t FitPolynomialOFF();
+    Bool_t FitGaussPoly();
+    //Bool_t FitGaussPolyONOFF();
+    Bool_t RebinHistogram(Double_t x0, Int_t nrebin);
+    Bool_t RebinHistogramOFF(Double_t x0, Int_t nrebin);
+
+ public:
+    MHFindSignificanceONOFF(const char *name=NULL, const char *title=NULL);
+    ~MHFindSignificanceONOFF();
+
+    
+    // fhistOFF is the alpha distribution of OFF data (after cuts), 
+    // BUT NOT normalized. Normalization factor is also one of the 
+    // arguments. Off alpha distribution will be normalized 
+    // at the beginning of the function FindSigmaONOFF. 
+
+    Bool_t FindSigmaONOFF(TH1 *fhistON, TH1 *fhistOFF, 
+			  Double_t NormFactor,
+			  Double_t alphamin, Double_t alphamax,
+			  Int_t degreeON,  Int_t degreeOFF, 
+			  Double_t alphasig, 
+			  Bool_t drawpoly, 
+			  Bool_t fitgauss, 
+			  Bool_t print, Bool_t saveplots, 
+			  //TPostScript* PsFile
+			  const TString psfilename);
+
+    // Set limits for the polynomial fit of the OFF data
+    // It will give the user the possibility of using, 
+    // for the OFF data substraction, a fit in the region 
+    // of interest. Might be useful in case of "pathological"  
+    // alpha distribution for the OFF data.
+
+    void SetLimitsForOFFDataFit(Double_t Low, Double_t Up)
+	{ fAlphaminOFF = Low; fAlphamaxOFF = Up;  }
+
+    void SetAlphaSig (Double_t alphasig)
+	{ fAlphasig = alphasig; }
+
+
+    void SetUseFittedQuantities (Bool_t b)
+	{fUseFittedQuantities = b;}
+	    
+
+    Bool_t SigmaLiMa(Double_t non, Double_t noff, Double_t gamma,
+                     Double_t *siglima);
+
+    Bool_t SigmaLiMaForm5(Double_t non, Double_t noff, Double_t gamma,
+			  Double_t *siglima);
+
+   
+    Bool_t SigmaVsAlphaONOFF(TH1 *fhistON, TH1 *fhistOFF,  
+			     Double_t alphamin, Double_t alphamax, 
+			     Int_t degree, Bool_t print);
+    
+
+
+    // Function that returns one of the 3 LiMa sigmas. 
+    // The returned value is the one used in the optimization 
+    // and final alpha plots. 
+    
+
+    Double_t GetSignificance();//   { return fSigLiMa; }
+
+    Bool_t GetUseFittedQuantities() {return fUseFittedQuantities;}
+
+
+
+    // Following function computes a clone of fHistOFF and normalizes 
+    // contents, errors and fPolyOFF (if exists) with the fNormFactor. 
+    // This normalized OFF hist will be used when plotting OFF data 
+    // together with ON data.
+ 
+    Bool_t ComputeHistOFFNormalized(); 
+
+
+    Bool_t DrawFit(Option_t *opt=NULL);
+
+    Bool_t DrawHistOFF();
+    Bool_t DrawHistOFFNormalized();
+
+    Float_t GetDegree()     const { return fDegree;  }
+    Float_t GetProb()       const { return fProb;    }
+    Float_t GetNdf()        const { return fNdf;     }
+    Float_t GetGamma()      const { return fGamma;   }
+    Float_t GetNon()        const { return fNon;     }
+    Float_t GetNex()        const { return fNex;     }
+    Float_t GetNbg()        const { return fNbg;     }
+    Float_t GetSigLiMa1()    const { return fSigLiMa; }
+    Float_t GetSigLiMa2()    const { return fSigLiMa2; }
+    Float_t GetSigLiMa3()    const { return fSigLiMa3; }
+       
+    Float_t GetMbins()      const { return fMbins;   }
+    Float_t GetAlphasi()    const { return fAlphasi; }
+    Float_t GetNexONOFF() const {return fNexONOFF;}
+    Float_t GetNexONOFFFitted() const {return fNexONOFFFitted;}
+    
+    
+
+    void SetRebin(Bool_t b=kTRUE);
+    void SetReduceDegree(Bool_t b=kTRUE);
+
+    void SetPsFilename (TPostScript* PsFile) {fPsFilename = PsFile;}
+
+    void PrintPoly(Option_t *opt=NULL);
+    void PrintPolyOFF(Option_t *opt=NULL);
+    void PrintPolyGauss(Option_t *opt=NULL);
+
+    ClassDef(MHFindSignificanceONOFF, 1) // Determine significance from alpha plot
+};
+
+#endif
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MSupercutsCalcONOFF.cc
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MSupercutsCalcONOFF.cc	(revision 4411)
+++ trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MSupercutsCalcONOFF.cc	(revision 4411)
@@ -0,0 +1,797 @@
+/* ======================================================================== *\
+!
+! *
+! * 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, 04/2003 <mailto:wittek@mppmu.mpg.de>
+!               David Paneque,   02/2004 <mailto:dpaneque@mppmu.mpg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2004
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+//   MSupercutsCalcONOFF                                                     //
+//                                                                         //
+//   this class calculates the hadronness for the supercuts                //
+//   the parameters of the supercuts are taken                             //
+//                  from the container MSupercuts                       //
+//                                                                         //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+#include "MSupercutsCalcONOFF.h"
+
+#include <math.h>
+#include <fstream>
+
+#include "TFile.h"
+#include "TArrayD.h"
+
+#include "MParList.h"
+#include "MHillasExt.h"
+#include "MHillasSrc.h"
+#include "MNewImagePar.h"
+#include "MPointingPos.h"
+#include "MCerPhotEvt.h"
+#include "MGeomCam.h"
+#include "MHadronness.h"
+#include "MTSupercutsApplied.h"
+#include "MHMatrix.h"
+#include "MSupercuts.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+ClassImp(MSupercutsCalcONOFF);
+
+using namespace std;
+
+
+// --------------------------------------------------------------------------
+//
+// constructor
+//
+
+MSupercutsCalcONOFF::MSupercutsCalcONOFF(const char *hilname, 
+                                     const char *hilsrcname, 
+                                     const char *name, const char *title)
+  : fHadronnessName("MHadronness"), fSupercutsAppliedName("MSupercutsApplied"), 
+    fHilName(hilname), fHilSrcName(hilsrcname),
+    fHilExtName("MHillasExt"), fNewParName("MNewImagePar"), 
+    fSuperName("MSupercuts") 
+{
+    fName  = name  ? name  : "MSupercutsCalcONOFF";
+    fTitle = title ? title : "Class to evaluate the Supercuts";
+
+    fMatrix = NULL;
+
+    fStoreAppliedSupercuts = kFALSE; // by default, applied SC parameters are not stored
+
+    fNotUseTheta = kFALSE; // by default, theta info is used in the computation of the cuts
+
+    fUseStaticCuts = kFALSE; // by default, dynamical cuts are used
+
+
+    // Usage of DIST parameter in the parameterization of the cuts.
+    // For the time being is in the constructor. If finally it comes out 
+    // that it is important to disable the DIST parameter from the 
+    // cut parameterization I will make a function that access this 
+    // data variable from outside the class.
+    fUseDist = kTRUE;
+
+
+
+    // OFFSETS FOR THE DYNAMICAL CUTS
+    // Values of Size (photons), Dist (degrees) and Theta (degrees) 
+    // for which the value of the dynamical cut is equal to the 
+    // non dependent parameter; i.e. to the static cut. 
+    // By adjusting these offsets the user can set the value in size, 
+    // dist and theta for which the dynamical cuts will be given by 
+    // the term that DOES not depend on size, dist and theta.
+
+    // For the time being, these quantities are set in the constructor. 
+    // In future, if they show to be useful, I will make them available 
+    // as external variables.
+
+    fSizeOffset = 3000; // photons
+    fDistOffset = 0.9; // degrees  
+    fThetaOffset = 20; // degrees   NOT USED FOR THE TIME BEING
+
+    
+
+
+
+
+    // Variables defining upper limits for some of the hillas params.
+    // The default values are set to conservative 
+    // values so that no gamma showers are removed
+
+    // If a cut value computed by function MSupercutsCalcONOFF::CtsMCut, 
+    // (i.e. widthlow) exceeds (larger or smaller 
+    // depending on wether is cutUP or cutLOW) one of these values
+    // (i.e. fWidthLowerLimit), such cut value is replaced by the 
+    // the corresponding Limit (i.e. widthlow = fWidthLowerLimit)
+
+
+
+    fDistUpperLimit = 1.4; // in deg
+    fLengthUpperLimit = 0.6;
+    fWidthUpperLimit = 0.4;
+
+    fLeakage1UpperLimit = 0.25; 
+
+    fLengthOverWidthUpperLimit = 1.0;
+
+    fDistLowerLimit = 0.1;
+    fLengthLowerLimit = 0.09;
+    fWidthLowerLimit = 0.05;
+
+    
+
+
+
+
+}
+
+// --------------------------------------------------------------------------
+//
+
+
+void MSupercutsCalcONOFF::SetStoreAppliedSupercuts(Bool_t b)
+{
+    fStoreAppliedSupercuts = b;
+    if (fStoreAppliedSupercuts)
+    {
+	*fLog << "Supercuts applied to all the individual events will be stored " 
+	      << "in a container of the class MSupercutsApplied." << endl;
+    }
+
+}
+
+
+void MSupercutsCalcONOFF::SetVariableNotUseTheta(Bool_t b)
+{
+    fNotUseTheta = b;
+    if (fNotUseTheta)
+    {
+	*fLog << "Theta variable is NOT used in the computation of the the  " 
+	      << "dynamical cuts" << endl;
+    }
+    else
+    {
+	*fLog << "Theta variable is used in the computation of the the  " 
+	      << "dynamical cuts" << endl;
+    }
+
+}
+
+
+void MSupercutsCalcONOFF::SetVariableUseStaticCuts(Bool_t b)
+{
+    fUseStaticCuts = b;
+    if (fUseStaticCuts)
+    {
+	*fLog << "Supercuts DO NOT take into account Theta, Size and Dist dependence; "
+	      << "i.e, they are STATIC CUTS." << endl;
+    }
+    else
+    {
+	*fLog << "Supercuts are computed taking into account Theta, size and Dist dependence."
+	      << "i.e., they are DYNAMICAL CUTS" << endl;
+
+    }
+
+
+
+}
+
+
+void MSupercutsCalcONOFF::SetHillasDistLengthWidthUpperLowerLimits(Double_t distup, 
+							      Double_t lengthup, 
+							      Double_t widthup, 
+							      Double_t distlow, 
+							      Double_t lengthlow, 
+							      Double_t widthlow)
+{
+  
+  fDistUpperLimit = distup;
+  fLengthUpperLimit = lengthup;
+  fWidthUpperLimit = widthup;
+
+
+  fDistLowerLimit = distlow;
+  fLengthLowerLimit = lengthlow;
+  fWidthLowerLimit = widthlow;
+
+
+  *fLog << "MSupercutsCalcONOFF::SetHillasDistLengthWidthUpperLowerLimits" << endl
+	<< "Upper limits to Hillas parameters Dist, Length and Width " 
+	<< "are set respectively to : " 
+	<<  fDistUpperLimit << ", " 
+	<< fLengthUpperLimit << ", "
+	<< fWidthUpperLimit << " (in degrees!!)" << endl
+
+	<< "Lower limits to Hillas parameters Dist, Length and Width " 
+	<< "are set respectively to : " 
+	<<  fDistLowerLimit << ", " 
+	<< fLengthLowerLimit << ", "
+	<< fWidthLowerLimit << " (in degrees!!)" << endl
+
+	<< "The Hadronnes of those images exceeding one of these limits will " 
+	<< "be set to 0.75." << endl << endl;
+
+
+} 
+
+
+
+Int_t MSupercutsCalcONOFF::PreProcess(MParList *pList)
+{
+    MGeomCam *cam = (MGeomCam*)pList->FindObject("MGeomCam");
+    if (!cam)
+    {
+        *fLog << err << "MGeomCam (Camera Geometry) not found... aborting." << endl;
+        return kFALSE;
+    }
+
+    fMm2Deg = cam->GetConvMm2Deg();
+
+    fHadronness = (MHadronness*)pList->FindCreateObj("MHadronness", fHadronnessName);
+    if (!fHadronness)
+    {
+        *fLog << err << fHadronnessName << " [MHadronness] not found... aborting." << endl;
+        return kFALSE;
+    }
+
+    fSuper = (MSupercuts*)pList->FindObject(fSuperName, "MSupercuts");
+    if (!fSuper)
+    {
+        *fLog << err << fSuperName << " [MSupercuts] not found... aborting." << endl;
+        return kFALSE;
+    }
+
+    if (fStoreAppliedSupercuts)
+    {
+	
+	fSupercutsApplied = (MTSupercutsApplied*)pList->FindObject(fSupercutsAppliedName,
+								  "MTSupercutsApplied");
+	if(!fSupercutsApplied)
+	{
+	    *fLog << err << fSupercutsAppliedName 
+		  << " [MTSupercutsApplied] not found... aborting." << endl;
+	    return kFALSE;
+	}
+	
+
+    }
+
+    if (fMatrix)
+        return kTRUE;
+
+    //-----------------------------------------------------------
+    fHil = (MHillas*)pList->FindObject(fHilName, "MHillas");
+    if (!fHil)
+    {
+        *fLog << err << fHilName << " [MHillas] not found... aborting." << endl;
+        return kFALSE;
+    }
+
+    fHilExt = (MHillasExt*)pList->FindObject(fHilExtName, "MHillasExt");
+    if (!fHilExt)
+    {
+        *fLog << err << fHilExtName << " [MHillasExt] not found... aborting." << endl;
+        return kFALSE;
+    }
+
+    fHilSrc = (MHillasSrc*)pList->FindObject(fHilSrcName, "MHillasSrc");
+    if (!fHilSrc)
+    {
+        *fLog << err << fHilSrcName << " [MHillasSrc] not found... aborting." << endl;
+        return kFALSE;
+    }
+
+    fNewPar = (MNewImagePar*)pList->FindObject(fNewParName, "MNewImagePar");
+    if (!fNewPar)
+    {
+        *fLog << err << fNewParName << " [MNewImagePar] not found... aborting." << endl;
+        return kFALSE;
+    }
+
+   fPointPos = (MPointingPos*)pList->FindCreateObj("MPointingPos");
+   if (!fPointPos)
+   {
+       *fLog << err << "MSupercutsCalcONOFF::PreProcess; MPointingPos not found... aborting." << endl;
+       return kFALSE;
+   }
+
+
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// Calculation of upper and lower limits
+//
+Double_t MSupercutsCalcONOFF::CtsMCut(const Double_t* a,  Double_t ls, Double_t ct,
+                                    Double_t ls2, Double_t dd2) const
+{
+    // define cut-function
+    //
+    //   
+    //    dNOMCOSZA   = 1.0
+    //
+    //      a: array of cut parameters
+    //     ls: log(SIZE) - log(fSizeOffset)
+    //    ls2: ls^2
+    //     ct: Cos(ZA.) - Cos(fThetaOffset)
+    //    dd2: (DIST- fDistOffset)^2
+
+    Double_t limit;
+
+    if(fUseStaticCuts)
+    { // static cuts are used
+	limit = a[0];
+    }
+    else
+    {
+	if (fNotUseTheta)
+	{ // Theta info is NOT used in the computation of the dynamical cuts
+	  // For the time being dist info will not be used
+
+	  if(fUseDist)
+	    {
+
+	     
+	      limit = a[0] + a[1] * dd2 + 
+		      ls  * (a[3] + a[4] * dd2) + 
+		      ls2 * (a[6] + a[7] * dd2);
+	      
+
+	    }
+	  else
+	    {
+	      limit =  a[0] + ls  * (a[3])+   ls2 * (a[6]);
+	    }
+
+
+	}
+	else
+	{// Theta info IS used in the computation of the dynamical cuts
+	    
+	    limit =
+		a[0] + a[1] * dd2 + a[2] * ct  +
+		ls  * (a[3] + a[4] * dd2 + a[5] * ct) +
+		ls2 * (a[6] + a[7] * dd2);
+	}
+
+    }
+
+
+
+    //*fLog << "MSupercutsCalcONOFF::CtsMCut; *a = "
+    //      << *a     << ",  " << *(a+1) << ",  " << *(a+2) << ",  "
+    //      << *(a+3) << ",  " << *(a+4) << ",  " << *(a+5) << ",  "
+    //      << *(a+6) << ",  " << *(a+7) << endl;
+
+    //*fLog << "MSupercutsCalcONOFF::CtsMCut; ls, ls2, ct, dd2, limit = " << ls
+    //      << ",  " << ls2 << ",  " << ct << ",  " << dd2 << ",  "
+    //      << limit << endl;
+
+    return limit;
+}
+
+// --------------------------------------------------------------------------
+//
+// Returns the mapped value from the Matrix
+//
+Double_t MSupercutsCalcONOFF::GetVal(Int_t i) const
+{
+
+    Double_t val = (*fMatrix)[fMap[i]];
+
+
+    //*fLog << "MSupercutsCalcONOFF::GetVal; i, fMatrix, fMap, val = "
+    //    << i << ",  " << fMatrix << ",  " << fMap[i] << ",  " << val << endl;
+
+
+    return val;
+}
+
+// --------------------------------------------------------------------------
+//
+// You can use this function if you want to use a MHMatrix instead of the
+// given containers. This function adds all necessary columns to the
+// given matrix. Afterward you should fill the matrix with the corresponding
+// data (eg from a file by using MHMatrix::Fill). If you now loop
+// through the matrix (eg using MMatrixLoop) MEnergyEstParam::Process
+// will take the values from the matrix instead of the containers.
+//
+
+
+void MSupercutsCalcONOFF::InitMapping(MHMatrix *mat)
+{
+    if (fMatrix)
+      return;
+
+    fMatrix = mat;
+
+    fMap[0] = fMatrix->AddColumn("MPointingPos.fZd");  //deg
+    fMap[1] = fMatrix->AddColumn("MHillas.fWidth");
+    fMap[2] = fMatrix->AddColumn("MHillas.fLength");
+    fMap[3] = fMatrix->AddColumn("MHillas.fSize");
+    fMap[4] = fMatrix->AddColumn("MHillas.fMeanX");
+    fMap[5] = fMatrix->AddColumn("MHillas.fMeanY");
+    fMap[6] = fMatrix->AddColumn("MHillasSrc.fDist");
+    fMap[7] = fMatrix->AddColumn("fabs(MHillasSrc.fAlpha)");
+    fMap[8] = fMatrix->AddColumn("sgn(MHillasSrc.fCosDeltaAlpha)*(MHillasExt.fM3Long)");
+    fMap[9] = fMatrix->AddColumn("MNewImagePar.fConc");
+    fMap[10]= fMatrix->AddColumn("MNewImagePar.fLeakage1");
+}
+
+
+// ---------------------------------------------------------------------------
+//
+// Evaluate dynamical supercuts 
+// 
+//          set hadronness to 0.25 if cuts are fullfilled
+//                            0.75 otherwise
+//
+Int_t MSupercutsCalcONOFF::Process()
+{
+  //    const Double_t kNomLogSize = 4.1;
+    const Double_t kNomCosZA   = 1.0;
+
+    //const Double_t theta   = fMatrix ? GetVal(0) : fMcEvt->GetTelescopeTheta();
+    // For the time being I do it in a way that theta must be 
+    // the value used in the row 0 of fMatrix. That means that if there is 
+    // no matrix, the program will complain (and crash). And tehn I will know 
+    // that value 0 (supposed to be fThetaOrig.Val) could not be taken.
+    const Double_t theta   = GetVal(0);
+    const Double_t width0  = fMatrix ? GetVal(1) : fHil->GetWidth();
+    const Double_t length0 = fMatrix ? GetVal(2) : fHil->GetLength();
+    const Double_t size    = fMatrix ? GetVal(3) : fHil->GetSize();
+    const Double_t meanx   = fMatrix ? GetVal(4) : fHil->GetMeanX();
+    const Double_t meany   = fMatrix ? GetVal(5) : fHil->GetMeanY();
+    const Double_t dist0   = fMatrix ? GetVal(6) : fHilSrc->GetDist();
+
+    const Double_t alpha   = fMatrix ? GetVal(7) : fHilSrc->GetAlpha();
+
+    Double_t help;
+    if (!fMatrix)
+      help = TMath::Sign(fHilExt->GetM3Long(), 
+	      		 fHilSrc->GetCosDeltaAlpha());
+    const Double_t asym0   = fMatrix ? GetVal(8) : help;
+    const Double_t conc    = fMatrix ? GetVal(9) : fNewPar->GetConc();
+    const Double_t leakage = fMatrix ? GetVal(10): fNewPar->GetLeakage1();
+
+    const Double_t newdist = dist0 * fMm2Deg;
+
+    const Double_t dist2   = meanx*meanx + meany*meany;
+    const Double_t dist    = sqrt(dist2) * fMm2Deg;
+    
+    // const Double_t dd2     = dist*dist;
+
+
+    // in the parameterization of the cuts 
+    // the dist parameter used is the one computed from the source position, 
+    // and not the one computed from the camera center.
+
+    // Actually the value used in the parameterization is newdist^2, 
+    // minus the offset_in_dist^2
+    
+    const Double_t dd2     = newdist*newdist - fDistOffset*fDistOffset;
+
+
+    
+    const Double_t dmls    = log(size) - log(fSizeOffset);
+    const Double_t dmls2   = dmls * dmls;
+
+    const Double_t dmcza   = cos(theta) - kNomCosZA;
+
+    const Double_t length  = length0 * fMm2Deg;
+    const Double_t width   = width0  * fMm2Deg;
+    const Double_t asym    = asym0   * fMm2Deg;
+
+
+    
+    // computation of the cut limits
+
+    Double_t lengthup  = CtsMCut (fSuper->GetLengthUp(), dmls, dmcza, dmls2, dd2);    
+    Double_t lengthlow = CtsMCut (fSuper->GetLengthLo(), dmls, dmcza, dmls2, dd2);
+
+    Double_t widthup   = CtsMCut (fSuper->GetWidthUp(),  dmls, dmcza, dmls2, dd2);     
+    Double_t widthlow  =  CtsMCut (fSuper->GetWidthLo(),  dmls, dmcza, dmls2, dd2);
+
+    Double_t distup   =  CtsMCut (fSuper->GetDistUp(),   dmls, dmcza, dmls2, dd2);
+    Double_t distlow  =  CtsMCut (fSuper->GetDistLo(),   dmls, dmcza, dmls2, dd2);
+
+    Double_t asymup   = CtsMCut (fSuper->GetAsymUp(),   dmls, dmcza, dmls2, dd2);
+    Double_t asymlow  = CtsMCut (fSuper->GetAsymLo(),   dmls, dmcza, dmls2, dd2);
+
+    Double_t concup   = CtsMCut (fSuper->GetConcUp(),   dmls, dmcza, dmls2, dd2);
+    Double_t conclow  = CtsMCut (fSuper->GetConcLo(),   dmls, dmcza, dmls2, dd2);
+
+    Double_t  leakageup = CtsMCut (fSuper->GetLeakage1Up(),dmls, dmcza, dmls2, dd2);
+    Double_t  leakagelow = CtsMCut (fSuper->GetLeakage1Lo(),dmls, dmcza, dmls2, dd2); 
+
+    
+    Double_t lengthoverwidth = length/width;
+
+    Double_t hadronness = 0.0;
+
+
+    // If the cut values computed before for Dist, Length and Width exceed the upper limits set 
+    // by the user through function MSupercutsCalcONOFF::SetHillasDistLengthWidthUpperLowerLimits,
+    // (or the default values defined in constructor); such cut values are replaced by the 
+    // the limit values
+
+    
+
+    if (distup > fDistUpperLimit)
+      {
+	distup = fDistUpperLimit;
+      }
+
+   
+    if (lengthup > fLengthUpperLimit)
+      {
+	lengthup = fLengthUpperLimit;
+      }
+
+    if (widthup > fWidthUpperLimit)
+      {
+	widthup = fWidthUpperLimit;
+      }
+
+    
+
+    if (distlow < fDistLowerLimit)
+      {
+	distlow = fDistLowerLimit;
+      }
+                   
+    if (lengthlow < fLengthLowerLimit)
+      {
+	lengthlow = fLengthLowerLimit;
+      }
+
+    if (widthlow < fWidthLowerLimit)
+      {            
+	widthlow = fWidthLowerLimit;
+      }
+
+    
+    if (leakageup > fLeakage1UpperLimit)
+      {
+	leakageup = fLeakage1UpperLimit;
+      }
+    
+
+   
+
+
+    // Upper cut in leakage 1 also implemented
+
+    
+    
+   
+    if (// 
+	newdist > distup ||
+	newdist < distlow ||	    
+	length  > lengthup ||
+	length  < lengthlow ||	    
+	width   > widthup ||
+	width   < widthlow ||	    
+	leakage > leakageup ||
+	leakage < leakagelow ||
+	lengthoverwidth < fLengthOverWidthUpperLimit
+	//
+	//asym    < asymup &&
+	//asym    > asymlow &&
+	
+	//dist    < distup &&
+	//dist    > distlow &&
+	
+	//conc    < concup &&
+	//conc    > conclow &&	
+	//
+	) 
+	  
+      {hadronness = 0.75;}
+    else
+      {
+	hadronness = 0.25;
+      }
+      
+    
+    fHadronness->SetHadronness(hadronness);
+    fHadronness->SetReadyToSave();
+    
+    
+    if(fStoreAppliedSupercuts)
+    {
+
+	// TArrayD vector with the shower parameters (matching the ones 
+	// specified in function MTSupercutsApplied::CreateTreeBranches)
+	// is created and filled with this event features
+
+	// Eventually this definition might be done from outside this 
+	// class, allowing for adding removing parameters without 
+	// recompiling mars. yet for the time being, let's keep it simple.
+	
+	TArrayD ShowerParams(10);
+	ShowerParams[0] = length;
+	ShowerParams[1] = width;
+	ShowerParams[2] = dist;
+	ShowerParams[3] = newdist;
+	ShowerParams[4] = asym;
+	ShowerParams[5] = conc;
+	ShowerParams[6] = leakage;
+	ShowerParams[7] = theta;
+	ShowerParams[8] = size;
+	ShowerParams[9] = alpha;
+	
+	
+	// TArrayD vector with the cut parameters (matching the ones 
+	// specified in function MTSupercutsApplied::CreateTreeBranches)
+	// is created and filled with this event features
+
+	// Eventually this definition might be done from outside this 
+	// class, allowing for adding removing parameters without 
+	// recompiling mars. yet for the time being, let's keep it simple.
+	
+	
+	TArrayD SuperCutParams(13);
+	SuperCutParams[0] = lengthup;
+	SuperCutParams[1] = lengthlow;
+	SuperCutParams[2] = widthup;
+	SuperCutParams[3] = widthlow;
+	SuperCutParams[4] = distup;
+	SuperCutParams[5] = distlow;
+	SuperCutParams[6] = asymup;
+	SuperCutParams[7] = asymlow;
+	SuperCutParams[8] = concup;
+	SuperCutParams[9] = conclow;
+	SuperCutParams[10] = leakageup;
+	SuperCutParams[11] = leakagelow;
+	SuperCutParams[12] = hadronness;
+
+	// SC parameters applied to this event, as well as the 
+	// shower parameters, are stored in the branches of the
+	// TTree object of a MTSupercutsApplied object
+
+   
+	if (!fSupercutsApplied ->FillTreeBranches(SuperCutParams, ShowerParams))
+	{
+	    *fLog << "MSupercutsCalcONOFF::Process()" << endl
+		  << "Supercuts applied could not be stored in tree..."
+		  << endl;
+	    
+	    return kFALSE;
+	}
+	
+
+    }
+     
+
+
+    return kTRUE;
+
+
+    // OLD STUFF
+
+    /*
+    *fLog << "newdist, length, width, asym, dist, conc, leakage = " 
+          << newdist << ",  " << length << ",  " << width << ",  "
+          << asym    << ",  " << dist   << ",  " << conc  << ",  " << leakage
+          << endl;
+  
+    *fLog << "upper cuts in newdist, length, width, asym, dist, conc, leakage = " 
+          << CtsMCut (fSuper->GetDistUp(),   dmls, dmcza, dmls2, dd2) << ",  "
+          << CtsMCut (fSuper->GetDistLo(),   dmls, dmcza, dmls2, dd2) << ",  "
+
+          << CtsMCut (fSuper->GetLengthUp(),   dmls, dmcza, dmls2, dd2) << ",  "
+          << CtsMCut (fSuper->GetLengthLo(),   dmls, dmcza, dmls2, dd2) << ",  "
+
+          << CtsMCut (fSuper->GetWidthUp(),   dmls, dmcza, dmls2, dd2) << ",  "
+          << CtsMCut (fSuper->GetWidthLo(),   dmls, dmcza, dmls2, dd2) << ",  "
+
+          << CtsMCut (fSuper->GetAsymUp(),   dmls, dmcza, dmls2, dd2) << ",  "
+          << CtsMCut (fSuper->GetAsymLo(),   dmls, dmcza, dmls2, dd2) << ",  "
+
+          << CtsMCut (fSuper->GetDistUp(),   dmls, dmcza, dmls2, dd2) << ",  "
+          << CtsMCut (fSuper->GetDistLo(),   dmls, dmcza, dmls2, dd2) << ",  "
+
+          << CtsMCut (fSuper->GetConcUp(),   dmls, dmcza, dmls2, dd2) << ",  "
+          << CtsMCut (fSuper->GetConcLo(),   dmls, dmcza, dmls2, dd2) << ",  "
+
+          << CtsMCut (fSuper->GetLeakage1Up(),   dmls, dmcza, dmls2, dd2) << ",  "
+          << CtsMCut (fSuper->GetLeakage1Lo(),   dmls, dmcza, dmls2, dd2) << ",  "
+          << endl;
+    */
+
+    /*
+    if (
+        //dist    < 1.05                                                     &&
+        //newdist < 1.05                                                     &&
+
+        newdist < CtsMCut (fSuper->GetDistUp(),   dmls, dmcza, dmls2, dd2) &&
+        newdist > CtsMCut (fSuper->GetDistLo(),   dmls, dmcza, dmls2, dd2) &&
+
+        length  < CtsMCut (fSuper->GetLengthUp(), dmls, dmcza, dmls2, dd2) &&
+        length  > CtsMCut (fSuper->GetLengthLo(), dmls, dmcza, dmls2, dd2) &&
+
+        width   < CtsMCut (fSuper->GetWidthUp(),  dmls, dmcza, dmls2, dd2) &&
+        width   > CtsMCut (fSuper->GetWidthLo(),  dmls, dmcza, dmls2, dd2) &&
+
+        asym    < CtsMCut (fSuper->GetAsymUp(),   dmls, dmcza, dmls2, dd2) &&
+        asym    > CtsMCut (fSuper->GetAsymLo(),   dmls, dmcza, dmls2, dd2) &&
+
+        dist    < CtsMCut (fSuper->GetDistUp(),   dmls, dmcza, dmls2, dd2) &&
+        dist    > CtsMCut (fSuper->GetDistLo(),   dmls, dmcza, dmls2, dd2) &&
+
+        conc    < CtsMCut (fSuper->GetConcUp(),   dmls, dmcza, dmls2, dd2) &&
+        conc    > CtsMCut (fSuper->GetConcLo(),   dmls, dmcza, dmls2, dd2) &&
+
+        leakage < CtsMCut (fSuper->GetLeakage1Up(),dmls, dmcza, dmls2, dd2) &&
+        leakage > CtsMCut (fSuper->GetLeakage1Lo(),dmls, dmcza, dmls2, dd2)  ) 
+
+      fHadronness->SetHadronness(0.25);
+    else
+      fHadronness->SetHadronness(0.75);
+
+   
+
+    // *fLog << "SChadroness = " << fHadronness->GetHadronness() << endl;
+
+    fHadronness->SetReadyToSave();
+    */
+
+    // END OF OLD STUFF
+}
+
+/*
+Bool_t MSupercutsCalcONOFF::StoreSupercutsAppliedToThisEvent(TArrayD CutParams, 
+							   TArrayD ShowerParams)
+{
+    // SC parameters applied to this event are stored in 
+    // TTree object of MTSupercutsApplied object
+
+   
+    if (!fSupercutsApplied ->FillTreeBranches(CutParams, ShowerParams))
+    {
+	*fLog << "MSupercutsCalcONOFF::StoreSupercutsAppliedToThisEvent" << endl
+	      << "Supercuts applied could not be stored in tree..."
+	      << endl;
+
+	return kFALSE;
+    }
+
+    
+    return kTRUE;
+}
+
+*/
+
+
+
+
+
+
+
+
Index: trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MSupercutsCalcONOFF.h
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MSupercutsCalcONOFF.h	(revision 4411)
+++ trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MSupercutsCalcONOFF.h	(revision 4411)
@@ -0,0 +1,173 @@
+#ifndef MARS_MSupercutsCalcONOFF
+#define MARS_MSupercutsCalcONOFF
+
+#ifndef MARS_MTask
+#include "MTask.h"
+#endif
+
+#ifndef ROOT_TArrayD
+#include <TArrayD.h>
+#endif
+
+class MParList;
+class MHillas;
+class MHillasSrc;
+class MHillasExt;
+class MNewImagePar;
+class MPointingPos;
+class MCerPhotEvt;
+class MGeomCam;
+class MHadronness;
+class MHMatrix;
+class MSupercuts;
+class MTSupercutsApplied;
+
+class MSupercutsCalcONOFF : public MTask
+{
+private:
+    MHillas       *fHil;
+    MHillasSrc    *fHilSrc;
+    MHillasExt    *fHilExt;
+    MNewImagePar  *fNewPar;
+    MPointingPos  *fPointPos;
+    MHadronness   *fHadronness; //! output container for hadronness
+    MTSupercutsApplied *fSupercutsApplied; // output container for applied supercuts
+    MSupercuts *fSuper;      // container for supercut parameters
+
+    TString  fHadronnessName;   // name of container to store hadronness
+    TString  fSupercutsAppliedName;        // name of the container to store applied supercuts
+    TString  fHilName;
+    TString  fHilSrcName;
+    TString  fHilExtName;
+    TString  fNewParName;
+    TString  fSuperName;        // name of container for supercut parameters
+
+    Double_t fMm2Deg;           //!
+
+    Int_t     fMap[11];         //!
+    MHMatrix *fMatrix;          //!
+
+    Bool_t fStoreAppliedSupercuts; // Boolean variable used to decided wether to store (kTRUE) or not (kFALSE) the supercuts applied
+
+
+    // Boolean variable used to control decide wether to use theta information 
+    // in the computation of teh dynamical cuts.
+    Bool_t fNotUseTheta;
+
+    // Boolean variable used to decide wether to use dynamical cuts or static cuts
+    // kTRUE means that static cuts are used
+    Bool_t fUseStaticCuts;
+
+
+    // Boolean variable that allows to use/not use the dist info in the cuts parameterization
+    // kTRUE for use it.
+    // For the time being this variable is set in the constructor
+
+    Bool_t fUseDist;
+
+
+
+     // OFFSETS FOR THE DYNAMICAL CUTS
+    // Values of Size (photons), Dist (degrees) and Theta (degrees) 
+    // for which the value of the dynamical cut is equal to the 
+    // non dependent parameter; i.e. to the static cut. 
+    // By adjusting these offsets the user can set the value in size, 
+    // dist and theta for which the dynamical cuts will be given by 
+    // the term that DOES not depend on size, dist and theta.
+
+    // For the time being, these quantities are set in the constructor. 
+    // In future, if they show to be useful, I will make them available 
+    // as external variables.
+
+    Double_t fSizeOffset; // photons
+    Double_t fDistOffset; // degrees   NOT USED FOR THE TIME BEING
+    Double_t fThetaOffset; // degrees   NOT USED FOR THE TIME BEING
+
+
+
+
+    // Variables defining upper/lower limits for some of the hillas params
+    // Variables in degrees !!
+
+    Double_t fDistUpperLimit;
+    Double_t fLengthUpperLimit;
+    Double_t fWidthUpperLimit;
+
+     Double_t fDistLowerLimit;
+    Double_t fLengthLowerLimit;
+    Double_t fWidthLowerLimit;
+
+    // tmp
+
+    Double_t fLeakage1UpperLimit;
+
+    Double_t fLengthOverWidthUpperLimit;
+    
+    //endtemp
+
+    Int_t PreProcess(MParList *pList);
+    Int_t Process();
+
+    Double_t GetVal(Int_t i) const;
+
+    Double_t CtsMCut(const Double_t* a, Double_t ls, Double_t ct,
+                     Double_t ls2, Double_t dd2) const;
+    /*
+    Bool_t StoreSupercutsAppliedToThisEvent(Double_t lengthup, Double_t lengthlow, 
+					    Double_t widthup, Double_t widthlow, 
+					    Double_t distup, Double_t distlow);
+    */     
+public:
+    MSupercutsCalcONOFF(const char *hilname="MHillas",
+                      const char *hilsrcname="MHillasSrc",
+                      const char *name=NULL, const char *title=NULL);
+
+    void SetHadronnessName(const TString name) { fHadronnessName = name; }
+    TString GetHadronnessName() const { return fHadronnessName; }
+
+    void SetSupercutsAppliedName(const TString name) { fSupercutsAppliedName = name; }
+    TString GetSupercutsAppliedName() const { return fSupercutsAppliedName; }
+
+
+    void SetStoreAppliedSupercuts(Bool_t b);
+    Bool_t GetStoreAppliedSupercuts() {return fStoreAppliedSupercuts;}
+
+
+    void SetVariableNotUseTheta(Bool_t b);
+    Bool_t GetVariableNotUseTheta() { return fNotUseTheta;}
+
+    void SetVariableUseStaticCuts(Bool_t b);
+    Bool_t GetVariableUseStaticCuts() { return fUseStaticCuts;}
+
+
+    
+    void SetHillasDistLengthWidthUpperLowerLimits(Double_t distup, 
+						  Double_t lengthup, 
+						  Double_t widthup, 
+						  Double_t distlow, 
+						  Double_t lengthlow, 
+						  Double_t widthlow);
+
+    void InitMapping(MHMatrix *mat); // use quantity ThetaOrig.fVal at theta
+    
+    void StopMapping() { InitMapping(NULL); }
+
+    
+
+
+    ClassDef(MSupercutsCalcONOFF, 0) // A class to evaluate the Supercuts
+};
+
+#endif
+
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MTSupercutsApplied.cc
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MTSupercutsApplied.cc	(revision 4411)
+++ trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MTSupercutsApplied.cc	(revision 4411)
@@ -0,0 +1,281 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): David Paneque 02/2004 <mailto:dpaneque@mppmu.mpg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2004
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// MTSupercutsApplied
+//
+// Class derived from TObject and containing a TTree object 
+// used to store the values of the Supercuts applied 
+// to each single event. The supercuts are dynamic, which means that 
+// the cuts depend on the characterics (size, theta, distance) of the 
+// individual events. 
+// For the time being, only Length, Width and Dist are used, yet in 
+// the future more parameters will be added (conc, asym...)
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#include "MTSupercutsApplied.h"
+
+#include <TObject.h>
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+ClassImp(MTSupercutsApplied);
+
+using namespace std;
+
+// --------------------------------------------------------------------------
+//
+// Default constructor.
+//
+MTSupercutsApplied::MTSupercutsApplied(const char* name, const char* title)
+{
+    fName  = name  ? name  : "MTSupercutsApplied";
+    fTitle = title ? title : "Storage container for the dynamical supercuts";
+
+
+    // TTree object is initialized with same name and titles as parent object
+    
+    fRootTree = new TTree (name, title);
+
+    fBranchesCreated = kFALSE;
+
+}
+
+// --------------------------------------------------------------------------
+//   DESTRUCTOR deletes dynamic memory allocated for TTree and vectors
+
+MTSupercutsApplied::~MTSupercutsApplied()
+{
+
+    // If I release the dynamic memory ocupied by this guys a segmentation 
+    // fault is produced. I guess this is due to the fact that tryis to 
+    // remove something which has been writtenn into a root file... 
+    // not sure...
+
+    // Anyhow, this occupies very little memory... it will not load 
+    // too much the system.
+
+    //delete fCutParameters;
+    //delete fShowerParamBranchName;
+    //delete fRootTree;
+    
+
+}
+
+
+
+
+// Function that creates the branches of the TTree object
+
+Bool_t MTSupercutsApplied::CreateTreeBranches()
+{
+
+    // Names of the branches is fixed for the time being
+    
+    fCutParamBranchName = ("SupercutsApplied");
+    fShowerParamBranchName = ("ShowerParameters");
+
+   
+    // Number of parameters for the 2 branches is set in cosntructor. 
+    // In later versions I might do it in such a way that can be set 
+    // by user
+
+    fNCutParameters = 13;
+    fNShowerParameters = 10;
+
+    
+    const Int_t dimscparam = fNCutParameters;
+    const Int_t dimshowerparam = fNShowerParameters;
+
+    fCutParameters = new Double_t [dimscparam];
+    fShowerParameters = new Double_t [dimshowerparam];
+    
+
+
+    // Cut parameters names and types for branch CutParameters
+    // will be stored in a member data TString fCutParametersNamesTypes
+    // Eventually might be set from outside the class
+
+    TString StringVector[dimscparam];
+    StringVector[0] = ("LengthUp/D");
+    StringVector[1] = ("LengthLow/D");
+    StringVector[2] = ("WidthUp/D");
+    StringVector[3] = ("WidthLow/D");
+    StringVector[4] = ("DistUp/D");
+    StringVector[5] = ("DistLow/D");
+    StringVector[6] = ("AsymUp/D");
+    StringVector[7] = ("AsymLow/D");
+    StringVector[8] = ("ConcUp/D");
+    StringVector[9] = ("ConcLow/D");
+    StringVector[10] = ("LeakageUp/D");
+    StringVector[11] = ("LeakageLow/D");
+    StringVector[12] = ("Hadronness/D");
+
+    fCutParametersNamesTypes = StringVector[0];
+    for (Int_t i = 1; i < dimscparam; i++)
+    {
+	fCutParametersNamesTypes += (":");
+	fCutParametersNamesTypes += StringVector[i];
+    }
+	
+
+    // Cut parameters names and types for branch CutParameters
+    // will be stored in a member data TString fShowerParametersNamesTypes
+    // Eventually might be set from outside the class
+	
+    TString StringVector2[dimshowerparam];
+
+    StringVector2[0] = ("Length/D");
+    StringVector2[1] = ("Width/D");
+    StringVector2[2] = ("Dist/D");
+    StringVector2[3] = ("NewDist/D");
+    StringVector2[4] = ("Asym/D");
+    StringVector2[5] = ("Conc/D");
+    StringVector2[6] = ("Leakage/D");
+    StringVector2[7] = ("Theta/D");
+    StringVector2[8] = ("Size/D");
+    StringVector2[9] = ("Alpha/D");
+
+
+ 
+    fShowerParametersNamesTypes = StringVector2[0];
+    for (Int_t i = 1; i < dimshowerparam; i++)
+    {
+	fShowerParametersNamesTypes += (":");
+	fShowerParametersNamesTypes += StringVector2[i];
+    }
+
+
+    *fLog << "MTSupercutsApplied::CreateTreeBranches()" << endl
+	  << "Branches created are the following ones (BranchName; Parameters)" << endl
+	  << fCutParamBranchName << " ; " << fCutParametersNamesTypes << endl
+	  << fShowerParamBranchName << " ; " << fShowerParametersNamesTypes << endl;
+
+    
+    // Branches are finally created
+
+    fRootTree -> Branch(fCutParamBranchName.Data(),
+			fCutParameters, fCutParametersNamesTypes.Data());
+
+    fRootTree -> Branch(fShowerParamBranchName.Data(),
+			fShowerParameters, fShowerParametersNamesTypes.Data());
+
+    fBranchesCreated = kTRUE;
+
+
+    /*
+
+    fRootTree -> Branch("LengthUp", &fLengthUp, "LengthUp/D");
+    fRootTree -> Branch("LengthLow", &fLengthLow, "LengthLow/D");
+    fRootTree -> Branch("WidthUp", &fWidthUp, "WidthUp/D");
+    fRootTree -> Branch("Widthlow", &fWidthLow, "WidthLow/D");
+    fRootTree -> Branch("DistUp", &fDistUp, "DistUp/D");
+    fRootTree -> Branch("DistLow", &fDistLow, "DistLow/D");
+
+    */
+
+
+    *fLog << "MTSupercutsApplied::CreateTreeBranches();" << endl
+	  << "Branches created successfully in TTree object" << endl;
+
+    return kTRUE;
+    
+}
+
+Bool_t MTSupercutsApplied::FillTreeBranches(const TArrayD cutparameters, 
+					    const TArrayD showerparameters)
+{
+
+    // Check that branches have been created 
+    if(!fBranchesCreated)
+    {
+	*fLog << "MTSupercutsApplied::FillTreeBranches" << endl
+	      << "Branches for the Tree object have not been created yet..." 
+	      << "Therefore Tree can not be filled" << endl;
+	
+	return kFALSE;
+
+    }
+
+    // Check that dimensions of the argument vectors match with the
+    // dimension of the vectors whose addresses are given to the branches
+
+    if (fNCutParameters != cutparameters.GetSize()
+	|| fNShowerParameters != showerparameters.GetSize())
+    {
+	*fLog << "MTSupercutsApplied::FillTreeBranches" << endl
+	      << "Dimension of arrays used in the argument of this function " 
+	      << "do not match with the dimension of the arrays used in the branches"
+	      << endl;
+
+	return kFALSE;
+    }
+
+    // Parameters are transferred to the member data vectors 
+
+    for (Int_t i = 0; i < fNCutParameters; i++)
+    {
+	fCutParameters[i] = double (cutparameters[i]);
+    }
+
+    for (Int_t i = 0; i < fNShowerParameters; i++)
+    {
+	fShowerParameters[i] = double (showerparameters[i]);
+    }
+
+
+    // Branches are finally filled
+
+    fRootTree -> Fill();
+    
+    return kTRUE;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MTSupercutsApplied.h
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MTSupercutsApplied.h	(revision 4411)
+++ trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MTSupercutsApplied.h	(revision 4411)
@@ -0,0 +1,98 @@
+#ifndef MARS_MTSupercutsApplied
+#define MARS_MTSupercutsApplied
+//////////////////////////////////////////////////////////////////////////
+//                                                                      //
+// MTSupercutsApplied                                                      //
+//                                                                      //
+// Class containing TTree object used to store 
+// supercuts applied to all individual events                               //
+//                                                                      //
+//////////////////////////////////////////////////////////////////////////
+#ifndef MARS_MAGIC
+#include "MAGIC.h"
+#endif
+
+#ifndef MARS_MParContainer
+#include "MParContainer.h"
+#endif
+
+
+#ifndef ROOT_TObject
+#include <TObject.h>
+#endif
+#ifndef ROOT_TString
+#include <TString.h>
+#endif
+#ifndef ROOT_TArrayD
+#include <TArrayD.h>
+#endif
+#ifndef ROOT_TTree
+#include <TTree.h>
+#endif
+
+class MTSupercutsApplied : public MParContainer
+{
+private:
+    
+    Int_t fNCutParameters;
+    Int_t fNShowerParameters;
+
+    Double_t* fCutParameters;
+    Double_t* fShowerParameters;
+/*
+    Double_t fLengthUp;
+    Double_t fLengthLow;
+    Double_t fWidthUp;
+    Double_t fWidthLow;
+    Double_t fDistUp;
+    Double_t fDistLow;    
+*/
+    TTree* fRootTree;
+
+    Bool_t fBranchesCreated;
+
+    TString fCutParamBranchName;
+    TString fShowerParamBranchName;
+
+    TString fCutParametersNamesTypes;
+    TString fShowerParametersNamesTypes;
+
+public:
+    MTSupercutsApplied(const char* name=NULL, const char* title=NULL);
+    ~MTSupercutsApplied();
+
+    /*
+    Double_t GetLengthUp() const { return fLengthUp; }
+    Double_t GetLengthLow() const { return fLengthLow; }
+    Double_t GetWidthUp() const { return fWidthUp; }
+    Double_t GetWidthLow() const { return fWidthLow; }
+    Double_t GetDistUp() const { return fDistUp; }
+    Double_t GetDistLow() const { return fDistLow; }
+
+
+    void     SetLengthUp(Double_t x) { fLengthUp = x; }
+    void     SetLengthLow(Double_t x) { fLengthLow = x; }
+    void     SetWidthUp(Double_t x) { fWidthUp = x; }
+    void     SetWidthLow(Double_t x) { fWidthLow = x; }
+    void     SetDistUp(Double_t x) { fDistUp = x; }
+    void     SetDistLow(Double_t x) { fDistLow = x; }
+    */
+     
+    Bool_t CreateTreeBranches();
+
+    Bool_t FillTreeBranches(TArrayD CutParamVector, 
+			    TArrayD ShowerParamVector);
+    	
+    TTree* GetTreePointer() {return fRootTree;}
+    
+
+    ClassDef(MTSupercutsApplied, 1) // Storage Container for the supercuts applied
+};
+
+#endif
+
+
+
+
+
+
Index: trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/Makefile	(revision 4411)
+++ trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/Makefile	(revision 4411)
@@ -0,0 +1,57 @@
+##################################################################
+#
+#   subdirectory makefile
+# 
+#   for the MARS software
+#
+##################################################################
+include ../../../Makefile.conf.$(OSTYPE)
+include ../../../Makefile.conf.general
+
+#------------------------------------------------------------------------------
+
+CINT     = SuperCutsONOFF
+LIB      = SuperCutsONOFF.a
+
+#------------------------------------------------------------------------------
+
+INCLUDES = -I. \
+	   -I../../../mbase \
+	   -I../../../mfbase \
+	   -I../../../mjobs \
+	   -I../../../mpedestal \
+	   -I../../../mbadpixels \
+	   -I../../../mfileio \
+           -I../../../mraw \
+           -I../../../manalysis \
+	   -I../../../mgui \
+	   -I../../../mgeom \
+	   -I../../../msignal \
+	   -I../../../mcalib \
+	   -I../../../mfilter \
+	   -I../../../mhbase \
+	   -I../../../mimage \
+	   -I../../../mpointing \
+	   -I../../../mcamera \
+	   -I../../../mhist \
+	   -I../../../mmc \
+	   -I../../../mreport \
+	   -I../../../mastro \
+	   -I../../../mdata 
+
+SRCFILES = \
+	MFRandomSplit.cc \
+	MSupercutsCalcONOFF.cc \
+	MHFindSignificanceONOFF.cc \
+	MTSupercutsApplied.cc \
+	MFindSupercutsONOFF.cc \
+        MFindSupercutsONOFFThetaLoop.cc 
+
+############################################################
+
+all: $(OBJS)
+
+include ../../../Makefile.rules
+
+clean:	rmcint rmobjs rmcore rmlib
+mrproper:	clean rmbak
Index: trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/SuperCutsONOFFCint.cc
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/SuperCutsONOFFCint.cc	(revision 4411)
+++ trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/SuperCutsONOFFCint.cc	(revision 4411)
@@ -0,0 +1,4707 @@
+//
+// File generated by /cernroot/3_05_07/root/bin/rootcint at Tue Jul 20 11:55:55 2004.
+// Do NOT change. Changes will be lost next time file is generated
+//
+
+#include "RConfig.h"
+#if !defined(R__ACCESS_IN_SYMBOL)
+//Break the privacy of classes -- Disabled for the moment
+#define private public
+#define protected public
+#endif
+
+#include "SuperCutsONOFFCint.h"
+#include "TClass.h"
+#include "TBuffer.h"
+#include "TMemberInspector.h"
+#include "TError.h"
+
+#ifndef G__ROOT
+#define G__ROOT
+#endif
+
+// Since CINT ignores the std namespace, we need to do so in this file.
+namespace std {} using namespace std;
+
+#include "RtypesImp.h"
+
+namespace ROOT {
+   namespace Shadow {
+   } // Of namespace ROOT::Shadow
+} // Of namespace ROOT
+
+namespace ROOT {
+   void MFRandomSplit_ShowMembers(void *obj, TMemberInspector &R__insp, char *R__parent);
+   TClass *MFRandomSplit_IsA(const void*);
+   void delete_MFRandomSplit(void *p);
+   void deleteArray_MFRandomSplit(void *p);
+   void destruct_MFRandomSplit(void *p);
+
+   // Function generating the singleton type initializer
+   TGenericClassInfo *GenerateInitInstance(const MFRandomSplit*)
+   {
+      MFRandomSplit *ptr = 0;
+      static ROOT::TGenericClassInfo 
+         instance("MFRandomSplit", MFRandomSplit::Class_Version(), "MFRandomSplit.h", 16,
+                  typeid(MFRandomSplit), DefineBehavior(ptr, ptr),
+                  &::MFRandomSplit::Dictionary, &MFRandomSplit_IsA, 4);
+      instance.SetDelete(&delete_MFRandomSplit);
+      instance.SetDeleteArray(&deleteArray_MFRandomSplit);
+      instance.SetDestructor(&destruct_MFRandomSplit);
+      return &instance;
+   }
+   // Static variable to force the class initialization
+   static ROOT::TGenericClassInfo *_R__UNIQUE_(Init) = GenerateInitInstance((const MFRandomSplit*)0x0); R__UseDummy(_R__UNIQUE_(Init));
+}
+
+namespace ROOT {
+   void MTSupercutsApplied_ShowMembers(void *obj, TMemberInspector &R__insp, char *R__parent);
+   TClass *MTSupercutsApplied_IsA(const void*);
+   void *new_MTSupercutsApplied(void *p = 0);
+   void *newArray_MTSupercutsApplied(Long_t size);
+   void delete_MTSupercutsApplied(void *p);
+   void deleteArray_MTSupercutsApplied(void *p);
+   void destruct_MTSupercutsApplied(void *p);
+
+   // Function generating the singleton type initializer
+   TGenericClassInfo *GenerateInitInstance(const MTSupercutsApplied*)
+   {
+      MTSupercutsApplied *ptr = 0;
+      static ROOT::TGenericClassInfo 
+         instance("MTSupercutsApplied", MTSupercutsApplied::Class_Version(), "MTSupercutsApplied.h", 34,
+                  typeid(MTSupercutsApplied), DefineBehavior(ptr, ptr),
+                  &::MTSupercutsApplied::Dictionary, &MTSupercutsApplied_IsA, 4);
+      instance.SetNew(&new_MTSupercutsApplied);
+      instance.SetNewArray(&newArray_MTSupercutsApplied);
+      instance.SetDelete(&delete_MTSupercutsApplied);
+      instance.SetDeleteArray(&deleteArray_MTSupercutsApplied);
+      instance.SetDestructor(&destruct_MTSupercutsApplied);
+      return &instance;
+   }
+   // Static variable to force the class initialization
+   static ROOT::TGenericClassInfo *_R__UNIQUE_(Init) = GenerateInitInstance((const MTSupercutsApplied*)0x0); R__UseDummy(_R__UNIQUE_(Init));
+}
+
+namespace ROOT {
+   void MSupercutsCalcONOFF_ShowMembers(void *obj, TMemberInspector &R__insp, char *R__parent);
+   TClass *MSupercutsCalcONOFF_IsA(const void*);
+   void *new_MSupercutsCalcONOFF(void *p = 0);
+   void *newArray_MSupercutsCalcONOFF(Long_t size);
+   void delete_MSupercutsCalcONOFF(void *p);
+   void deleteArray_MSupercutsCalcONOFF(void *p);
+   void destruct_MSupercutsCalcONOFF(void *p);
+
+   // Function generating the singleton type initializer
+   TGenericClassInfo *GenerateInitInstance(const MSupercutsCalcONOFF*)
+   {
+      MSupercutsCalcONOFF *ptr = 0;
+      static ROOT::TGenericClassInfo 
+         instance("MSupercutsCalcONOFF", MSupercutsCalcONOFF::Class_Version(), "MSupercutsCalcONOFF.h", 26,
+                  typeid(MSupercutsCalcONOFF), DefineBehavior(ptr, ptr),
+                  &::MSupercutsCalcONOFF::Dictionary, &MSupercutsCalcONOFF_IsA, 4);
+      instance.SetNew(&new_MSupercutsCalcONOFF);
+      instance.SetNewArray(&newArray_MSupercutsCalcONOFF);
+      instance.SetDelete(&delete_MSupercutsCalcONOFF);
+      instance.SetDeleteArray(&deleteArray_MSupercutsCalcONOFF);
+      instance.SetDestructor(&destruct_MSupercutsCalcONOFF);
+      return &instance;
+   }
+   // Static variable to force the class initialization
+   static ROOT::TGenericClassInfo *_R__UNIQUE_(Init) = GenerateInitInstance((const MSupercutsCalcONOFF*)0x0); R__UseDummy(_R__UNIQUE_(Init));
+}
+
+namespace ROOT {
+   void MHFindSignificanceONOFF_ShowMembers(void *obj, TMemberInspector &R__insp, char *R__parent);
+   TClass *MHFindSignificanceONOFF_IsA(const void*);
+   void *new_MHFindSignificanceONOFF(void *p = 0);
+   void *newArray_MHFindSignificanceONOFF(Long_t size);
+   void delete_MHFindSignificanceONOFF(void *p);
+   void deleteArray_MHFindSignificanceONOFF(void *p);
+   void destruct_MHFindSignificanceONOFF(void *p);
+
+   // Function generating the singleton type initializer
+   TGenericClassInfo *GenerateInitInstance(const MHFindSignificanceONOFF*)
+   {
+      MHFindSignificanceONOFF *ptr = 0;
+      static ROOT::TGenericClassInfo 
+         instance("MHFindSignificanceONOFF", MHFindSignificanceONOFF::Class_Version(), "MHFindSignificanceONOFF.h", 22,
+                  typeid(MHFindSignificanceONOFF), DefineBehavior(ptr, ptr),
+                  &::MHFindSignificanceONOFF::Dictionary, &MHFindSignificanceONOFF_IsA, 4);
+      instance.SetNew(&new_MHFindSignificanceONOFF);
+      instance.SetNewArray(&newArray_MHFindSignificanceONOFF);
+      instance.SetDelete(&delete_MHFindSignificanceONOFF);
+      instance.SetDeleteArray(&deleteArray_MHFindSignificanceONOFF);
+      instance.SetDestructor(&destruct_MHFindSignificanceONOFF);
+      return &instance;
+   }
+   // Static variable to force the class initialization
+   static ROOT::TGenericClassInfo *_R__UNIQUE_(Init) = GenerateInitInstance((const MHFindSignificanceONOFF*)0x0); R__UseDummy(_R__UNIQUE_(Init));
+}
+
+namespace ROOT {
+   void MFindSupercutsONOFF_ShowMembers(void *obj, TMemberInspector &R__insp, char *R__parent);
+   TClass *MFindSupercutsONOFF_IsA(const void*);
+   void *new_MFindSupercutsONOFF(void *p = 0);
+   void *newArray_MFindSupercutsONOFF(Long_t size);
+   void delete_MFindSupercutsONOFF(void *p);
+   void deleteArray_MFindSupercutsONOFF(void *p);
+   void destruct_MFindSupercutsONOFF(void *p);
+
+   // Function generating the singleton type initializer
+   TGenericClassInfo *GenerateInitInstance(const MFindSupercutsONOFF*)
+   {
+      MFindSupercutsONOFF *ptr = 0;
+      static ROOT::TGenericClassInfo 
+         instance("MFindSupercutsONOFF", MFindSupercutsONOFF::Class_Version(), "MFindSupercutsONOFF.h", 34,
+                  typeid(MFindSupercutsONOFF), DefineBehavior(ptr, ptr),
+                  &::MFindSupercutsONOFF::Dictionary, &MFindSupercutsONOFF_IsA, 4);
+      instance.SetNew(&new_MFindSupercutsONOFF);
+      instance.SetNewArray(&newArray_MFindSupercutsONOFF);
+      instance.SetDelete(&delete_MFindSupercutsONOFF);
+      instance.SetDeleteArray(&deleteArray_MFindSupercutsONOFF);
+      instance.SetDestructor(&destruct_MFindSupercutsONOFF);
+      return &instance;
+   }
+   // Static variable to force the class initialization
+   static ROOT::TGenericClassInfo *_R__UNIQUE_(Init) = GenerateInitInstance((const MFindSupercutsONOFF*)0x0); R__UseDummy(_R__UNIQUE_(Init));
+}
+
+namespace ROOT {
+   void MFindSupercutsONOFFThetaLoop_ShowMembers(void *obj, TMemberInspector &R__insp, char *R__parent);
+   TClass *MFindSupercutsONOFFThetaLoop_IsA(const void*);
+   void *new_MFindSupercutsONOFFThetaLoop(void *p = 0);
+   void *newArray_MFindSupercutsONOFFThetaLoop(Long_t size);
+   void delete_MFindSupercutsONOFFThetaLoop(void *p);
+   void deleteArray_MFindSupercutsONOFFThetaLoop(void *p);
+   void destruct_MFindSupercutsONOFFThetaLoop(void *p);
+
+   // Function generating the singleton type initializer
+   TGenericClassInfo *GenerateInitInstance(const MFindSupercutsONOFFThetaLoop*)
+   {
+      MFindSupercutsONOFFThetaLoop *ptr = 0;
+      static ROOT::TGenericClassInfo 
+         instance("MFindSupercutsONOFFThetaLoop", MFindSupercutsONOFFThetaLoop::Class_Version(), "MFindSupercutsONOFFThetaLoop.h", 34,
+                  typeid(MFindSupercutsONOFFThetaLoop), DefineBehavior(ptr, ptr),
+                  &::MFindSupercutsONOFFThetaLoop::Dictionary, &MFindSupercutsONOFFThetaLoop_IsA, 4);
+      instance.SetNew(&new_MFindSupercutsONOFFThetaLoop);
+      instance.SetNewArray(&newArray_MFindSupercutsONOFFThetaLoop);
+      instance.SetDelete(&delete_MFindSupercutsONOFFThetaLoop);
+      instance.SetDeleteArray(&deleteArray_MFindSupercutsONOFFThetaLoop);
+      instance.SetDestructor(&destruct_MFindSupercutsONOFFThetaLoop);
+      return &instance;
+   }
+   // Static variable to force the class initialization
+   static ROOT::TGenericClassInfo *_R__UNIQUE_(Init) = GenerateInitInstance((const MFindSupercutsONOFFThetaLoop*)0x0); R__UseDummy(_R__UNIQUE_(Init));
+}
+
+//______________________________________________________________________________
+TClass *MFRandomSplit::fgIsA = 0;  // static to hold class pointer
+
+//______________________________________________________________________________
+const char *MFRandomSplit::Class_Name()
+{
+   return "MFRandomSplit";
+}
+
+//______________________________________________________________________________
+const char *MFRandomSplit::ImplFileName()
+{
+   return ROOT::GenerateInitInstance((const MFRandomSplit*)0x0)->GetImplFileName();
+}
+
+//______________________________________________________________________________
+int MFRandomSplit::ImplFileLine()
+{
+   return ROOT::GenerateInitInstance((const MFRandomSplit*)0x0)->GetImplFileLine();
+}
+
+//______________________________________________________________________________
+void MFRandomSplit::Dictionary()
+{
+   fgIsA = ROOT::GenerateInitInstance((const MFRandomSplit*)0x0)->GetClass();
+}
+
+//______________________________________________________________________________
+TClass *MFRandomSplit::Class()
+{
+   if (!fgIsA) fgIsA = ROOT::GenerateInitInstance((const MFRandomSplit*)0x0)->GetClass();
+   return fgIsA;
+}
+
+//______________________________________________________________________________
+TClass *MTSupercutsApplied::fgIsA = 0;  // static to hold class pointer
+
+//______________________________________________________________________________
+const char *MTSupercutsApplied::Class_Name()
+{
+   return "MTSupercutsApplied";
+}
+
+//______________________________________________________________________________
+const char *MTSupercutsApplied::ImplFileName()
+{
+   return ROOT::GenerateInitInstance((const MTSupercutsApplied*)0x0)->GetImplFileName();
+}
+
+//______________________________________________________________________________
+int MTSupercutsApplied::ImplFileLine()
+{
+   return ROOT::GenerateInitInstance((const MTSupercutsApplied*)0x0)->GetImplFileLine();
+}
+
+//______________________________________________________________________________
+void MTSupercutsApplied::Dictionary()
+{
+   fgIsA = ROOT::GenerateInitInstance((const MTSupercutsApplied*)0x0)->GetClass();
+}
+
+//______________________________________________________________________________
+TClass *MTSupercutsApplied::Class()
+{
+   if (!fgIsA) fgIsA = ROOT::GenerateInitInstance((const MTSupercutsApplied*)0x0)->GetClass();
+   return fgIsA;
+}
+
+//______________________________________________________________________________
+TClass *MSupercutsCalcONOFF::fgIsA = 0;  // static to hold class pointer
+
+//______________________________________________________________________________
+const char *MSupercutsCalcONOFF::Class_Name()
+{
+   return "MSupercutsCalcONOFF";
+}
+
+//______________________________________________________________________________
+const char *MSupercutsCalcONOFF::ImplFileName()
+{
+   return ROOT::GenerateInitInstance((const MSupercutsCalcONOFF*)0x0)->GetImplFileName();
+}
+
+//______________________________________________________________________________
+int MSupercutsCalcONOFF::ImplFileLine()
+{
+   return ROOT::GenerateInitInstance((const MSupercutsCalcONOFF*)0x0)->GetImplFileLine();
+}
+
+//______________________________________________________________________________
+void MSupercutsCalcONOFF::Dictionary()
+{
+   fgIsA = ROOT::GenerateInitInstance((const MSupercutsCalcONOFF*)0x0)->GetClass();
+}
+
+//______________________________________________________________________________
+TClass *MSupercutsCalcONOFF::Class()
+{
+   if (!fgIsA) fgIsA = ROOT::GenerateInitInstance((const MSupercutsCalcONOFF*)0x0)->GetClass();
+   return fgIsA;
+}
+
+//______________________________________________________________________________
+TClass *MHFindSignificanceONOFF::fgIsA = 0;  // static to hold class pointer
+
+//______________________________________________________________________________
+const char *MHFindSignificanceONOFF::Class_Name()
+{
+   return "MHFindSignificanceONOFF";
+}
+
+//______________________________________________________________________________
+const char *MHFindSignificanceONOFF::ImplFileName()
+{
+   return ROOT::GenerateInitInstance((const MHFindSignificanceONOFF*)0x0)->GetImplFileName();
+}
+
+//______________________________________________________________________________
+int MHFindSignificanceONOFF::ImplFileLine()
+{
+   return ROOT::GenerateInitInstance((const MHFindSignificanceONOFF*)0x0)->GetImplFileLine();
+}
+
+//______________________________________________________________________________
+void MHFindSignificanceONOFF::Dictionary()
+{
+   fgIsA = ROOT::GenerateInitInstance((const MHFindSignificanceONOFF*)0x0)->GetClass();
+}
+
+//______________________________________________________________________________
+TClass *MHFindSignificanceONOFF::Class()
+{
+   if (!fgIsA) fgIsA = ROOT::GenerateInitInstance((const MHFindSignificanceONOFF*)0x0)->GetClass();
+   return fgIsA;
+}
+
+//______________________________________________________________________________
+TClass *MFindSupercutsONOFF::fgIsA = 0;  // static to hold class pointer
+
+//______________________________________________________________________________
+const char *MFindSupercutsONOFF::Class_Name()
+{
+   return "MFindSupercutsONOFF";
+}
+
+//______________________________________________________________________________
+const char *MFindSupercutsONOFF::ImplFileName()
+{
+   return ROOT::GenerateInitInstance((const MFindSupercutsONOFF*)0x0)->GetImplFileName();
+}
+
+//______________________________________________________________________________
+int MFindSupercutsONOFF::ImplFileLine()
+{
+   return ROOT::GenerateInitInstance((const MFindSupercutsONOFF*)0x0)->GetImplFileLine();
+}
+
+//______________________________________________________________________________
+void MFindSupercutsONOFF::Dictionary()
+{
+   fgIsA = ROOT::GenerateInitInstance((const MFindSupercutsONOFF*)0x0)->GetClass();
+}
+
+//______________________________________________________________________________
+TClass *MFindSupercutsONOFF::Class()
+{
+   if (!fgIsA) fgIsA = ROOT::GenerateInitInstance((const MFindSupercutsONOFF*)0x0)->GetClass();
+   return fgIsA;
+}
+
+//______________________________________________________________________________
+TClass *MFindSupercutsONOFFThetaLoop::fgIsA = 0;  // static to hold class pointer
+
+//______________________________________________________________________________
+const char *MFindSupercutsONOFFThetaLoop::Class_Name()
+{
+   return "MFindSupercutsONOFFThetaLoop";
+}
+
+//______________________________________________________________________________
+const char *MFindSupercutsONOFFThetaLoop::ImplFileName()
+{
+   return ROOT::GenerateInitInstance((const MFindSupercutsONOFFThetaLoop*)0x0)->GetImplFileName();
+}
+
+//______________________________________________________________________________
+int MFindSupercutsONOFFThetaLoop::ImplFileLine()
+{
+   return ROOT::GenerateInitInstance((const MFindSupercutsONOFFThetaLoop*)0x0)->GetImplFileLine();
+}
+
+//______________________________________________________________________________
+void MFindSupercutsONOFFThetaLoop::Dictionary()
+{
+   fgIsA = ROOT::GenerateInitInstance((const MFindSupercutsONOFFThetaLoop*)0x0)->GetClass();
+}
+
+//______________________________________________________________________________
+TClass *MFindSupercutsONOFFThetaLoop::Class()
+{
+   if (!fgIsA) fgIsA = ROOT::GenerateInitInstance((const MFindSupercutsONOFFThetaLoop*)0x0)->GetClass();
+   return fgIsA;
+}
+
+//______________________________________________________________________________
+void MFRandomSplit::Streamer(TBuffer &R__b)
+{
+   // Stream an object of class MFRandomSplit.
+
+   if (R__b.IsReading()) {
+      MFRandomSplit::Class()->ReadBuffer(R__b, this);
+   } else {
+      MFRandomSplit::Class()->WriteBuffer(R__b, this);
+   }
+}
+
+//______________________________________________________________________________
+void MFRandomSplit::ShowMembers(TMemberInspector &R__insp, char *R__parent)
+{
+      // Inspect the data members of an object of class MFRandomSplit.
+
+      TClass *R__cl = MFRandomSplit::IsA();
+      Int_t R__ncp = strlen(R__parent);
+      if (R__ncp || R__cl || R__insp.IsA()) { }
+      R__insp.Inspect(R__cl, R__parent, "fNumSelectedEvts", &fNumSelectedEvts);
+      R__insp.Inspect(R__cl, R__parent, "fProb", &fProb);
+      R__insp.Inspect(R__cl, R__parent, "fResult", &fResult);
+      MFilter::ShowMembers(R__insp, R__parent);
+}
+
+namespace ROOT {
+   // Return the actual TClass for the object argument
+   TClass *MFRandomSplit_IsA(const void *obj) {
+      return ((::MFRandomSplit*)obj)->IsA();
+   }
+   // Wrapper around operator delete
+   void delete_MFRandomSplit(void *p) {
+      delete ((::MFRandomSplit*)p);
+   }
+   void deleteArray_MFRandomSplit(void *p) {
+      delete [] ((::MFRandomSplit*)p);
+   }
+   void destruct_MFRandomSplit(void *p) {
+      typedef ::MFRandomSplit current_t;
+      ((current_t*)p)->~current_t();
+   }
+} // end of namespace ROOT for class MFRandomSplit
+
+//______________________________________________________________________________
+void MSupercutsCalcONOFF::Streamer(TBuffer &R__b)
+{
+   // Stream an object of class MSupercutsCalcONOFF.
+
+   if (R__b.IsReading()) {
+      MSupercutsCalcONOFF::Class()->ReadBuffer(R__b, this);
+   } else {
+      MSupercutsCalcONOFF::Class()->WriteBuffer(R__b, this);
+   }
+}
+
+//______________________________________________________________________________
+void MSupercutsCalcONOFF::ShowMembers(TMemberInspector &R__insp, char *R__parent)
+{
+      // Inspect the data members of an object of class MSupercutsCalcONOFF.
+
+      TClass *R__cl = MSupercutsCalcONOFF::IsA();
+      Int_t R__ncp = strlen(R__parent);
+      if (R__ncp || R__cl || R__insp.IsA()) { }
+      R__insp.Inspect(R__cl, R__parent, "*fHil", &fHil);
+      R__insp.Inspect(R__cl, R__parent, "*fHilSrc", &fHilSrc);
+      R__insp.Inspect(R__cl, R__parent, "*fHilExt", &fHilExt);
+      R__insp.Inspect(R__cl, R__parent, "*fNewPar", &fNewPar);
+      R__insp.Inspect(R__cl, R__parent, "*fPointPos", &fPointPos);
+      R__insp.Inspect(R__cl, R__parent, "*fHadronness", &fHadronness);
+      R__insp.Inspect(R__cl, R__parent, "*fSupercutsApplied", &fSupercutsApplied);
+      R__insp.Inspect(R__cl, R__parent, "*fSuper", &fSuper);
+      R__insp.Inspect(R__cl, R__parent, "fHadronnessName", &fHadronnessName);
+      fHadronnessName.ShowMembers(R__insp, strcat(R__parent,"fHadronnessName.")); R__parent[R__ncp] = 0;
+      R__insp.Inspect(R__cl, R__parent, "fSupercutsAppliedName", &fSupercutsAppliedName);
+      fSupercutsAppliedName.ShowMembers(R__insp, strcat(R__parent,"fSupercutsAppliedName.")); R__parent[R__ncp] = 0;
+      R__insp.Inspect(R__cl, R__parent, "fHilName", &fHilName);
+      fHilName.ShowMembers(R__insp, strcat(R__parent,"fHilName.")); R__parent[R__ncp] = 0;
+      R__insp.Inspect(R__cl, R__parent, "fHilSrcName", &fHilSrcName);
+      fHilSrcName.ShowMembers(R__insp, strcat(R__parent,"fHilSrcName.")); R__parent[R__ncp] = 0;
+      R__insp.Inspect(R__cl, R__parent, "fHilExtName", &fHilExtName);
+      fHilExtName.ShowMembers(R__insp, strcat(R__parent,"fHilExtName.")); R__parent[R__ncp] = 0;
+      R__insp.Inspect(R__cl, R__parent, "fNewParName", &fNewParName);
+      fNewParName.ShowMembers(R__insp, strcat(R__parent,"fNewParName.")); R__parent[R__ncp] = 0;
+      R__insp.Inspect(R__cl, R__parent, "fSuperName", &fSuperName);
+      fSuperName.ShowMembers(R__insp, strcat(R__parent,"fSuperName.")); R__parent[R__ncp] = 0;
+      R__insp.Inspect(R__cl, R__parent, "fMm2Deg", &fMm2Deg);
+      R__insp.Inspect(R__cl, R__parent, "fMap[11]", fMap);
+      R__insp.Inspect(R__cl, R__parent, "*fMatrix", &fMatrix);
+      R__insp.Inspect(R__cl, R__parent, "fStoreAppliedSupercuts", &fStoreAppliedSupercuts);
+      R__insp.Inspect(R__cl, R__parent, "fNotUseTheta", &fNotUseTheta);
+      R__insp.Inspect(R__cl, R__parent, "fUseStaticCuts", &fUseStaticCuts);
+      R__insp.Inspect(R__cl, R__parent, "fUseDist", &fUseDist);
+      R__insp.Inspect(R__cl, R__parent, "fSizeOffset", &fSizeOffset);
+      R__insp.Inspect(R__cl, R__parent, "fDistOffset", &fDistOffset);
+      R__insp.Inspect(R__cl, R__parent, "fThetaOffset", &fThetaOffset);
+      R__insp.Inspect(R__cl, R__parent, "fDistUpperLimit", &fDistUpperLimit);
+      R__insp.Inspect(R__cl, R__parent, "fLengthUpperLimit", &fLengthUpperLimit);
+      R__insp.Inspect(R__cl, R__parent, "fWidthUpperLimit", &fWidthUpperLimit);
+      R__insp.Inspect(R__cl, R__parent, "fDistLowerLimit", &fDistLowerLimit);
+      R__insp.Inspect(R__cl, R__parent, "fLengthLowerLimit", &fLengthLowerLimit);
+      R__insp.Inspect(R__cl, R__parent, "fWidthLowerLimit", &fWidthLowerLimit);
+      R__insp.Inspect(R__cl, R__parent, "fLeakage1UpperLimit", &fLeakage1UpperLimit);
+      R__insp.Inspect(R__cl, R__parent, "fLengthOverWidthUpperLimit", &fLengthOverWidthUpperLimit);
+      MTask::ShowMembers(R__insp, R__parent);
+}
+
+namespace ROOT {
+   // Return the actual TClass for the object argument
+   TClass *MSupercutsCalcONOFF_IsA(const void *obj) {
+      return ((::MSupercutsCalcONOFF*)obj)->IsA();
+   }
+   // Wrappers around operator new
+   void *new_MSupercutsCalcONOFF(void *p) {
+      return  p ? new(p) ::MSupercutsCalcONOFF : new ::MSupercutsCalcONOFF;
+   }
+   void *newArray_MSupercutsCalcONOFF(Long_t size) {
+      return new ::MSupercutsCalcONOFF[size];
+   }
+   // Wrapper around operator delete
+   void delete_MSupercutsCalcONOFF(void *p) {
+      delete ((::MSupercutsCalcONOFF*)p);
+   }
+   void deleteArray_MSupercutsCalcONOFF(void *p) {
+      delete [] ((::MSupercutsCalcONOFF*)p);
+   }
+   void destruct_MSupercutsCalcONOFF(void *p) {
+      typedef ::MSupercutsCalcONOFF current_t;
+      ((current_t*)p)->~current_t();
+   }
+} // end of namespace ROOT for class MSupercutsCalcONOFF
+
+//______________________________________________________________________________
+void R__MHFindSignificanceONOFF_fHistOrig(TBuffer &R__b, void *R__p, int)
+{
+   TH1** fHistOrig = (TH1**)R__p;
+   if (R__b.IsReading()) {
+      R__b >> *fHistOrig;
+   } else {
+      R__b << (TObject*)*fHistOrig;
+   }
+}
+
+//______________________________________________________________________________
+void R__MHFindSignificanceONOFF_fHist(TBuffer &R__b, void *R__p, int)
+{
+   TH1** fHist = (TH1**)R__p;
+   if (R__b.IsReading()) {
+      R__b >> *fHist;
+   } else {
+      R__b << (TObject*)*fHist;
+   }
+}
+
+//______________________________________________________________________________
+void R__MHFindSignificanceONOFF_fHistOrigOFF(TBuffer &R__b, void *R__p, int)
+{
+   TH1** fHistOrigOFF = (TH1**)R__p;
+   if (R__b.IsReading()) {
+      R__b >> *fHistOrigOFF;
+   } else {
+      R__b << (TObject*)*fHistOrigOFF;
+   }
+}
+
+//______________________________________________________________________________
+void R__MHFindSignificanceONOFF_fHistOFF(TBuffer &R__b, void *R__p, int)
+{
+   TH1** fHistOFF = (TH1**)R__p;
+   if (R__b.IsReading()) {
+      R__b >> *fHistOFF;
+   } else {
+      R__b << (TObject*)*fHistOFF;
+   }
+}
+
+//______________________________________________________________________________
+void R__MHFindSignificanceONOFF_fHistOFFNormalized(TBuffer &R__b, void *R__p, int)
+{
+   TH1** fHistOFFNormalized = (TH1**)R__p;
+   if (R__b.IsReading()) {
+      R__b >> *fHistOFFNormalized;
+   } else {
+      R__b << (TObject*)*fHistOFFNormalized;
+   }
+}
+
+//______________________________________________________________________________
+void R__MHFindSignificanceONOFF_fPsFilenameString(TBuffer &R__b, void *R__p, int)
+{
+   TString &fPsFilenameString = *(TString *)R__p;
+   if (R__b.IsReading()) {
+      fPsFilenameString.Streamer(R__b);
+   } else {
+      fPsFilenameString.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MHFindSignificanceONOFF_fValues(TBuffer &R__b, void *R__p, int)
+{
+   TArrayD &fValues = *(TArrayD *)R__p;
+   if (R__b.IsReading()) {
+      fValues.Streamer(R__b);
+   } else {
+      fValues.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MHFindSignificanceONOFF_fErrors(TBuffer &R__b, void *R__p, int)
+{
+   TArrayD &fErrors = *(TArrayD *)R__p;
+   if (R__b.IsReading()) {
+      fErrors.Streamer(R__b);
+   } else {
+      fErrors.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MHFindSignificanceONOFF_fValuesOFF(TBuffer &R__b, void *R__p, int)
+{
+   TArrayD &fValuesOFF = *(TArrayD *)R__p;
+   if (R__b.IsReading()) {
+      fValuesOFF.Streamer(R__b);
+   } else {
+      fValuesOFF.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MHFindSignificanceONOFF_fErrorsOFF(TBuffer &R__b, void *R__p, int)
+{
+   TArrayD &fErrorsOFF = *(TArrayD *)R__p;
+   if (R__b.IsReading()) {
+      fErrorsOFF.Streamer(R__b);
+   } else {
+      fErrorsOFF.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MHFindSignificanceONOFF_fValuesOFFNormalized(TBuffer &R__b, void *R__p, int)
+{
+   TArrayD &fValuesOFFNormalized = *(TArrayD *)R__p;
+   if (R__b.IsReading()) {
+      fValuesOFFNormalized.Streamer(R__b);
+   } else {
+      fValuesOFFNormalized.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MHFindSignificanceONOFF_fErrorsOFFNormalized(TBuffer &R__b, void *R__p, int)
+{
+   TArrayD &fErrorsOFFNormalized = *(TArrayD *)R__p;
+   if (R__b.IsReading()) {
+      fErrorsOFFNormalized.Streamer(R__b);
+   } else {
+      fErrorsOFFNormalized.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MHFindSignificanceONOFF_fGValues(TBuffer &R__b, void *R__p, int)
+{
+   TArrayD &fGValues = *(TArrayD *)R__p;
+   if (R__b.IsReading()) {
+      fGValues.Streamer(R__b);
+   } else {
+      fGValues.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MHFindSignificanceONOFF_fGErrors(TBuffer &R__b, void *R__p, int)
+{
+   TArrayD &fGErrors = *(TArrayD *)R__p;
+   if (R__b.IsReading()) {
+      fGErrors.Streamer(R__b);
+   } else {
+      fGErrors.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void MHFindSignificanceONOFF::Streamer(TBuffer &R__b)
+{
+   // Stream an object of class MHFindSignificanceONOFF.
+
+   if (R__b.IsReading()) {
+      MHFindSignificanceONOFF::Class()->ReadBuffer(R__b, this);
+   } else {
+      MHFindSignificanceONOFF::Class()->WriteBuffer(R__b, this);
+   }
+}
+
+//______________________________________________________________________________
+void MHFindSignificanceONOFF::ShowMembers(TMemberInspector &R__insp, char *R__parent)
+{
+      // Inspect the data members of an object of class MHFindSignificanceONOFF.
+
+      TClass *R__cl = MHFindSignificanceONOFF::IsA();
+      Int_t R__ncp = strlen(R__parent);
+      if (R__ncp || R__cl || R__insp.IsA()) { }
+      R__insp.Inspect(R__cl, R__parent, "*fHistOrig", &fHistOrig);
+      R__cl->SetStreamer("*fHistOrig",R__MHFindSignificanceONOFF_fHistOrig);
+      R__insp.Inspect(R__cl, R__parent, "*fHist", &fHist);
+      R__cl->SetStreamer("*fHist",R__MHFindSignificanceONOFF_fHist);
+      R__insp.Inspect(R__cl, R__parent, "*fHistOrigOFF", &fHistOrigOFF);
+      R__cl->SetStreamer("*fHistOrigOFF",R__MHFindSignificanceONOFF_fHistOrigOFF);
+      R__insp.Inspect(R__cl, R__parent, "*fHistOFF", &fHistOFF);
+      R__cl->SetStreamer("*fHistOFF",R__MHFindSignificanceONOFF_fHistOFF);
+      R__insp.Inspect(R__cl, R__parent, "*fHistOFFNormalized", &fHistOFFNormalized);
+      R__cl->SetStreamer("*fHistOFFNormalized",R__MHFindSignificanceONOFF_fHistOFFNormalized);
+      R__insp.Inspect(R__cl, R__parent, "*fPsFilename", &fPsFilename);
+      R__insp.Inspect(R__cl, R__parent, "fPsFilenameString", &fPsFilenameString);
+      fPsFilenameString.ShowMembers(R__insp, strcat(R__parent,"fPsFilenameString.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fPsFilenameString",R__MHFindSignificanceONOFF_fPsFilenameString);
+      R__insp.Inspect(R__cl, R__parent, "fAlphamin", &fAlphamin);
+      R__insp.Inspect(R__cl, R__parent, "fAlphammm", &fAlphammm);
+      R__insp.Inspect(R__cl, R__parent, "fAlphamax", &fAlphamax);
+      R__insp.Inspect(R__cl, R__parent, "fAlphaminOFF", &fAlphaminOFF);
+      R__insp.Inspect(R__cl, R__parent, "fAlphamaxOFF", &fAlphamaxOFF);
+      R__insp.Inspect(R__cl, R__parent, "fAlphami", &fAlphami);
+      R__insp.Inspect(R__cl, R__parent, "fAlphamm", &fAlphamm);
+      R__insp.Inspect(R__cl, R__parent, "fAlphama", &fAlphama);
+      R__insp.Inspect(R__cl, R__parent, "fAlphasig", &fAlphasig);
+      R__insp.Inspect(R__cl, R__parent, "fAlphasi", &fAlphasi);
+      R__insp.Inspect(R__cl, R__parent, "fAlphasiOFF", &fAlphasiOFF);
+      R__insp.Inspect(R__cl, R__parent, "fAlphalow", &fAlphalow);
+      R__insp.Inspect(R__cl, R__parent, "fAlphalo", &fAlphalo);
+      R__insp.Inspect(R__cl, R__parent, "fAlphahig", &fAlphahig);
+      R__insp.Inspect(R__cl, R__parent, "fAlphahi", &fAlphahi);
+      R__insp.Inspect(R__cl, R__parent, "fNon", &fNon);
+      R__insp.Inspect(R__cl, R__parent, "fNbg", &fNbg);
+      R__insp.Inspect(R__cl, R__parent, "fNex", &fNex);
+      R__insp.Inspect(R__cl, R__parent, "fdNon", &fdNon);
+      R__insp.Inspect(R__cl, R__parent, "fdNbg", &fdNbg);
+      R__insp.Inspect(R__cl, R__parent, "fdNex", &fdNex);
+      R__insp.Inspect(R__cl, R__parent, "fNbgtot", &fNbgtot);
+      R__insp.Inspect(R__cl, R__parent, "fNbgtotFitted", &fNbgtotFitted);
+      R__insp.Inspect(R__cl, R__parent, "fdNbgtotFitted", &fdNbgtotFitted);
+      R__insp.Inspect(R__cl, R__parent, "fNexONOFF", &fNexONOFF);
+      R__insp.Inspect(R__cl, R__parent, "fNexONOFFFitted", &fNexONOFFFitted);
+      R__insp.Inspect(R__cl, R__parent, "fdNexONOFF", &fdNexONOFF);
+      R__insp.Inspect(R__cl, R__parent, "fdNexONOFFFitted", &fdNexONOFFFitted);
+      R__insp.Inspect(R__cl, R__parent, "fNoffTot", &fNoffTot);
+      R__insp.Inspect(R__cl, R__parent, "fNoffSig", &fNoffSig);
+      R__insp.Inspect(R__cl, R__parent, "fNoffBg", &fNoffBg);
+      R__insp.Inspect(R__cl, R__parent, "fdNoffTot", &fdNoffTot);
+      R__insp.Inspect(R__cl, R__parent, "fdNoffSig", &fdNoffSig);
+      R__insp.Inspect(R__cl, R__parent, "fdNoffBg", &fdNoffBg);
+      R__insp.Inspect(R__cl, R__parent, "fNoffTotFitted", &fNoffTotFitted);
+      R__insp.Inspect(R__cl, R__parent, "fNoffSigFitted", &fNoffSigFitted);
+      R__insp.Inspect(R__cl, R__parent, "fNoffBgFitted", &fNoffBgFitted);
+      R__insp.Inspect(R__cl, R__parent, "fdNoffTotFitted", &fdNoffTotFitted);
+      R__insp.Inspect(R__cl, R__parent, "fdNoffSigFitted", &fdNoffSigFitted);
+      R__insp.Inspect(R__cl, R__parent, "fdNoffBgFitted", &fdNoffBgFitted);
+      R__insp.Inspect(R__cl, R__parent, "fUseFittedQuantities", &fUseFittedQuantities);
+      R__insp.Inspect(R__cl, R__parent, "fPrintResultsOntoAlphaPlot", &fPrintResultsOntoAlphaPlot);
+      R__insp.Inspect(R__cl, R__parent, "fNoff", &fNoff);
+      R__insp.Inspect(R__cl, R__parent, "fGamma", &fGamma);
+      R__insp.Inspect(R__cl, R__parent, "fNormFactor", &fNormFactor);
+      R__insp.Inspect(R__cl, R__parent, "fSigLiMa", &fSigLiMa);
+      R__insp.Inspect(R__cl, R__parent, "fSigLiMa2", &fSigLiMa2);
+      R__insp.Inspect(R__cl, R__parent, "fSigLiMa3", &fSigLiMa3);
+      R__insp.Inspect(R__cl, R__parent, "fDraw", &fDraw);
+      R__insp.Inspect(R__cl, R__parent, "fSavePlots", &fSavePlots);
+      R__insp.Inspect(R__cl, R__parent, "fFitGauss", &fFitGauss);
+      R__insp.Inspect(R__cl, R__parent, "fRebin", &fRebin);
+      R__insp.Inspect(R__cl, R__parent, "fReduceDegree", &fReduceDegree);
+      R__insp.Inspect(R__cl, R__parent, "fConstantBackg", &fConstantBackg);
+      R__insp.Inspect(R__cl, R__parent, "*fCanvas", &fCanvas);
+      R__insp.Inspect(R__cl, R__parent, "fNexGauss", &fNexGauss);
+      R__insp.Inspect(R__cl, R__parent, "fdNexGauss", &fdNexGauss);
+      R__insp.Inspect(R__cl, R__parent, "fSigmaGauss", &fSigmaGauss);
+      R__insp.Inspect(R__cl, R__parent, "fdSigmaGauss", &fdSigmaGauss);
+      R__insp.Inspect(R__cl, R__parent, "*fPoly", &fPoly);
+      R__insp.Inspect(R__cl, R__parent, "fFitBad", &fFitBad);
+      R__insp.Inspect(R__cl, R__parent, "fDegree", &fDegree);
+      R__insp.Inspect(R__cl, R__parent, "fNdf", &fNdf);
+      R__insp.Inspect(R__cl, R__parent, "fChisq", &fChisq);
+      R__insp.Inspect(R__cl, R__parent, "fProb", &fProb);
+      R__insp.Inspect(R__cl, R__parent, "fValues", &fValues);
+      fValues.ShowMembers(R__insp, strcat(R__parent,"fValues.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fValues",R__MHFindSignificanceONOFF_fValues);
+      R__insp.Inspect(R__cl, R__parent, "fErrors", &fErrors);
+      fErrors.ShowMembers(R__insp, strcat(R__parent,"fErrors.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fErrors",R__MHFindSignificanceONOFF_fErrors);
+      R__insp.Inspect(R__cl, R__parent, "fEmat[6][6]", fEmat);
+      R__insp.Inspect(R__cl, R__parent, "fEma[6][6]", fEma);
+      R__insp.Inspect(R__cl, R__parent, "fCorr[6][6]", fCorr);
+      R__insp.Inspect(R__cl, R__parent, "fMbins", &fMbins);
+      R__insp.Inspect(R__cl, R__parent, "fMlow", &fMlow);
+      R__insp.Inspect(R__cl, R__parent, "fNzero", &fNzero);
+      R__insp.Inspect(R__cl, R__parent, "fIstat", &fIstat);
+      R__insp.Inspect(R__cl, R__parent, "*fPolyOFF", &fPolyOFF);
+      R__insp.Inspect(R__cl, R__parent, "*fPolyOFFNormalized", &fPolyOFFNormalized);
+      R__insp.Inspect(R__cl, R__parent, "fFitBadOFF", &fFitBadOFF);
+      R__insp.Inspect(R__cl, R__parent, "fDegreeOFF", &fDegreeOFF);
+      R__insp.Inspect(R__cl, R__parent, "fNdfOFF", &fNdfOFF);
+      R__insp.Inspect(R__cl, R__parent, "fChisqOFF", &fChisqOFF);
+      R__insp.Inspect(R__cl, R__parent, "fProbOFF", &fProbOFF);
+      R__insp.Inspect(R__cl, R__parent, "fValuesOFF", &fValuesOFF);
+      fValuesOFF.ShowMembers(R__insp, strcat(R__parent,"fValuesOFF.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fValuesOFF",R__MHFindSignificanceONOFF_fValuesOFF);
+      R__insp.Inspect(R__cl, R__parent, "fErrorsOFF", &fErrorsOFF);
+      fErrorsOFF.ShowMembers(R__insp, strcat(R__parent,"fErrorsOFF.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fErrorsOFF",R__MHFindSignificanceONOFF_fErrorsOFF);
+      R__insp.Inspect(R__cl, R__parent, "fValuesOFFNormalized", &fValuesOFFNormalized);
+      fValuesOFFNormalized.ShowMembers(R__insp, strcat(R__parent,"fValuesOFFNormalized.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fValuesOFFNormalized",R__MHFindSignificanceONOFF_fValuesOFFNormalized);
+      R__insp.Inspect(R__cl, R__parent, "fErrorsOFFNormalized", &fErrorsOFFNormalized);
+      fErrorsOFFNormalized.ShowMembers(R__insp, strcat(R__parent,"fErrorsOFFNormalized.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fErrorsOFFNormalized",R__MHFindSignificanceONOFF_fErrorsOFFNormalized);
+      R__insp.Inspect(R__cl, R__parent, "fEmatOFF[6][6]", fEmatOFF);
+      R__insp.Inspect(R__cl, R__parent, "fEmaOFF[6][6]", fEmaOFF);
+      R__insp.Inspect(R__cl, R__parent, "fCorrOFF[6][6]", fCorrOFF);
+      R__insp.Inspect(R__cl, R__parent, "fMbinsOFF", &fMbinsOFF);
+      R__insp.Inspect(R__cl, R__parent, "fMlowOFF", &fMlowOFF);
+      R__insp.Inspect(R__cl, R__parent, "fNzeroOFF", &fNzeroOFF);
+      R__insp.Inspect(R__cl, R__parent, "fIstatOFF", &fIstatOFF);
+      R__insp.Inspect(R__cl, R__parent, "*fGPoly", &fGPoly);
+      R__insp.Inspect(R__cl, R__parent, "*fGBackg", &fGBackg);
+      R__insp.Inspect(R__cl, R__parent, "fGFitBad", &fGFitBad);
+      R__insp.Inspect(R__cl, R__parent, "fGDegree", &fGDegree);
+      R__insp.Inspect(R__cl, R__parent, "fGNdf", &fGNdf);
+      R__insp.Inspect(R__cl, R__parent, "fGChisq", &fGChisq);
+      R__insp.Inspect(R__cl, R__parent, "fGProb", &fGProb);
+      R__insp.Inspect(R__cl, R__parent, "fGValues", &fGValues);
+      fGValues.ShowMembers(R__insp, strcat(R__parent,"fGValues.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fGValues",R__MHFindSignificanceONOFF_fGValues);
+      R__insp.Inspect(R__cl, R__parent, "fGErrors", &fGErrors);
+      fGErrors.ShowMembers(R__insp, strcat(R__parent,"fGErrors.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fGErrors",R__MHFindSignificanceONOFF_fGErrors);
+      R__insp.Inspect(R__cl, R__parent, "fGEmat[9][9]", fGEmat);
+      R__insp.Inspect(R__cl, R__parent, "fGEma[9][9]", fGEma);
+      R__insp.Inspect(R__cl, R__parent, "fGCorr[9][9]", fGCorr);
+      R__insp.Inspect(R__cl, R__parent, "fGMbins", &fGMbins);
+      R__insp.Inspect(R__cl, R__parent, "fGNzero", &fGNzero);
+      R__insp.Inspect(R__cl, R__parent, "fGIstat", &fGIstat);
+      MH::ShowMembers(R__insp, R__parent);
+}
+
+namespace ROOT {
+   // Return the actual TClass for the object argument
+   TClass *MHFindSignificanceONOFF_IsA(const void *obj) {
+      return ((::MHFindSignificanceONOFF*)obj)->IsA();
+   }
+   // Wrappers around operator new
+   void *new_MHFindSignificanceONOFF(void *p) {
+      return  p ? new(p) ::MHFindSignificanceONOFF : new ::MHFindSignificanceONOFF;
+   }
+   void *newArray_MHFindSignificanceONOFF(Long_t size) {
+      return new ::MHFindSignificanceONOFF[size];
+   }
+   // Wrapper around operator delete
+   void delete_MHFindSignificanceONOFF(void *p) {
+      delete ((::MHFindSignificanceONOFF*)p);
+   }
+   void deleteArray_MHFindSignificanceONOFF(void *p) {
+      delete [] ((::MHFindSignificanceONOFF*)p);
+   }
+   void destruct_MHFindSignificanceONOFF(void *p) {
+      typedef ::MHFindSignificanceONOFF current_t;
+      ((current_t*)p)->~current_t();
+   }
+} // end of namespace ROOT for class MHFindSignificanceONOFF
+
+//______________________________________________________________________________
+void R__MTSupercutsApplied_fRootTree(TBuffer &R__b, void *R__p, int)
+{
+   TTree** fRootTree = (TTree**)R__p;
+   if (R__b.IsReading()) {
+      R__b >> *fRootTree;
+   } else {
+      R__b << (TObject*)*fRootTree;
+   }
+}
+
+//______________________________________________________________________________
+void R__MTSupercutsApplied_fCutParamBranchName(TBuffer &R__b, void *R__p, int)
+{
+   TString &fCutParamBranchName = *(TString *)R__p;
+   if (R__b.IsReading()) {
+      fCutParamBranchName.Streamer(R__b);
+   } else {
+      fCutParamBranchName.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MTSupercutsApplied_fShowerParamBranchName(TBuffer &R__b, void *R__p, int)
+{
+   TString &fShowerParamBranchName = *(TString *)R__p;
+   if (R__b.IsReading()) {
+      fShowerParamBranchName.Streamer(R__b);
+   } else {
+      fShowerParamBranchName.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MTSupercutsApplied_fCutParametersNamesTypes(TBuffer &R__b, void *R__p, int)
+{
+   TString &fCutParametersNamesTypes = *(TString *)R__p;
+   if (R__b.IsReading()) {
+      fCutParametersNamesTypes.Streamer(R__b);
+   } else {
+      fCutParametersNamesTypes.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MTSupercutsApplied_fShowerParametersNamesTypes(TBuffer &R__b, void *R__p, int)
+{
+   TString &fShowerParametersNamesTypes = *(TString *)R__p;
+   if (R__b.IsReading()) {
+      fShowerParametersNamesTypes.Streamer(R__b);
+   } else {
+      fShowerParametersNamesTypes.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void MTSupercutsApplied::Streamer(TBuffer &R__b)
+{
+   // Stream an object of class MTSupercutsApplied.
+
+   if (R__b.IsReading()) {
+      MTSupercutsApplied::Class()->ReadBuffer(R__b, this);
+   } else {
+      MTSupercutsApplied::Class()->WriteBuffer(R__b, this);
+   }
+}
+
+//______________________________________________________________________________
+void MTSupercutsApplied::ShowMembers(TMemberInspector &R__insp, char *R__parent)
+{
+      // Inspect the data members of an object of class MTSupercutsApplied.
+
+      TClass *R__cl = MTSupercutsApplied::IsA();
+      Int_t R__ncp = strlen(R__parent);
+      if (R__ncp || R__cl || R__insp.IsA()) { }
+      R__insp.Inspect(R__cl, R__parent, "fNCutParameters", &fNCutParameters);
+      R__insp.Inspect(R__cl, R__parent, "fNShowerParameters", &fNShowerParameters);
+      R__insp.Inspect(R__cl, R__parent, "*fCutParameters", &fCutParameters);
+      R__insp.Inspect(R__cl, R__parent, "*fShowerParameters", &fShowerParameters);
+      R__insp.Inspect(R__cl, R__parent, "*fRootTree", &fRootTree);
+      R__cl->SetStreamer("*fRootTree",R__MTSupercutsApplied_fRootTree);
+      R__insp.Inspect(R__cl, R__parent, "fBranchesCreated", &fBranchesCreated);
+      R__insp.Inspect(R__cl, R__parent, "fCutParamBranchName", &fCutParamBranchName);
+      fCutParamBranchName.ShowMembers(R__insp, strcat(R__parent,"fCutParamBranchName.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fCutParamBranchName",R__MTSupercutsApplied_fCutParamBranchName);
+      R__insp.Inspect(R__cl, R__parent, "fShowerParamBranchName", &fShowerParamBranchName);
+      fShowerParamBranchName.ShowMembers(R__insp, strcat(R__parent,"fShowerParamBranchName.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fShowerParamBranchName",R__MTSupercutsApplied_fShowerParamBranchName);
+      R__insp.Inspect(R__cl, R__parent, "fCutParametersNamesTypes", &fCutParametersNamesTypes);
+      fCutParametersNamesTypes.ShowMembers(R__insp, strcat(R__parent,"fCutParametersNamesTypes.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fCutParametersNamesTypes",R__MTSupercutsApplied_fCutParametersNamesTypes);
+      R__insp.Inspect(R__cl, R__parent, "fShowerParametersNamesTypes", &fShowerParametersNamesTypes);
+      fShowerParametersNamesTypes.ShowMembers(R__insp, strcat(R__parent,"fShowerParametersNamesTypes.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fShowerParametersNamesTypes",R__MTSupercutsApplied_fShowerParametersNamesTypes);
+      MParContainer::ShowMembers(R__insp, R__parent);
+}
+
+namespace ROOT {
+   // Return the actual TClass for the object argument
+   TClass *MTSupercutsApplied_IsA(const void *obj) {
+      return ((::MTSupercutsApplied*)obj)->IsA();
+   }
+   // Wrappers around operator new
+   void *new_MTSupercutsApplied(void *p) {
+      return  p ? new(p) ::MTSupercutsApplied : new ::MTSupercutsApplied;
+   }
+   void *newArray_MTSupercutsApplied(Long_t size) {
+      return new ::MTSupercutsApplied[size];
+   }
+   // Wrapper around operator delete
+   void delete_MTSupercutsApplied(void *p) {
+      delete ((::MTSupercutsApplied*)p);
+   }
+   void deleteArray_MTSupercutsApplied(void *p) {
+      delete [] ((::MTSupercutsApplied*)p);
+   }
+   void destruct_MTSupercutsApplied(void *p) {
+      typedef ::MTSupercutsApplied current_t;
+      ((current_t*)p)->~current_t();
+   }
+} // end of namespace ROOT for class MTSupercutsApplied
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFF_fFilenameTrain(TBuffer &R__b, void *R__p, int)
+{
+   TString &fFilenameTrain = *(TString *)R__p;
+   if (R__b.IsReading()) {
+      fFilenameTrain.Streamer(R__b);
+   } else {
+      fFilenameTrain.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFF_fFilenameTest(TBuffer &R__b, void *R__p, int)
+{
+   TString &fFilenameTest = *(TString *)R__p;
+   if (R__b.IsReading()) {
+      fFilenameTest.Streamer(R__b);
+   } else {
+      fFilenameTest.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFF_fThetaRangeString(TBuffer &R__b, void *R__p, int)
+{
+   TString &fThetaRangeString = *(TString *)R__p;
+   if (R__b.IsReading()) {
+      fThetaRangeString.Streamer(R__b);
+   } else {
+      fThetaRangeString.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFF_fFilenameParam(TBuffer &R__b, void *R__p, int)
+{
+   TString &fFilenameParam = *(TString *)R__p;
+   if (R__b.IsReading()) {
+      fFilenameParam.Streamer(R__b);
+   } else {
+      fFilenameParam.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFF_fHadronnessName(TBuffer &R__b, void *R__p, int)
+{
+   TString &fHadronnessName = *(TString *)R__p;
+   if (R__b.IsReading()) {
+      fHadronnessName.Streamer(R__b);
+   } else {
+      fHadronnessName.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFF_fHadronnessNameOFF(TBuffer &R__b, void *R__p, int)
+{
+   TString &fHadronnessNameOFF = *(TString *)R__p;
+   if (R__b.IsReading()) {
+      fHadronnessNameOFF.Streamer(R__b);
+   } else {
+      fHadronnessNameOFF.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFF_fTrainONSupercutsAppliedName(TBuffer &R__b, void *R__p, int)
+{
+   TString &fTrainONSupercutsAppliedName = *(TString *)R__p;
+   if (R__b.IsReading()) {
+      fTrainONSupercutsAppliedName.Streamer(R__b);
+   } else {
+      fTrainONSupercutsAppliedName.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFF_fTrainOFFSupercutsAppliedName(TBuffer &R__b, void *R__p, int)
+{
+   TString &fTrainOFFSupercutsAppliedName = *(TString *)R__p;
+   if (R__b.IsReading()) {
+      fTrainOFFSupercutsAppliedName.Streamer(R__b);
+   } else {
+      fTrainOFFSupercutsAppliedName.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFF_fTestONSupercutsAppliedName(TBuffer &R__b, void *R__p, int)
+{
+   TString &fTestONSupercutsAppliedName = *(TString *)R__p;
+   if (R__b.IsReading()) {
+      fTestONSupercutsAppliedName.Streamer(R__b);
+   } else {
+      fTestONSupercutsAppliedName.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFF_fTestOFFSupercutsAppliedName(TBuffer &R__b, void *R__p, int)
+{
+   TString &fTestOFFSupercutsAppliedName = *(TString *)R__p;
+   if (R__b.IsReading()) {
+      fTestOFFSupercutsAppliedName.Streamer(R__b);
+   } else {
+      fTestOFFSupercutsAppliedName.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFF_fPsFilenameString(TBuffer &R__b, void *R__p, int)
+{
+   TString &fPsFilenameString = *(TString *)R__p;
+   if (R__b.IsReading()) {
+      fPsFilenameString.Streamer(R__b);
+   } else {
+      fPsFilenameString.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFF_fAlphaDistributionsRootFilename(TBuffer &R__b, void *R__p, int)
+{
+   TString &fAlphaDistributionsRootFilename = *(TString *)R__p;
+   if (R__b.IsReading()) {
+      fAlphaDistributionsRootFilename.Streamer(R__b);
+   } else {
+      fAlphaDistributionsRootFilename.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFF_fMatrixFilter(TBuffer &R__b, void *R__p, int)
+{
+   MFilter** fMatrixFilter = (MFilter**)R__p;
+   if (R__b.IsReading()) {
+      R__b >> *fMatrixFilter;
+   } else {
+      R__b << (TObject*)*fMatrixFilter;
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFF_fVinit(TBuffer &R__b, void *R__p, int)
+{
+   TArrayD &fVinit = *(TArrayD *)R__p;
+   if (R__b.IsReading()) {
+      fVinit.Streamer(R__b);
+   } else {
+      fVinit.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFF_fStep(TBuffer &R__b, void *R__p, int)
+{
+   TArrayD &fStep = *(TArrayD *)R__p;
+   if (R__b.IsReading()) {
+      fStep.Streamer(R__b);
+   } else {
+      fStep.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFF_fLimlo(TBuffer &R__b, void *R__p, int)
+{
+   TArrayD &fLimlo = *(TArrayD *)R__p;
+   if (R__b.IsReading()) {
+      fLimlo.Streamer(R__b);
+   } else {
+      fLimlo.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFF_fLimup(TBuffer &R__b, void *R__p, int)
+{
+   TArrayD &fLimup = *(TArrayD *)R__p;
+   if (R__b.IsReading()) {
+      fLimup.Streamer(R__b);
+   } else {
+      fLimup.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFF_fFix(TBuffer &R__b, void *R__p, int)
+{
+   TArrayI &fFix = *(TArrayI *)R__p;
+   if (R__b.IsReading()) {
+      fFix.Streamer(R__b);
+   } else {
+      fFix.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFF_fMethod(TBuffer &R__b, void *R__p, int)
+{
+   TString &fMethod = *(TString *)R__p;
+   if (R__b.IsReading()) {
+      fMethod.Streamer(R__b);
+   } else {
+      fMethod.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void MFindSupercutsONOFF::Streamer(TBuffer &R__b)
+{
+   // Stream an object of class MFindSupercutsONOFF.
+
+   if (R__b.IsReading()) {
+      MFindSupercutsONOFF::Class()->ReadBuffer(R__b, this);
+   } else {
+      MFindSupercutsONOFF::Class()->WriteBuffer(R__b, this);
+   }
+}
+
+//______________________________________________________________________________
+void MFindSupercutsONOFF::ShowMembers(TMemberInspector &R__insp, char *R__parent)
+{
+      // Inspect the data members of an object of class MFindSupercutsONOFF.
+
+      TClass *R__cl = MFindSupercutsONOFF::IsA();
+      Int_t R__ncp = strlen(R__parent);
+      if (R__ncp || R__cl || R__insp.IsA()) { }
+      R__insp.Inspect(R__cl, R__parent, "fSizeCutLow", &fSizeCutLow);
+      R__insp.Inspect(R__cl, R__parent, "fSizeCutUp", &fSizeCutUp);
+      R__insp.Inspect(R__cl, R__parent, "fDistCutLow", &fDistCutLow);
+      R__insp.Inspect(R__cl, R__parent, "fDistCutUp", &fDistCutUp);
+      R__insp.Inspect(R__cl, R__parent, "fLengthCutLow", &fLengthCutLow);
+      R__insp.Inspect(R__cl, R__parent, "fLengthCutUp", &fLengthCutUp);
+      R__insp.Inspect(R__cl, R__parent, "fWidthCutLow", &fWidthCutLow);
+      R__insp.Inspect(R__cl, R__parent, "fWidthCutUp", &fWidthCutUp);
+      R__insp.Inspect(R__cl, R__parent, "fFilenameTrain", &fFilenameTrain);
+      fFilenameTrain.ShowMembers(R__insp, strcat(R__parent,"fFilenameTrain.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fFilenameTrain",R__MFindSupercutsONOFF_fFilenameTrain);
+      R__insp.Inspect(R__cl, R__parent, "fFilenameTest", &fFilenameTest);
+      fFilenameTest.ShowMembers(R__insp, strcat(R__parent,"fFilenameTest.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fFilenameTest",R__MFindSupercutsONOFF_fFilenameTest);
+      R__insp.Inspect(R__cl, R__parent, "fHowManyTrain", &fHowManyTrain);
+      R__insp.Inspect(R__cl, R__parent, "fHowManyTest", &fHowManyTest);
+      R__insp.Inspect(R__cl, R__parent, "fHowManyTrainOFF", &fHowManyTrainOFF);
+      R__insp.Inspect(R__cl, R__parent, "fHowManyTestOFF", &fHowManyTestOFF);
+      R__insp.Inspect(R__cl, R__parent, "fAlphaSig", &fAlphaSig);
+      R__insp.Inspect(R__cl, R__parent, "fAlphaBkgMin", &fAlphaBkgMin);
+      R__insp.Inspect(R__cl, R__parent, "fAlphaBkgMax", &fAlphaBkgMax);
+      R__insp.Inspect(R__cl, R__parent, "fThetaMin", &fThetaMin);
+      R__insp.Inspect(R__cl, R__parent, "fThetaMax", &fThetaMax);
+      R__insp.Inspect(R__cl, R__parent, "fThetaRangeString", &fThetaRangeString);
+      fThetaRangeString.ShowMembers(R__insp, strcat(R__parent,"fThetaRangeString.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fThetaRangeString",R__MFindSupercutsONOFF_fThetaRangeString);
+      R__insp.Inspect(R__cl, R__parent, "fNAlphaBins", &fNAlphaBins);
+      R__insp.Inspect(R__cl, R__parent, "fAlphaBinLow", &fAlphaBinLow);
+      R__insp.Inspect(R__cl, R__parent, "fAlphaBinUp", &fAlphaBinUp);
+      R__insp.Inspect(R__cl, R__parent, "fUseOrigDistribution", &fUseOrigDistribution);
+      R__insp.Inspect(R__cl, R__parent, "fNormFactorTrain", &fNormFactorTrain);
+      R__insp.Inspect(R__cl, R__parent, "fNormFactorTest", &fNormFactorTest);
+      R__insp.Inspect(R__cl, R__parent, "fSigmaLiMaTrain", &fSigmaLiMaTrain);
+      R__insp.Inspect(R__cl, R__parent, "fSigmaLiMaTest", &fSigmaLiMaTest);
+      R__insp.Inspect(R__cl, R__parent, "fNexTrain", &fNexTrain);
+      R__insp.Inspect(R__cl, R__parent, "fNexTest", &fNexTest);
+      R__insp.Inspect(R__cl, R__parent, "fGammaEfficiency", &fGammaEfficiency);
+      R__insp.Inspect(R__cl, R__parent, "fTuneNormFactor", &fTuneNormFactor);
+      R__insp.Inspect(R__cl, R__parent, "fNormFactorFromAlphaBkg", &fNormFactorFromAlphaBkg);
+      R__insp.Inspect(R__cl, R__parent, "fUseFittedQuantities", &fUseFittedQuantities);
+      R__insp.Inspect(R__cl, R__parent, "fSkipOptimization", &fSkipOptimization);
+      R__insp.Inspect(R__cl, R__parent, "fSetLimitsToSomeMinuitParams", &fSetLimitsToSomeMinuitParams);
+      R__insp.Inspect(R__cl, R__parent, "fMinuitDistUPUpperLimit", &fMinuitDistUPUpperLimit);
+      R__insp.Inspect(R__cl, R__parent, "fMinuitDistUPLowerLimit", &fMinuitDistUPLowerLimit);
+      R__insp.Inspect(R__cl, R__parent, "fMinuitLengthUPUpperLimit", &fMinuitLengthUPUpperLimit);
+      R__insp.Inspect(R__cl, R__parent, "fMinuitLengthUPLowerLimit", &fMinuitLengthUPLowerLimit);
+      R__insp.Inspect(R__cl, R__parent, "fMinuitWidthUPUpperLimit", &fMinuitWidthUPUpperLimit);
+      R__insp.Inspect(R__cl, R__parent, "fMinuitWidthUPLowerLimit", &fMinuitWidthUPLowerLimit);
+      R__insp.Inspect(R__cl, R__parent, "fMinuitLeakage1UPUpperLimit", &fMinuitLeakage1UPUpperLimit);
+      R__insp.Inspect(R__cl, R__parent, "fMinuitLeakage1UPLowerLimit", &fMinuitLeakage1UPLowerLimit);
+      R__insp.Inspect(R__cl, R__parent, "fMinuitDistLOWUpperLimit", &fMinuitDistLOWUpperLimit);
+      R__insp.Inspect(R__cl, R__parent, "fMinuitDistLOWLowerLimit", &fMinuitDistLOWLowerLimit);
+      R__insp.Inspect(R__cl, R__parent, "fMinuitLengthLOWUpperLimit", &fMinuitLengthLOWUpperLimit);
+      R__insp.Inspect(R__cl, R__parent, "fMinuitLengthLOWLowerLimit", &fMinuitLengthLOWLowerLimit);
+      R__insp.Inspect(R__cl, R__parent, "fMinuitWidthLOWUpperLimit", &fMinuitWidthLOWUpperLimit);
+      R__insp.Inspect(R__cl, R__parent, "fMinuitWidthLOWLowerLimit", &fMinuitWidthLOWLowerLimit);
+      R__insp.Inspect(R__cl, R__parent, "fNotUseTheta", &fNotUseTheta);
+      R__insp.Inspect(R__cl, R__parent, "fUseDist", &fUseDist);
+      R__insp.Inspect(R__cl, R__parent, "fUseStaticCuts", &fUseStaticCuts);
+      R__insp.Inspect(R__cl, R__parent, "fUseInitialSCParams", &fUseInitialSCParams);
+      R__insp.Inspect(R__cl, R__parent, "fFilenameParam", &fFilenameParam);
+      fFilenameParam.ShowMembers(R__insp, strcat(R__parent,"fFilenameParam.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fFilenameParam",R__MFindSupercutsONOFF_fFilenameParam);
+      R__insp.Inspect(R__cl, R__parent, "fHadronnessName", &fHadronnessName);
+      fHadronnessName.ShowMembers(R__insp, strcat(R__parent,"fHadronnessName.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fHadronnessName",R__MFindSupercutsONOFF_fHadronnessName);
+      R__insp.Inspect(R__cl, R__parent, "fHadronnessNameOFF", &fHadronnessNameOFF);
+      fHadronnessNameOFF.ShowMembers(R__insp, strcat(R__parent,"fHadronnessNameOFF.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fHadronnessNameOFF",R__MFindSupercutsONOFF_fHadronnessNameOFF);
+      R__insp.Inspect(R__cl, R__parent, "fTrainONSupercutsAppliedName", &fTrainONSupercutsAppliedName);
+      fTrainONSupercutsAppliedName.ShowMembers(R__insp, strcat(R__parent,"fTrainONSupercutsAppliedName.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fTrainONSupercutsAppliedName",R__MFindSupercutsONOFF_fTrainONSupercutsAppliedName);
+      R__insp.Inspect(R__cl, R__parent, "fTrainOFFSupercutsAppliedName", &fTrainOFFSupercutsAppliedName);
+      fTrainOFFSupercutsAppliedName.ShowMembers(R__insp, strcat(R__parent,"fTrainOFFSupercutsAppliedName.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fTrainOFFSupercutsAppliedName",R__MFindSupercutsONOFF_fTrainOFFSupercutsAppliedName);
+      R__insp.Inspect(R__cl, R__parent, "fTestONSupercutsAppliedName", &fTestONSupercutsAppliedName);
+      fTestONSupercutsAppliedName.ShowMembers(R__insp, strcat(R__parent,"fTestONSupercutsAppliedName.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fTestONSupercutsAppliedName",R__MFindSupercutsONOFF_fTestONSupercutsAppliedName);
+      R__insp.Inspect(R__cl, R__parent, "fTestOFFSupercutsAppliedName", &fTestOFFSupercutsAppliedName);
+      fTestOFFSupercutsAppliedName.ShowMembers(R__insp, strcat(R__parent,"fTestOFFSupercutsAppliedName.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fTestOFFSupercutsAppliedName",R__MFindSupercutsONOFF_fTestOFFSupercutsAppliedName);
+      R__insp.Inspect(R__cl, R__parent, "*fPsFilename", &fPsFilename);
+      R__insp.Inspect(R__cl, R__parent, "*fPsFilename2", &fPsFilename2);
+      R__insp.Inspect(R__cl, R__parent, "fPsFilenameString", &fPsFilenameString);
+      fPsFilenameString.ShowMembers(R__insp, strcat(R__parent,"fPsFilenameString.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fPsFilenameString",R__MFindSupercutsONOFF_fPsFilenameString);
+      R__insp.Inspect(R__cl, R__parent, "fAlphaDistributionsRootFilename", &fAlphaDistributionsRootFilename);
+      fAlphaDistributionsRootFilename.ShowMembers(R__insp, strcat(R__parent,"fAlphaDistributionsRootFilename.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fAlphaDistributionsRootFilename",R__MFindSupercutsONOFF_fAlphaDistributionsRootFilename);
+      R__insp.Inspect(R__cl, R__parent, "*fCalcHadTrain", &fCalcHadTrain);
+      R__insp.Inspect(R__cl, R__parent, "*fCalcHadTest", &fCalcHadTest);
+      R__insp.Inspect(R__cl, R__parent, "*fCalcHadTrainOFF", &fCalcHadTrainOFF);
+      R__insp.Inspect(R__cl, R__parent, "*fCalcHadTestOFF", &fCalcHadTestOFF);
+      R__insp.Inspect(R__cl, R__parent, "*fMatrixTrain", &fMatrixTrain);
+      R__insp.Inspect(R__cl, R__parent, "*fMatrixTest", &fMatrixTest);
+      R__insp.Inspect(R__cl, R__parent, "*fMatrixTrainOFF", &fMatrixTrainOFF);
+      R__insp.Inspect(R__cl, R__parent, "*fMatrixTestOFF", &fMatrixTestOFF);
+      R__insp.Inspect(R__cl, R__parent, "*fCam", &fCam);
+      R__insp.Inspect(R__cl, R__parent, "*fObjectFit", &fObjectFit);
+      R__insp.Inspect(R__cl, R__parent, "*fMatrixFilter", &fMatrixFilter);
+      R__cl->SetStreamer("*fMatrixFilter",R__MFindSupercutsONOFF_fMatrixFilter);
+      R__insp.Inspect(R__cl, R__parent, "fVinit", &fVinit);
+      fVinit.ShowMembers(R__insp, strcat(R__parent,"fVinit.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fVinit",R__MFindSupercutsONOFF_fVinit);
+      R__insp.Inspect(R__cl, R__parent, "fStep", &fStep);
+      fStep.ShowMembers(R__insp, strcat(R__parent,"fStep.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fStep",R__MFindSupercutsONOFF_fStep);
+      R__insp.Inspect(R__cl, R__parent, "fLimlo", &fLimlo);
+      fLimlo.ShowMembers(R__insp, strcat(R__parent,"fLimlo.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fLimlo",R__MFindSupercutsONOFF_fLimlo);
+      R__insp.Inspect(R__cl, R__parent, "fLimup", &fLimup);
+      fLimup.ShowMembers(R__insp, strcat(R__parent,"fLimup.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fLimup",R__MFindSupercutsONOFF_fLimup);
+      R__insp.Inspect(R__cl, R__parent, "fFix", &fFix);
+      fFix.ShowMembers(R__insp, strcat(R__parent,"fFix.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fFix",R__MFindSupercutsONOFF_fFix);
+      R__insp.Inspect(R__cl, R__parent, "fNpar", &fNpar);
+      R__insp.Inspect(R__cl, R__parent, "fMethod", &fMethod);
+      fMethod.ShowMembers(R__insp, strcat(R__parent,"fMethod.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fMethod",R__MFindSupercutsONOFF_fMethod);
+      R__insp.Inspect(R__cl, R__parent, "fMin", &fMin);
+      R__insp.Inspect(R__cl, R__parent, "fEdm", &fEdm);
+      R__insp.Inspect(R__cl, R__parent, "fErrdef", &fErrdef);
+      R__insp.Inspect(R__cl, R__parent, "fNpari", &fNpari);
+      R__insp.Inspect(R__cl, R__parent, "fNparx", &fNparx);
+      R__insp.Inspect(R__cl, R__parent, "fIstat", &fIstat);
+      R__insp.Inspect(R__cl, R__parent, "fErrMinimize", &fErrMinimize);
+      MParContainer::ShowMembers(R__insp, R__parent);
+}
+
+namespace ROOT {
+   // Return the actual TClass for the object argument
+   TClass *MFindSupercutsONOFF_IsA(const void *obj) {
+      return ((::MFindSupercutsONOFF*)obj)->IsA();
+   }
+   // Wrappers around operator new
+   void *new_MFindSupercutsONOFF(void *p) {
+      return  p ? new(p) ::MFindSupercutsONOFF : new ::MFindSupercutsONOFF;
+   }
+   void *newArray_MFindSupercutsONOFF(Long_t size) {
+      return new ::MFindSupercutsONOFF[size];
+   }
+   // Wrapper around operator delete
+   void delete_MFindSupercutsONOFF(void *p) {
+      delete ((::MFindSupercutsONOFF*)p);
+   }
+   void deleteArray_MFindSupercutsONOFF(void *p) {
+      delete [] ((::MFindSupercutsONOFF*)p);
+   }
+   void destruct_MFindSupercutsONOFF(void *p) {
+      typedef ::MFindSupercutsONOFF current_t;
+      ((current_t*)p)->~current_t();
+   }
+} // end of namespace ROOT for class MFindSupercutsONOFF
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFFThetaLoop_fDataONRootFilename(TBuffer &R__b, void *R__p, int)
+{
+   TString &fDataONRootFilename = *(TString *)R__p;
+   if (R__b.IsReading()) {
+      fDataONRootFilename.Streamer(R__b);
+   } else {
+      fDataONRootFilename.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFFThetaLoop_fDataOFFRootFilename(TBuffer &R__b, void *R__p, int)
+{
+   TString &fDataOFFRootFilename = *(TString *)R__p;
+   if (R__b.IsReading()) {
+      fDataOFFRootFilename.Streamer(R__b);
+   } else {
+      fDataOFFRootFilename.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFFThetaLoop_fPathForFiles(TBuffer &R__b, void *R__p, int)
+{
+   TString &fPathForFiles = *(TString *)R__p;
+   if (R__b.IsReading()) {
+      fPathForFiles.Streamer(R__b);
+   } else {
+      fPathForFiles.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFFThetaLoop_fOptSCParamFilenameVector(TBuffer &R__b, void *R__p, int)
+{
+   TString** fOptSCParamFilenameVector = (TString**)R__p;
+   if (R__b.IsReading()) {
+      R__b >> *fOptSCParamFilenameVector;
+   } else {
+      R__b << *fOptSCParamFilenameVector;
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFFThetaLoop_fTrainMatrixONFilenameVector(TBuffer &R__b, void *R__p, int)
+{
+   TString** fTrainMatrixONFilenameVector = (TString**)R__p;
+   if (R__b.IsReading()) {
+      R__b >> *fTrainMatrixONFilenameVector;
+   } else {
+      R__b << *fTrainMatrixONFilenameVector;
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFFThetaLoop_fTestMatrixONFilenameVector(TBuffer &R__b, void *R__p, int)
+{
+   TString** fTestMatrixONFilenameVector = (TString**)R__p;
+   if (R__b.IsReading()) {
+      R__b >> *fTestMatrixONFilenameVector;
+   } else {
+      R__b << *fTestMatrixONFilenameVector;
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFFThetaLoop_fTrainMatrixOFFFilenameVector(TBuffer &R__b, void *R__p, int)
+{
+   TString** fTrainMatrixOFFFilenameVector = (TString**)R__p;
+   if (R__b.IsReading()) {
+      R__b >> *fTrainMatrixOFFFilenameVector;
+   } else {
+      R__b << *fTrainMatrixOFFFilenameVector;
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFFThetaLoop_fTestMatrixOFFFilenameVector(TBuffer &R__b, void *R__p, int)
+{
+   TString** fTestMatrixOFFFilenameVector = (TString**)R__p;
+   if (R__b.IsReading()) {
+      R__b >> *fTestMatrixOFFFilenameVector;
+   } else {
+      R__b << *fTestMatrixOFFFilenameVector;
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFFThetaLoop_fCosThetaRangeVector(TBuffer &R__b, void *R__p, int)
+{
+   TArrayD &fCosThetaRangeVector = *(TArrayD *)R__p;
+   if (R__b.IsReading()) {
+      fCosThetaRangeVector.Streamer(R__b);
+   } else {
+      fCosThetaRangeVector.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFFThetaLoop_fThetaRangeStringVector(TBuffer &R__b, void *R__p, int)
+{
+   TString** fThetaRangeStringVector = (TString**)R__p;
+   if (R__b.IsReading()) {
+      R__b >> *fThetaRangeStringVector;
+   } else {
+      R__b << *fThetaRangeStringVector;
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFFThetaLoop_fCosThetaBinCenterVector(TBuffer &R__b, void *R__p, int)
+{
+   TArrayD &fCosThetaBinCenterVector = *(TArrayD *)R__p;
+   if (R__b.IsReading()) {
+      fCosThetaBinCenterVector.Streamer(R__b);
+   } else {
+      fCosThetaBinCenterVector.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFFThetaLoop_fSuccessfulThetaBinsHist(TBuffer &R__b, void *R__p, int)
+{
+   TH1F** fSuccessfulThetaBinsHist = (TH1F**)R__p;
+   if (R__b.IsReading()) {
+      R__b >> *fSuccessfulThetaBinsHist;
+   } else {
+      R__b << (TObject*)*fSuccessfulThetaBinsHist;
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFFThetaLoop_fNormFactorTrainHist(TBuffer &R__b, void *R__p, int)
+{
+   TH1F** fNormFactorTrainHist = (TH1F**)R__p;
+   if (R__b.IsReading()) {
+      R__b >> *fNormFactorTrainHist;
+   } else {
+      R__b << (TObject*)*fNormFactorTrainHist;
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFFThetaLoop_fNormFactorTestHist(TBuffer &R__b, void *R__p, int)
+{
+   TH1F** fNormFactorTestHist = (TH1F**)R__p;
+   if (R__b.IsReading()) {
+      R__b >> *fNormFactorTestHist;
+   } else {
+      R__b << (TObject*)*fNormFactorTestHist;
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFFThetaLoop_fSigmaLiMaTrainHist(TBuffer &R__b, void *R__p, int)
+{
+   TH1F** fSigmaLiMaTrainHist = (TH1F**)R__p;
+   if (R__b.IsReading()) {
+      R__b >> *fSigmaLiMaTrainHist;
+   } else {
+      R__b << (TObject*)*fSigmaLiMaTrainHist;
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFFThetaLoop_fSigmaLiMaTestHist(TBuffer &R__b, void *R__p, int)
+{
+   TH1F** fSigmaLiMaTestHist = (TH1F**)R__p;
+   if (R__b.IsReading()) {
+      R__b >> *fSigmaLiMaTestHist;
+   } else {
+      R__b << (TObject*)*fSigmaLiMaTestHist;
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFFThetaLoop_fNexTrainHist(TBuffer &R__b, void *R__p, int)
+{
+   TH1F** fNexTrainHist = (TH1F**)R__p;
+   if (R__b.IsReading()) {
+      R__b >> *fNexTrainHist;
+   } else {
+      R__b << (TObject*)*fNexTrainHist;
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFFThetaLoop_fNexTestHist(TBuffer &R__b, void *R__p, int)
+{
+   TH1F** fNexTestHist = (TH1F**)R__p;
+   if (R__b.IsReading()) {
+      R__b >> *fNexTestHist;
+   } else {
+      R__b << (TObject*)*fNexTestHist;
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFFThetaLoop_fNEvtsInTrainMatrixONHist(TBuffer &R__b, void *R__p, int)
+{
+   TH1F** fNEvtsInTrainMatrixONHist = (TH1F**)R__p;
+   if (R__b.IsReading()) {
+      R__b >> *fNEvtsInTrainMatrixONHist;
+   } else {
+      R__b << (TObject*)*fNEvtsInTrainMatrixONHist;
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFFThetaLoop_fNEvtsInTestMatrixONHist(TBuffer &R__b, void *R__p, int)
+{
+   TH1F** fNEvtsInTestMatrixONHist = (TH1F**)R__p;
+   if (R__b.IsReading()) {
+      R__b >> *fNEvtsInTestMatrixONHist;
+   } else {
+      R__b << (TObject*)*fNEvtsInTestMatrixONHist;
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFFThetaLoop_fNEvtsInTrainMatrixOFFHist(TBuffer &R__b, void *R__p, int)
+{
+   TH1F** fNEvtsInTrainMatrixOFFHist = (TH1F**)R__p;
+   if (R__b.IsReading()) {
+      R__b >> *fNEvtsInTrainMatrixOFFHist;
+   } else {
+      R__b << (TObject*)*fNEvtsInTrainMatrixOFFHist;
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFFThetaLoop_fNEvtsInTestMatrixOFFHist(TBuffer &R__b, void *R__p, int)
+{
+   TH1F** fNEvtsInTestMatrixOFFHist = (TH1F**)R__p;
+   if (R__b.IsReading()) {
+      R__b >> *fNEvtsInTestMatrixOFFHist;
+   } else {
+      R__b << (TObject*)*fNEvtsInTestMatrixOFFHist;
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFFThetaLoop_fHadronnessName(TBuffer &R__b, void *R__p, int)
+{
+   TString &fHadronnessName = *(TString *)R__p;
+   if (R__b.IsReading()) {
+      fHadronnessName.Streamer(R__b);
+   } else {
+      fHadronnessName.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFFThetaLoop_fHadronnessNameOFF(TBuffer &R__b, void *R__p, int)
+{
+   TString &fHadronnessNameOFF = *(TString *)R__p;
+   if (R__b.IsReading()) {
+      fHadronnessNameOFF.Streamer(R__b);
+   } else {
+      fHadronnessNameOFF.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFFThetaLoop_fInitSCPar(TBuffer &R__b, void *R__p, int)
+{
+   TArrayD &fInitSCPar = *(TArrayD *)R__p;
+   if (R__b.IsReading()) {
+      fInitSCPar.Streamer(R__b);
+   } else {
+      fInitSCPar.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFFThetaLoop_fInitSCParSteps(TBuffer &R__b, void *R__p, int)
+{
+   TArrayD &fInitSCParSteps = *(TArrayD *)R__p;
+   if (R__b.IsReading()) {
+      fInitSCParSteps.Streamer(R__b);
+   } else {
+      fInitSCParSteps.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void R__MFindSupercutsONOFFThetaLoop_fAlphaDistributionsRootFilename(TBuffer &R__b, void *R__p, int)
+{
+   TString &fAlphaDistributionsRootFilename = *(TString *)R__p;
+   if (R__b.IsReading()) {
+      fAlphaDistributionsRootFilename.Streamer(R__b);
+   } else {
+      fAlphaDistributionsRootFilename.Streamer(R__b);
+   }
+}
+
+//______________________________________________________________________________
+void MFindSupercutsONOFFThetaLoop::Streamer(TBuffer &R__b)
+{
+   // Stream an object of class MFindSupercutsONOFFThetaLoop.
+
+   if (R__b.IsReading()) {
+      MFindSupercutsONOFFThetaLoop::Class()->ReadBuffer(R__b, this);
+   } else {
+      MFindSupercutsONOFFThetaLoop::Class()->WriteBuffer(R__b, this);
+   }
+}
+
+//______________________________________________________________________________
+void MFindSupercutsONOFFThetaLoop::ShowMembers(TMemberInspector &R__insp, char *R__parent)
+{
+      // Inspect the data members of an object of class MFindSupercutsONOFFThetaLoop.
+
+      TClass *R__cl = MFindSupercutsONOFFThetaLoop::IsA();
+      Int_t R__ncp = strlen(R__parent);
+      if (R__ncp || R__cl || R__insp.IsA()) { }
+      R__insp.Inspect(R__cl, R__parent, "fDataONRootFilename", &fDataONRootFilename);
+      fDataONRootFilename.ShowMembers(R__insp, strcat(R__parent,"fDataONRootFilename.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fDataONRootFilename",R__MFindSupercutsONOFFThetaLoop_fDataONRootFilename);
+      R__insp.Inspect(R__cl, R__parent, "fDataOFFRootFilename", &fDataOFFRootFilename);
+      fDataOFFRootFilename.ShowMembers(R__insp, strcat(R__parent,"fDataOFFRootFilename.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fDataOFFRootFilename",R__MFindSupercutsONOFFThetaLoop_fDataOFFRootFilename);
+      R__insp.Inspect(R__cl, R__parent, "fPathForFiles", &fPathForFiles);
+      fPathForFiles.ShowMembers(R__insp, strcat(R__parent,"fPathForFiles.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fPathForFiles",R__MFindSupercutsONOFFThetaLoop_fPathForFiles);
+      R__insp.Inspect(R__cl, R__parent, "*fOptSCParamFilenameVector", &fOptSCParamFilenameVector);
+      R__cl->SetStreamer("*fOptSCParamFilenameVector",R__MFindSupercutsONOFFThetaLoop_fOptSCParamFilenameVector);
+      R__insp.Inspect(R__cl, R__parent, "*fTrainMatrixONFilenameVector", &fTrainMatrixONFilenameVector);
+      R__cl->SetStreamer("*fTrainMatrixONFilenameVector",R__MFindSupercutsONOFFThetaLoop_fTrainMatrixONFilenameVector);
+      R__insp.Inspect(R__cl, R__parent, "*fTestMatrixONFilenameVector", &fTestMatrixONFilenameVector);
+      R__cl->SetStreamer("*fTestMatrixONFilenameVector",R__MFindSupercutsONOFFThetaLoop_fTestMatrixONFilenameVector);
+      R__insp.Inspect(R__cl, R__parent, "*fTrainMatrixOFFFilenameVector", &fTrainMatrixOFFFilenameVector);
+      R__cl->SetStreamer("*fTrainMatrixOFFFilenameVector",R__MFindSupercutsONOFFThetaLoop_fTrainMatrixOFFFilenameVector);
+      R__insp.Inspect(R__cl, R__parent, "*fTestMatrixOFFFilenameVector", &fTestMatrixOFFFilenameVector);
+      R__cl->SetStreamer("*fTestMatrixOFFFilenameVector",R__MFindSupercutsONOFFThetaLoop_fTestMatrixOFFFilenameVector);
+      R__insp.Inspect(R__cl, R__parent, "fAlphaSig", &fAlphaSig);
+      R__insp.Inspect(R__cl, R__parent, "fAlphaBkgMin", &fAlphaBkgMin);
+      R__insp.Inspect(R__cl, R__parent, "fAlphaBkgMax", &fAlphaBkgMax);
+      R__insp.Inspect(R__cl, R__parent, "fSizeCutLow", &fSizeCutLow);
+      R__insp.Inspect(R__cl, R__parent, "fSizeCutUp", &fSizeCutUp);
+      R__insp.Inspect(R__cl, R__parent, "fNAlphaBins", &fNAlphaBins);
+      R__insp.Inspect(R__cl, R__parent, "fAlphaBinLow", &fAlphaBinLow);
+      R__insp.Inspect(R__cl, R__parent, "fAlphaBinUp", &fAlphaBinUp);
+      R__insp.Inspect(R__cl, R__parent, "fUseFittedQuantities", &fUseFittedQuantities);
+      R__insp.Inspect(R__cl, R__parent, "fPolyGaussFitAlphaSigma", &fPolyGaussFitAlphaSigma);
+      R__insp.Inspect(R__cl, R__parent, "fWhichFractionTrain", &fWhichFractionTrain);
+      R__insp.Inspect(R__cl, R__parent, "fWhichFractionTest", &fWhichFractionTest);
+      R__insp.Inspect(R__cl, R__parent, "fWhichFractionTrainOFF", &fWhichFractionTrainOFF);
+      R__insp.Inspect(R__cl, R__parent, "fWhichFractionTestOFF", &fWhichFractionTestOFF);
+      R__insp.Inspect(R__cl, R__parent, "fThetaMin", &fThetaMin);
+      R__insp.Inspect(R__cl, R__parent, "fThetaMax", &fThetaMax);
+      R__insp.Inspect(R__cl, R__parent, "fCosThetaRangeVector", &fCosThetaRangeVector);
+      fCosThetaRangeVector.ShowMembers(R__insp, strcat(R__parent,"fCosThetaRangeVector.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fCosThetaRangeVector",R__MFindSupercutsONOFFThetaLoop_fCosThetaRangeVector);
+      R__insp.Inspect(R__cl, R__parent, "*fThetaRangeStringVector", &fThetaRangeStringVector);
+      R__cl->SetStreamer("*fThetaRangeStringVector",R__MFindSupercutsONOFFThetaLoop_fThetaRangeStringVector);
+      R__insp.Inspect(R__cl, R__parent, "fCosThetaBinCenterVector", &fCosThetaBinCenterVector);
+      fCosThetaBinCenterVector.ShowMembers(R__insp, strcat(R__parent,"fCosThetaBinCenterVector.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fCosThetaBinCenterVector",R__MFindSupercutsONOFFThetaLoop_fCosThetaBinCenterVector);
+      R__insp.Inspect(R__cl, R__parent, "fActualCosThetaBinCenter", &fActualCosThetaBinCenter);
+      R__insp.Inspect(R__cl, R__parent, "fOverallNexTrain", &fOverallNexTrain);
+      R__insp.Inspect(R__cl, R__parent, "fOverallNexTest", &fOverallNexTest);
+      R__insp.Inspect(R__cl, R__parent, "fOverallSigmaLiMaTrain", &fOverallSigmaLiMaTrain);
+      R__insp.Inspect(R__cl, R__parent, "fOverallSigmaLiMaTest", &fOverallSigmaLiMaTest);
+      R__insp.Inspect(R__cl, R__parent, "*fSuccessfulThetaBinsHist", &fSuccessfulThetaBinsHist);
+      R__cl->SetStreamer("*fSuccessfulThetaBinsHist",R__MFindSupercutsONOFFThetaLoop_fSuccessfulThetaBinsHist);
+      R__insp.Inspect(R__cl, R__parent, "*fNormFactorTrainHist", &fNormFactorTrainHist);
+      R__cl->SetStreamer("*fNormFactorTrainHist",R__MFindSupercutsONOFFThetaLoop_fNormFactorTrainHist);
+      R__insp.Inspect(R__cl, R__parent, "*fNormFactorTestHist", &fNormFactorTestHist);
+      R__cl->SetStreamer("*fNormFactorTestHist",R__MFindSupercutsONOFFThetaLoop_fNormFactorTestHist);
+      R__insp.Inspect(R__cl, R__parent, "*fSigmaLiMaTrainHist", &fSigmaLiMaTrainHist);
+      R__cl->SetStreamer("*fSigmaLiMaTrainHist",R__MFindSupercutsONOFFThetaLoop_fSigmaLiMaTrainHist);
+      R__insp.Inspect(R__cl, R__parent, "*fSigmaLiMaTestHist", &fSigmaLiMaTestHist);
+      R__cl->SetStreamer("*fSigmaLiMaTestHist",R__MFindSupercutsONOFFThetaLoop_fSigmaLiMaTestHist);
+      R__insp.Inspect(R__cl, R__parent, "*fNexTrainHist", &fNexTrainHist);
+      R__cl->SetStreamer("*fNexTrainHist",R__MFindSupercutsONOFFThetaLoop_fNexTrainHist);
+      R__insp.Inspect(R__cl, R__parent, "*fNexTestHist", &fNexTestHist);
+      R__cl->SetStreamer("*fNexTestHist",R__MFindSupercutsONOFFThetaLoop_fNexTestHist);
+      R__insp.Inspect(R__cl, R__parent, "*fNEvtsInTrainMatrixONHist", &fNEvtsInTrainMatrixONHist);
+      R__cl->SetStreamer("*fNEvtsInTrainMatrixONHist",R__MFindSupercutsONOFFThetaLoop_fNEvtsInTrainMatrixONHist);
+      R__insp.Inspect(R__cl, R__parent, "*fNEvtsInTestMatrixONHist", &fNEvtsInTestMatrixONHist);
+      R__cl->SetStreamer("*fNEvtsInTestMatrixONHist",R__MFindSupercutsONOFFThetaLoop_fNEvtsInTestMatrixONHist);
+      R__insp.Inspect(R__cl, R__parent, "*fNEvtsInTrainMatrixOFFHist", &fNEvtsInTrainMatrixOFFHist);
+      R__cl->SetStreamer("*fNEvtsInTrainMatrixOFFHist",R__MFindSupercutsONOFFThetaLoop_fNEvtsInTrainMatrixOFFHist);
+      R__insp.Inspect(R__cl, R__parent, "*fNEvtsInTestMatrixOFFHist", &fNEvtsInTestMatrixOFFHist);
+      R__cl->SetStreamer("*fNEvtsInTestMatrixOFFHist",R__MFindSupercutsONOFFThetaLoop_fNEvtsInTestMatrixOFFHist);
+      R__insp.Inspect(R__cl, R__parent, "fSkipOptimization", &fSkipOptimization);
+      R__insp.Inspect(R__cl, R__parent, "fUseInitialSCParams", &fUseInitialSCParams);
+      R__insp.Inspect(R__cl, R__parent, "fGammaEfficiency", &fGammaEfficiency);
+      R__insp.Inspect(R__cl, R__parent, "fTuneNormFactor", &fTuneNormFactor);
+      R__insp.Inspect(R__cl, R__parent, "fNormFactorFromAlphaBkg", &fNormFactorFromAlphaBkg);
+      R__insp.Inspect(R__cl, R__parent, "fNotUseTheta", &fNotUseTheta);
+      R__insp.Inspect(R__cl, R__parent, "fUseStaticCuts", &fUseStaticCuts);
+      R__insp.Inspect(R__cl, R__parent, "fHadronnessName", &fHadronnessName);
+      fHadronnessName.ShowMembers(R__insp, strcat(R__parent,"fHadronnessName.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fHadronnessName",R__MFindSupercutsONOFFThetaLoop_fHadronnessName);
+      R__insp.Inspect(R__cl, R__parent, "fHadronnessNameOFF", &fHadronnessNameOFF);
+      fHadronnessNameOFF.ShowMembers(R__insp, strcat(R__parent,"fHadronnessNameOFF.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fHadronnessNameOFF",R__MFindSupercutsONOFFThetaLoop_fHadronnessNameOFF);
+      R__insp.Inspect(R__cl, R__parent, "fInitSCPar", &fInitSCPar);
+      fInitSCPar.ShowMembers(R__insp, strcat(R__parent,"fInitSCPar.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fInitSCPar",R__MFindSupercutsONOFFThetaLoop_fInitSCPar);
+      R__insp.Inspect(R__cl, R__parent, "fInitSCParSteps", &fInitSCParSteps);
+      fInitSCParSteps.ShowMembers(R__insp, strcat(R__parent,"fInitSCParSteps.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fInitSCParSteps",R__MFindSupercutsONOFFThetaLoop_fInitSCParSteps);
+      R__insp.Inspect(R__cl, R__parent, "*fPsFilename", &fPsFilename);
+      R__insp.Inspect(R__cl, R__parent, "fAlphaDistributionsRootFilename", &fAlphaDistributionsRootFilename);
+      fAlphaDistributionsRootFilename.ShowMembers(R__insp, strcat(R__parent,"fAlphaDistributionsRootFilename.")); R__parent[R__ncp] = 0;
+      R__cl->SetStreamer("fAlphaDistributionsRootFilename",R__MFindSupercutsONOFFThetaLoop_fAlphaDistributionsRootFilename);
+      R__insp.Inspect(R__cl, R__parent, "fReadMatricesFromFile", &fReadMatricesFromFile);
+      R__insp.Inspect(R__cl, R__parent, "fOptimizeParameters", &fOptimizeParameters);
+      R__insp.Inspect(R__cl, R__parent, "fTestParameters", &fTestParameters);
+      MParContainer::ShowMembers(R__insp, R__parent);
+}
+
+namespace ROOT {
+   // Return the actual TClass for the object argument
+   TClass *MFindSupercutsONOFFThetaLoop_IsA(const void *obj) {
+      return ((::MFindSupercutsONOFFThetaLoop*)obj)->IsA();
+   }
+   // Wrappers around operator new
+   void *new_MFindSupercutsONOFFThetaLoop(void *p) {
+      return  p ? new(p) ::MFindSupercutsONOFFThetaLoop : new ::MFindSupercutsONOFFThetaLoop;
+   }
+   void *newArray_MFindSupercutsONOFFThetaLoop(Long_t size) {
+      return new ::MFindSupercutsONOFFThetaLoop[size];
+   }
+   // Wrapper around operator delete
+   void delete_MFindSupercutsONOFFThetaLoop(void *p) {
+      delete ((::MFindSupercutsONOFFThetaLoop*)p);
+   }
+   void deleteArray_MFindSupercutsONOFFThetaLoop(void *p) {
+      delete [] ((::MFindSupercutsONOFFThetaLoop*)p);
+   }
+   void destruct_MFindSupercutsONOFFThetaLoop(void *p) {
+      typedef ::MFindSupercutsONOFFThetaLoop current_t;
+      ((current_t*)p)->~current_t();
+   }
+} // end of namespace ROOT for class MFindSupercutsONOFFThetaLoop
+
+/********************************************************
+* SuperCutsONOFFCint.cc
+********************************************************/
+
+#ifdef G__MEMTEST
+#undef malloc
+#undef free
+#endif
+
+extern "C" void G__cpp_reset_tagtableSuperCutsONOFFCint();
+
+extern "C" void G__set_cpp_environmentSuperCutsONOFFCint() {
+  G__add_compiledheader("TROOT.h");
+  G__add_compiledheader("TMemberInspector.h");
+  G__add_compiledheader("MFRandomSplit.h");
+  G__add_compiledheader("MSupercutsCalcONOFF.h");
+  G__add_compiledheader("MHFindSignificanceONOFF.h");
+  G__add_compiledheader("MTSupercutsApplied.h");
+  G__add_compiledheader("MFindSupercutsONOFF.h");
+  G__add_compiledheader("MFindSupercutsONOFFThetaLoop.h");
+  G__add_compiledheader("SuperCutsONOFFIncl.h");
+  G__cpp_reset_tagtableSuperCutsONOFFCint();
+}
+class G__SuperCutsONOFFCintdOcc_tag {};
+
+void* operator new(size_t size,G__SuperCutsONOFFCintdOcc_tag* p) {
+  if(p && G__PVOID!=G__getgvp()) return((void*)p);
+#ifndef G__ROOT
+  return(malloc(size));
+#else
+  return(::operator new(size));
+#endif
+}
+
+/* dummy, for exception */
+#ifdef G__EH_DUMMY_DELETE
+void operator delete(void *p,G__SuperCutsONOFFCintdOcc_tag* x) {
+  if((long)p==G__getgvp() && G__PVOID!=G__getgvp()) return;
+#ifndef G__ROOT
+  free(p);
+#else
+  ::operator delete(p);
+#endif
+}
+#endif
+
+static void G__operator_delete(void *p) {
+  if((long)p==G__getgvp() && G__PVOID!=G__getgvp()) return;
+#ifndef G__ROOT
+  free(p);
+#else
+  ::operator delete(p);
+#endif
+}
+
+void G__DELDMY_SuperCutsONOFFCintdOcc() { G__operator_delete(0); }
+
+extern "C" int G__cpp_dllrevSuperCutsONOFFCint() { return(30051515); }
+
+/*********************************************************
+* Member function Interface Method
+*********************************************************/
+
+/* MFRandomSplit */
+static int G__SuperCutsONOFFCint_124_3_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   MFRandomSplit *p=NULL;
+   switch(libp->paran) {
+   case 3:
+      p = new MFRandomSplit(
+(Double_t)G__double(libp->para[0]),(const char*)G__int(libp->para[1])
+,(const char*)G__int(libp->para[2]));
+      break;
+   case 2:
+      p = new MFRandomSplit((Double_t)G__double(libp->para[0]),(const char*)G__int(libp->para[1]));
+      break;
+   case 1:
+      p = new MFRandomSplit((Double_t)G__double(libp->para[0]));
+      break;
+   }
+      result7->obj.i = (long)p;
+      result7->ref = (long)p;
+      result7->type = 'u';
+      result7->tagnum = G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFRandomSplit);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_124_4_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((const MFRandomSplit*)(G__getstructoffset()))->IsExpressionTrue());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_124_5_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,85,(long)MFRandomSplit::Class());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_124_6_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,67,(long)MFRandomSplit::Class_Name());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_124_7_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,115,(long)MFRandomSplit::Class_Version());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_124_8_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      MFRandomSplit::Dictionary();
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_124_9_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,85,(long)((const MFRandomSplit*)(G__getstructoffset()))->IsA());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_124_0_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFRandomSplit*)(G__getstructoffset()))->ShowMembers(*(TMemberInspector*)libp->para[0].ref,(char*)G__int(libp->para[1]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_124_1_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFRandomSplit*)(G__getstructoffset()))->Streamer(*(TBuffer*)libp->para[0].ref);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_124_2_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFRandomSplit*)(G__getstructoffset()))->StreamerNVirtual(*(TBuffer*)libp->para[0].ref);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_124_3_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,67,(long)MFRandomSplit::DeclFileName());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_124_4_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,105,(long)MFRandomSplit::ImplFileLine());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_124_5_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,67,(long)MFRandomSplit::ImplFileName());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_124_6_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,105,(long)MFRandomSplit::DeclFileLine());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+// automatic copy constructor
+static int G__SuperCutsONOFFCint_124_7_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash)
+{
+   MFRandomSplit *p;
+   p=new MFRandomSplit(*(MFRandomSplit*)G__int(libp->para[0]));
+   result7->obj.i = (long)p;
+   result7->ref = (long)p;
+   result7->type = 'u';
+   result7->tagnum = G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFRandomSplit);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+// automatic destructor
+typedef MFRandomSplit G__TMFRandomSplit;
+static int G__SuperCutsONOFFCint_124_8_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   if(0==G__getstructoffset()) return(1);
+   if(G__getaryconstruct())
+     if(G__PVOID==G__getgvp())
+       delete[] (MFRandomSplit *)(G__getstructoffset());
+     else
+       for(int i=G__getaryconstruct()-1;i>=0;i--)
+         delete (MFRandomSplit *)((G__getstructoffset())+sizeof(MFRandomSplit)*i);
+   else  delete (MFRandomSplit *)(G__getstructoffset());
+      G__setnull(result7);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+
+/* MTSupercutsApplied */
+static int G__SuperCutsONOFFCint_136_0_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   MTSupercutsApplied *p=NULL;
+   switch(libp->paran) {
+   case 2:
+      p = new MTSupercutsApplied((const char*)G__int(libp->para[0]),(const char*)G__int(libp->para[1]));
+      break;
+   case 1:
+      p = new MTSupercutsApplied((const char*)G__int(libp->para[0]));
+      break;
+   case 0:
+   if(G__getaryconstruct()) p=new MTSupercutsApplied[G__getaryconstruct()];
+   else                    p=new MTSupercutsApplied;
+      break;
+   }
+      result7->obj.i = (long)p;
+      result7->ref = (long)p;
+      result7->type = 'u';
+      result7->tagnum = G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MTSupercutsApplied);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_136_2_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MTSupercutsApplied*)(G__getstructoffset()))->CreateTreeBranches());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_136_3_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MTSupercutsApplied*)(G__getstructoffset()))->FillTreeBranches(*((TArrayD*)G__int(libp->para[0])),*((TArrayD*)G__int(libp->para[1]))));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_136_4_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,85,(long)((MTSupercutsApplied*)(G__getstructoffset()))->GetTreePointer());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_136_5_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,85,(long)MTSupercutsApplied::Class());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_136_6_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,67,(long)MTSupercutsApplied::Class_Name());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_136_7_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,115,(long)MTSupercutsApplied::Class_Version());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_136_8_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      MTSupercutsApplied::Dictionary();
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_136_9_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,85,(long)((const MTSupercutsApplied*)(G__getstructoffset()))->IsA());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_136_0_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MTSupercutsApplied*)(G__getstructoffset()))->ShowMembers(*(TMemberInspector*)libp->para[0].ref,(char*)G__int(libp->para[1]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_136_1_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MTSupercutsApplied*)(G__getstructoffset()))->Streamer(*(TBuffer*)libp->para[0].ref);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_136_2_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MTSupercutsApplied*)(G__getstructoffset()))->StreamerNVirtual(*(TBuffer*)libp->para[0].ref);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_136_3_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,67,(long)MTSupercutsApplied::DeclFileName());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_136_4_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,105,(long)MTSupercutsApplied::ImplFileLine());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_136_5_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,67,(long)MTSupercutsApplied::ImplFileName());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_136_6_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,105,(long)MTSupercutsApplied::DeclFileLine());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+// automatic copy constructor
+static int G__SuperCutsONOFFCint_136_7_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash)
+{
+   MTSupercutsApplied *p;
+   p=new MTSupercutsApplied(*(MTSupercutsApplied*)G__int(libp->para[0]));
+   result7->obj.i = (long)p;
+   result7->ref = (long)p;
+   result7->type = 'u';
+   result7->tagnum = G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MTSupercutsApplied);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+// automatic destructor
+typedef MTSupercutsApplied G__TMTSupercutsApplied;
+static int G__SuperCutsONOFFCint_136_8_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   if(0==G__getstructoffset()) return(1);
+   if(G__getaryconstruct())
+     if(G__PVOID==G__getgvp())
+       delete[] (MTSupercutsApplied *)(G__getstructoffset());
+     else
+       for(int i=G__getaryconstruct()-1;i>=0;i--)
+         delete (MTSupercutsApplied *)((G__getstructoffset())+sizeof(MTSupercutsApplied)*i);
+   else  delete (MTSupercutsApplied *)(G__getstructoffset());
+      G__setnull(result7);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+
+/* MSupercutsCalcONOFF */
+static int G__SuperCutsONOFFCint_137_4_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   MSupercutsCalcONOFF *p=NULL;
+   switch(libp->paran) {
+   case 4:
+      p = new MSupercutsCalcONOFF(
+(const char*)G__int(libp->para[0]),(const char*)G__int(libp->para[1])
+,(const char*)G__int(libp->para[2]),(const char*)G__int(libp->para[3]));
+      break;
+   case 3:
+      p = new MSupercutsCalcONOFF(
+(const char*)G__int(libp->para[0]),(const char*)G__int(libp->para[1])
+,(const char*)G__int(libp->para[2]));
+      break;
+   case 2:
+      p = new MSupercutsCalcONOFF((const char*)G__int(libp->para[0]),(const char*)G__int(libp->para[1]));
+      break;
+   case 1:
+      p = new MSupercutsCalcONOFF((const char*)G__int(libp->para[0]));
+      break;
+   case 0:
+   if(G__getaryconstruct()) p=new MSupercutsCalcONOFF[G__getaryconstruct()];
+   else                    p=new MSupercutsCalcONOFF;
+      break;
+   }
+      result7->obj.i = (long)p;
+      result7->ref = (long)p;
+      result7->type = 'u';
+      result7->tagnum = G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MSupercutsCalcONOFF);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_137_5_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MSupercutsCalcONOFF*)(G__getstructoffset()))->SetHadronnessName(*((const TString*)G__int(libp->para[0])));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_137_6_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      {
+const         TString *pobj,xobj=((const MSupercutsCalcONOFF*)(G__getstructoffset()))->GetHadronnessName();
+        pobj=new TString(xobj);
+        result7->obj.i=(long)((void*)pobj); result7->ref=result7->obj.i;
+        G__store_tempobject(*result7);
+      }
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_137_7_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MSupercutsCalcONOFF*)(G__getstructoffset()))->SetSupercutsAppliedName(*((const TString*)G__int(libp->para[0])));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_137_8_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      {
+const         TString *pobj,xobj=((const MSupercutsCalcONOFF*)(G__getstructoffset()))->GetSupercutsAppliedName();
+        pobj=new TString(xobj);
+        result7->obj.i=(long)((void*)pobj); result7->ref=result7->obj.i;
+        G__store_tempobject(*result7);
+      }
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_137_9_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MSupercutsCalcONOFF*)(G__getstructoffset()))->SetStoreAppliedSupercuts((Bool_t)G__int(libp->para[0]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_137_0_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MSupercutsCalcONOFF*)(G__getstructoffset()))->GetStoreAppliedSupercuts());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_137_1_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MSupercutsCalcONOFF*)(G__getstructoffset()))->SetVariableNotUseTheta((Bool_t)G__int(libp->para[0]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_137_2_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MSupercutsCalcONOFF*)(G__getstructoffset()))->GetVariableNotUseTheta());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_137_3_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MSupercutsCalcONOFF*)(G__getstructoffset()))->SetVariableUseStaticCuts((Bool_t)G__int(libp->para[0]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_137_4_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MSupercutsCalcONOFF*)(G__getstructoffset()))->GetVariableUseStaticCuts());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_137_5_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MSupercutsCalcONOFF*)(G__getstructoffset()))->SetHillasDistLengthWidthUpperLowerLimits((Double_t)G__double(libp->para[0]),(Double_t)G__double(libp->para[1])
+,(Double_t)G__double(libp->para[2]),(Double_t)G__double(libp->para[3])
+,(Double_t)G__double(libp->para[4]),(Double_t)G__double(libp->para[5]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_137_6_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MSupercutsCalcONOFF*)(G__getstructoffset()))->InitMapping((MHMatrix*)G__int(libp->para[0]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_137_7_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MSupercutsCalcONOFF*)(G__getstructoffset()))->StopMapping();
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_137_8_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,85,(long)MSupercutsCalcONOFF::Class());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_137_9_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,67,(long)MSupercutsCalcONOFF::Class_Name());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_137_0_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,115,(long)MSupercutsCalcONOFF::Class_Version());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_137_1_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      MSupercutsCalcONOFF::Dictionary();
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_137_2_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,85,(long)((const MSupercutsCalcONOFF*)(G__getstructoffset()))->IsA());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_137_3_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MSupercutsCalcONOFF*)(G__getstructoffset()))->ShowMembers(*(TMemberInspector*)libp->para[0].ref,(char*)G__int(libp->para[1]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_137_4_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MSupercutsCalcONOFF*)(G__getstructoffset()))->Streamer(*(TBuffer*)libp->para[0].ref);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_137_5_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MSupercutsCalcONOFF*)(G__getstructoffset()))->StreamerNVirtual(*(TBuffer*)libp->para[0].ref);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_137_6_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,67,(long)MSupercutsCalcONOFF::DeclFileName());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_137_7_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,105,(long)MSupercutsCalcONOFF::ImplFileLine());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_137_8_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,67,(long)MSupercutsCalcONOFF::ImplFileName());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_137_9_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,105,(long)MSupercutsCalcONOFF::DeclFileLine());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+// automatic copy constructor
+static int G__SuperCutsONOFFCint_137_0_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash)
+{
+   MSupercutsCalcONOFF *p;
+   p=new MSupercutsCalcONOFF(*(MSupercutsCalcONOFF*)G__int(libp->para[0]));
+   result7->obj.i = (long)p;
+   result7->ref = (long)p;
+   result7->type = 'u';
+   result7->tagnum = G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MSupercutsCalcONOFF);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+// automatic destructor
+typedef MSupercutsCalcONOFF G__TMSupercutsCalcONOFF;
+static int G__SuperCutsONOFFCint_137_1_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   if(0==G__getstructoffset()) return(1);
+   if(G__getaryconstruct())
+     if(G__PVOID==G__getgvp())
+       delete[] (MSupercutsCalcONOFF *)(G__getstructoffset());
+     else
+       for(int i=G__getaryconstruct()-1;i>=0;i--)
+         delete (MSupercutsCalcONOFF *)((G__getstructoffset())+sizeof(MSupercutsCalcONOFF)*i);
+   else  delete (MSupercutsCalcONOFF *)(G__getstructoffset());
+      G__setnull(result7);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+
+/* MHFindSignificanceONOFF */
+static int G__SuperCutsONOFFCint_159_7_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   MHFindSignificanceONOFF *p=NULL;
+   switch(libp->paran) {
+   case 2:
+      p = new MHFindSignificanceONOFF((const char*)G__int(libp->para[0]),(const char*)G__int(libp->para[1]));
+      break;
+   case 1:
+      p = new MHFindSignificanceONOFF((const char*)G__int(libp->para[0]));
+      break;
+   case 0:
+   if(G__getaryconstruct()) p=new MHFindSignificanceONOFF[G__getaryconstruct()];
+   else                    p=new MHFindSignificanceONOFF;
+      break;
+   }
+      result7->obj.i = (long)p;
+      result7->ref = (long)p;
+      result7->type = 'u';
+      result7->tagnum = G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHFindSignificanceONOFF);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_9_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MHFindSignificanceONOFF*)(G__getstructoffset()))->FindSigmaONOFF(
+(TH1*)G__int(libp->para[0]),(TH1*)G__int(libp->para[1])
+,(Double_t)G__double(libp->para[2]),(Double_t)G__double(libp->para[3])
+,(Double_t)G__double(libp->para[4]),(Int_t)G__int(libp->para[5])
+,(Int_t)G__int(libp->para[6]),(Double_t)G__double(libp->para[7])
+,(Bool_t)G__int(libp->para[8]),(Bool_t)G__int(libp->para[9])
+,(Bool_t)G__int(libp->para[10]),(Bool_t)G__int(libp->para[11])
+,*((const TString*)G__int(libp->para[12]))));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_0_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MHFindSignificanceONOFF*)(G__getstructoffset()))->SetLimitsForOFFDataFit((Double_t)G__double(libp->para[0]),(Double_t)G__double(libp->para[1]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_1_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MHFindSignificanceONOFF*)(G__getstructoffset()))->SetAlphaSig((Double_t)G__double(libp->para[0]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_2_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MHFindSignificanceONOFF*)(G__getstructoffset()))->SetUseFittedQuantities((Bool_t)G__int(libp->para[0]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_3_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MHFindSignificanceONOFF*)(G__getstructoffset()))->SigmaLiMa((Double_t)G__double(libp->para[0]),(Double_t)G__double(libp->para[1])
+,(Double_t)G__double(libp->para[2]),(Double_t*)G__int(libp->para[3])));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_4_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MHFindSignificanceONOFF*)(G__getstructoffset()))->SigmaLiMaForm5((Double_t)G__double(libp->para[0]),(Double_t)G__double(libp->para[1])
+,(Double_t)G__double(libp->para[2]),(Double_t*)G__int(libp->para[3])));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_5_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MHFindSignificanceONOFF*)(G__getstructoffset()))->SigmaVsAlphaONOFF((TH1*)G__int(libp->para[0]),(TH1*)G__int(libp->para[1])
+,(Double_t)G__double(libp->para[2]),(Double_t)G__double(libp->para[3])
+,(Int_t)G__int(libp->para[4]),(Bool_t)G__int(libp->para[5])));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_6_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,100,(double)((MHFindSignificanceONOFF*)(G__getstructoffset()))->GetSignificance());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_7_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MHFindSignificanceONOFF*)(G__getstructoffset()))->GetUseFittedQuantities());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_8_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MHFindSignificanceONOFF*)(G__getstructoffset()))->ComputeHistOFFNormalized());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_9_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   switch(libp->paran) {
+   case 1:
+      G__letint(result7,103,(long)((MHFindSignificanceONOFF*)(G__getstructoffset()))->DrawFit((const Option_t*)G__int(libp->para[0])));
+      break;
+   case 0:
+      G__letint(result7,103,(long)((MHFindSignificanceONOFF*)(G__getstructoffset()))->DrawFit());
+      break;
+   }
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_0_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MHFindSignificanceONOFF*)(G__getstructoffset()))->DrawHistOFF());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_1_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MHFindSignificanceONOFF*)(G__getstructoffset()))->DrawHistOFFNormalized());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_2_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,102,(double)((const MHFindSignificanceONOFF*)(G__getstructoffset()))->GetDegree());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_3_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,102,(double)((const MHFindSignificanceONOFF*)(G__getstructoffset()))->GetProb());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_4_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,102,(double)((const MHFindSignificanceONOFF*)(G__getstructoffset()))->GetNdf());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_5_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,102,(double)((const MHFindSignificanceONOFF*)(G__getstructoffset()))->GetGamma());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_6_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,102,(double)((const MHFindSignificanceONOFF*)(G__getstructoffset()))->GetNon());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_7_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,102,(double)((const MHFindSignificanceONOFF*)(G__getstructoffset()))->GetNex());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_8_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,102,(double)((const MHFindSignificanceONOFF*)(G__getstructoffset()))->GetNbg());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_9_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,102,(double)((const MHFindSignificanceONOFF*)(G__getstructoffset()))->GetSigLiMa1());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_0_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,102,(double)((const MHFindSignificanceONOFF*)(G__getstructoffset()))->GetSigLiMa2());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_1_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,102,(double)((const MHFindSignificanceONOFF*)(G__getstructoffset()))->GetSigLiMa3());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_2_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,102,(double)((const MHFindSignificanceONOFF*)(G__getstructoffset()))->GetMbins());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_3_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,102,(double)((const MHFindSignificanceONOFF*)(G__getstructoffset()))->GetAlphasi());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_4_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,102,(double)((const MHFindSignificanceONOFF*)(G__getstructoffset()))->GetNexONOFF());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_5_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,102,(double)((const MHFindSignificanceONOFF*)(G__getstructoffset()))->GetNexONOFFFitted());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_6_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   switch(libp->paran) {
+   case 1:
+      G__setnull(result7);
+      ((MHFindSignificanceONOFF*)(G__getstructoffset()))->SetRebin((Bool_t)G__int(libp->para[0]));
+      break;
+   case 0:
+      G__setnull(result7);
+      ((MHFindSignificanceONOFF*)(G__getstructoffset()))->SetRebin();
+      break;
+   }
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_7_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   switch(libp->paran) {
+   case 1:
+      G__setnull(result7);
+      ((MHFindSignificanceONOFF*)(G__getstructoffset()))->SetReduceDegree((Bool_t)G__int(libp->para[0]));
+      break;
+   case 0:
+      G__setnull(result7);
+      ((MHFindSignificanceONOFF*)(G__getstructoffset()))->SetReduceDegree();
+      break;
+   }
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_8_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MHFindSignificanceONOFF*)(G__getstructoffset()))->SetPsFilename((TPostScript*)G__int(libp->para[0]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_9_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   switch(libp->paran) {
+   case 1:
+      G__setnull(result7);
+      ((MHFindSignificanceONOFF*)(G__getstructoffset()))->PrintPoly((const Option_t*)G__int(libp->para[0]));
+      break;
+   case 0:
+      G__setnull(result7);
+      ((MHFindSignificanceONOFF*)(G__getstructoffset()))->PrintPoly();
+      break;
+   }
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_0_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   switch(libp->paran) {
+   case 1:
+      G__setnull(result7);
+      ((MHFindSignificanceONOFF*)(G__getstructoffset()))->PrintPolyOFF((const Option_t*)G__int(libp->para[0]));
+      break;
+   case 0:
+      G__setnull(result7);
+      ((MHFindSignificanceONOFF*)(G__getstructoffset()))->PrintPolyOFF();
+      break;
+   }
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_1_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   switch(libp->paran) {
+   case 1:
+      G__setnull(result7);
+      ((MHFindSignificanceONOFF*)(G__getstructoffset()))->PrintPolyGauss((const Option_t*)G__int(libp->para[0]));
+      break;
+   case 0:
+      G__setnull(result7);
+      ((MHFindSignificanceONOFF*)(G__getstructoffset()))->PrintPolyGauss();
+      break;
+   }
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_2_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,85,(long)MHFindSignificanceONOFF::Class());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_3_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,67,(long)MHFindSignificanceONOFF::Class_Name());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_4_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,115,(long)MHFindSignificanceONOFF::Class_Version());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_5_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      MHFindSignificanceONOFF::Dictionary();
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_6_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,85,(long)((const MHFindSignificanceONOFF*)(G__getstructoffset()))->IsA());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_7_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MHFindSignificanceONOFF*)(G__getstructoffset()))->ShowMembers(*(TMemberInspector*)libp->para[0].ref,(char*)G__int(libp->para[1]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_8_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MHFindSignificanceONOFF*)(G__getstructoffset()))->Streamer(*(TBuffer*)libp->para[0].ref);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_9_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MHFindSignificanceONOFF*)(G__getstructoffset()))->StreamerNVirtual(*(TBuffer*)libp->para[0].ref);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_0_5(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,67,(long)MHFindSignificanceONOFF::DeclFileName());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_1_5(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,105,(long)MHFindSignificanceONOFF::ImplFileLine());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_2_5(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,67,(long)MHFindSignificanceONOFF::ImplFileName());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_159_3_5(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,105,(long)MHFindSignificanceONOFF::DeclFileLine());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+// automatic copy constructor
+static int G__SuperCutsONOFFCint_159_4_5(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash)
+{
+   MHFindSignificanceONOFF *p;
+   p=new MHFindSignificanceONOFF(*(MHFindSignificanceONOFF*)G__int(libp->para[0]));
+   result7->obj.i = (long)p;
+   result7->ref = (long)p;
+   result7->type = 'u';
+   result7->tagnum = G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHFindSignificanceONOFF);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+// automatic destructor
+typedef MHFindSignificanceONOFF G__TMHFindSignificanceONOFF;
+static int G__SuperCutsONOFFCint_159_5_5(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   if(0==G__getstructoffset()) return(1);
+   if(G__getaryconstruct())
+     if(G__PVOID==G__getgvp())
+       delete[] (MHFindSignificanceONOFF *)(G__getstructoffset());
+     else
+       for(int i=G__getaryconstruct()-1;i>=0;i--)
+         delete (MHFindSignificanceONOFF *)((G__getstructoffset())+sizeof(MHFindSignificanceONOFF)*i);
+   else  delete (MHFindSignificanceONOFF *)(G__getstructoffset());
+      G__setnull(result7);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+
+/* MFindSupercutsONOFF */
+static int G__SuperCutsONOFFCint_205_0_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   MFindSupercutsONOFF *p=NULL;
+   switch(libp->paran) {
+   case 2:
+      p = new MFindSupercutsONOFF((const char*)G__int(libp->para[0]),(const char*)G__int(libp->para[1]));
+      break;
+   case 1:
+      p = new MFindSupercutsONOFF((const char*)G__int(libp->para[0]));
+      break;
+   case 0:
+   if(G__getaryconstruct()) p=new MFindSupercutsONOFF[G__getaryconstruct()];
+   else                    p=new MFindSupercutsONOFF;
+      break;
+   }
+      result7->obj.i = (long)p;
+      result7->ref = (long)p;
+      result7->type = 'u';
+      result7->tagnum = G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFindSupercutsONOFF);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_2_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFF*)(G__getstructoffset()))->SetFilenameTraining(*(TString*)libp->para[0].ref,(const Int_t)G__int(libp->para[1]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_3_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFF*)(G__getstructoffset()))->SetFilenameTest(*(TString*)libp->para[0].ref,(const Int_t)G__int(libp->para[1]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_4_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFF*)(G__getstructoffset()))->SetFilenameParam(*(TString*)libp->para[0].ref);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_5_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFF*)(G__getstructoffset()))->SetHadronnessName(*(TString*)libp->para[0].ref);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_6_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFF*)(G__getstructoffset()))->SetHadronnessNameOFF(*(TString*)libp->para[0].ref);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_7_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFF*)(G__getstructoffset()))->SetSupercutsAppliedTreeNames();
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_8_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFF*)(G__getstructoffset()))->SetAlphaDistributionsRootFilename(*(TString*)libp->para[0].ref);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_9_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFF*)(G__getstructoffset()))->SetAlphaSig((Double_t)G__double(libp->para[0])));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_0_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFF*)(G__getstructoffset()))->SetAlphaBkgMin((Double_t)G__double(libp->para[0])));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_1_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFF*)(G__getstructoffset()))->SetAlphaBkgMax((Double_t)G__double(libp->para[0])));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_2_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFF*)(G__getstructoffset()))->CheckAlphaSigBkg());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_3_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFF*)(G__getstructoffset()))->SetUseFittedQuantities((Bool_t)G__int(libp->para[0]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_4_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFF*)(G__getstructoffset()))->SetPostScriptFile((TPostScript*)G__int(libp->para[0]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_5_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFF*)(G__getstructoffset()))->SetPostScriptFile2(*(TPostScript*)libp->para[0].ref);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_6_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFF*)(G__getstructoffset()))->SetPsFilenameString(*((const TString*)G__int(libp->para[0])));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_7_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFF*)(G__getstructoffset()))->SetMatrixFilter((MFilter*)G__int(libp->para[0]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_8_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFF*)(G__getstructoffset()))->DefineTrainMatrix(*(TString*)libp->para[0].ref,*(MH3*)libp->para[1].ref
+,(const Int_t)G__int(libp->para[2]),*(TString*)libp->para[3].ref));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_9_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFF*)(G__getstructoffset()))->DefineTestMatrix(*(TString*)libp->para[0].ref,*(MH3*)libp->para[1].ref
+,(const Int_t)G__int(libp->para[2]),*(TString*)libp->para[3].ref));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_0_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFF*)(G__getstructoffset()))->DefineTrainTestMatrix(*(TString*)libp->para[0].ref,*(MH3*)libp->para[1].ref
+,(const Int_t)G__int(libp->para[2]),(const Int_t)G__int(libp->para[3])
+,*(TString*)libp->para[4].ref,*(TString*)libp->para[5].ref));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_1_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFF*)(G__getstructoffset()))->DefineTrainTestMatrixThetaRange(
+*(TString*)libp->para[0].ref,(const Double_t)G__double(libp->para[1])
+,(const Double_t)G__double(libp->para[2]),(Double_t)G__double(libp->para[3])
+,(Double_t)G__double(libp->para[4]),*(TString*)libp->para[5].ref
+,*(TString*)libp->para[6].ref));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_2_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFF*)(G__getstructoffset()))->DefineTrainTestMatrixOFFThetaRange(
+*(TString*)libp->para[0].ref,(const Double_t)G__double(libp->para[1])
+,(const Double_t)G__double(libp->para[2]),(Double_t)G__double(libp->para[3])
+,(Double_t)G__double(libp->para[4]),*(TString*)libp->para[5].ref
+,*(TString*)libp->para[6].ref));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_3_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,85,(long)((MFindSupercutsONOFF*)(G__getstructoffset()))->GetMatrixTrain());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_4_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,85,(long)((MFindSupercutsONOFF*)(G__getstructoffset()))->GetMatrixTest());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_5_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,85,(long)((MFindSupercutsONOFF*)(G__getstructoffset()))->GetMatrixTrainOFF());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_6_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,85,(long)((MFindSupercutsONOFF*)(G__getstructoffset()))->GetMatrixTestOFF());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_7_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFF*)(G__getstructoffset()))->SetUseOrigDistribution((Bool_t)G__int(libp->para[0]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_8_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFF*)(G__getstructoffset()))->ReadMatrix(*(TString*)libp->para[0].ref,*(TString*)libp->para[1].ref));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_9_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFF*)(G__getstructoffset()))->ReadMatrixOFF(*(TString*)libp->para[0].ref,*(TString*)libp->para[1].ref));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_0_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFF*)(G__getstructoffset()))->ComputeNormFactorTrain());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_1_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFF*)(G__getstructoffset()))->ComputeNormFactorTest());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_2_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFF*)(G__getstructoffset()))->FindParams(*((TString*)G__int(libp->para[0])),*(TArrayD*)libp->para[1].ref
+,*(TArrayD*)libp->para[2].ref));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_3_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFF*)(G__getstructoffset()))->TestParamsOnTestSample());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_4_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFF*)(G__getstructoffset()))->TestParamsOnTrainSample());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_5_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFF*)(G__getstructoffset()))->SetThetaRange((Double_t)G__double(libp->para[0]),(Double_t)G__double(libp->para[1])));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_6_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFF*)(G__getstructoffset()))->SetSizeRange((Double_t)G__double(libp->para[0]),(Double_t)G__double(libp->para[1])));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_7_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFF*)(G__getstructoffset()))->SetAlphaPlotBinining((Int_t)G__int(libp->para[0]),(Double_t)G__double(libp->para[1])
+,(Double_t)G__double(libp->para[2]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_8_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,100,(double)((MFindSupercutsONOFF*)(G__getstructoffset()))->GetNormFactorTrain());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_9_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,100,(double)((MFindSupercutsONOFF*)(G__getstructoffset()))->GetNormFactorTest());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_0_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,100,(double)((MFindSupercutsONOFF*)(G__getstructoffset()))->GetSigmaLiMaTrain());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_1_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,100,(double)((MFindSupercutsONOFF*)(G__getstructoffset()))->GetSigmaLiMaTest());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_2_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,100,(double)((MFindSupercutsONOFF*)(G__getstructoffset()))->GetNexTrain());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_3_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,100,(double)((MFindSupercutsONOFF*)(G__getstructoffset()))->GetNexTest());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_4_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,100,(double)((MFindSupercutsONOFF*)(G__getstructoffset()))->GetAlphaSig());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_5_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,100,(double)((MFindSupercutsONOFF*)(G__getstructoffset()))->GetAlphaBkgMin());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_6_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,100,(double)((MFindSupercutsONOFF*)(G__getstructoffset()))->GetAlphaBkgMax());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_7_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFF*)(G__getstructoffset()))->GetUseFittedQuantities());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_8_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFF*)(G__getstructoffset()))->GetSkipOptimization());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_9_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFF*)(G__getstructoffset()))->GetUseInitialSCParams());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_0_5(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFF*)(G__getstructoffset()))->SetGammaEfficiency((Double_t)G__double(libp->para[0])));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_1_5(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,100,(double)((MFindSupercutsONOFF*)(G__getstructoffset()))->GetGammaEfficiency());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_2_5(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFF*)(G__getstructoffset()))->SetTuneNormFactor((Bool_t)G__int(libp->para[0]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_3_5(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFF*)(G__getstructoffset()))->SetNormFactorFromAlphaBkg((Bool_t)G__int(libp->para[0]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_4_5(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFF*)(G__getstructoffset()))->SetSkipOptimization((Bool_t)G__int(libp->para[0]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_5_5(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFF*)(G__getstructoffset()))->SetUseInitialSCParams((Bool_t)G__int(libp->para[0]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_6_5(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFF*)(G__getstructoffset()))->SetVariableNotUseTheta((Bool_t)G__int(libp->para[0]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_7_5(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFF*)(G__getstructoffset()))->GetVariableNotUseTheta());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_8_5(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFF*)(G__getstructoffset()))->SetVariableUseStaticCuts((Bool_t)G__int(libp->para[0]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_9_5(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFF*)(G__getstructoffset()))->GetVariableUseStaticCuts());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_0_6(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,85,(long)MFindSupercutsONOFF::Class());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_1_6(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,67,(long)MFindSupercutsONOFF::Class_Name());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_2_6(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,115,(long)MFindSupercutsONOFF::Class_Version());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_3_6(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      MFindSupercutsONOFF::Dictionary();
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_4_6(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,85,(long)((const MFindSupercutsONOFF*)(G__getstructoffset()))->IsA());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_5_6(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFF*)(G__getstructoffset()))->ShowMembers(*(TMemberInspector*)libp->para[0].ref,(char*)G__int(libp->para[1]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_6_6(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFF*)(G__getstructoffset()))->Streamer(*(TBuffer*)libp->para[0].ref);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_7_6(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFF*)(G__getstructoffset()))->StreamerNVirtual(*(TBuffer*)libp->para[0].ref);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_8_6(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,67,(long)MFindSupercutsONOFF::DeclFileName());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_9_6(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,105,(long)MFindSupercutsONOFF::ImplFileLine());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_0_7(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,67,(long)MFindSupercutsONOFF::ImplFileName());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_205_1_7(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,105,(long)MFindSupercutsONOFF::DeclFileLine());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+// automatic copy constructor
+static int G__SuperCutsONOFFCint_205_2_7(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash)
+{
+   MFindSupercutsONOFF *p;
+   p=new MFindSupercutsONOFF(*(MFindSupercutsONOFF*)G__int(libp->para[0]));
+   result7->obj.i = (long)p;
+   result7->ref = (long)p;
+   result7->type = 'u';
+   result7->tagnum = G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFindSupercutsONOFF);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+// automatic destructor
+typedef MFindSupercutsONOFF G__TMFindSupercutsONOFF;
+static int G__SuperCutsONOFFCint_205_3_7(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   if(0==G__getstructoffset()) return(1);
+   if(G__getaryconstruct())
+     if(G__PVOID==G__getgvp())
+       delete[] (MFindSupercutsONOFF *)(G__getstructoffset());
+     else
+       for(int i=G__getaryconstruct()-1;i>=0;i--)
+         delete (MFindSupercutsONOFF *)((G__getstructoffset())+sizeof(MFindSupercutsONOFF)*i);
+   else  delete (MFindSupercutsONOFF *)(G__getstructoffset());
+      G__setnull(result7);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+
+/* MFindSupercutsONOFFThetaLoop */
+static int G__SuperCutsONOFFCint_206_0_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   MFindSupercutsONOFFThetaLoop *p=NULL;
+   switch(libp->paran) {
+   case 2:
+      p = new MFindSupercutsONOFFThetaLoop((const char*)G__int(libp->para[0]),(const char*)G__int(libp->para[1]));
+      break;
+   case 1:
+      p = new MFindSupercutsONOFFThetaLoop((const char*)G__int(libp->para[0]));
+      break;
+   case 0:
+   if(G__getaryconstruct()) p=new MFindSupercutsONOFFThetaLoop[G__getaryconstruct()];
+   else                    p=new MFindSupercutsONOFFThetaLoop;
+      break;
+   }
+      result7->obj.i = (long)p;
+      result7->ref = (long)p;
+      result7->type = 'u';
+      result7->tagnum = G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFindSupercutsONOFFThetaLoop);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_2_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetHadronnessName(*(TString*)libp->para[0].ref);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_3_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetHadronnessNameOFF(*(TString*)libp->para[0].ref);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_4_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetPathForFiles(*(TString*)libp->para[0].ref);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_5_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetDataONOFFRootFilenames(*(TString*)libp->para[0].ref,*(TString*)libp->para[1].ref);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_6_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetALLNames());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_7_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetNamesManually((TString*)G__int(libp->para[0]),(TString*)G__int(libp->para[1])
+,(TString*)G__int(libp->para[2]),(TString*)G__int(libp->para[3])
+,(TString*)G__int(libp->para[4]),(TString*)G__int(libp->para[5])));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_8_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetAlphaDistributionsRootFilename(*(TString*)libp->para[0].ref));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_9_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetAlphaSig((Double_t)G__double(libp->para[0])));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_0_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetAlphaBkgMin((Double_t)G__double(libp->para[0])));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_1_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetAlphaBkgMax((Double_t)G__double(libp->para[0])));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_2_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->CheckAlphaSigBkg());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_3_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetPostScriptFile((TPostScript*)G__int(libp->para[0]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_4_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetCosThetaRangeVector(*(TArrayD*)libp->para[0].ref));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_5_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetThetaRange((Int_t)G__int(libp->para[0])));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_6_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetAlphaPlotBinining((Int_t)G__int(libp->para[0]),(Double_t)G__double(libp->para[1])
+,(Double_t)G__double(libp->para[2]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_7_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetNormFactorTrainHist());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_8_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetNormFactorTestHist());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_9_1(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetSigmaLiMaTrainHist());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_0_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetSigmaLiMaTestHist());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_1_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetNexTrainHist());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_2_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetNexTestHist());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_3_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetNexSigmaLiMaNormFactorNEvtsTrainTestHist());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_4_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetSuccessfulThetaBinsHist());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_5_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->WriteNexSigmaLiMaNormFactorNEvtsTrainTestHistToFile();
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_6_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->WriteSuccessfulThetaBinsHistToFile();
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_7_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetInitSCPar(*(TArrayD*)libp->para[0].ref));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_8_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetInitSCParSteps(*(TArrayD*)libp->para[0].ref));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_9_2(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->ReadSCParamsFromAsciiFile((const char*)G__int(libp->para[0]),(Int_t)G__int(libp->para[1])));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_0_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetFractionTrainTestOnOffEvents((Double_t)G__double(libp->para[0]),(Double_t)G__double(libp->para[1])
+,(Double_t)G__double(libp->para[2]),(Double_t)G__double(libp->para[3]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_1_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetTuneNormFactor((Bool_t)G__int(libp->para[0]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_2_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetGammaEfficiency((Double_t)G__double(libp->para[0])));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_3_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetNormFactorFromAlphaBkg((Bool_t)G__int(libp->para[0]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_4_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetUseFittedQuantities((Bool_t)G__int(libp->para[0]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_5_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetReadMatricesFromFile((Bool_t)G__int(libp->para[0]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_6_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetTrainParameters((Bool_t)G__int(libp->para[0]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_7_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetTestParameters((Bool_t)G__int(libp->para[0]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_8_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetSkipOptimization((Bool_t)G__int(libp->para[0]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_9_3(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetUseInitialSCParams((Bool_t)G__int(libp->para[0]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_0_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetVariableNotUseTheta((Bool_t)G__int(libp->para[0]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_1_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->GetVariableNotUseTheta());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_2_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetVariableUseStaticCuts((Bool_t)G__int(libp->para[0]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_3_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->GetVariableUseStaticCuts());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_4_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->SetSizeRange((Double_t)G__double(libp->para[0]),(Double_t)G__double(libp->para[1]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_5_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->LoopOverThetaRanges());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_6_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->ComputeNexSignificanceVSAlphaSig());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_7_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->ComputeOverallSignificance((Bool_t)G__int(libp->para[0]),(Bool_t)G__int(libp->para[1])));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_8_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,100,(double)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->GetOverallNexTrain());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_9_4(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,100,(double)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->GetOverallNexTest());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_0_5(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,100,(double)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->GetOverallSigmaLiMaTrain());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_1_5(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,100,(double)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->GetOverallSigmaLiMaTest());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_2_5(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,100,(double)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->GetGammaEfficiency());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_3_5(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,100,(double)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->GetAlphaSig());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_4_5(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,100,(double)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->GetAlphaBkgMin());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_5_5(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letdouble(result7,100,(double)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->GetAlphaBkgMax());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_6_5(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->GetSkipOptimization());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_7_5(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,103,(long)((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->GetUseFittedQuantities());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_8_5(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,85,(long)MFindSupercutsONOFFThetaLoop::Class());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_9_5(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,67,(long)MFindSupercutsONOFFThetaLoop::Class_Name());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_0_6(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,115,(long)MFindSupercutsONOFFThetaLoop::Class_Version());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_1_6(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      MFindSupercutsONOFFThetaLoop::Dictionary();
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_2_6(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,85,(long)((const MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->IsA());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_3_6(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->ShowMembers(*(TMemberInspector*)libp->para[0].ref,(char*)G__int(libp->para[1]));
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_4_6(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->Streamer(*(TBuffer*)libp->para[0].ref);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_5_6(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__setnull(result7);
+      ((MFindSupercutsONOFFThetaLoop*)(G__getstructoffset()))->StreamerNVirtual(*(TBuffer*)libp->para[0].ref);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_6_6(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,67,(long)MFindSupercutsONOFFThetaLoop::DeclFileName());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_7_6(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,105,(long)MFindSupercutsONOFFThetaLoop::ImplFileLine());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_8_6(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   G__letint(result7,67,(long)MFindSupercutsONOFFThetaLoop::ImplFileName());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+static int G__SuperCutsONOFFCint_206_9_6(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+      G__letint(result7,105,(long)MFindSupercutsONOFFThetaLoop::DeclFileLine());
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+// automatic copy constructor
+static int G__SuperCutsONOFFCint_206_0_7(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash)
+{
+   MFindSupercutsONOFFThetaLoop *p;
+   p=new MFindSupercutsONOFFThetaLoop(*(MFindSupercutsONOFFThetaLoop*)G__int(libp->para[0]));
+   result7->obj.i = (long)p;
+   result7->ref = (long)p;
+   result7->type = 'u';
+   result7->tagnum = G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFindSupercutsONOFFThetaLoop);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+// automatic destructor
+typedef MFindSupercutsONOFFThetaLoop G__TMFindSupercutsONOFFThetaLoop;
+static int G__SuperCutsONOFFCint_206_1_7(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
+   if(0==G__getstructoffset()) return(1);
+   if(G__getaryconstruct())
+     if(G__PVOID==G__getgvp())
+       delete[] (MFindSupercutsONOFFThetaLoop *)(G__getstructoffset());
+     else
+       for(int i=G__getaryconstruct()-1;i>=0;i--)
+         delete (MFindSupercutsONOFFThetaLoop *)((G__getstructoffset())+sizeof(MFindSupercutsONOFFThetaLoop)*i);
+   else  delete (MFindSupercutsONOFFThetaLoop *)(G__getstructoffset());
+      G__setnull(result7);
+   return(1 || funcname || hash || result7 || libp) ;
+}
+
+
+/* Setting up global function */
+
+/*********************************************************
+* Member function Stub
+*********************************************************/
+
+/* MFRandomSplit */
+
+/* MTSupercutsApplied */
+
+/* MSupercutsCalcONOFF */
+
+/* MHFindSignificanceONOFF */
+
+/* MFindSupercutsONOFF */
+
+/* MFindSupercutsONOFFThetaLoop */
+
+/*********************************************************
+* Global function Stub
+*********************************************************/
+
+/*********************************************************
+* Get size of pointer to member function
+*********************************************************/
+class G__Sizep2memfuncSuperCutsONOFFCint {
+ public:
+  G__Sizep2memfuncSuperCutsONOFFCint() {p=&G__Sizep2memfuncSuperCutsONOFFCint::sizep2memfunc;}
+    size_t sizep2memfunc() { return(sizeof(p)); }
+  private:
+    size_t (G__Sizep2memfuncSuperCutsONOFFCint::*p)();
+};
+
+size_t G__get_sizep2memfuncSuperCutsONOFFCint()
+{
+  G__Sizep2memfuncSuperCutsONOFFCint a;
+  G__setsizep2memfunc((int)a.sizep2memfunc());
+  return((size_t)a.sizep2memfunc());
+}
+
+
+/*********************************************************
+* virtual base class offset calculation interface
+*********************************************************/
+
+   /* Setting up class inheritance */
+
+/*********************************************************
+* Inheritance information setup/
+*********************************************************/
+extern "C" void G__cpp_setup_inheritanceSuperCutsONOFFCint() {
+
+   /* Setting up class inheritance */
+   if(0==G__getnumbaseclass(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFRandomSplit))) {
+     MFRandomSplit *G__Lderived;
+     G__Lderived=(MFRandomSplit*)0x1000;
+     {
+       MFilter *G__Lpbase=(MFilter*)G__Lderived;
+       G__inheritance_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFRandomSplit),G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFilter),(long)G__Lpbase-(long)G__Lderived,1,1);
+     }
+     {
+       MTask *G__Lpbase=(MTask*)G__Lderived;
+       G__inheritance_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFRandomSplit),G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MTask),(long)G__Lpbase-(long)G__Lderived,1,0);
+     }
+     {
+       MInputStreamID *G__Lpbase=(MInputStreamID*)G__Lderived;
+       G__inheritance_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFRandomSplit),G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MInputStreamID),(long)G__Lpbase-(long)G__Lderived,1,0);
+     }
+     {
+       MParContainer *G__Lpbase=(MParContainer*)G__Lderived;
+       G__inheritance_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFRandomSplit),G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MParContainer),(long)G__Lpbase-(long)G__Lderived,1,0);
+     }
+     {
+       TObject *G__Lpbase=(TObject*)G__Lderived;
+       G__inheritance_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFRandomSplit),G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TObject),(long)G__Lpbase-(long)G__Lderived,1,0);
+     }
+   }
+   if(0==G__getnumbaseclass(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MTSupercutsApplied))) {
+     MTSupercutsApplied *G__Lderived;
+     G__Lderived=(MTSupercutsApplied*)0x1000;
+     {
+       MParContainer *G__Lpbase=(MParContainer*)G__Lderived;
+       G__inheritance_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MTSupercutsApplied),G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MParContainer),(long)G__Lpbase-(long)G__Lderived,1,1);
+     }
+     {
+       TObject *G__Lpbase=(TObject*)G__Lderived;
+       G__inheritance_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MTSupercutsApplied),G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TObject),(long)G__Lpbase-(long)G__Lderived,1,0);
+     }
+   }
+   if(0==G__getnumbaseclass(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MSupercutsCalcONOFF))) {
+     MSupercutsCalcONOFF *G__Lderived;
+     G__Lderived=(MSupercutsCalcONOFF*)0x1000;
+     {
+       MTask *G__Lpbase=(MTask*)G__Lderived;
+       G__inheritance_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MSupercutsCalcONOFF),G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MTask),(long)G__Lpbase-(long)G__Lderived,1,1);
+     }
+     {
+       MInputStreamID *G__Lpbase=(MInputStreamID*)G__Lderived;
+       G__inheritance_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MSupercutsCalcONOFF),G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MInputStreamID),(long)G__Lpbase-(long)G__Lderived,1,0);
+     }
+     {
+       MParContainer *G__Lpbase=(MParContainer*)G__Lderived;
+       G__inheritance_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MSupercutsCalcONOFF),G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MParContainer),(long)G__Lpbase-(long)G__Lderived,1,0);
+     }
+     {
+       TObject *G__Lpbase=(TObject*)G__Lderived;
+       G__inheritance_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MSupercutsCalcONOFF),G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TObject),(long)G__Lpbase-(long)G__Lderived,1,0);
+     }
+   }
+   if(0==G__getnumbaseclass(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHFindSignificanceONOFF))) {
+     MHFindSignificanceONOFF *G__Lderived;
+     G__Lderived=(MHFindSignificanceONOFF*)0x1000;
+     {
+       MH *G__Lpbase=(MH*)G__Lderived;
+       G__inheritance_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHFindSignificanceONOFF),G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MH),(long)G__Lpbase-(long)G__Lderived,1,1);
+     }
+     {
+       MParContainer *G__Lpbase=(MParContainer*)G__Lderived;
+       G__inheritance_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHFindSignificanceONOFF),G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MParContainer),(long)G__Lpbase-(long)G__Lderived,1,0);
+     }
+     {
+       TObject *G__Lpbase=(TObject*)G__Lderived;
+       G__inheritance_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHFindSignificanceONOFF),G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TObject),(long)G__Lpbase-(long)G__Lderived,1,0);
+     }
+   }
+   if(0==G__getnumbaseclass(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFindSupercutsONOFF))) {
+     MFindSupercutsONOFF *G__Lderived;
+     G__Lderived=(MFindSupercutsONOFF*)0x1000;
+     {
+       MParContainer *G__Lpbase=(MParContainer*)G__Lderived;
+       G__inheritance_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFindSupercutsONOFF),G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MParContainer),(long)G__Lpbase-(long)G__Lderived,1,1);
+     }
+     {
+       TObject *G__Lpbase=(TObject*)G__Lderived;
+       G__inheritance_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFindSupercutsONOFF),G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TObject),(long)G__Lpbase-(long)G__Lderived,1,0);
+     }
+   }
+   if(0==G__getnumbaseclass(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFindSupercutsONOFFThetaLoop))) {
+     MFindSupercutsONOFFThetaLoop *G__Lderived;
+     G__Lderived=(MFindSupercutsONOFFThetaLoop*)0x1000;
+     {
+       MParContainer *G__Lpbase=(MParContainer*)G__Lderived;
+       G__inheritance_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFindSupercutsONOFFThetaLoop),G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MParContainer),(long)G__Lpbase-(long)G__Lderived,1,1);
+     }
+     {
+       TObject *G__Lpbase=(TObject*)G__Lderived;
+       G__inheritance_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFindSupercutsONOFFThetaLoop),G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TObject),(long)G__Lpbase-(long)G__Lderived,1,0);
+     }
+   }
+}
+
+/*********************************************************
+* typedef information setup/
+*********************************************************/
+extern "C" void G__cpp_setup_typetableSuperCutsONOFFCint() {
+
+   /* Setting up typedef entry */
+   G__search_typename2("Int_t",105,-1,0,
+-1);
+   G__setnewtype(-1,"Signed integer 4 bytes (int)",0);
+   G__search_typename2("Float_t",102,-1,0,
+-1);
+   G__setnewtype(-1,"Float 4 bytes (float)",0);
+   G__search_typename2("Double_t",100,-1,0,
+-1);
+   G__setnewtype(-1,"Float 8 bytes (double)",0);
+   G__search_typename2("Bool_t",103,-1,0,
+-1);
+   G__setnewtype(-1,"Boolean (0=false, 1=true) (bool)",0);
+   G__search_typename2("Version_t",115,-1,0,
+-1);
+   G__setnewtype(-1,"Class version identifier (short)",0);
+   G__search_typename2("Option_t",99,-1,256,
+-1);
+   G__setnewtype(-1,"Option string (const char)",0);
+}
+
+/*********************************************************
+* Data Member information setup/
+*********************************************************/
+
+   /* Setting up class,struct,union tag member variable */
+
+   /* MFRandomSplit */
+static void G__setup_memvarMFRandomSplit(void) {
+   G__tag_memvar_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFRandomSplit));
+   { MFRandomSplit *p; p=(MFRandomSplit*)0x1000; if (p) { }
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fNumSelectedEvts=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fProb=",0,"probability with which the result should be kTRUE");
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fResult=",0,"Result returned by IsExpressionTrue");
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TClass),-1,-2,4,"fgIsA=",0,(char*)NULL);
+   }
+   G__tag_memvar_reset();
+}
+
+
+   /* MTSupercutsApplied */
+static void G__setup_memvarMTSupercutsApplied(void) {
+   G__tag_memvar_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MTSupercutsApplied));
+   { MTSupercutsApplied *p; p=(MTSupercutsApplied*)0x1000; if (p) { }
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fNCutParameters=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fNShowerParameters=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,68,0,0,-1,G__defined_typename("Double_t"),-1,4,"fCutParameters=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,68,0,0,-1,G__defined_typename("Double_t"),-1,4,"fShowerParameters=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TTree),-1,-1,4,"fRootTree=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fBranchesCreated=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fCutParamBranchName=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fShowerParamBranchName=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fCutParametersNamesTypes=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fShowerParametersNamesTypes=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TClass),-1,-2,4,"fgIsA=",0,(char*)NULL);
+   }
+   G__tag_memvar_reset();
+}
+
+
+   /* MSupercutsCalcONOFF */
+static void G__setup_memvarMSupercutsCalcONOFF(void) {
+   G__tag_memvar_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MSupercutsCalcONOFF));
+   { MSupercutsCalcONOFF *p; p=(MSupercutsCalcONOFF*)0x1000; if (p) { }
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHillas),-1,-1,4,"fHil=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHillasSrc),-1,-1,4,"fHilSrc=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHillasExt),-1,-1,4,"fHilExt=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MNewImagePar),-1,-1,4,"fNewPar=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MPointingPos),-1,-1,4,"fPointPos=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHadronness),-1,-1,4,"fHadronness=",0,"! output container for hadronness");
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MTSupercutsApplied),-1,-1,4,"fSupercutsApplied=",0,"output container for applied supercuts");
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MSupercuts),-1,-1,4,"fSuper=",0,"container for supercut parameters");
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fHadronnessName=",0,"name of container to store hadronness");
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fSupercutsAppliedName=",0,"name of the container to store applied supercuts");
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fHilName=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fHilSrcName=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fHilExtName=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fNewParName=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fSuperName=",0,"name of container for supercut parameters");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fMm2Deg=",0,"!");
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fMap[11]=",0,"!");
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHMatrix),-1,-1,4,"fMatrix=",0,"!");
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fStoreAppliedSupercuts=",0,"Boolean variable used to decided wether to store (kTRUE) or not (kFALSE) the supercuts applied");
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fNotUseTheta=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fUseStaticCuts=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fUseDist=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fSizeOffset=",0,"photons");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fDistOffset=",0,"degrees   NOT USED FOR THE TIME BEING");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fThetaOffset=",0,"degrees   NOT USED FOR THE TIME BEING");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fDistUpperLimit=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fLengthUpperLimit=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fWidthUpperLimit=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fDistLowerLimit=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fLengthLowerLimit=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fWidthLowerLimit=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fLeakage1UpperLimit=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fLengthOverWidthUpperLimit=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TClass),-1,-2,4,"fgIsA=",0,(char*)NULL);
+   }
+   G__tag_memvar_reset();
+}
+
+
+   /* MHFindSignificanceONOFF */
+static void G__setup_memvarMHFindSignificanceONOFF(void) {
+   G__tag_memvar_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHFindSignificanceONOFF));
+   { MHFindSignificanceONOFF *p; p=(MHFindSignificanceONOFF*)0x1000; if (p) { }
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TH1),-1,-1,4,"fHistOrig=",0,"original plot of |alpha| (0.0 to 90.0 degrees)");
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TH1),-1,-1,4,"fHist=",0,"copy of fHistOrig or rebinned histogram");
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TH1),-1,-1,4,"fHistOrigOFF=",0,"original plot of |alpha| (0.0 to 90.0 degrees)");
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TH1),-1,-1,4,"fHistOFF=",0,"copy of fHistOrig or rebinned histogram");
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TH1),-1,-1,4,"fHistOFFNormalized=",0,"fHistOFF normalized (contents and errors) with ");
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TPostScript),-1,-1,4,"fPsFilename=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fPsFilenameString=",0,"Name of the file where plots will be stored while the ");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fAlphamin=",0,"requested lower limit of fit range");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fAlphammm=",0,"center of fit range");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fAlphamax=",0,"requested lower limit of fit range");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fAlphaminOFF=",0,"requested lower limit of fit range for OFF data");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fAlphamaxOFF=",0,"requested lower limit of fit range for OFF data");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fAlphami=",0,"actual lower limit of fit range ");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fAlphamm=",0,"actual center of fit range ");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fAlphama=",0,"actual upper limit of fit range");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fAlphasig=",0,"requested signal range");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fAlphasi=",0,"actual signal range");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fAlphasiOFF=",0,"actual signal range for OFF data");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fAlphalow=",0,"requested lower edge of signal range");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fAlphalo=",0,"actual lower edge of signal range");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fAlphahig=",0,"requested upper edge of background range");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fAlphahi=",0,"actual upper edge of background range");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fNon=",0,"total number of events in signal region");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fNbg=",0,"number of background events in signal region");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fNex=",0,"number of excess events in signal region");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fdNon=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fdNbg=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fdNex=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fNbgtot=",0,"total number of events in background region");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fNbgtotFitted=",0,"fitted total no. of events in background region");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fdNbgtotFitted=",0,"fitted error of this number");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fNexONOFF=",0,"number of excess events (ON-OFF) ");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fNexONOFFFitted=",0,"number of excess events (ON-OFF fitted) ");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fdNexONOFF=",0,"error in number of excess events (ON-OFF) ");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fdNexONOFFFitted=",0,"error in number of excess events (ON-OFF fitted) ");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fNoffTot=",0,"Total number of OFF events");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fNoffSig=",0,"Number of OFF events in \"signal\" region ");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fNoffBg=",0,"Number of OFF events in \"background\" region");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fdNoffTot=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fdNoffSig=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fdNoffBg=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fNoffTotFitted=",0,"Total number of OFF events");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fNoffSigFitted=",0,"Number of OFF events in \"signal\" region ");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fNoffBgFitted=",0,"Number of OFF events in \"background\" region");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fdNoffTotFitted=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fdNoffSigFitted=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fdNoffBgFitted=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fUseFittedQuantities=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fPrintResultsOntoAlphaPlot=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fNoff=",0,"fNoff = fNoffSig * fNormFactor");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fGamma=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fNormFactor=",0,"= TotalNon/TotalNoff)");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fSigLiMa=",0,"significance of gamma signal according to Li & Ma");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fSigLiMa2=",0,"significance of gamma signal according to Li & Ma");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fSigLiMa3=",0,"significance of gamma signal according to Li & Ma");
+   G__memvar_setup((void*)NULL,100,0,1,-1,G__defined_typename("Double_t"),-2,4,"fEps=",0,"tolerance for floating point comparisons");
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fDraw=",0,"if true : draw plots");
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fSavePlots=",0,"if true : Save plots in Psfile");
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fFitGauss=",0,"if true : do the (polynomial+Gauss fit)");
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fRebin=",0,"if true : allow rebinning of the alpha plot    ");
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fReduceDegree=",0,"if true : allow reducing of the order of the polynomial");
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fConstantBackg=",0,"if set true if background fit is not possible");
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TCanvas),-1,-1,4,"fCanvas=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fNexGauss=",0,"total number of excess events ");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fdNexGauss=",0,"error of the total number of excess events");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fSigmaGauss=",0,"sigma of fitted Gauss function");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fdSigmaGauss=",0,"error of this sigma");
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TF1),-1,-1,4,"fPoly=",0,"polynomial function");
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fFitBad=",0,"if != 0 fit failed");
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fDegree=",0,"degree of polynomial to be fitted to the background");
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fNdf=",0,"number of degrees of freedom of polynomial fit");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fChisq=",0,"chi squared of polynomial fit");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fProb=",0,"chi squared probability ofg polynomial fit ");
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TArrayD),-1,-1,4,"fValues=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TArrayD),-1,-1,4,"fErrors=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,105,0,1,-1,G__defined_typename("Int_t"),-2,4,"fNdim=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fEmat[6][6]=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fEma[6][6]=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fCorr[6][6]=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fMbins=",0,"number of bins in the fit range");
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fMlow=",0,"number of bins in the fit range with too few entries");
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fNzero=",0,"number of bins in the fit range with zero entry");
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fIstat=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TF1),-1,-1,4,"fPolyOFF=",0,"polynomial function for OFF data");
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TF1),-1,-1,4,"fPolyOFFNormalized=",0,"polynomial function for OFF data normalized with fNormFactor*(BinWidthON/BinWidthOFF)");
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fFitBadOFF=",0,"if != 0 fit failed");
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fDegreeOFF=",0,"degree of polynomial to be fitted to the background");
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fNdfOFF=",0,"number of degrees of freedom of polynomial fit");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fChisqOFF=",0,"chi squared of polynomial fit");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fProbOFF=",0,"chi squared probability ofg polynomial fit ");
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TArrayD),-1,-1,4,"fValuesOFF=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TArrayD),-1,-1,4,"fErrorsOFF=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TArrayD),-1,-1,4,"fValuesOFFNormalized=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TArrayD),-1,-1,4,"fErrorsOFFNormalized=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,105,0,1,-1,G__defined_typename("Int_t"),-2,4,"fNdimOFF=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fEmatOFF[6][6]=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fEmaOFF[6][6]=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fCorrOFF[6][6]=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fMbinsOFF=",0,"number of bins in the fit range");
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fMlowOFF=",0,"number of bins in the fit range with too few entries");
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fNzeroOFF=",0,"number of bins in the fit range with zero entry");
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fIstatOFF=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TF1),-1,-1,4,"fGPoly=",0,"(Gauss+polynomial) function");
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TF1),-1,-1,4,"fGBackg=",0,"polynomial part of (Gauss+polynomial) function");
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fGFitBad=",0,"if != 0 fit failed");
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fGDegree=",0,"degree of polynomial to be fitted to the background");
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fGNdf=",0,"number of degrees of freedom of polynomial fit");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fGChisq=",0,"chi squared of polynomial fit");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fGProb=",0,"chi squared probability ofg polynomial fit ");
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TArrayD),-1,-1,4,"fGValues=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TArrayD),-1,-1,4,"fGErrors=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,105,0,1,-1,G__defined_typename("Int_t"),-2,4,"fGNdim=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fGEmat[9][9]=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fGEma[9][9]=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fGCorr[9][9]=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fGMbins=",0,"number of bins in the fit range");
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fGNzero=",0,"numnber of bins in the fit range with zero entry");
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fGIstat=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,1,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-2,4,"gsDefName=",0,"! Default Name");
+   G__memvar_setup((void*)NULL,117,0,1,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-2,4,"gsDefTitle=",0,"! Default Title");
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TClass),-1,-2,4,"fgIsA=",0,(char*)NULL);
+   }
+   G__tag_memvar_reset();
+}
+
+
+   /* MFindSupercutsONOFF */
+static void G__setup_memvarMFindSupercutsONOFF(void) {
+   G__tag_memvar_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFindSupercutsONOFF));
+   { MFindSupercutsONOFF *p; p=(MFindSupercutsONOFF*)0x1000; if (p) { }
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fSizeCutLow=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fSizeCutUp=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fDistCutLow=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fDistCutUp=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fLengthCutLow=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fLengthCutUp=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fWidthCutLow=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fWidthCutUp=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fFilenameTrain=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fFilenameTest=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fHowManyTrain=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fHowManyTest=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fHowManyTrainOFF=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fHowManyTestOFF=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fAlphaSig=",0,"Max alpha value were signal is expected");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fAlphaBkgMin=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fAlphaBkgMax=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fThetaMin=",0,"Cuts in ThetaOrig.fVal (in mili radians!!!)");
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fThetaMax=",0,"Cuts in ThetaOrig.fVal (in mili radians !!!)");
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fThetaRangeString=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fNAlphaBins=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fAlphaBinLow=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fAlphaBinUp=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fUseOrigDistribution=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fNormFactorTrain=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fNormFactorTest=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fSigmaLiMaTrain=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fSigmaLiMaTest=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fNexTrain=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fNexTest=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fGammaEfficiency=",0,"Fraction of gammas that remain after cuts");
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fTuneNormFactor=",0,"If true, normalization factors are corrected using the estimated number of gammas and the gamma efficiency");
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fNormFactorFromAlphaBkg=",0,"if kTRUE, method 2) is used");
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fUseFittedQuantities=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fSkipOptimization=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fSetLimitsToSomeMinuitParams=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fMinuitDistUPUpperLimit=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fMinuitDistUPLowerLimit=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fMinuitLengthUPUpperLimit=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fMinuitLengthUPLowerLimit=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fMinuitWidthUPUpperLimit=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fMinuitWidthUPLowerLimit=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fMinuitLeakage1UPUpperLimit=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fMinuitLeakage1UPLowerLimit=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fMinuitDistLOWUpperLimit=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fMinuitDistLOWLowerLimit=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fMinuitLengthLOWUpperLimit=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fMinuitLengthLOWLowerLimit=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fMinuitWidthLOWUpperLimit=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fMinuitWidthLOWLowerLimit=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fNotUseTheta=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fUseDist=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fUseStaticCuts=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fUseInitialSCParams=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fFilenameParam=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fHadronnessName=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fHadronnessNameOFF=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fTrainONSupercutsAppliedName=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fTrainOFFSupercutsAppliedName=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fTestONSupercutsAppliedName=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fTestOFFSupercutsAppliedName=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TPostScript),-1,-1,4,"fPsFilename=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TPostScript),-1,-1,4,"fPsFilename2=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fPsFilenameString=",0,"Name of the file where plots will be stored while the ");
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fAlphaDistributionsRootFilename=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MSupercutsCalcONOFF),-1,-1,4,"fCalcHadTrain=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MSupercutsCalcONOFF),-1,-1,4,"fCalcHadTest=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MSupercutsCalcONOFF),-1,-1,4,"fCalcHadTrainOFF=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MSupercutsCalcONOFF),-1,-1,4,"fCalcHadTestOFF=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHMatrix),-1,-1,4,"fMatrixTrain=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHMatrix),-1,-1,4,"fMatrixTest=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHMatrix),-1,-1,4,"fMatrixTrainOFF=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHMatrix),-1,-1,4,"fMatrixTestOFF=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MGeomCam),-1,-1,4,"fCam=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MEvtLoop),-1,-1,4,"fObjectFit=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFilter),-1,-1,4,"fMatrixFilter=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TArrayD),-1,-1,4,"fVinit=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TArrayD),-1,-1,4,"fStep=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TArrayD),-1,-1,4,"fLimlo=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TArrayD),-1,-1,4,"fLimup=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TArrayI),-1,-1,4,"fFix=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,104,0,0,-1,G__defined_typename("UInt_t"),-1,4,"fNpar=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fMethod=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fMin=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fEdm=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fErrdef=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fNpari=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fNparx=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fIstat=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fErrMinimize=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TClass),-1,-2,4,"fgIsA=",0,(char*)NULL);
+   }
+   G__tag_memvar_reset();
+}
+
+
+   /* MFindSupercutsONOFFThetaLoop */
+static void G__setup_memvarMFindSupercutsONOFFThetaLoop(void) {
+   G__tag_memvar_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFindSupercutsONOFFThetaLoop));
+   { MFindSupercutsONOFFThetaLoop *p; p=(MFindSupercutsONOFFThetaLoop*)0x1000; if (p) { }
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fDataONRootFilename=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fDataOFFRootFilename=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fPathForFiles=",0,"Path to directory where files (PsFiles, rootfiles) will be stored");
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fOptSCParamFilenameVector=",0,"Pointer to vector of TStrings containing name of the root files where optimized supercuts will be stored. To be created and filled once Vector of Costheta ranges is defined");
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fTrainMatrixONFilenameVector=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fTestMatrixONFilenameVector=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fTrainMatrixOFFFilenameVector=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fTestMatrixOFFFilenameVector=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fAlphaSig=",0,"Max alpha value were signal is expected");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fAlphaBkgMin=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fAlphaBkgMax=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fSizeCutLow=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fSizeCutUp=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,105,0,0,-1,G__defined_typename("Int_t"),-1,4,"fNAlphaBins=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fAlphaBinLow=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fAlphaBinUp=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fUseFittedQuantities=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fPolyGaussFitAlphaSigma=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fWhichFractionTrain=",0,"number <= 1; specifying fraction of ON Train events");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fWhichFractionTest=",0,"number <= 1; specifying fraction of ON Test events");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fWhichFractionTrainOFF=",0,"number <= 1; specifying fraction of OFF  Train events");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fWhichFractionTestOFF=",0,"number <= 1; specifying fraction of OFF Test events");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fThetaMin=",0,"Cuts in ThetaOrig.fVal (in rad!!!)");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fThetaMax=",0,"Cuts in ThetaOrig.fVal (in rad !!!)");
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TArrayD),-1,-1,4,"fCosThetaRangeVector=",0,"vector containing the ");
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fThetaRangeStringVector=",0,"Pointer to vector of TStrings that contain Cos theta ranges specified in fCosThetaRangeVector. It will be used to identify alpha distributions stored in fAlphaDistributionsRootFilename");
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TArrayD),-1,-1,4,"fCosThetaBinCenterVector=",0,"vector containing the ");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fActualCosThetaBinCenter=",0,"Theta value used to fill ");
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fOverallNexTrain=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fOverallNexTest=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fOverallSigmaLiMaTrain=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fOverallSigmaLiMaTest=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TH1F),-1,-1,4,"fSuccessfulThetaBinsHist=",0,"Hist containing theta bins were optimization was successful");
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TH1F),-1,-1,4,"fNormFactorTrainHist=",0,"Hist containing norm factors train for all Cos theta ranges");
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TH1F),-1,-1,4,"fNormFactorTestHist=",0,"Hist containing norm factors test for all Cos theta ranges");
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TH1F),-1,-1,4,"fSigmaLiMaTrainHist=",0,"Hist containing SigmaLiMa for Train samples for all Cos theta ranges");
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TH1F),-1,-1,4,"fSigmaLiMaTestHist=",0,"Hist containing SigmaLiMa for Test samples for all Cos theta ranges");
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TH1F),-1,-1,4,"fNexTrainHist=",0,"Hist containing Number os excess events for Train sample for all Cos thetas");
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TH1F),-1,-1,4,"fNexTestHist=",0,"Hist containing Number os excess events for Test sample for all Cos theta");
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TH1F),-1,-1,4,"fNEvtsInTrainMatrixONHist=",0,"Hist containing total number of events in Train Matrices of ON data for all Cos theta ranges");
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TH1F),-1,-1,4,"fNEvtsInTestMatrixONHist=",0,"Hist containing total number of events in Test Matrices of ON data for all Cos theta ranges");
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TH1F),-1,-1,4,"fNEvtsInTrainMatrixOFFHist=",0,"Hist containing total number of events in Train Matrices of OFF data for all Cos theta ranges");
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TH1F),-1,-1,4,"fNEvtsInTestMatrixOFFHist=",0,"Hist containing total number of events in Test Matrices of OFF data for all Cos theta ranges");
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fSkipOptimization=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fUseInitialSCParams=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,100,0,0,-1,G__defined_typename("Double_t"),-1,4,"fGammaEfficiency=",0,"Fraction of gammas that remain after cuts");
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fTuneNormFactor=",0,"If true, normalization factors are corrected ");
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fNormFactorFromAlphaBkg=",0,"if kTRUE, method 2) is used");
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fNotUseTheta=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fUseStaticCuts=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fHadronnessName=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fHadronnessNameOFF=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TArrayD),-1,-1,4,"fInitSCPar=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TArrayD),-1,-1,4,"fInitSCParSteps=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TPostScript),-1,-1,4,"fPsFilename=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,117,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,-1,4,"fAlphaDistributionsRootFilename=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fReadMatricesFromFile=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fOptimizeParameters=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,103,0,0,-1,G__defined_typename("Bool_t"),-1,4,"fTestParameters=",0,(char*)NULL);
+   G__memvar_setup((void*)NULL,85,0,0,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TClass),-1,-2,4,"fgIsA=",0,(char*)NULL);
+   }
+   G__tag_memvar_reset();
+}
+
+extern "C" void G__cpp_setup_memvarSuperCutsONOFFCint() {
+}
+/***********************************************************
+************************************************************
+************************************************************
+************************************************************
+************************************************************
+************************************************************
+************************************************************
+***********************************************************/
+
+/*********************************************************
+* Member function information setup for each class
+*********************************************************/
+static void G__setup_memfuncMFRandomSplit(void) {
+   /* MFRandomSplit */
+   G__tag_memfunc_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFRandomSplit));
+   G__memfunc_setup("PreProcess",1030,(G__InterfaceMethod)NULL,105,-1,G__defined_typename("Int_t"),0,1,1,4,0,"U 'MParList' - 0 - pList",(char*)NULL,(void*)NULL,1);
+   G__memfunc_setup("Process",735,(G__InterfaceMethod)NULL,105,-1,G__defined_typename("Int_t"),0,0,1,4,0,"",(char*)NULL,(void*)NULL,1);
+   G__memfunc_setup("PostProcess",1157,(G__InterfaceMethod)NULL,105,-1,G__defined_typename("Int_t"),0,0,1,4,0,"",(char*)NULL,(void*)NULL,1);
+   G__memfunc_setup("MFRandomSplit",1280,G__SuperCutsONOFFCint_124_3_0,105,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFRandomSplit),-1,0,3,1,1,0,
+"d - 'Double_t' 0 - f C - - 10 NULL name "
+"C - - 10 NULL title",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("IsExpressionTrue",1676,G__SuperCutsONOFFCint_124_4_0,103,-1,G__defined_typename("Bool_t"),0,0,1,1,8,"",(char*)NULL,(void*)NULL,1);
+   G__memfunc_setup("Class",502,G__SuperCutsONOFFCint_124_5_0,85,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TClass),-1,0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("Class_Name",982,G__SuperCutsONOFFCint_124_6_0,67,-1,-1,0,0,3,1,1,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("Class_Version",1339,G__SuperCutsONOFFCint_124_7_0,115,-1,G__defined_typename("Version_t"),0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("Dictionary",1046,G__SuperCutsONOFFCint_124_8_0,121,-1,-1,0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("IsA",253,G__SuperCutsONOFFCint_124_9_0,85,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TClass),-1,0,0,1,1,8,"",(char*)NULL,(void*)NULL,1);
+   G__memfunc_setup("ShowMembers",1132,G__SuperCutsONOFFCint_124_0_1,121,-1,-1,0,2,1,1,0,
+"u 'TMemberInspector' - 1 - insp C - - 0 - parent",(char*)NULL,(void*)NULL,1);
+   G__memfunc_setup("Streamer",835,G__SuperCutsONOFFCint_124_1_1,121,-1,-1,0,1,1,1,0,"u 'TBuffer' - 1 - b",(char*)NULL,(void*)NULL,1);
+   G__memfunc_setup("StreamerNVirtual",1656,G__SuperCutsONOFFCint_124_2_1,121,-1,-1,0,1,1,1,0,"u 'TBuffer' - 1 - b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("DeclFileName",1145,G__SuperCutsONOFFCint_124_3_1,67,-1,-1,0,0,3,1,1,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("ImplFileLine",1178,G__SuperCutsONOFFCint_124_4_1,105,-1,-1,0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("ImplFileName",1171,G__SuperCutsONOFFCint_124_5_1,67,-1,-1,0,0,3,1,1,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("DeclFileLine",1152,G__SuperCutsONOFFCint_124_6_1,105,-1,-1,0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   // automatic copy constructor
+   G__memfunc_setup("MFRandomSplit",1280,G__SuperCutsONOFFCint_124_7_1,(int)('i'),G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFRandomSplit),-1,0,1,1,1,0,"u 'MFRandomSplit' - 11 - -",(char*)NULL,(void*)NULL,0);
+   // automatic destructor
+   G__memfunc_setup("~MFRandomSplit",1406,G__SuperCutsONOFFCint_124_8_1,(int)('y'),-1,-1,0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__tag_memfunc_reset();
+}
+
+static void G__setup_memfuncMTSupercutsApplied(void) {
+   /* MTSupercutsApplied */
+   G__tag_memfunc_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MTSupercutsApplied));
+   G__memfunc_setup("MTSupercutsApplied",1838,G__SuperCutsONOFFCint_136_0_0,105,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MTSupercutsApplied),-1,0,2,1,1,0,
+"C - - 10 NULL name C - - 10 NULL title",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("CreateTreeBranches",1802,G__SuperCutsONOFFCint_136_2_0,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("FillTreeBranches",1597,G__SuperCutsONOFFCint_136_3_0,103,-1,G__defined_typename("Bool_t"),0,2,1,1,0,
+"u 'TArrayD' - 0 - CutParamVector u 'TArrayD' - 0 - ShowerParamVector",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetTreePointer",1425,G__SuperCutsONOFFCint_136_4_0,85,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TTree),-1,0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("Class",502,G__SuperCutsONOFFCint_136_5_0,85,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TClass),-1,0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("Class_Name",982,G__SuperCutsONOFFCint_136_6_0,67,-1,-1,0,0,3,1,1,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("Class_Version",1339,G__SuperCutsONOFFCint_136_7_0,115,-1,G__defined_typename("Version_t"),0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("Dictionary",1046,G__SuperCutsONOFFCint_136_8_0,121,-1,-1,0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("IsA",253,G__SuperCutsONOFFCint_136_9_0,85,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TClass),-1,0,0,1,1,8,"",(char*)NULL,(void*)NULL,1);
+   G__memfunc_setup("ShowMembers",1132,G__SuperCutsONOFFCint_136_0_1,121,-1,-1,0,2,1,1,0,
+"u 'TMemberInspector' - 1 - insp C - - 0 - parent",(char*)NULL,(void*)NULL,1);
+   G__memfunc_setup("Streamer",835,G__SuperCutsONOFFCint_136_1_1,121,-1,-1,0,1,1,1,0,"u 'TBuffer' - 1 - b",(char*)NULL,(void*)NULL,1);
+   G__memfunc_setup("StreamerNVirtual",1656,G__SuperCutsONOFFCint_136_2_1,121,-1,-1,0,1,1,1,0,"u 'TBuffer' - 1 - b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("DeclFileName",1145,G__SuperCutsONOFFCint_136_3_1,67,-1,-1,0,0,3,1,1,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("ImplFileLine",1178,G__SuperCutsONOFFCint_136_4_1,105,-1,-1,0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("ImplFileName",1171,G__SuperCutsONOFFCint_136_5_1,67,-1,-1,0,0,3,1,1,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("DeclFileLine",1152,G__SuperCutsONOFFCint_136_6_1,105,-1,-1,0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   // automatic copy constructor
+   G__memfunc_setup("MTSupercutsApplied",1838,G__SuperCutsONOFFCint_136_7_1,(int)('i'),G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MTSupercutsApplied),-1,0,1,1,1,0,"u 'MTSupercutsApplied' - 11 - -",(char*)NULL,(void*)NULL,0);
+   // automatic destructor
+   G__memfunc_setup("~MTSupercutsApplied",1964,G__SuperCutsONOFFCint_136_8_1,(int)('y'),-1,-1,0,0,1,1,0,"",(char*)NULL,(void*)NULL,1);
+   G__tag_memfunc_reset();
+}
+
+static void G__setup_memfuncMSupercutsCalcONOFF(void) {
+   /* MSupercutsCalcONOFF */
+   G__tag_memfunc_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MSupercutsCalcONOFF));
+   G__memfunc_setup("PreProcess",1030,(G__InterfaceMethod)NULL,105,-1,G__defined_typename("Int_t"),0,1,1,4,0,"U 'MParList' - 0 - pList",(char*)NULL,(void*)NULL,1);
+   G__memfunc_setup("Process",735,(G__InterfaceMethod)NULL,105,-1,G__defined_typename("Int_t"),0,0,1,4,0,"",(char*)NULL,(void*)NULL,1);
+   G__memfunc_setup("GetVal",579,(G__InterfaceMethod)NULL,100,-1,G__defined_typename("Double_t"),0,1,1,4,8,"i - 'Int_t' 0 - i",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("CtsMCut",675,(G__InterfaceMethod)NULL,100,-1,G__defined_typename("Double_t"),0,5,1,4,8,
+"D - 'Double_t' 10 - a d - 'Double_t' 0 - ls "
+"d - 'Double_t' 0 - ct d - 'Double_t' 0 - ls2 "
+"d - 'Double_t' 0 - dd2",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("MSupercutsCalcONOFF",1798,G__SuperCutsONOFFCint_137_4_0,105,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MSupercutsCalcONOFF),-1,0,4,1,1,0,
+"C - - 10 \"MHillas\" hilname C - - 10 \"MHillasSrc\" hilsrcname "
+"C - - 10 NULL name C - - 10 NULL title",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetHadronnessName",1730,G__SuperCutsONOFFCint_137_5_0,121,-1,-1,0,1,1,1,0,"u 'TString' - 10 - name",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetHadronnessName",1718,G__SuperCutsONOFFCint_137_6_0,117,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,0,0,1,1,8,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetSupercutsAppliedName",2362,G__SuperCutsONOFFCint_137_7_0,121,-1,-1,0,1,1,1,0,"u 'TString' - 10 - name",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetSupercutsAppliedName",2350,G__SuperCutsONOFFCint_137_8_0,117,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString),-1,0,0,1,1,8,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetStoreAppliedSupercuts",2502,G__SuperCutsONOFFCint_137_9_0,121,-1,-1,0,1,1,1,0,"g - 'Bool_t' 0 - b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetStoreAppliedSupercuts",2490,G__SuperCutsONOFFCint_137_0_1,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetVariableNotUseTheta",2214,G__SuperCutsONOFFCint_137_1_1,121,-1,-1,0,1,1,1,0,"g - 'Bool_t' 0 - b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetVariableNotUseTheta",2202,G__SuperCutsONOFFCint_137_2_1,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetVariableUseStaticCuts",2438,G__SuperCutsONOFFCint_137_3_1,121,-1,-1,0,1,1,1,0,"g - 'Bool_t' 0 - b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetVariableUseStaticCuts",2426,G__SuperCutsONOFFCint_137_4_1,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetHillasDistLengthWidthUpperLowerLimits",4102,G__SuperCutsONOFFCint_137_5_1,121,-1,-1,0,6,1,1,0,
+"d - 'Double_t' 0 - distup d - 'Double_t' 0 - lengthup "
+"d - 'Double_t' 0 - widthup d - 'Double_t' 0 - distlow "
+"d - 'Double_t' 0 - lengthlow d - 'Double_t' 0 - widthlow",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("InitMapping",1120,G__SuperCutsONOFFCint_137_6_1,121,-1,-1,0,1,1,1,0,"U 'MHMatrix' - 0 - mat","use quantity ThetaOrig.fVal at theta",(void*)NULL,0);
+   G__memfunc_setup("StopMapping",1138,G__SuperCutsONOFFCint_137_7_1,121,-1,-1,0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("Class",502,G__SuperCutsONOFFCint_137_8_1,85,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TClass),-1,0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("Class_Name",982,G__SuperCutsONOFFCint_137_9_1,67,-1,-1,0,0,3,1,1,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("Class_Version",1339,G__SuperCutsONOFFCint_137_0_2,115,-1,G__defined_typename("Version_t"),0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("Dictionary",1046,G__SuperCutsONOFFCint_137_1_2,121,-1,-1,0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("IsA",253,G__SuperCutsONOFFCint_137_2_2,85,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TClass),-1,0,0,1,1,8,"",(char*)NULL,(void*)NULL,1);
+   G__memfunc_setup("ShowMembers",1132,G__SuperCutsONOFFCint_137_3_2,121,-1,-1,0,2,1,1,0,
+"u 'TMemberInspector' - 1 - insp C - - 0 - parent",(char*)NULL,(void*)NULL,1);
+   G__memfunc_setup("Streamer",835,G__SuperCutsONOFFCint_137_4_2,121,-1,-1,0,1,1,1,0,"u 'TBuffer' - 1 - b",(char*)NULL,(void*)NULL,1);
+   G__memfunc_setup("StreamerNVirtual",1656,G__SuperCutsONOFFCint_137_5_2,121,-1,-1,0,1,1,1,0,"u 'TBuffer' - 1 - b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("DeclFileName",1145,G__SuperCutsONOFFCint_137_6_2,67,-1,-1,0,0,3,1,1,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("ImplFileLine",1178,G__SuperCutsONOFFCint_137_7_2,105,-1,-1,0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("ImplFileName",1171,G__SuperCutsONOFFCint_137_8_2,67,-1,-1,0,0,3,1,1,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("DeclFileLine",1152,G__SuperCutsONOFFCint_137_9_2,105,-1,-1,0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   // automatic copy constructor
+   G__memfunc_setup("MSupercutsCalcONOFF",1798,G__SuperCutsONOFFCint_137_0_3,(int)('i'),G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MSupercutsCalcONOFF),-1,0,1,1,1,0,"u 'MSupercutsCalcONOFF' - 11 - -",(char*)NULL,(void*)NULL,0);
+   // automatic destructor
+   G__memfunc_setup("~MSupercutsCalcONOFF",1924,G__SuperCutsONOFFCint_137_1_3,(int)('y'),-1,-1,0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__tag_memfunc_reset();
+}
+
+static void G__setup_memfuncMHFindSignificanceONOFF(void) {
+   /* MHFindSignificanceONOFF */
+   G__tag_memfunc_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHFindSignificanceONOFF));
+   G__memfunc_setup("DetExcess",904,(G__InterfaceMethod)NULL,103,-1,G__defined_typename("Bool_t"),0,0,1,4,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("DetExcessONOFF",1280,(G__InterfaceMethod)NULL,103,-1,G__defined_typename("Bool_t"),0,0,1,4,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("FitPolynomial",1351,(G__InterfaceMethod)NULL,103,-1,G__defined_typename("Bool_t"),0,0,1,4,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("FitPolynomialOFF",1570,(G__InterfaceMethod)NULL,103,-1,G__defined_typename("Bool_t"),0,0,1,4,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("FitGaussPoly",1226,(G__InterfaceMethod)NULL,103,-1,G__defined_typename("Bool_t"),0,0,1,4,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("RebinHistogram",1438,(G__InterfaceMethod)NULL,103,-1,G__defined_typename("Bool_t"),0,2,1,4,0,
+"d - 'Double_t' 0 - x0 i - 'Int_t' 0 - nrebin",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("RebinHistogramOFF",1657,(G__InterfaceMethod)NULL,103,-1,G__defined_typename("Bool_t"),0,2,1,4,0,
+"d - 'Double_t' 0 - x0 i - 'Int_t' 0 - nrebin",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("MHFindSignificanceONOFF",2129,G__SuperCutsONOFFCint_159_7_0,105,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHFindSignificanceONOFF),-1,0,2,1,1,0,
+"C - - 10 NULL name C - - 10 NULL title",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("FindSigmaONOFF",1258,G__SuperCutsONOFFCint_159_9_0,103,-1,G__defined_typename("Bool_t"),0,13,1,1,0,
+"U 'TH1' - 0 - fhistON U 'TH1' - 0 - fhistOFF "
+"d - 'Double_t' 0 - NormFactor d - 'Double_t' 0 - alphamin "
+"d - 'Double_t' 0 - alphamax i - 'Int_t' 0 - degreeON "
+"i - 'Int_t' 0 - degreeOFF d - 'Double_t' 0 - alphasig "
+"g - 'Bool_t' 0 - drawpoly g - 'Bool_t' 0 - fitgauss "
+"g - 'Bool_t' 0 - print g - 'Bool_t' 0 - saveplots "
+"u 'TString' - 10 - psfilename",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetLimitsForOFFDataFit",2109,G__SuperCutsONOFFCint_159_0_1,121,-1,-1,0,2,1,1,0,
+"d - 'Double_t' 0 - Low d - 'Double_t' 0 - Up",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetAlphaSig",1077,G__SuperCutsONOFFCint_159_1_1,121,-1,-1,0,1,1,1,0,"d - 'Double_t' 0 - alphasig",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetUseFittedQuantities",2272,G__SuperCutsONOFFCint_159_2_1,121,-1,-1,0,1,1,1,0,"g - 'Bool_t' 0 - b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SigmaLiMa",852,G__SuperCutsONOFFCint_159_3_1,103,-1,G__defined_typename("Bool_t"),0,4,1,1,0,
+"d - 'Double_t' 0 - non d - 'Double_t' 0 - noff "
+"d - 'Double_t' 0 - gamma D - 'Double_t' 0 - siglima",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SigmaLiMaForm5",1309,G__SuperCutsONOFFCint_159_4_1,103,-1,G__defined_typename("Bool_t"),0,4,1,1,0,
+"d - 'Double_t' 0 - non d - 'Double_t' 0 - noff "
+"d - 'Double_t' 0 - gamma D - 'Double_t' 0 - siglima",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SigmaVsAlphaONOFF",1560,G__SuperCutsONOFFCint_159_5_1,103,-1,G__defined_typename("Bool_t"),0,6,1,1,0,
+"U 'TH1' - 0 - fhistON U 'TH1' - 0 - fhistOFF "
+"d - 'Double_t' 0 - alphamin d - 'Double_t' 0 - alphamax "
+"i - 'Int_t' 0 - degree g - 'Bool_t' 0 - print",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetSignificance",1507,G__SuperCutsONOFFCint_159_6_1,100,-1,G__defined_typename("Double_t"),0,0,1,1,0,"","{ return fSigLiMa; }",(void*)NULL,0);
+   G__memfunc_setup("GetUseFittedQuantities",2260,G__SuperCutsONOFFCint_159_7_1,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("ComputeHistOFFNormalized",2405,G__SuperCutsONOFFCint_159_8_1,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("DrawFit",689,G__SuperCutsONOFFCint_159_9_1,103,-1,G__defined_typename("Bool_t"),0,1,1,1,0,"C - 'Option_t' 10 NULL opt",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("DrawHistOFF",1025,G__SuperCutsONOFFCint_159_0_2,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("DrawHistOFFNormalized",2070,G__SuperCutsONOFFCint_159_1_2,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetDegree",876,G__SuperCutsONOFFCint_159_2_2,102,-1,G__defined_typename("Float_t"),0,0,1,1,8,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetProb",691,G__SuperCutsONOFFCint_159_3_2,102,-1,G__defined_typename("Float_t"),0,0,1,1,8,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetNdf",568,G__SuperCutsONOFFCint_159_4_2,102,-1,G__defined_typename("Float_t"),0,0,1,1,8,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetGamma",771,G__SuperCutsONOFFCint_159_5_2,102,-1,G__defined_typename("Float_t"),0,0,1,1,8,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetNon",587,G__SuperCutsONOFFCint_159_6_2,102,-1,G__defined_typename("Float_t"),0,0,1,1,8,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetNex",587,G__SuperCutsONOFFCint_159_7_2,102,-1,G__defined_typename("Float_t"),0,0,1,1,8,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetNbg",567,G__SuperCutsONOFFCint_159_8_2,102,-1,G__defined_typename("Float_t"),0,0,1,1,8,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetSigLiMa1",983,G__SuperCutsONOFFCint_159_9_2,102,-1,G__defined_typename("Float_t"),0,0,1,1,8,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetSigLiMa2",984,G__SuperCutsONOFFCint_159_0_3,102,-1,G__defined_typename("Float_t"),0,0,1,1,8,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetSigLiMa3",985,G__SuperCutsONOFFCint_159_1_3,102,-1,G__defined_typename("Float_t"),0,0,1,1,8,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetMbins",793,G__SuperCutsONOFFCint_159_2_3,102,-1,G__defined_typename("Float_t"),0,0,1,1,8,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetAlphasi",994,G__SuperCutsONOFFCint_159_3_3,102,-1,G__defined_typename("Float_t"),0,0,1,1,8,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetNexONOFF",963,G__SuperCutsONOFFCint_159_4_3,102,-1,G__defined_typename("Float_t"),0,0,1,1,8,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetNexONOFFFitted",1571,G__SuperCutsONOFFCint_159_5_3,102,-1,G__defined_typename("Float_t"),0,0,1,1,8,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetRebin",796,G__SuperCutsONOFFCint_159_6_3,121,-1,-1,0,1,1,1,0,"g - 'Bool_t' 0 kTRUE b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetReduceDegree",1488,G__SuperCutsONOFFCint_159_7_3,121,-1,-1,0,1,1,1,0,"g - 'Bool_t' 0 kTRUE b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetPsFilename",1296,G__SuperCutsONOFFCint_159_8_3,121,-1,-1,0,1,1,1,0,"U 'TPostScript' - 0 - PsFile",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("PrintPoly",945,G__SuperCutsONOFFCint_159_9_3,121,-1,-1,0,1,1,1,0,"C - 'Option_t' 10 NULL opt",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("PrintPolyOFF",1164,G__SuperCutsONOFFCint_159_0_4,121,-1,-1,0,1,1,1,0,"C - 'Option_t' 10 NULL opt",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("PrintPolyGauss",1460,G__SuperCutsONOFFCint_159_1_4,121,-1,-1,0,1,1,1,0,"C - 'Option_t' 10 NULL opt",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("Class",502,G__SuperCutsONOFFCint_159_2_4,85,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TClass),-1,0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("Class_Name",982,G__SuperCutsONOFFCint_159_3_4,67,-1,-1,0,0,3,1,1,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("Class_Version",1339,G__SuperCutsONOFFCint_159_4_4,115,-1,G__defined_typename("Version_t"),0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("Dictionary",1046,G__SuperCutsONOFFCint_159_5_4,121,-1,-1,0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("IsA",253,G__SuperCutsONOFFCint_159_6_4,85,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TClass),-1,0,0,1,1,8,"",(char*)NULL,(void*)NULL,1);
+   G__memfunc_setup("ShowMembers",1132,G__SuperCutsONOFFCint_159_7_4,121,-1,-1,0,2,1,1,0,
+"u 'TMemberInspector' - 1 - insp C - - 0 - parent",(char*)NULL,(void*)NULL,1);
+   G__memfunc_setup("Streamer",835,G__SuperCutsONOFFCint_159_8_4,121,-1,-1,0,1,1,1,0,"u 'TBuffer' - 1 - b",(char*)NULL,(void*)NULL,1);
+   G__memfunc_setup("StreamerNVirtual",1656,G__SuperCutsONOFFCint_159_9_4,121,-1,-1,0,1,1,1,0,"u 'TBuffer' - 1 - b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("DeclFileName",1145,G__SuperCutsONOFFCint_159_0_5,67,-1,-1,0,0,3,1,1,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("ImplFileLine",1178,G__SuperCutsONOFFCint_159_1_5,105,-1,-1,0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("ImplFileName",1171,G__SuperCutsONOFFCint_159_2_5,67,-1,-1,0,0,3,1,1,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("DeclFileLine",1152,G__SuperCutsONOFFCint_159_3_5,105,-1,-1,0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   // automatic copy constructor
+   G__memfunc_setup("MHFindSignificanceONOFF",2129,G__SuperCutsONOFFCint_159_4_5,(int)('i'),
+G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHFindSignificanceONOFF),-1,0,1,1,1,0,"u 'MHFindSignificanceONOFF' - 11 - -",(char*)NULL,(void*)NULL,0);
+   // automatic destructor
+   G__memfunc_setup("~MHFindSignificanceONOFF",2255,G__SuperCutsONOFFCint_159_5_5,(int)('y'),-1,-1,0,0,1,1,0,"",(char*)NULL,(void*)NULL,1);
+   G__tag_memfunc_reset();
+}
+
+static void G__setup_memfuncMFindSupercutsONOFF(void) {
+   /* MFindSupercutsONOFF */
+   G__tag_memfunc_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFindSupercutsONOFF));
+   G__memfunc_setup("MFindSupercutsONOFF",1812,G__SuperCutsONOFFCint_205_0_0,105,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFindSupercutsONOFF),-1,0,2,1,1,0,
+"C - - 10 NULL name C - - 10 NULL title",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetFilenameTraining",1929,G__SuperCutsONOFFCint_205_2_0,121,-1,-1,0,2,1,1,0,
+"u 'TString' - 11 - name i - 'Int_t' 10 - howmany",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetFilenameTest",1517,G__SuperCutsONOFFCint_205_3_0,121,-1,-1,0,2,1,1,0,
+"u 'TString' - 11 - name i - 'Int_t' 10 - howmany",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetFilenameParam",1598,G__SuperCutsONOFFCint_205_4_0,121,-1,-1,0,1,1,1,0,"u 'TString' - 11 - name",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetHadronnessName",1730,G__SuperCutsONOFFCint_205_5_0,121,-1,-1,0,1,1,1,0,"u 'TString' - 11 - name",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetHadronnessNameOFF",1949,G__SuperCutsONOFFCint_205_6_0,121,-1,-1,0,1,1,1,0,"u 'TString' - 11 - name",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetSupercutsAppliedTreeNames",2877,G__SuperCutsONOFFCint_205_7_0,121,-1,-1,0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetAlphaDistributionsRootFilename",3402,G__SuperCutsONOFFCint_205_8_0,121,-1,-1,0,1,1,1,0,"u 'TString' - 11 - name",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetAlphaSig",1077,G__SuperCutsONOFFCint_205_9_0,103,-1,G__defined_typename("Bool_t"),0,1,1,1,0,"d - 'Double_t' 0 - alphasig",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetAlphaBkgMin",1354,G__SuperCutsONOFFCint_205_0_1,103,-1,G__defined_typename("Bool_t"),0,1,1,1,0,"d - 'Double_t' 0 - alphabkgmin",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetAlphaBkgMax",1356,G__SuperCutsONOFFCint_205_1_1,103,-1,G__defined_typename("Bool_t"),0,1,1,1,0,"d - 'Double_t' 0 - alphabkgmax",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("CheckAlphaSigBkg",1531,G__SuperCutsONOFFCint_205_2_1,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetUseFittedQuantities",2272,G__SuperCutsONOFFCint_205_3_1,121,-1,-1,0,1,1,1,0,"g - 'Bool_t' 0 - b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetPostScriptFile",1735,G__SuperCutsONOFFCint_205_4_1,121,-1,-1,0,1,1,1,0,"U 'TPostScript' - 0 - PsFile",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetPostScriptFile2",1785,G__SuperCutsONOFFCint_205_5_1,121,-1,-1,0,1,1,1,0,"u 'TPostScript' - 1 - PsFile",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetPsFilenameString",1927,G__SuperCutsONOFFCint_205_6_1,121,-1,-1,0,1,1,1,0,"u 'TString' - 10 - filename",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetMatrixFilter",1543,G__SuperCutsONOFFCint_205_7_1,121,-1,-1,0,1,1,1,0,"U 'MFilter' - 0 - filter",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("DefineTrainMatrix",1726,G__SuperCutsONOFFCint_205_8_1,103,-1,G__defined_typename("Bool_t"),0,4,1,1,0,
+"u 'TString' - 11 - name u 'MH3' - 1 - href "
+"i - 'Int_t' 10 - howmany u 'TString' - 11 - filetrain",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("DefineTestMatrix",1632,G__SuperCutsONOFFCint_205_9_1,103,-1,G__defined_typename("Bool_t"),0,4,1,1,0,
+"u 'TString' - 11 - name u 'MH3' - 1 - href "
+"i - 'Int_t' 10 - howmany u 'TString' - 11 - filetest",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("DefineTrainTestMatrix",2142,G__SuperCutsONOFFCint_205_0_2,103,-1,G__defined_typename("Bool_t"),0,6,1,1,0,
+"u 'TString' - 11 - name u 'MH3' - 1 - href "
+"i - 'Int_t' 10 - howmanytrain i - 'Int_t' 10 - howmanytest "
+"u 'TString' - 11 - filetrain u 'TString' - 11 - filetest",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("DefineTrainTestMatrixThetaRange",3137,G__SuperCutsONOFFCint_205_1_2,103,-1,G__defined_typename("Bool_t"),0,7,1,1,0,
+"u 'TString' - 11 - name d - 'Double_t' 10 - whichfractiontrain "
+"d - 'Double_t' 10 - whichfractiontest d - 'Double_t' 0 - ThetaMin "
+"d - 'Double_t' 0 - ThetaMax u 'TString' - 11 - filetrain "
+"u 'TString' - 11 - filetest",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("DefineTrainTestMatrixOFFThetaRange",3356,G__SuperCutsONOFFCint_205_2_2,103,-1,G__defined_typename("Bool_t"),0,7,1,1,0,
+"u 'TString' - 11 - name d - 'Double_t' 10 - whichfractiontrain "
+"d - 'Double_t' 10 - whichfractiontest d - 'Double_t' 0 - ThetaMin "
+"d - 'Double_t' 0 - ThetaMax u 'TString' - 11 - filetrain "
+"u 'TString' - 11 - filetest",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetMatrixTrain",1427,G__SuperCutsONOFFCint_205_3_2,85,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHMatrix),-1,0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetMatrixTest",1333,G__SuperCutsONOFFCint_205_4_2,85,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHMatrix),-1,0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetMatrixTrainOFF",1646,G__SuperCutsONOFFCint_205_5_2,85,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHMatrix),-1,0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetMatrixTestOFF",1552,G__SuperCutsONOFFCint_205_6_2,85,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHMatrix),-1,0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetUseOrigDistribution",2282,G__SuperCutsONOFFCint_205_7_2,121,-1,-1,0,1,1,1,0,"g - 'Bool_t' 0 - b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("ReadMatrix",1009,G__SuperCutsONOFFCint_205_8_2,103,-1,G__defined_typename("Bool_t"),0,2,1,1,0,
+"u 'TString' - 11 - filetrain u 'TString' - 11 - filetest",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("ReadMatrixOFF",1228,G__SuperCutsONOFFCint_205_9_2,103,-1,G__defined_typename("Bool_t"),0,2,1,1,0,
+"u 'TString' - 11 - filetrainOFF u 'TString' - 11 - filetestOFF",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("ComputeNormFactorTrain",2262,G__SuperCutsONOFFCint_205_0_3,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("ComputeNormFactorTest",2168,G__SuperCutsONOFFCint_205_1_3,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("FindParams",997,G__SuperCutsONOFFCint_205_2_3,103,-1,G__defined_typename("Bool_t"),0,3,1,1,0,
+"u 'TString' - 0 - parSCinit u 'TArrayD' - 1 - params "
+"u 'TArrayD' - 1 - steps",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("TestParamsOnTestSample",2243,G__SuperCutsONOFFCint_205_3_3,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("TestParamsOnTrainSample",2337,G__SuperCutsONOFFCint_205_4_3,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetThetaRange",1295,G__SuperCutsONOFFCint_205_5_3,103,-1,G__defined_typename("Bool_t"),0,2,1,1,0,
+"d - 'Double_t' 0 - ThetaMin d - 'Double_t' 0 - ThetaMax",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetSizeRange",1204,G__SuperCutsONOFFCint_205_6_3,103,-1,G__defined_typename("Bool_t"),0,2,1,1,0,
+"d - 'Double_t' 0 - SizeMin d - 'Double_t' 0 - SizeMax",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetAlphaPlotBinining",2015,G__SuperCutsONOFFCint_205_7_3,121,-1,-1,0,3,1,1,0,
+"i - 'Int_t' 0 - nbins d - 'Double_t' 0 - binlow "
+"d - 'Double_t' 0 - binup",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetNormFactorTrain",1817,G__SuperCutsONOFFCint_205_8_3,100,-1,G__defined_typename("Double_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetNormFactorTest",1723,G__SuperCutsONOFFCint_205_9_3,100,-1,G__defined_typename("Double_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetSigmaLiMaTrain",1650,G__SuperCutsONOFFCint_205_0_4,100,-1,G__defined_typename("Double_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetSigmaLiMaTest",1556,G__SuperCutsONOFFCint_205_1_4,100,-1,G__defined_typename("Double_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetNexTrain",1097,G__SuperCutsONOFFCint_205_2_4,100,-1,G__defined_typename("Double_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetNexTest",1003,G__SuperCutsONOFFCint_205_3_4,100,-1,G__defined_typename("Double_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetAlphaSig",1065,G__SuperCutsONOFFCint_205_4_4,100,-1,G__defined_typename("Double_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetAlphaBkgMin",1342,G__SuperCutsONOFFCint_205_5_4,100,-1,G__defined_typename("Double_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetAlphaBkgMax",1344,G__SuperCutsONOFFCint_205_6_4,100,-1,G__defined_typename("Double_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetUseFittedQuantities",2260,G__SuperCutsONOFFCint_205_7_4,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetSkipOptimization",1982,G__SuperCutsONOFFCint_205_8_4,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetUseInitialSCParams",2065,G__SuperCutsONOFFCint_205_9_4,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetGammaEfficiency",1796,G__SuperCutsONOFFCint_205_0_5,103,-1,G__defined_typename("Bool_t"),0,1,1,1,0,"d - 'Double_t' 0 - gammaeff",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetGammaEfficiency",1784,G__SuperCutsONOFFCint_205_1_5,100,-1,G__defined_typename("Double_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetTuneNormFactor",1731,G__SuperCutsONOFFCint_205_2_5,121,-1,-1,0,1,1,1,0,"g - 'Bool_t' 0 - b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetNormFactorFromAlphaBkg",2485,G__SuperCutsONOFFCint_205_3_5,121,-1,-1,0,1,1,1,0,"g - 'Bool_t' 0 - b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetSkipOptimization",1994,G__SuperCutsONOFFCint_205_4_5,121,-1,-1,0,1,1,1,0,"g - 'Bool_t' 0 - b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetUseInitialSCParams",2077,G__SuperCutsONOFFCint_205_5_5,121,-1,-1,0,1,1,1,0,"g - 'Bool_t' 0 - b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetVariableNotUseTheta",2214,G__SuperCutsONOFFCint_205_6_5,121,-1,-1,0,1,1,1,0,"g - 'Bool_t' 0 - b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetVariableNotUseTheta",2202,G__SuperCutsONOFFCint_205_7_5,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetVariableUseStaticCuts",2438,G__SuperCutsONOFFCint_205_8_5,121,-1,-1,0,1,1,1,0,"g - 'Bool_t' 0 - b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetVariableUseStaticCuts",2426,G__SuperCutsONOFFCint_205_9_5,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("Class",502,G__SuperCutsONOFFCint_205_0_6,85,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TClass),-1,0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("Class_Name",982,G__SuperCutsONOFFCint_205_1_6,67,-1,-1,0,0,3,1,1,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("Class_Version",1339,G__SuperCutsONOFFCint_205_2_6,115,-1,G__defined_typename("Version_t"),0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("Dictionary",1046,G__SuperCutsONOFFCint_205_3_6,121,-1,-1,0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("IsA",253,G__SuperCutsONOFFCint_205_4_6,85,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TClass),-1,0,0,1,1,8,"",(char*)NULL,(void*)NULL,1);
+   G__memfunc_setup("ShowMembers",1132,G__SuperCutsONOFFCint_205_5_6,121,-1,-1,0,2,1,1,0,
+"u 'TMemberInspector' - 1 - insp C - - 0 - parent",(char*)NULL,(void*)NULL,1);
+   G__memfunc_setup("Streamer",835,G__SuperCutsONOFFCint_205_6_6,121,-1,-1,0,1,1,1,0,"u 'TBuffer' - 1 - b",(char*)NULL,(void*)NULL,1);
+   G__memfunc_setup("StreamerNVirtual",1656,G__SuperCutsONOFFCint_205_7_6,121,-1,-1,0,1,1,1,0,"u 'TBuffer' - 1 - b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("DeclFileName",1145,G__SuperCutsONOFFCint_205_8_6,67,-1,-1,0,0,3,1,1,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("ImplFileLine",1178,G__SuperCutsONOFFCint_205_9_6,105,-1,-1,0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("ImplFileName",1171,G__SuperCutsONOFFCint_205_0_7,67,-1,-1,0,0,3,1,1,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("DeclFileLine",1152,G__SuperCutsONOFFCint_205_1_7,105,-1,-1,0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   // automatic copy constructor
+   G__memfunc_setup("MFindSupercutsONOFF",1812,G__SuperCutsONOFFCint_205_2_7,(int)('i'),G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFindSupercutsONOFF),-1,0,1,1,1,0,"u 'MFindSupercutsONOFF' - 11 - -",(char*)NULL,(void*)NULL,0);
+   // automatic destructor
+   G__memfunc_setup("~MFindSupercutsONOFF",1938,G__SuperCutsONOFFCint_205_3_7,(int)('y'),-1,-1,0,0,1,1,0,"",(char*)NULL,(void*)NULL,1);
+   G__tag_memfunc_reset();
+}
+
+static void G__setup_memfuncMFindSupercutsONOFFThetaLoop(void) {
+   /* MFindSupercutsONOFFThetaLoop */
+   G__tag_memfunc_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFindSupercutsONOFFThetaLoop));
+   G__memfunc_setup("MFindSupercutsONOFFThetaLoop",2724,G__SuperCutsONOFFCint_206_0_0,105,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFindSupercutsONOFFThetaLoop),-1,0,2,1,1,0,
+"C - - 10 NULL name C - - 10 NULL title",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetHadronnessName",1730,G__SuperCutsONOFFCint_206_2_0,121,-1,-1,0,1,1,1,0,"u 'TString' - 11 - name",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetHadronnessNameOFF",1949,G__SuperCutsONOFFCint_206_3_0,121,-1,-1,0,1,1,1,0,"u 'TString' - 11 - name",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetPathForFiles",1491,G__SuperCutsONOFFCint_206_4_0,121,-1,-1,0,1,1,1,0,"u 'TString' - 11 - path",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetDataONOFFRootFilenames",2390,G__SuperCutsONOFFCint_206_5_0,121,-1,-1,0,2,1,1,0,
+"u 'TString' - 11 - name1 u 'TString' - 11 - name2",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetALLNames",1017,G__SuperCutsONOFFCint_206_6_0,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetNamesManually",1635,G__SuperCutsONOFFCint_206_7_0,103,-1,G__defined_typename("Bool_t"),0,6,1,1,0,
+"U 'TString' - 0 - OptSCParamFilenameVector U 'TString' - 0 - ThetaRangeStringVector "
+"U 'TString' - 0 - TrainMatrixONFilenameVector U 'TString' - 0 - TestMatrixONFilenameVector "
+"U 'TString' - 0 - TrainMatrixOFFFilenameVector U 'TString' - 0 - TestMatrixOFFFilenameVector",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetAlphaDistributionsRootFilename",3402,G__SuperCutsONOFFCint_206_8_0,103,-1,G__defined_typename("Bool_t"),0,1,1,1,0,"u 'TString' - 11 - name",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetAlphaSig",1077,G__SuperCutsONOFFCint_206_9_0,103,-1,G__defined_typename("Bool_t"),0,1,1,1,0,"d - 'Double_t' 0 - alphasig",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetAlphaBkgMin",1354,G__SuperCutsONOFFCint_206_0_1,103,-1,G__defined_typename("Bool_t"),0,1,1,1,0,"d - 'Double_t' 0 - alphabkgmin",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetAlphaBkgMax",1356,G__SuperCutsONOFFCint_206_1_1,103,-1,G__defined_typename("Bool_t"),0,1,1,1,0,"d - 'Double_t' 0 - alphabkgmax",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("CheckAlphaSigBkg",1531,G__SuperCutsONOFFCint_206_2_1,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetPostScriptFile",1735,G__SuperCutsONOFFCint_206_3_1,121,-1,-1,0,1,1,1,0,"U 'TPostScript' - 0 - PsFile",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetCosThetaRangeVector",2215,G__SuperCutsONOFFCint_206_4_1,103,-1,G__defined_typename("Bool_t"),0,1,1,1,0,"u 'TArrayD' - 11 - d",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetThetaRange",1295,G__SuperCutsONOFFCint_206_5_1,103,-1,G__defined_typename("Bool_t"),0,1,1,1,0,"i - 'Int_t' 0 - thetabin",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetAlphaPlotBinining",2015,G__SuperCutsONOFFCint_206_6_1,121,-1,-1,0,3,1,1,0,
+"i - 'Int_t' 0 - nbins d - 'Double_t' 0 - binlow "
+"d - 'Double_t' 0 - binup",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetNormFactorTrainHist",2237,G__SuperCutsONOFFCint_206_7_1,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetNormFactorTestHist",2143,G__SuperCutsONOFFCint_206_8_1,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetSigmaLiMaTrainHist",2070,G__SuperCutsONOFFCint_206_9_1,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetSigmaLiMaTestHist",1976,G__SuperCutsONOFFCint_206_0_2,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetNexTrainHist",1517,G__SuperCutsONOFFCint_206_1_2,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetNexTestHist",1423,G__SuperCutsONOFFCint_206_2_2,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetNexSigmaLiMaNormFactorNEvtsTrainTestHist",4300,G__SuperCutsONOFFCint_206_3_2,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetSuccessfulThetaBinsHist",2662,G__SuperCutsONOFFCint_206_4_2,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("WriteNexSigmaLiMaNormFactorNEvtsTrainTestHistToFile",5102,G__SuperCutsONOFFCint_206_5_2,121,-1,-1,0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("WriteSuccessfulThetaBinsHistToFile",3464,G__SuperCutsONOFFCint_206_6_2,121,-1,-1,0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetInitSCPar",1145,G__SuperCutsONOFFCint_206_7_2,103,-1,G__defined_typename("Bool_t"),0,1,1,1,0,"u 'TArrayD' - 1 - d",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetInitSCParSteps",1672,G__SuperCutsONOFFCint_206_8_2,103,-1,G__defined_typename("Bool_t"),0,1,1,1,0,"u 'TArrayD' - 1 - d",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("ReadSCParamsFromAsciiFile",2419,G__SuperCutsONOFFCint_206_9_2,103,-1,G__defined_typename("Bool_t"),0,2,1,1,0,
+"C - - 10 - filename i - 'Int_t' 0 - Nparams",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetFractionTrainTestOnOffEvents",3149,G__SuperCutsONOFFCint_206_0_3,121,-1,-1,0,4,1,1,0,
+"d - 'Double_t' 0 - fontrain d - 'Double_t' 0 - fontest "
+"d - 'Double_t' 0 - fofftrain d - 'Double_t' 0 - fofftest",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetTuneNormFactor",1731,G__SuperCutsONOFFCint_206_1_3,121,-1,-1,0,1,1,1,0,"g - 'Bool_t' 0 - b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetGammaEfficiency",1796,G__SuperCutsONOFFCint_206_2_3,103,-1,G__defined_typename("Bool_t"),0,1,1,1,0,"d - 'Double_t' 0 - gammaeff",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetNormFactorFromAlphaBkg",2485,G__SuperCutsONOFFCint_206_3_3,121,-1,-1,0,1,1,1,0,"g - 'Bool_t' 0 - b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetUseFittedQuantities",2272,G__SuperCutsONOFFCint_206_4_3,121,-1,-1,0,1,1,1,0,"g - 'Bool_t' 0 - b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetReadMatricesFromFile",2292,G__SuperCutsONOFFCint_206_5_3,121,-1,-1,0,1,1,1,0,"g - 'Bool_t' 0 - b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetTrainParameters",1854,G__SuperCutsONOFFCint_206_6_3,121,-1,-1,0,1,1,1,0,"g - 'Bool_t' 0 - b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetTestParameters",1760,G__SuperCutsONOFFCint_206_7_3,121,-1,-1,0,1,1,1,0,"g - 'Bool_t' 0 - b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetSkipOptimization",1994,G__SuperCutsONOFFCint_206_8_3,121,-1,-1,0,1,1,1,0,"g - 'Bool_t' 0 - b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetUseInitialSCParams",2077,G__SuperCutsONOFFCint_206_9_3,121,-1,-1,0,1,1,1,0,"g - 'Bool_t' 0 - b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetVariableNotUseTheta",2214,G__SuperCutsONOFFCint_206_0_4,121,-1,-1,0,1,1,1,0,"g - 'Bool_t' 0 - b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetVariableNotUseTheta",2202,G__SuperCutsONOFFCint_206_1_4,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetVariableUseStaticCuts",2438,G__SuperCutsONOFFCint_206_2_4,121,-1,-1,0,1,1,1,0,"g - 'Bool_t' 0 - b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetVariableUseStaticCuts",2426,G__SuperCutsONOFFCint_206_3_4,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("SetSizeRange",1204,G__SuperCutsONOFFCint_206_4_4,121,-1,-1,0,2,1,1,0,
+"d - 'Double_t' 0 - SizeMin d - 'Double_t' 0 - SizeMax",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("LoopOverThetaRanges",1932,G__SuperCutsONOFFCint_206_5_4,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("ComputeNexSignificanceVSAlphaSig",3197,G__SuperCutsONOFFCint_206_6_4,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("ComputeOverallSignificance",2677,G__SuperCutsONOFFCint_206_7_4,103,-1,G__defined_typename("Bool_t"),0,2,1,1,0,
+"g - 'Bool_t' 0 - CombineTrainData g - 'Bool_t' 0 - CombineTestData",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetOverallNexTrain",1822,G__SuperCutsONOFFCint_206_8_4,100,-1,G__defined_typename("Double_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetOverallNexTest",1728,G__SuperCutsONOFFCint_206_9_4,100,-1,G__defined_typename("Double_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetOverallSigmaLiMaTrain",2375,G__SuperCutsONOFFCint_206_0_5,100,-1,G__defined_typename("Double_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetOverallSigmaLiMaTest",2281,G__SuperCutsONOFFCint_206_1_5,100,-1,G__defined_typename("Double_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetGammaEfficiency",1784,G__SuperCutsONOFFCint_206_2_5,100,-1,G__defined_typename("Double_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetAlphaSig",1065,G__SuperCutsONOFFCint_206_3_5,100,-1,G__defined_typename("Double_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetAlphaBkgMin",1342,G__SuperCutsONOFFCint_206_4_5,100,-1,G__defined_typename("Double_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetAlphaBkgMax",1344,G__SuperCutsONOFFCint_206_5_5,100,-1,G__defined_typename("Double_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetSkipOptimization",1982,G__SuperCutsONOFFCint_206_6_5,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("GetUseFittedQuantities",2260,G__SuperCutsONOFFCint_206_7_5,103,-1,G__defined_typename("Bool_t"),0,0,1,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("Class",502,G__SuperCutsONOFFCint_206_8_5,85,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TClass),-1,0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("Class_Name",982,G__SuperCutsONOFFCint_206_9_5,67,-1,-1,0,0,3,1,1,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("Class_Version",1339,G__SuperCutsONOFFCint_206_0_6,115,-1,G__defined_typename("Version_t"),0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("Dictionary",1046,G__SuperCutsONOFFCint_206_1_6,121,-1,-1,0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("IsA",253,G__SuperCutsONOFFCint_206_2_6,85,G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TClass),-1,0,0,1,1,8,"",(char*)NULL,(void*)NULL,1);
+   G__memfunc_setup("ShowMembers",1132,G__SuperCutsONOFFCint_206_3_6,121,-1,-1,0,2,1,1,0,
+"u 'TMemberInspector' - 1 - insp C - - 0 - parent",(char*)NULL,(void*)NULL,1);
+   G__memfunc_setup("Streamer",835,G__SuperCutsONOFFCint_206_4_6,121,-1,-1,0,1,1,1,0,"u 'TBuffer' - 1 - b",(char*)NULL,(void*)NULL,1);
+   G__memfunc_setup("StreamerNVirtual",1656,G__SuperCutsONOFFCint_206_5_6,121,-1,-1,0,1,1,1,0,"u 'TBuffer' - 1 - b",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("DeclFileName",1145,G__SuperCutsONOFFCint_206_6_6,67,-1,-1,0,0,3,1,1,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("ImplFileLine",1178,G__SuperCutsONOFFCint_206_7_6,105,-1,-1,0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("ImplFileName",1171,G__SuperCutsONOFFCint_206_8_6,67,-1,-1,0,0,3,1,1,"",(char*)NULL,(void*)NULL,0);
+   G__memfunc_setup("DeclFileLine",1152,G__SuperCutsONOFFCint_206_9_6,105,-1,-1,0,0,3,1,0,"",(char*)NULL,(void*)NULL,0);
+   // automatic copy constructor
+   G__memfunc_setup("MFindSupercutsONOFFThetaLoop",2724,G__SuperCutsONOFFCint_206_0_7,(int)('i'),
+G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFindSupercutsONOFFThetaLoop),-1,0,1,1,1,0,"u 'MFindSupercutsONOFFThetaLoop' - 11 - -",(char*)NULL,(void*)NULL,0);
+   // automatic destructor
+   G__memfunc_setup("~MFindSupercutsONOFFThetaLoop",2850,G__SuperCutsONOFFCint_206_1_7,(int)('y'),-1,-1,0,0,1,1,0,"",(char*)NULL,(void*)NULL,1);
+   G__tag_memfunc_reset();
+}
+
+
+/*********************************************************
+* Member function information setup
+*********************************************************/
+extern "C" void G__cpp_setup_memfuncSuperCutsONOFFCint() {
+}
+
+/*********************************************************
+* Global variable information setup for each class
+*********************************************************/
+static void G__cpp_setup_global0() {
+
+   /* Setting up global variables */
+   G__resetplocal();
+
+}
+
+static void G__cpp_setup_global1() {
+}
+
+static void G__cpp_setup_global2() {
+
+   G__resetglobalenv();
+}
+extern "C" void G__cpp_setup_globalSuperCutsONOFFCint() {
+  G__cpp_setup_global0();
+  G__cpp_setup_global1();
+  G__cpp_setup_global2();
+}
+
+/*********************************************************
+* Global function information setup for each class
+*********************************************************/
+static void G__cpp_setup_func0() {
+   G__lastifuncposition();
+
+}
+
+static void G__cpp_setup_func1() {
+}
+
+static void G__cpp_setup_func2() {
+}
+
+static void G__cpp_setup_func3() {
+
+   G__resetifuncposition();
+}
+
+extern "C" void G__cpp_setup_funcSuperCutsONOFFCint() {
+  G__cpp_setup_func0();
+  G__cpp_setup_func1();
+  G__cpp_setup_func2();
+  G__cpp_setup_func3();
+}
+
+/*********************************************************
+* Class,struct,union,enum tag information setup
+*********************************************************/
+/* Setup class/struct taginfo */
+G__linked_taginfo G__SuperCutsONOFFCintLN_TClass = { "TClass" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_TBuffer = { "TBuffer" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_TMemberInspector = { "TMemberInspector" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_TObject = { "TObject" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_TString = { "TString" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_TArrayD = { "TArrayD" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_MParContainer = { "MParContainer" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_MInputStreamID = { "MInputStreamID" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_MFilter = { "MFilter" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_MParList = { "MParList" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_MTask = { "MTask" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_MFRandomSplit = { "MFRandomSplit" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_MHillas = { "MHillas" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_MHillasSrc = { "MHillasSrc" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_MHillasExt = { "MHillasExt" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_MNewImagePar = { "MNewImagePar" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_MPointingPos = { "MPointingPos" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_MGeomCam = { "MGeomCam" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_MHadronness = { "MHadronness" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_MHMatrix = { "MHMatrix" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_MSupercuts = { "MSupercuts" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_MTSupercutsApplied = { "MTSupercutsApplied" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_MSupercutsCalcONOFF = { "MSupercutsCalcONOFF" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_TH1 = { "TH1" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_TCanvas = { "TCanvas" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_MH = { "MH" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_TPostScript = { "TPostScript" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_TF1 = { "TF1" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_MHFindSignificanceONOFF = { "MHFindSignificanceONOFF" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_TTree = { "TTree" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_TArrayI = { "TArrayI" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_TH1F = { "TH1F" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_MEvtLoop = { "MEvtLoop" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_MH3 = { "MH3" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_MFindSupercutsONOFF = { "MFindSupercutsONOFF" , 99 , -1 };
+G__linked_taginfo G__SuperCutsONOFFCintLN_MFindSupercutsONOFFThetaLoop = { "MFindSupercutsONOFFThetaLoop" , 99 , -1 };
+
+/* Reset class/struct taginfo */
+extern "C" void G__cpp_reset_tagtableSuperCutsONOFFCint() {
+  G__SuperCutsONOFFCintLN_TClass.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_TBuffer.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_TMemberInspector.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_TObject.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_TString.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_TArrayD.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_MParContainer.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_MInputStreamID.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_MFilter.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_MParList.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_MTask.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_MFRandomSplit.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_MHillas.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_MHillasSrc.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_MHillasExt.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_MNewImagePar.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_MPointingPos.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_MGeomCam.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_MHadronness.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_MHMatrix.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_MSupercuts.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_MTSupercutsApplied.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_MSupercutsCalcONOFF.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_TH1.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_TCanvas.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_MH.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_TPostScript.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_TF1.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_MHFindSignificanceONOFF.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_TTree.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_TArrayI.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_TH1F.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_MEvtLoop.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_MH3.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_MFindSupercutsONOFF.tagnum = -1 ;
+  G__SuperCutsONOFFCintLN_MFindSupercutsONOFFThetaLoop.tagnum = -1 ;
+}
+
+
+extern "C" void G__cpp_setup_tagtableSuperCutsONOFFCint() {
+
+   /* Setting up class,struct,union tag entry */
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TClass);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TBuffer);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TMemberInspector);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TObject);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TString);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TArrayD);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MParContainer);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MInputStreamID);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFilter);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MParList);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MTask);
+   G__tagtable_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFRandomSplit),sizeof(MFRandomSplit),-1,323584,"A Filter giving kTRUE with a certain probability",G__setup_memvarMFRandomSplit,G__setup_memfuncMFRandomSplit);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHillas);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHillasSrc);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHillasExt);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MNewImagePar);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MPointingPos);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MGeomCam);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHadronness);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHMatrix);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MSupercuts);
+   G__tagtable_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MTSupercutsApplied),sizeof(MTSupercutsApplied),-1,324864,"Storage Container for the supercuts applied",G__setup_memvarMTSupercutsApplied,G__setup_memfuncMTSupercutsApplied);
+   G__tagtable_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MSupercutsCalcONOFF),sizeof(MSupercutsCalcONOFF),-1,323840,"A class to evaluate the Supercuts",G__setup_memvarMSupercutsCalcONOFF,G__setup_memfuncMSupercutsCalcONOFF);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TH1);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TCanvas);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MH);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TPostScript);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TF1);
+   G__tagtable_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MHFindSignificanceONOFF),sizeof(MHFindSignificanceONOFF),-1,324864,"Determine significance from alpha plot",G__setup_memvarMHFindSignificanceONOFF,G__setup_memfuncMHFindSignificanceONOFF);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TTree);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TArrayI);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_TH1F);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MEvtLoop);
+   G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MH3);
+   G__tagtable_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFindSupercutsONOFF),sizeof(MFindSupercutsONOFF),-1,324864,"Class for optimization of the Supercuts",G__setup_memvarMFindSupercutsONOFF,G__setup_memfuncMFindSupercutsONOFF);
+   G__tagtable_setup(G__get_linked_tagnum(&G__SuperCutsONOFFCintLN_MFindSupercutsONOFFThetaLoop),sizeof(MFindSupercutsONOFFThetaLoop),-1,324864,(char*)NULL,G__setup_memvarMFindSupercutsONOFFThetaLoop,G__setup_memfuncMFindSupercutsONOFFThetaLoop);
+}
+extern "C" void G__cpp_setupSuperCutsONOFFCint(void) {
+  G__check_setup_version(30051515,"G__cpp_setupSuperCutsONOFFCint()");
+  G__set_cpp_environmentSuperCutsONOFFCint();
+  G__cpp_setup_tagtableSuperCutsONOFFCint();
+
+  G__cpp_setup_inheritanceSuperCutsONOFFCint();
+
+  G__cpp_setup_typetableSuperCutsONOFFCint();
+
+  G__cpp_setup_memvarSuperCutsONOFFCint();
+
+  G__cpp_setup_memfuncSuperCutsONOFFCint();
+  G__cpp_setup_globalSuperCutsONOFFCint();
+  G__cpp_setup_funcSuperCutsONOFFCint();
+
+   if(0==G__getsizep2memfunc()) G__get_sizep2memfuncSuperCutsONOFFCint();
+  return;
+}
+class G__cpp_setup_initSuperCutsONOFFCint {
+  public:
+    G__cpp_setup_initSuperCutsONOFFCint() { G__add_setup_func("SuperCutsONOFFCint",(G__incsetup)(&G__cpp_setupSuperCutsONOFFCint)); G__call_setup_funcs(); }
+   ~G__cpp_setup_initSuperCutsONOFFCint() { G__remove_setup_func("SuperCutsONOFFCint"); }
+};
+G__cpp_setup_initSuperCutsONOFFCint G__cpp_setup_initializerSuperCutsONOFFCint;
+
Index: trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/SuperCutsONOFFCint.h
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/SuperCutsONOFFCint.h	(revision 4411)
+++ trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/SuperCutsONOFFCint.h	(revision 4411)
@@ -0,0 +1,77 @@
+/********************************************************************
+* SuperCutsONOFFCint.h
+********************************************************************/
+#ifdef __CINT__
+#error SuperCutsONOFFCint.h/C is only for compilation. Abort cint.
+#endif
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+#define G__ANSIHEADER
+#define G__DICTIONARY
+#include "G__ci.h"
+extern "C" {
+extern void G__cpp_setup_tagtableSuperCutsONOFFCint();
+extern void G__cpp_setup_inheritanceSuperCutsONOFFCint();
+extern void G__cpp_setup_typetableSuperCutsONOFFCint();
+extern void G__cpp_setup_memvarSuperCutsONOFFCint();
+extern void G__cpp_setup_globalSuperCutsONOFFCint();
+extern void G__cpp_setup_memfuncSuperCutsONOFFCint();
+extern void G__cpp_setup_funcSuperCutsONOFFCint();
+extern void G__set_cpp_environmentSuperCutsONOFFCint();
+}
+
+
+#include "TROOT.h"
+#include "TMemberInspector.h"
+#include "MFRandomSplit.h"
+#include "MSupercutsCalcONOFF.h"
+#include "MHFindSignificanceONOFF.h"
+#include "MTSupercutsApplied.h"
+#include "MFindSupercutsONOFF.h"
+#include "MFindSupercutsONOFFThetaLoop.h"
+#include "SuperCutsONOFFIncl.h"
+
+#ifndef G__MEMFUNCBODY
+#endif
+
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_TClass;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_TBuffer;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_TMemberInspector;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_TObject;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_TString;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_TArrayD;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_MParContainer;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_MInputStreamID;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_MFilter;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_MParList;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_MTask;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_MFRandomSplit;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_MHillas;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_MHillasSrc;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_MHillasExt;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_MNewImagePar;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_MPointingPos;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_MGeomCam;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_MHadronness;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_MHMatrix;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_MSupercuts;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_MTSupercutsApplied;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_MSupercutsCalcONOFF;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_TH1;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_TCanvas;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_MH;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_TPostScript;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_TF1;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_MHFindSignificanceONOFF;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_TTree;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_TArrayI;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_TH1F;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_MEvtLoop;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_MH3;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_MFindSupercutsONOFF;
+extern G__linked_taginfo G__SuperCutsONOFFCintLN_MFindSupercutsONOFFThetaLoop;
+
+/* STUB derived class for protected member access */
Index: trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/SuperCutsONOFFDep.d
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/SuperCutsONOFFDep.d	(revision 4411)
+++ trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/SuperCutsONOFFDep.d	(revision 4411)
@@ -0,0 +1,9 @@
+# DO NOT DELETE
+
+SuperCutsONOFFDep.d MFRandomSplit.o: MFRandomSplit.h ../../../mbase/MFilter.h ../../../mbase/MTask.h ../../../mbase/MInputStreamID.h ../../../mbase/MParContainer.h ../../../mbase/MAGIC.h ../../../mbase/MParList.h ../../../mbase/MLog.h ../../../mbase/MLogManip.h
+SuperCutsONOFFDep.d MSupercutsCalcONOFF.o: MSupercutsCalcONOFF.h ../../../mbase/MTask.h ../../../mbase/MInputStreamID.h ../../../mbase/MParContainer.h ../../../mbase/MAGIC.h ../../../mbase/MParList.h ../../../mimage/MHillasExt.h ../../../mimage/MHillasSrc.h ../../../mimage/MHillas.h ../../../mimage/MNewImagePar.h ../../../mpointing/MPointingPos.h ../../../manalysis/MCerPhotEvt.h ../../../mgui/MCamEvent.h ../../../manalysis/MCerPhotPix.h ../../../mgeom/MGeomCam.h ../../../manalysis/MHadronness.h MTSupercutsApplied.h ../../../mhbase/MHMatrix.h ../../../mhbase/MH.h ../../../manalysis/MSupercuts.h ../../../mbase/MLog.h ../../../mbase/MLogManip.h
+SuperCutsONOFFDep.d MHFindSignificanceONOFF.o: MHFindSignificanceONOFF.h ../../../mhbase/MH.h ../../../mbase/MParContainer.h ../../../mbase/MAGIC.h ../../../mbase/MLog.h ../../../mbase/MLogManip.h ../../../manalysis/MMinuitInterface.h
+SuperCutsONOFFDep.d MTSupercutsApplied.o: MTSupercutsApplied.h ../../../mbase/MAGIC.h ../../../mbase/MParContainer.h ../../../mbase/MLog.h ../../../mbase/MLogManip.h
+SuperCutsONOFFDep.d MFindSupercutsONOFF.o: MFindSupercutsONOFF.h ../../../mbase/MParContainer.h ../../../mbase/MAGIC.h ../../../mhbase/MBinning.h ../../../mbase/MContinue.h ../../../mbase/MTask.h ../../../mbase/MInputStreamID.h ../../../manalysis/MSupercuts.h MSupercutsCalcONOFF.h ../../../mdata/MDataElement.h ../../../mdata/MData.h ../../../mdata/MDataMember.h ../../../mbase/MEvtLoop.h ../../../mfilter/MFCT1SelFinal.h ../../../mbase/MFilter.h ../../../mfbase/MF.h ../../../mfbase/MFEventSelector.h ../../../mfbase/MFEventSelector2.h ../../../mdata/MDataChain.h ../../../mhbase/MFillH.h ../../../mgeom/MGeomCamMagic.h ../../../mgeom/MGeomCam.h MFRandomSplit.h ../../../mhbase/MH3.h ../../../mhbase/MH.h ../../../mhist/MHCT1Supercuts.h ../../../mhist/MHFindSignificance.h MHFindSignificanceONOFF.h MTSupercutsApplied.h ../../../mhbase/MHMatrix.h ../../../mhist/MHOnSubtraction.h ../../../mdata/MDataValue.h ../../../mbase/MLog.h ../../../mbase/MLogManip.h ../../../manalysis/MMatrixLoop.h ../../../manalysis/MMinuitInterface.h ../../../mbase/MParList.h ../../../mbase/MProgressBar.h ../../../mfileio/MReadMarsFile.h ../../../mfileio/MReadTree.h ../../../mfileio/MRead.h ../../../mbase/MTaskList.h
+SuperCutsONOFFDep.d MFindSupercutsONOFFThetaLoop.o: MFindSupercutsONOFFThetaLoop.h ../../../mbase/MParContainer.h ../../../mbase/MAGIC.h MFindSupercutsONOFF.h ../../../mhbase/MBinning.h ../../../mbase/MContinue.h ../../../mbase/MTask.h ../../../mbase/MInputStreamID.h ../../../manalysis/MSupercuts.h MSupercutsCalcONOFF.h ../../../mdata/MDataElement.h ../../../mdata/MData.h ../../../mdata/MDataMember.h ../../../mbase/MEvtLoop.h ../../../mfilter/MFCT1SelFinal.h ../../../mbase/MFilter.h ../../../mfbase/MF.h ../../../mfbase/MFEventSelector.h ../../../mfbase/MFEventSelector2.h ../../../mdata/MDataChain.h ../../../mhbase/MFillH.h ../../../mgeom/MGeomCamMagic.h ../../../mgeom/MGeomCam.h MFRandomSplit.h ../../../mhbase/MH3.h ../../../mhbase/MH.h ../../../mhist/MHCT1Supercuts.h ../../../mhist/MHFindSignificance.h MHFindSignificanceONOFF.h ../../../mhbase/MHMatrix.h ../../../mhist/MHOnSubtraction.h ../../../mdata/MDataValue.h ../../../mbase/MLog.h ../../../mbase/MLogManip.h ../../../manalysis/MMatrixLoop.h ../../../manalysis/MMinuitInterface.h ../../../mbase/MParList.h ../../../mbase/MProgressBar.h ../../../mfileio/MReadMarsFile.h ../../../mfileio/MReadTree.h ../../../mfileio/MRead.h ../../../mbase/MTaskList.h
+SuperCutsONOFFDep.d: Makefile
Index: trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/SuperCutsONOFFIncl.h
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/SuperCutsONOFFIncl.h	(revision 4411)
+++ trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/SuperCutsONOFFIncl.h	(revision 4411)
@@ -0,0 +1,3 @@
+#ifndef __CINT__
+
+#endif // __CINT__
Index: trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/SuperCutsONOFFLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/SuperCutsONOFFLinkDef.h	(revision 4411)
+++ trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/SuperCutsONOFFLinkDef.h	(revision 4411)
@@ -0,0 +1,15 @@
+#ifdef __CINT__
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+
+
+#pragma link C++ class MFRandomSplit+;
+#pragma link C++ class MSupercutsCalcONOFF+;
+#pragma link C++ class MHFindSignificanceONOFF+;
+#pragma link C++ class MTSupercutsApplied+;
+#pragma link C++ class MFindSupercutsONOFF+;
+#pragma link C++ class MFindSupercutsONOFFThetaLoop+;
+
+#endif
Index: trunk/MagicSoft/Mars/mtemp/mmpi/asciifiles/OptimizedMkn421DynCutsGridWithSelected22pointsMay19.txt
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mmpi/asciifiles/OptimizedMkn421DynCutsGridWithSelected22pointsMay19.txt	(revision 4411)
+++ trunk/MagicSoft/Mars/mtemp/mmpi/asciifiles/OptimizedMkn421DynCutsGridWithSelected22pointsMay19.txt	(revision 4411)
@@ -0,0 +1,107 @@
+0.291162		0.03
+0.0767981		0.01
+0.0			0.0
+0.0319514		0.003
+0.0			0.00
+0.0			0.0
+0.00197097		0.001
+0.0			0.00
+0.136532		0.01
+0.0672596		0.01
+0.0			0.0
+-0.00328891		0.003
+0.0			0.000
+0.0			0.0
+0.00346991		0.001
+0.0			0.0
+0.121355		0.01
+0.00941745		0.002
+0.0			0.0
+0.0130449		0.001
+0.0			0.0
+0.0			0.0
+-7.67104e-05		0.001
+0.0			0.0
+0.0553008		0.005
+0.00677071		0.002
+0.0			0.0
+0.012681		0.001
+0.0			0.000
+0.0			0.0
+0.00110842		0.001
+0.0			0.0
+1.21178			0.1
+0.0			0.0
+0.0			0.0
+0.105799		0.005
+0.0			0.0
+0.0			0.0
+0.00212262		0.001
+0.0			0.0
+0.607549		0.06
+0.0			0.0
+0.0			0.0
+0.0390365		0.006
+0.0			0.0
+0.0			0.0
+0.000148364		0.001
+0.0			0.0
+1.e10			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+-1.e10			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+1.e10			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+-1.e10			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+.25			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+-1.e10			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+13.123440		0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+
+
+
Index: trunk/MagicSoft/Mars/mtemp/mmpi/asciifiles/StartingValuesForOptimizationMkn421DynCutsOnSizeAndDist.txt
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mmpi/asciifiles/StartingValuesForOptimizationMkn421DynCutsOnSizeAndDist.txt	(revision 4411)
+++ trunk/MagicSoft/Mars/mtemp/mmpi/asciifiles/StartingValuesForOptimizationMkn421DynCutsOnSizeAndDist.txt	(revision 4411)
@@ -0,0 +1,107 @@
+0.32			0.03
+0.05			0.01
+0.0			0.0
+0.034			0.003
+0.0			0.01
+0.0			0.0
+0.0			0.001
+0.0			0.01
+0.12			0.01
+0.05			0.01
+0.0			0.0
+0.034			0.003
+0.0			0.001
+0.0			0.0
+0.0			0.001
+0.0			0.001
+0.12			0.01
+0.007			0.002
+0.0			0.0
+0.013			0.001
+0.0			0.001
+0.0			0.0
+0.0			0.001
+0.0			0.001
+0.055			0.005
+0.007			0.002
+0.0			0.0
+0.013			0.001
+0.0			0.001
+0.0			0.0
+0.0			0.001
+0.0			0.001
+1.25			0.1
+0.0			0.0
+0.0			0.0
+0.059			0.005
+0.0			0.0
+0.0			0.0
+0.0			0.001
+0.0			0.0
+0.60			0.06
+0.0			0.0
+0.0			0.0
+0.059			0.006
+0.0			0.0
+0.0			0.0
+0.0			0.001
+0.0			0.0
+1.e10			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+-1.e10			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+1.e10			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+-1.e10			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+.25			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+-1.e10			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+13.123440		0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+
+
+
Index: trunk/MagicSoft/Mars/mtemp/mmpi/asciifiles/StartingValuesForSmallSizes1.txt
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mmpi/asciifiles/StartingValuesForSmallSizes1.txt	(revision 4411)
+++ trunk/MagicSoft/Mars/mtemp/mmpi/asciifiles/StartingValuesForSmallSizes1.txt	(revision 4411)
@@ -0,0 +1,107 @@
+0.32			0.03
+0.05			0.01
+0.0			0.0
+0.034			0.003
+0.0			0.01
+0.0			0.0
+0.0			0.001
+0.0			0.01
+0.12			0.01
+0.05			0.01
+0.0			0.0
+0.034			0.003
+0.0			0.001
+0.0			0.0
+0.0			0.001
+0.0			0.001
+0.12			0.01
+0.007			0.002
+0.0			0.0
+0.013			0.001
+0.0			0.001
+0.0			0.0
+0.0			0.001
+0.0			0.001
+0.055			0.005
+0.007			0.002
+0.0			0.0
+0.013			0.001
+0.0			0.001
+0.0			0.0
+0.0			0.001
+0.0			0.001
+1.25			0.1
+0.0			0.0
+0.0			0.0
+0.059			0.005
+0.0			0.0
+0.0			0.0
+0.0			0.001
+0.0			0.0
+0.60			0.06
+0.0			0.0
+0.0			0.0
+0.059			0.006
+0.0			0.0
+0.0			0.0
+0.0			0.001
+0.0			0.0
+1.e10			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+-1.e10			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+1.e10			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+-1.e10			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+.25			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+-1.e10			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+13.123440		0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+0.0			0.0
+
+
+
