Ignore:
Timestamp:
10/24/01 15:12:21 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/macros
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/macros/collarea.C

    r971 r988  
    3434    MTaskList tasklist;
    3535
    36     //
    37     // Setup the parameter list.
    38     //  - we need to create MCollArea only. The other containers
    39     //    are created automatically without loss - we don't have to
    40     //    access them-
    41     //  - MCollArea must be created by us because we need the pointer
    42     //    to it and if it would get created automatically it would also be
    43     //    deleted automatically
    44     //
    4536    parlist.AddToList(&tasklist);
    46 
    47     MHMcCollectionArea *collArea = new MHMcCollectionArea;
    48     parlist.AddToList(collArea);
    4937
    5038    //
     
    6452    MTask task;
    6553    tasklist.AddToList(&task);
    66 
    6754
    6855    //
     
    8471    // filled and can be displayd
    8572    //
    86     collArea->Draw();
     73    parlist.FindObject("MHMcCollectionArea")->DrawClone();
    8774}
  • trunk/MagicSoft/Mars/macros/threshold.C

    r971 r988  
    2424
    2525
    26 void threshold(char* filename="data/CrabNebula_dnsb_09_loop.root")
     26void threshold(char* filename="data/camera.root")
    2727{
    2828    //
     
    3030    // MMcThresholdCalc and shows the results.
    3131    //
    32     MParList  parlist;
     32    MParList parlist;
    3333
    3434    MTaskList tasklist;
     
    4343    //      taking only the trigger information from MMcTrig
    4444    //
    45     const UInt_t numtriggerconditions = 4;
     45    const UInt_t numtrigcond = 0;
     46
     47    UInt_t from = numtrigcond>0 ?           1 : -numtrigcond;
     48    UInt_t to   = numtrigcond>0 ? numtrigcond : -numtrigcond;
     49
     50    Int_t dim = to-from+1;
    4651
    4752    //
     
    4954    // and store the histograms in an TObjArray
    5055    //
    51     TObjArray *hists = new TObjArray(MParList::CreateObjList("MHMcEnergy", numtriggerconditions));
     56    TObjArray hists(MParList::CreateObjList("MHMcEnergy", from, to));
     57    hists.SetOwner();
    5258
    5359    //
    5460    // Check if the list really contains the right number of histograms
    5561    //
    56     if (hists->GetEntriesFast() != numtriggerconditions)
     62    if (hists.GetEntriesFast() != dim)
    5763        return;
    5864
     
    6066    // Add the histograms to the paramater list.
    6167    //
    62     parlist.AddToList(hists);
     68    parlist.AddToList(&hists);
    6369
    6470    //
     
    7177    //      like one dimension MMcThresholdCalc
    7278    //
    73     MReadTree        read("Events;7", filename);
    74     MMcThresholdCalc calc(numtriggerconditions);
     79    MReadTree read("Events", filename);
     80    read.UseLeaf("fEnergy");
     81    read.UseLeaf("fNumFirstLevel");
     82
     83    MMcThresholdCalc calc(numtrigcond);
    7584
    7685    tasklist.AddToList(&read);
     
    9099    // Now you can display the results
    91100    //
    92     for (UInt_t i=0; i<numtriggerconditions; i++)
    93         ((*hists)[i])->Draw();
     101    TIter Next(&hists);
     102    TObject *obj;
     103    while ((obj=Next()))
     104        obj->DrawClone();
    94105}
  • trunk/MagicSoft/Mars/macros/trigrate.C

    r984 r988  
    109109        return;
    110110
    111     TIter Next(&hists);
    112     MHMcRate *r=NULL;
    113     while ((r=(MHMcRate*)Next()))
    114         r->Print();
     111    hists.Print();
    115112}
Note: See TracChangeset for help on using the changeset viewer.