Changeset 7673


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

Legend:

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

    r7672 r7673  
    386386    const Double_t N = num;                        //[#]
    387387
    388     *fLog << "Events produced by MC inside the production area:         " << num << endl;
     388    *fLog << "Events produced by MC inside the production area:         " << TMath::Nint(num) << endl;
    389389
    390390    // This correponds to an observation time T [s]
     
    398398
    399399    *fLog << "Events measured per second effective on time:             " << r << "Hz" << endl;
    400     *fLog << "Total effective on time:                                  " << data/r  << endl;
     400    *fLog << "Total effective on time:                                  " << data/r  << "s" << endl;
    401401
    402402    // this yields a number of n events to be read for training
    403403    const Double_t n = r*T;                        //[#]
    404404
    405     *fLog << "Events to be read from the data sample:                   " << n    << endl;
     405    *fLog << "Events to be read from the data sample:                   " << TMath::Nint(n) << endl;
    406406    *fLog << "Events available in data sample:                          " << data << endl;
    407407
     
    421421        on  = TMath::Nint(nummc*data/n);
    422422        off = TMath::Nint(data);
    423         *fLog << "Not enough data events available... scaling by " << data/n << endl;
     423        *fLog << warn << "Not enough data events available... scaling by " << data/n << endl;
    424424    }
    425425    else
     
    529529        return kFALSE;
    530530
    531     const Int_t numgammas = train.GetNumRows();
    532     if (numgammas==0)
     531    const Int_t numgammastrn = train.GetNumRows();
     532    if (numgammastrn==0)
    533533    {
    534534        *fLog << err << "ERROR - No gammas available for training... aborting." << endl;
     
    544544        return kFALSE;
    545545
    546     const Int_t numbackgrnd = train.GetNumRows()-numgammas;
    547     if (numbackgrnd==0)
     546    const Int_t numbackgrndtrn = train.GetNumRows()-numgammastrn;
     547    if (numbackgrndtrn==0)
    548548    {
    549549        *fLog << err << "ERROR - No background available for training... aborting." << endl;
     
    583583
    584584    *fLog << all;
    585     fLog->Separator();
     585    fLog->Separator("The forest was tested with...");
    586586
    587587    *fLog << "Training method:" << endl;
     
    589589    *fLog << endl;
    590590    *fLog << "Events used for training:"   << endl;
    591     *fLog << " * Gammas:     " << numgammas   << endl;
    592     *fLog << " * Background: " << numbackgrnd << endl;
     591    *fLog << " * Gammas:     " << numgammastrn   << endl;
     592    *fLog << " * Background: " << numbackgrndtrn << endl;
    593593    *fLog << endl;
    594594    *fLog << "Gamma/Background ratio:" << endl;
    595595    *fLog << " * Requested:  " << (float)fNumTrainOn/fNumTrainOff << endl;
    596     *fLog << " * Result:     " << (float)numgammas/numbackgrnd << endl;
     596    *fLog << " * Result:     " << (float)numgammastrn/numbackgrndtrn << endl;
    597597
    598598    if (!fDataSetTest.IsValid())
     
    684684        return kFALSE;
    685685
     686    *fLog << all;
     687    fLog->Separator("The forest was tested with...");
     688
     689    const Double_t numgammastst   = h32.GetHist().GetEntries();
     690    const Double_t numbackgrndtst = h31.GetHist().GetEntries();
     691
     692    *fLog << "Events used for test:"   << endl;
     693    *fLog << " * Gammas:     " << numgammastst   << endl;
     694    *fLog << " * Background: " << numbackgrndtst << endl;
     695    *fLog << endl;
     696    *fLog << "Gamma/Background ratio:" << endl;
     697    *fLog << " * Requested:  " << (float)fNumTestOn/fNumTestOff << endl;
     698    *fLog << " * Result:     " << (float)numgammastst/numbackgrndtst << endl;
     699
    686700    return kTRUE;
    687701}
Note: See TracChangeset for help on using the changeset viewer.