Ignore:
Timestamp:
04/30/06 19:16:08 (19 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r7669 r7670  
    9090    TH2D res2(g);
    9191
     92    h.SetTitle("Hadronness-Distribution vs. Size");
    9293    res1.SetTitle("Significance Li/Ma");
    9394    res2.SetTitle("Significance Li/Ma * log_{10}(excess)");
     
    351352}
    352353
    353 Bool_t MJTrainSeparation::AutoTrain()
     354Bool_t MJTrainSeparation::AutoTrain(MDataSet &set, UInt_t &seton, UInt_t &setoff)
    354355{
    355356    Double_t num, min, max;
    356     if (!GetEventsProduced(fDataSetTrain, num, min, max))
     357    if (!GetEventsProduced(set, num, min, max))
    357358        return kFALSE;
    358359
     
    386387    // With an average data rate after star of
    387388    Double_t data=0;
    388     const Double_t r = GetDataRate(fDataSetTrain, data); //[Hz]
     389    const Double_t r = GetDataRate(set, data); //[Hz]
    389390
    390391    *fLog << "Events measured per second effective on time:             " << r << "Hz" << endl;
     392    *fLog << "Total effective on time:                                  " << data/r  << endl;
    391393
    392394    // this yields a number of n events to be read for training
     
    399401        return kFALSE;
    400402
    401     Double_t nummc = GetNumMC(fDataSetTrain);
     403    Double_t nummc = GetNumMC(set);
    402404
    403405    *fLog << "Events available in MC sample:                            " << nummc << endl;
     
    419421    }
    420422
    421     if (fNumTrainOn>0 && fNumTrainOn<on)
    422     {
    423         fNumTrainOff = TMath::Nint(off*fNumTrainOn/on);
    424         *fLog << "Less MC events requested... scaling by " << fNumTrainOn/on << endl;
     423    if (seton>0 && seton<on)
     424    {
     425        setoff = TMath::Nint(off*seton/on);
     426        *fLog << "Less MC events requested... scaling by " << seton/on << endl;
    425427    }
    426428    else
    427429    {
    428         fNumTrainOn  = TMath::Nint(on);
    429         fNumTrainOff = TMath::Nint(off);
    430     }
    431 
    432     *fLog << "Target number of MC events:   " << fNumTrainOn << endl;
    433     *fLog << "Target number of data events: " << fNumTrainOff << endl;
    434 
    435     fNumTestOn  = fNumTrainOn;
    436     fNumTestOff = fNumTrainOff;
     430        seton  = TMath::Nint(on);
     431        setoff = TMath::Nint(off);
     432    }
     433
     434    *fLog << "Target number of MC events:   " << seton  << endl;
     435    *fLog << "Target number of data events: " << setoff << endl;
    437436
    438437    /*
     
    470469
    471470    if (fAutoTrain)
    472         if (!AutoTrain())
     471    {
     472        fLog->Separator("Auto-Training -- Train-Data");
     473        if (!AutoTrain(fDataSetTrain, fNumTrainOn, fNumTrainOff))
    473474            return kFALSE;
     475        fLog->Separator("Auto-Training -- Test-Data");
     476        if (!AutoTrain(fDataSetTest,  fNumTestOn,  fNumTestOff))
     477            return kFALSE;
     478    }
    474479
    475480    // --------------------- Setup files --------------------
Note: See TracChangeset for help on using the changeset viewer.