Index: trunk/MagicSoft/Mars/mtemp/mmpi/macros/SuperCutsONOFFMacro.C
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mmpi/macros/SuperCutsONOFFMacro.C	(revision 5724)
+++ trunk/MagicSoft/Mars/mtemp/mmpi/macros/SuperCutsONOFFMacro.C	(revision 6232)
@@ -8,5 +8,5 @@
 gROOT -> Reset();
 
-void SuperCutsONOFFMacro()
+void SuperCutsONOFFMacroNew()
 {
   gLog.SetNoColors();
@@ -15,19 +15,30 @@
 
     // From magicserv01
-    TString  ONDataFilename("/.magic/data16a/mazin/data/Mrk421/2004_04_22/4slices/Hillas_20040422_4sl_time_clean/Mrk421_*_HillasON.root");
+//    TString  ONDataFilename("/.magic/data16a/mazin/data/mcdata/2004_06_30/*HillasON.root");
                                        
-    TString  OFFDataFilename("/.magic/data16a/mazin/data/Mrk421/2004_04_22/4slices/Hillas_20040422_4sl_time_clean/Mrk421_*_HillasOFF.root");
-
-    
-    TString PathForFiles ("/mnt/magicserv01/scratch/David/SillyTestForCommiting_July20_2004/");
-
-    
-    // **********************************************
+//    TString  OFFDataFilename("/.magic/data16a/mazin/data/mcdata/2004_06_30/*HillasOFF.root");
+
+//   TString  ONDataFilename("/.magic/magicserv01/scratch/Period21/HillasFiles/CrabNebula_20040914.root");
+//   TString  ONDataFilename("/.magic/magicserv01/scratch/Period21/HillasFiles/CrabNebula_20040921.root");
+//   TString  ONDataFilename("/.magic/magicserv01/scratch/Period21/HillasFiles/CrabNebula_20040922.root");
+
+//   TString  ONDataFilename("/.magic/magicserv01/scratch/Period21/HillasFiles/CrabNebula_2004*.root");
+  
+   //TString  ONDataFilename("/.magic/data22a/mazin/HillasParam/Period24/2004_12_18/Crab_40_25_1_AbsHillas.root");
+   TString  ONDataFilename("/.magic/data04a/nadia/Analysis/starfiles/DF/40_25_1/CrabNebula_*_Hillas_Abs.root");
+   TString  OFFDataFilename("/.magic/data04a/nadia/Analysis/starfiles/DF/40_25_1/OffCrab1*Hillas_Abs.root");
+   //TString ONDataFilename("/.magic/data03a/mazin/results/2004_09_21/CrabNebulaNadiaHillas.root");  
+   //TString OFFDataFilename("/.magic/data03a/mazin/results/2004_09_21/CrabNebulaNadiaHillas.root");  
+
+
+    TString PathForFiles ("/.magic/data03a/mazin/results/Crab/DF/CrabNadia/SuperCuts/Size2000/");  
+
+//    TString PathForFiles ("/.magic/magicserv01/scratch/hbartko/SC/"); // was: Daniel/SuperCuts/Mrk421/2004_04_22/4slices_3520_nc/E800_1200_Opt_MC_Test/
+
+    
+
     // Boolean variables defining the job of the 
     // macro
-    // **********************************************
-
-    
-
+ 
     // Boolean variable that decides wether data is read from files specified above
     // (ON/OFF) or read from already existing Matrices (which are obviously stored
@@ -36,59 +47,44 @@
     // values must be specified by user.
 
-    // kTRUE reads alredy existing matrices, and kFALSE read data and produce matrices.
-
-    Bool_t ReadMatrixFromRootFiles = kTRUE; 
+    Bool_t ReadMatrixFromRootFiles = kTRUE;  
   
 
-    // Boolean variable that controls wether to use the 
-    // TRAIN sample or not.
-    
-
-    Bool_t TrainParams   = kTRUE;  
-
-
-
-    // Variable that allows the user to skip the optimization on the 
-    // train sample. If optimization is skipped (value kTRUE), the
-    // previously optimized supercuts (stored in root file
-    // which is called OptSCParametersONOFFThetaRangeXXXXXmRad.root, and located 
-    // in the directory specified by variable PathForFiles) are used 
-    // on the train and/or the test sample.
-
-    // If value kFALSE, the cuts are optimized.
+    // Boolean variable that controls the supercuts 
+    // optimization using the training sample
     // The optimized cuts will be  written in root file
     // located in directory specified before. Name of 
     // the root files is created automatically.
-    
-    Bool_t SkipOptimization = kTRUE;
-  
-
-
-
+
+    Bool_t TrainParams   = kTRUE;  
+
+    // Variable that allows the user to skip the optimization on the 
+    // train sample. If optimization is skipped (value kTRUE), the
+    // previously optimized supercuts (stored in root file) are used 
+    // on the train sample.
+    
+    Bool_t SkipOptimization = 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 ApplyInitialParams = kTRUE , the initial 
-    // parameters are written into this root file, and they 
-    // will be applied to the data (TRAIN/TEST ) 
-    // IF NO OPTIMIZATION PROCEDURE IS PERFORMED.
-    
-    // If cuts are optimized (ie, variable SkipOptimization = kFALSE), 
-    // the cuts applied to the data are the optimized 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;
   
-    // NOTE: be aware that, if ApplyInitialSCParams = kTRUE and 
-    // there was a root file with the optimized cuts 
+    // NOTE: be aware that, if there was a file with the optimized cuts 
     // (previously computed), it will be overwritten with the initial 
-    // SC parameters. 
-
-    Bool_t ApplyInitialSCParams = kTRUE;
-    
-
-
-    // Boolean variable that controls wether to use the 
-    // TEST sample or not.
-    
-
-    Bool_t TestParams = kFALSE;  
+    // SC parameters. This is something that I WILL HAVE TO CHANGE IN 
+    // future. Yet for the time being...
+
+    Bool_t UseInitialSCParams = kTRUE;  // was kFALSE 
+    
+
+
+    // Variable that decides whether the optimized cuts are used 
+    // in the test sample.
+
+    Bool_t TestParams = kTRUE;  
 
 
@@ -107,10 +103,10 @@
 
     // Fraction of ON events used for the training/testing
-    Double_t whichfractiontrain = 0.999;
-    Double_t whichfractiontest = 0.001;
+    Double_t whichfractiontrain = 0.5;
+    Double_t whichfractiontest = 0.5;
 
     // Fraction of OFF events used for the training/testing 
-    Double_t whichfractiontrainOFF = 0.999;
-    Double_t whichfractiontestOFF = 0.001;
+    Double_t whichfractiontrainOFF = 0.5;
+    Double_t whichfractiontestOFF = 0.5;
 
 
@@ -126,5 +122,5 @@
     // Alpha value (degrees) below which signal is expected
     
-    Double_t alphasig = 12; 
+    Double_t alphasig = 9; 
 
     // Definition of alpha bkg region (where no signal is expected)
@@ -135,8 +131,11 @@
     // Definition of the Size range
 
-    Double_t SizeLow = 800;
-    Double_t SizeUp = 1200;
-//    Double_t SizeUp = 1000000;
-    
+    Double_t SizeLow = 2000;
+//    Double_t SizeUp =  2000;
+    Double_t SizeUp = 1000000;
+    
+    Double_t LeakageMax = 0.04;
+    Double_t DistMax    = 1.5;
+    Double_t DistMin    = 0.1;
 
      // Definition of binning of alpha plots
@@ -167,5 +166,6 @@
     // in the computation of teh dynamical cuts that take place within
     // class MCT1SupercutsCalc
-    Bool_t NotUseTheta = kTRUE; // kTRUE renoves theta from the parameterization of cuts
+    //Bool_t NotUseTheta = kFALSE; // kTRUE removes theta from the parameterization of cuts
+    Bool_t NotUseTheta = kTRUE; // kTRUE removes theta from the parameterization of cuts
 
     // Boolean variable used to decide wether to use dynamical cuts or static cuts
@@ -192,6 +192,5 @@
     // Boolean variable used to decide wether initial parameters are 
     // read from ascii file or not. If kTRUE, parameters are retrieved 
-    // from ascii file. Otherwise, default parameters from MSupercuts 
-    // class are used.
+    // from ascii file. 
 
     Bool_t ReadInitParamsFromAsciiFile = kTRUE;
@@ -219,5 +218,9 @@
       // {"../InitialSCParametersSteps/StartingValuesForOptimizationMkn421DynCutsOnSize.txt"};
       // {"../InitialSCParametersSteps/StartingValuesForOptimizationMkn421DynCutsOnSizeAndDist.txt"};
-      {"mtemp/mmpi/asciifiles/OptimizedMkn421DynCutsGridWithSelected22pointsMay19.txt"};
+      //{"mtemp/mmpi/asciifiles/OptimizedMkn421DynCutsGridWithSelected22pointsMay19.txt"};
+      //{"/home/pcmagic16/mazin/mars/Mars260804/mtemp/mmpi/asciifiles/StartingValuesForSmallSizes1.txt"};
+//      {"/home/pcmagic16/mazin/mars/Mars260804/mtemp/mmpi/asciifiles/SmallSizeRFStartValues.txt"};
+      {"/home/pcmagic16/mazin/mars/Mars260804/mtemp/mmpi/asciifiles/OptimizedCrabFrom2000_a.txt"};
+      //{"mtemp/mmpi/asciifiles/VeryGoodDummyValuesWithConcCut.txt"};
 
 
@@ -244,9 +247,13 @@
 
     TArrayD CosThetaRangeVector(2);
-    CosThetaRangeVector[0] = 0.0;
+    CosThetaRangeVector[1] = 0.866;  //30
+    //CosThetaRangeVector[1] = 0.74;  //42
+    //CosThetaRangeVector[1] = 0.82;  //35
+    //CosThetaRangeVector[1] = 0;
     //CosThetaRangeVector[1] = 0.825;
     //CosThetaRangeVector[2] = 0.921; 
     //CosThetaRangeVector[3] = 0.961; 
-    CosThetaRangeVector[1] = 1.0;
+    CosThetaRangeVector[0] = 0.5;  // 60
+    //CosThetaRangeVector[0] = 1;
 
 
@@ -303,4 +310,6 @@
 
     FindSupercuts.SetSizeRange(SizeLow, SizeUp);
+    FindSupercuts.SetFilters(LeakageMax, DistMax, DistMin);
+//    FindSupercuts.SetFilters(0.001, 1.5, 0.2);
 
 
@@ -318,5 +327,5 @@
     FindSupercuts.SetTrainParameters(TrainParams);
     FindSupercuts.SetSkipOptimization(SkipOptimization);
-    FindSupercuts.SetUseInitialSCParams(ApplyInitialSCParams);
+    FindSupercuts.SetUseInitialSCParams(UseInitialSCParams);
 
     FindSupercuts.SetTestParameters(TestParams);
