Ignore:
Timestamp:
01/26/05 11:24:12 (20 years ago)
Author:
moralejo
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mtemp/mpadova/macros/RanForestDISP.C

    r5831 r6024  
    6161
    6262
    63     MReadMarsFile  read("Events", "/data1/magic/mc_data/root/Period021_0.73_mirror/FixedWindowPeakSearch/WOBBLE_Star_6slices_tc32/star_gamma_train_new.root");
     63    MReadMarsFile  read("Events", "/data1/magic/mc_data/root/Period021_0.73_mirror/FixedWindowPeakSearch/WOBBLE_Calib_6slices/tc_3.84_2.56/star_gamma_train_new.root");
    6464    Float_t numgammas = read.GetEntries();
    6565
    66     read.AddFile("/data2/magic/data/rootdata/Crab/Period021/20040915/star_train_20040915_CrabNebulaW1.root");
     66    read.AddFile("star_train_20050110_CrabNebulaW1.root");
    6767    Float_t numhadrons = read.GetEntries() - numgammas;
    6868
    6969    // Fraction of gammas to be used in training:
    7070    //    Float_t gamma_frac = 1.5*(numhadrons / numgammas);
    71 
    7271    Float_t gamma_frac = 1.;
     72
     73    // Total hadron number to be processed in training:
     74    // If you run RF over different data runs, using always the same # of training gammas,
     75    // you should also use always a fixed number of hadrons for training (although the data
     76    // runs may be of different duration). Otherwise the meaning of the output hadronness
     77    // would be different for the different subsamples, since its absolute values depend on
     78    // the statistics of the training sample. The number set here is the number BEFORE the
     79    // "a priori cuts" set above through "skipevents".
     80
     81    Float_t select_n_hadrons = 37000.; 
     82    Float_t hadron_frac = select_n_hadrons / numhadrons;
    7383
    7484    read.DisableAutoScheme();
     
    165175    plist.AddToList(&matrixh);
    166176
     177    MFEventSelector reduce_training_hadrons;
     178    reduce_training_hadrons.SetSelectionRatio(hadron_frac);
     179    MFilterList hadfilter;
     180    hadfilter.AddToList(&reduce_training_hadrons);
     181    hadfilter.AddToList(&fhadrons);
     182    tlist.AddToList(&hadfilter);
     183
    167184    MFillH fillmath("MatrixHadrons");
    168     fillmath.SetFilter(&fhadrons);
     185    fillmath.SetFilter(&hadfilter);
    169186    tlist.AddToList(&fillmath);
     187
     188    MContinue skiphad(&fhadrons);
     189    tlist.AddToList(&skiphad);
    170190
    171191    MFEventSelector reduce_training_gammas;
    172192    reduce_training_gammas.SetSelectionRatio(gamma_frac);
    173193    tlist.AddToList(&reduce_training_gammas);
    174     MContinue skiphad(&fhadrons);
    175     tlist.AddToList(&skiphad);
    176194
    177195    MFillH fillmatg("MatrixGammas");
     
    263281
    264282
    265     MReadMarsFile  read3("Events", "/data2/magic/data/rootdata/Crab/Period021/20040915/star_20040915_CrabNebulaW1.root");
     283    MReadMarsFile  read3("Events", "star_20050110_CrabNebulaW1.root");
    266284
    267285    read3.DisableAutoScheme();
     
    280298    TString outfname = "star_S";
    281299    outfname += minsize;
    282     outfname += "_20040915_CrabNebulaW1.root";
     300    outfname += "_20050110_CrabNebulaW1.root";
    283301    MWriteRootFile write(outfname, "recreate");
    284302
Note: See TracChangeset for help on using the changeset viewer.