Ignore:
Timestamp:
08/28/07 13:03:04 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mjtrain
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mjtrain/MJTrainDisp.cc

    r8704 r8719  
    4343//    opt.Train("rf-disp.root", set, 30000); // Number of train events
    4444//
     45//    // Two of the displayed histograms show the cut efficiency for
     46//    // a given Theta-Cut. The default is 0.215. It can be overwritten
     47//    // by
     48//    opt.SetThetaCut(0.165);
     49//
    4550//
    4651// Random Numbers:
     
    227232Bool_t MJTrainDisp::Train(const char *out, const MDataSet &set, Int_t num)
    228233{
    229     SetTitle(Form("TrainDisp: %s", out));
     234    SetTitle(Form("Train%s: %s", fNameOutput.Data(), out));
    230235
    231236    if (fDisplay)
     
    282287
    283288    // ------------------------ Train RF --------------------------
    284     MRanForestCalc rf("TrainDisp", fTitle);
     289    MRanForestCalc rf("Train", fTitle);
    285290    rf.SetNumTrees(fNumTrees);
    286291    rf.SetNdSize(fNdSize);
     
    292297    rf.SetFileName(out);
    293298    rf.SetDebug(fDebug>1);
    294     rf.SetNameOutput("Disp");
     299    rf.SetNameOutput(fNameOutput);
     300    rf.SetFunction(fResultFunction);
    295301
    296302    /*
     
    319325
    320326    MParameterD par("ThetaSquaredCut");
    321     par.SetVal(0.215*0.215);
     327    par.SetVal(fThetaCut*fThetaCut);
    322328    plist.AddToList(&par);
    323329
  • trunk/MagicSoft/Mars/mjtrain/MJTrainDisp.h

    r8656 r8719  
    1717
    1818    TString fTrainParameter;
     19    TString fResultFunction;
     20
     21    Float_t fThetaCut;
     22
     23    // To be moved to a base class
     24    TString fNameOutput;
    1925
    2026    void DisplayHist(TCanvas &c, Int_t i, MH3 &mh3) const;
     
    2228
    2329public:
    24     MJTrainDisp() : fTrainParameter(fgTrainParameter) { }
     30    MJTrainDisp() : fTrainParameter(fgTrainParameter), fResultFunction("x"), fThetaCut(0.215), fNameOutput("Disp") { }
    2531
    2632    void SetTrainParameter(const char *txt) { fTrainParameter=txt; }
     33
     34    void SetThetaCut(Float_t cut=0.215) { fThetaCut=cut; }
    2735
    2836    Bool_t Train(const char *out, const MDataSet &set, Int_t num);
  • trunk/MagicSoft/Mars/mjtrain/MJTrainEnergy.cc

    r8704 r8719  
    8989Bool_t MJTrainEnergy::Train(const char *out, const MDataSet &set, Int_t num)
    9090{
    91     SetTitle(Form("TrainEnergy: %s", out));
     91    SetTitle(Form("Train%s: %s", fNameOutput.Data(), out));
    9292
    9393    if (fDisplay)
     
    128128    if (fEnableWeights)
    129129        train.AddColumn("MWeight.fVal");
    130     train.AddColumn("MMcEvt.fImpact/100");
    131     train.AddColumn("MMcEvt.fTelescopeTheta*TMath::RadToDeg()");
    132130    train.AddColumn(fTrainParameter);
    133 
    134131
    135132    // ----------------------- Fill Matrix RF ----------------------
     
    147144
    148145    // ------------------------ Train RF --------------------------
    149     MRanForestCalc rf("TrainEnergy", fTitle);
     146    MRanForestCalc rf("Train", fTitle);
    150147    rf.SetNumTrees(fNumTrees);
    151148    rf.SetNdSize(fNdSize);
    152149    rf.SetNumTry(fNumTry);
    153     rf.SetNumObsoleteVariables(3);
     150    rf.SetNumObsoleteVariables(1);
    154151    rf.SetLastDataColumnHasWeights(fEnableWeights);
    155152    rf.SetDisplay(fDisplay);
     
    157154    rf.SetFileName(out);
    158155    rf.SetDebug(fDebug>1);
    159     rf.SetNameOutput("MEnergyEst");
     156    rf.SetNameOutput(fNameOutput);
    160157    rf.SetFunction(fResultFunction);
    161158
     
    175172
    176173    gLog.Separator("Test");
     174
     175    MH::SetPalette("pretty");
    177176
    178177    MParList  plist;
  • trunk/MagicSoft/Mars/mjtrain/MJTrainEnergy.h

    r8704 r8719  
    1414    TString fResultFunction;
    1515
     16    // To be moved to a base class
     17    TString fNameOutput;
     18
    1619public:
    17     MJTrainEnergy() { SetTrainLin(); }
     20    MJTrainEnergy() : fNameOutput("MEnergyEst") { SetTrainLin(); }
    1821
    1922    void SetTrainLog() { SetTrainFunc("log10(MMcEvt.fEnergy)", "pow(10, x)"); }
Note: See TracChangeset for help on using the changeset viewer.