Ignore:
Timestamp:
02/03/05 12:42:21 (20 years ago)
Author:
mazin
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mtemp/mmpi/macros/SuperCutsONOFFMacro.C

    r4412 r6232  
    88gROOT -> Reset();
    99
    10 void SuperCutsONOFFMacro()
     10void SuperCutsONOFFMacroNew()
    1111{
    1212  gLog.SetNoColors();
     
    1515
    1616    // From magicserv01
    17     TString  ONDataFilename("/.magic/data16a/mazin/data/Mrk421/2004_04_22/4slices/Hillas_20040422_4sl_time_clean/Mrk421_*_HillasON.root");
     17//    TString  ONDataFilename("/.magic/data16a/mazin/data/mcdata/2004_06_30/*HillasON.root");
    1818                                       
    19     TString  OFFDataFilename("/.magic/data16a/mazin/data/Mrk421/2004_04_22/4slices/Hillas_20040422_4sl_time_clean/Mrk421_*_HillasOFF.root");
    20 
    21    
    22     TString PathForFiles ("/mnt/magicserv01/scratch/David/SillyTestForCommiting_July20_2004/");
    23 
    24    
    25     // **********************************************
     19//    TString  OFFDataFilename("/.magic/data16a/mazin/data/mcdata/2004_06_30/*HillasOFF.root");
     20
     21//   TString  ONDataFilename("/.magic/magicserv01/scratch/Period21/HillasFiles/CrabNebula_20040914.root");
     22//   TString  ONDataFilename("/.magic/magicserv01/scratch/Period21/HillasFiles/CrabNebula_20040921.root");
     23//   TString  ONDataFilename("/.magic/magicserv01/scratch/Period21/HillasFiles/CrabNebula_20040922.root");
     24
     25//   TString  ONDataFilename("/.magic/magicserv01/scratch/Period21/HillasFiles/CrabNebula_2004*.root");
     26 
     27   //TString  ONDataFilename("/.magic/data22a/mazin/HillasParam/Period24/2004_12_18/Crab_40_25_1_AbsHillas.root");
     28   TString  ONDataFilename("/.magic/data04a/nadia/Analysis/starfiles/DF/40_25_1/CrabNebula_*_Hillas_Abs.root");
     29   TString  OFFDataFilename("/.magic/data04a/nadia/Analysis/starfiles/DF/40_25_1/OffCrab1*Hillas_Abs.root");
     30   //TString ONDataFilename("/.magic/data03a/mazin/results/2004_09_21/CrabNebulaNadiaHillas.root"); 
     31   //TString OFFDataFilename("/.magic/data03a/mazin/results/2004_09_21/CrabNebulaNadiaHillas.root"); 
     32
     33
     34    TString PathForFiles ("/.magic/data03a/mazin/results/Crab/DF/CrabNadia/SuperCuts/Size2000/"); 
     35
     36//    TString PathForFiles ("/.magic/magicserv01/scratch/hbartko/SC/"); // was: Daniel/SuperCuts/Mrk421/2004_04_22/4slices_3520_nc/E800_1200_Opt_MC_Test/
     37
     38   
     39
    2640    // Boolean variables defining the job of the
    2741    // macro
    28     // **********************************************
    29 
    30    
    31 
     42 
    3243    // Boolean variable that decides wether data is read from files specified above
    3344    // (ON/OFF) or read from already existing Matrices (which are obviously stored
     
    3647    // values must be specified by user.
    3748
    38     // kTRUE reads alredy existing matrices, and kFALSE read data and produce matrices.
    39 
    40     Bool_t ReadMatrixFromRootFiles = kTRUE;
     49    Bool_t ReadMatrixFromRootFiles = kTRUE; 
    4150 
    4251
    43     // Boolean variable that controls wether to use the
    44     // TRAIN sample or not.
    45    
    46 
    47     Bool_t TrainParams   = kTRUE; 
    48 
    49 
    50 
    51     // Variable that allows the user to skip the optimization on the
    52     // train sample. If optimization is skipped (value kTRUE), the
    53     // previously optimized supercuts (stored in root file
    54     // which is called OptSCParametersONOFFThetaRangeXXXXXmRad.root, and located
    55     // in the directory specified by variable PathForFiles) are used
    56     // on the train and/or the test sample.
    57 
    58     // If value kFALSE, the cuts are optimized.
     52    // Boolean variable that controls the supercuts
     53    // optimization using the training sample
    5954    // The optimized cuts will be  written in root file
    6055    // located in directory specified before. Name of
    6156    // the root files is created automatically.
    62    
    63     Bool_t SkipOptimization = kTRUE;
    64  
    65 
    66 
    67 
     57
     58    Bool_t TrainParams   = kTRUE; 
     59
     60    // Variable that allows the user to skip the optimization on the
     61    // train sample. If optimization is skipped (value kTRUE), the
     62    // previously optimized supercuts (stored in root file) are used
     63    // on the train sample.
     64   
     65    Bool_t SkipOptimization = kFALSE;
    6866
    6967    // Boolean variable that allows the user to write the initial parameters
    7068    // into the root file that will be used to store the optimum cuts.
    71     // If ApplyInitialParams = kTRUE , the initial
    72     // parameters are written into this root file, and they
    73     // will be applied to the data (TRAIN/TEST )
    74     // IF NO OPTIMIZATION PROCEDURE IS PERFORMED.
    75    
    76     // If cuts are optimized (ie, variable SkipOptimization = kFALSE),
    77     // the cuts applied to the data are the optimized cuts.
     69    // If fUseInitialSCParams = kTRUE , parameters are written.
     70    // In this way, the initial SC parameters can be applied on the data (train/test)
     71   
     72    // The initial parameters are ONLY written to the root file if
     73    // there is NO SC params optimization, i.e., if variable
     74    // fSkipOptimization = kTRUE;
    7875 
    79     // NOTE: be aware that, if ApplyInitialSCParams = kTRUE and
    80     // there was a root file with the optimized cuts
     76    // NOTE: be aware that, if there was a file with the optimized cuts
    8177    // (previously computed), it will be overwritten with the initial
    82     // SC parameters.
    83 
    84     Bool_t ApplyInitialSCParams = kTRUE;
    85    
    86 
    87 
    88     // Boolean variable that controls wether to use the
    89     // TEST sample or not.
    90    
    91 
    92     Bool_t TestParams = kFALSE; 
     78    // SC parameters. This is something that I WILL HAVE TO CHANGE IN
     79    // future. Yet for the time being...
     80
     81    Bool_t UseInitialSCParams = kTRUE;  // was kFALSE
     82   
     83
     84
     85    // Variable that decides whether the optimized cuts are used
     86    // in the test sample.
     87
     88    Bool_t TestParams = kTRUE; 
    9389
    9490
     
    107103
    108104    // Fraction of ON events used for the training/testing
    109     Double_t whichfractiontrain = 0.999;
    110     Double_t whichfractiontest = 0.001;
     105    Double_t whichfractiontrain = 0.5;
     106    Double_t whichfractiontest = 0.5;
    111107
    112108    // Fraction of OFF events used for the training/testing
    113     Double_t whichfractiontrainOFF = 0.999;
    114     Double_t whichfractiontestOFF = 0.001;
     109    Double_t whichfractiontrainOFF = 0.5;
     110    Double_t whichfractiontestOFF = 0.5;
    115111
    116112
     
    126122    // Alpha value (degrees) below which signal is expected
    127123   
    128     Double_t alphasig = 12;
     124    Double_t alphasig = 9;
    129125
    130126    // Definition of alpha bkg region (where no signal is expected)
     
    135131    // Definition of the Size range
    136132
    137     Double_t SizeLow = 800;
    138     Double_t SizeUp = 1200;
    139 //    Double_t SizeUp = 1000000;
    140    
     133    Double_t SizeLow = 2000;
     134//    Double_t SizeUp =  2000;
     135    Double_t SizeUp = 1000000;
     136   
     137    Double_t LeakageMax = 0.04;
     138    Double_t DistMax    = 1.5;
     139    Double_t DistMin    = 0.1;
    141140
    142141     // Definition of binning of alpha plots
     
    167166    // in the computation of teh dynamical cuts that take place within
    168167    // class MCT1SupercutsCalc
    169     Bool_t NotUseTheta = kTRUE; // kTRUE renoves theta from the parameterization of cuts
     168    //Bool_t NotUseTheta = kFALSE; // kTRUE removes theta from the parameterization of cuts
     169    Bool_t NotUseTheta = kTRUE; // kTRUE removes theta from the parameterization of cuts
    170170
    171171    // Boolean variable used to decide wether to use dynamical cuts or static cuts
     
    192192    // Boolean variable used to decide wether initial parameters are
    193193    // read from ascii file or not. If kTRUE, parameters are retrieved
    194     // from ascii file. Otherwise, default parameters from MSupercuts
    195     // class are used.
     194    // from ascii file.
    196195
    197196    Bool_t ReadInitParamsFromAsciiFile = kTRUE;
     
    219218      // {"../InitialSCParametersSteps/StartingValuesForOptimizationMkn421DynCutsOnSize.txt"};
    220219      // {"../InitialSCParametersSteps/StartingValuesForOptimizationMkn421DynCutsOnSizeAndDist.txt"};
    221       {"mtemp/mmpi/asciifiles/OptimizedMkn421DynCutsGridWithSelected22pointsMay19.txt"};
     220      //{"mtemp/mmpi/asciifiles/OptimizedMkn421DynCutsGridWithSelected22pointsMay19.txt"};
     221      //{"/home/pcmagic16/mazin/mars/Mars260804/mtemp/mmpi/asciifiles/StartingValuesForSmallSizes1.txt"};
     222//      {"/home/pcmagic16/mazin/mars/Mars260804/mtemp/mmpi/asciifiles/SmallSizeRFStartValues.txt"};
     223      {"/home/pcmagic16/mazin/mars/Mars260804/mtemp/mmpi/asciifiles/OptimizedCrabFrom2000_a.txt"};
     224      //{"mtemp/mmpi/asciifiles/VeryGoodDummyValuesWithConcCut.txt"};
    222225
    223226
     
    244247
    245248    TArrayD CosThetaRangeVector(2);
    246     CosThetaRangeVector[0] = 0.0;
     249    CosThetaRangeVector[1] = 0.866;  //30
     250    //CosThetaRangeVector[1] = 0.74;  //42
     251    //CosThetaRangeVector[1] = 0.82;  //35
     252    //CosThetaRangeVector[1] = 0;
    247253    //CosThetaRangeVector[1] = 0.825;
    248254    //CosThetaRangeVector[2] = 0.921;
    249255    //CosThetaRangeVector[3] = 0.961;
    250     CosThetaRangeVector[1] = 1.0;
     256    CosThetaRangeVector[0] = 0.5;  // 60
     257    //CosThetaRangeVector[0] = 1;
    251258
    252259
     
    303310
    304311    FindSupercuts.SetSizeRange(SizeLow, SizeUp);
     312    FindSupercuts.SetFilters(LeakageMax, DistMax, DistMin);
     313//    FindSupercuts.SetFilters(0.001, 1.5, 0.2);
    305314
    306315
     
    318327    FindSupercuts.SetTrainParameters(TrainParams);
    319328    FindSupercuts.SetSkipOptimization(SkipOptimization);
    320     FindSupercuts.SetUseInitialSCParams(ApplyInitialSCParams);
     329    FindSupercuts.SetUseInitialSCParams(UseInitialSCParams);
    321330
    322331    FindSupercuts.SetTestParameters(TestParams);
Note: See TracChangeset for help on using the changeset viewer.