Ignore:
Timestamp:
04/18/05 10:17:03 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mjobs
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mjobs/MJCut.cc

    r6941 r6948  
    227227// analysis number num, see GetOutputFile()
    228228//
    229 Bool_t MJCut::WriteResult(UInt_t num) const
     229Bool_t MJCut::WriteResult(const MParList &plist, UInt_t num) const
    230230{
    231231    TObjArray arr;
     232
     233    TIter Next(plist);
     234    TObject *o=0;
     235    while ((o=Next()))
     236        if (o->InheritsFrom(MBinning::Class()))
     237            arr.Add(o);
     238
    232239    return WriteContainer(arr, GetOutputFile(num), "UPDATE");
    233240}
     
    278285    write->AddContainer("MHillas",        "Events");
    279286    write->AddContainer("MHillasSrc",     "Events");
     287    write->AddContainer("MHillasExt",     "Events");
    280288    write->AddContainer("MPointingPos",   "Events");
    281289    write->AddContainer("MHillasSrcAnti", "Events", kFALSE);
     
    293301}
    294302
     303void MJCut::DisplayResult(const MParList &plist) const
     304{
     305    /*
     306     TObject *h1 = plist.FindObject("MHHillasOffPre",  "MHHillas");
     307     TObject *h2 = plist.FindObject("MHHillasOffPost", "MHHillas");
     308     TObject *h3 = plist.FindObject("MHVsSizeOffPost", "MHVsSize");
     309     TObject *h4 = plist.FindObject("MHHilExtOffPost", "MHHillasExt");
     310     TObject *h5 = plist.FindObject("MHHilSrcOffPost", "MHHillasSrc");
     311     TObject *h6 = plist.FindObject("MHImgParOffPost", "MHImagePar");
     312     TObject *h7 = plist.FindObject("MHNewParOffPost", "MHNewImagePar");
     313     */
     314}
     315
    295316Bool_t MJCut::ProcessFile(const MDataSet &set)
    296317{
     
    342363    MBinning bins3(50, 0,  60,   "BinningTheta",     "cos");
    343364    MBinning bins4("BinningFalseSource");
    344     //MBinning bins5("BinningWidth");
    345     //MBinning bins6("BinningLength");
    346     //MBinning bins7("BinningDist");
     365    MBinning bins5("BinningWidth");
     366    MBinning bins6("BinningLength");
     367    MBinning bins7("BinningDist");
     368    MBinning bins8("BinningMaxDist");
    347369    plist.AddToList(&bins1);
    348370    plist.AddToList(&bins2);
    349371    plist.AddToList(&bins3);
    350372    plist.AddToList(&bins4);
    351     //plist.AddToList(&bins5);
    352     //plist.AddToList(&bins6);
    353     //plist.AddToList(&bins7);
     373    plist.AddToList(&bins5);
     374    plist.AddToList(&bins6);
     375    plist.AddToList(&bins7);
     376    plist.AddToList(&bins8);
    354377
    355378    // --------------------------------------------------------------------------------
     
    623646    tlist.PrintStatistics();
    624647
     648    DisplayResult(plist);
     649
    625650    // FIXME: Perform fit and plot energy dependant alpha plots
    626651    // and fit result to new tabs!
    627     if (!WriteResult(set.GetNumAnalysis()))
     652    if (!WriteResult(plist, set.GetNumAnalysis()))
    628653        return kFALSE;
    629654
  • trunk/MagicSoft/Mars/mjobs/MJCut.h

    r6907 r6948  
    88class MTask;
    99class MDataSet;
     10class MParList;
    1011class MWriteRootFile;
    1112
     
    1819    Bool_t  fIsWobble;
    1920    Bool_t  fFullDisplay;
     21    //Bool_t  fSubstraction;
    2022
    2123    TString fNameSummary;
     
    3032    void    SetupWriter(MWriteRootFile *write, const char *name) const;
    3133    Bool_t  WriteTasks(UInt_t num, TObjArray &cont) const;
    32     Bool_t  WriteResult(UInt_t num) const;
     34    Bool_t  WriteResult(const MParList &plist, UInt_t num) const;
     35    void    DisplayResult(const MParList &plist) const;
    3336
    3437    Bool_t  CanStoreSummary() const { return !fPathOut.IsNull() && fStoreSummary; }
     
    4649    void EnableWobbleMode(Bool_t b=kTRUE)        { fIsWobble     = b; }
    4750    void EnableFullDisplay(Bool_t b=kTRUE)       { fFullDisplay  = b; }
     51    //void EnableSubstraction(Bool_t b=kTRUE)      { fSubstraction = b; }
    4852
    4953    void SetNameSummaryFile(const char *name="");
  • trunk/MagicSoft/Mars/mjobs/MJOptimize.cc

    r6939 r6948  
    228228}
    229229
    230 MJOptimize::MJOptimize() : fDebug(-1), fNumEvents(0), fType(kSimplex), fNumMaxCalls(0), fTolerance(0), fTestTrain(kFALSE)
     230MJOptimize::MJOptimize() : fDebug(-1), fNumEvents(0), fType(kSimplex), fNumMaxCalls(0), fTolerance(0), fTestTrain(0)
    231231{
    232232    fRules.SetOwner();
     
    661661    case kMigrad:    txt += "Migrad";    break;
    662662    case kMinimize:  txt += "Minimize";  break;
    663     case kMinos:     txt += "Minot";     break;
     663    case kMinos:     txt += "Minos";     break;
    664664    case kImprove:   txt += "Improve";   break;
    665665    case kSimplex:   txt += "Simplex";   break;
     
    682682    // In case the reader is the matrix loop and testrain is enabled
    683683    // switch on even mode...
    684     if (loop && fTestTrain)
    685         loop->SetOperationMode(MMatrixLoop::kEven);
     684    if (loop && TMath::Abs(fTestTrain)>0)
     685        loop->SetOperationMode(fTestTrain>0?MMatrixLoop::kEven:MMatrixLoop::kOdd);
    686686
    687687    if (!Optimize(evtloop))
     
    696696    // In case the reader is the matrix loop and testrain is enabled
    697697    // switch on odd mode...
    698     if (!loop || !fTestTrain)
     698    if (!loop || fTestTrain==0)
    699699        return kTRUE;
    700700
    701     loop->SetOperationMode(MMatrixLoop::kOdd);
     701    loop->SetOperationMode(fTestTrain<0?MMatrixLoop::kEven:MMatrixLoop::kOdd);
    702702
    703703    // Done already in Fcn
  • trunk/MagicSoft/Mars/mjobs/MJOptimize.h

    r6932 r6948  
    8484    UInt_t  fNumMaxCalls;
    8585    Float_t fTolerance;
    86     Bool_t  fTestTrain;
     86    Int_t   fTestTrain;
    8787
    8888    Bool_t Optimize(MEvtLoop &evtloop);
     
    110110    void SetNumMaxCalls(UInt_t num=0) { fNumMaxCalls=num; }
    111111    void SetTolerance(Float_t tol=0)  { fTolerance=tol; }
    112     void EnableTestTrain(Bool_t b=kTRUE) { fTestTrain=b; }
     112    void EnableTestTrain(Int_t b=2)  { fTestTrain=b; }
    113113
    114114    // Parameter access
Note: See TracChangeset for help on using the changeset viewer.