Ignore:
Timestamp:
10/24/01 15:12:21 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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}
Note: See TracChangeset for help on using the changeset viewer.