Changeset 1911


Ignore:
Timestamp:
04/07/03 16:08:03 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r1910 r1911  
    2424     - simplified some code
    2525     - uses argument in Fill now
     26
     27   * mmain/MMonteCarlo.cc:
     28     - some code simplification
     29     - fixed a warning
    2630
    2731
  • trunk/MagicSoft/Mars/mmain/MMonteCarlo.cc

    r1800 r1911  
    9191     WARNING:
    9292     Bacause of some strage and hidden dependencies the
    93      GetMaiFrame call in the destructor of TGButton may fail if some
     93     GetMainFrame call in the destructor of TGButton may fail if some
    9494     of the other gui elemts is deleted first.
    9595     AddFirst adds the buttons at the beginning of the deletion list,
     
    279279void MMonteCarlo::CalculateTriggerRate()
    280280{
    281     // This macro has two input parameter:
     281    //
    282282    // dim : = 0 -> root file with 1 trigger condition.
    283283    //       > 0 -> number of trigger condition to be analised
     
    285285    //       < 0 -> selects the -dim trigger condition.
    286286    //
    287     // first we have to create our empty lists
    288     //
    289287    const Int_t dim = GetDim();
    290288
     
    294292    //
    295293    // Setup the parameter list.
    296     //  - we do not need to create any other container. All of them
    297     //    are created automatically without loss - we don't have to
    298     //    access them-
    299     //
    300     //  - we need to create MHMcRate only. The other containers
    301     //    are created automatically without loss - we don't have to
    302     //    access them-
    303     //  - MHMcRate must be created by us because we need the pointer
    304     //    to it and if it would get created automatically it would also be
    305     //    deleted automatically
    306     //  - Actually, depending on using a single trigger option MonteCarlo
    307     //    file or a multyple trigger option, a MHMcRate or an array of
    308     //    MHMcRate are needed.
    309294    //
    310295    plist.AddToList(&tlist);
    311296
    312     //
    313     // You don't have to add the MHMcRate container here by hand.
    314     // But if you want to print or display these containers later on
    315     // it is necessary (Rem: No printing or displaying is done in this
    316     // macro yet)
    317     //
    318297    const UInt_t from = dim>0 ?   1 : -dim;
    319298    const UInt_t to   = dim>0 ? dim : -dim;
     
    334313    // produced with the trigger_loop option.
    335314    //
    336 
    337315    if (dim < 0)
    338       ((MHMcRate*)(hists[0]))->SetTriggerCondNum((Short_t)(-dim));
    339     else if (dim > 0)
    340       for (Short_t i = from ; i <= to; i++)
    341         ((MHMcRate*)(hists[i-1]))->SetTriggerCondNum(i);
     316        ((MHMcRate*)(hists[0]))->SetTriggerCondNum(to);
     317    else
     318        for (UInt_t i=from; i<=to; i++)
     319            ((MHMcRate*)(hists[i-1]))->SetTriggerCondNum(i);
    342320
    343321    //
     
    393371    DestroyProgressBar(bar);
    394372
     373    delete BgR;
     374
    395375    if (!rc)
    396376        return;
     
    403383    const Int_t dim = GetDim();
    404384
    405     //
    406     // This macro fill the container MHMcEnergies using the task
    407     // MMcThresholdCalc and shows the results.
    408     //
    409385    MParList plist;
    410386
    411387    MTaskList tlist;
    412388    plist.AddToList(&tlist);
    413 
    414     //
    415     // Setup the parameter list
    416     // - You need create the container MHMcEnergies.
    417     //    + You need to put the number of trigger conditions when
    418     //      you declarete the MHMcEnergies
    419     //    + If you don't put any dimension to MHMcEnergies it works
    420     //      taking only the trigger information from MMcTrig
    421     //
    422389
    423390    //
     
    453420    //
    454421    // Setup the task list
    455     // - You need the read and the MMcThresholdCalc tasks
    456     // - You have to fill the histograms for the Energy threshold
    457     //    + You need to put the number of trigger conditions when
    458     //      you declarete the MMcThresholdCalc
    459     //    + If you don't put any dimension to MMcThresholdCalc it works
    460     //      like one dimension MMcThresholdCalc
    461     //
    462 
     422    //
    463423    MReadTree read("Events", fInputFile);
    464424
     
    492452    // Now you can display the results
    493453    //
    494     TIter Next(&hists);
    495     TObject *obj;
    496     while ((obj=Next()))
    497     obj->DrawClone();
     454    hists.ForEach(TObject, DrawClone)();
    498455}
    499456
Note: See TracChangeset for help on using the changeset viewer.