GetMinimum() and GetMaximum() of events selected from a TTree and stored in a TEventList

From: Matthias Kirsch <mkirsch_at_fnal.gov>
Date: Sun, 16 Aug 2009 19:08:42 +0200


Dear ROOT team,

I have a question concerning TTree and TEventList (or TEntryList). After making a selection of events from a TTree and storing the result in a TEventList, I would like to get the minimum (or the maximum) of a variable ("iCount" in the example below). Neither TEventList nor TEntryList have a method GetMinimum(const char* columnname). If I set the pointer to the TEventList via SetEventList and use the GetMinimum(...) method of the TTree, the TEventList selection is not taken into account.

TFile* tf = TFile::Open("testfile.root","READ") TTree* tt = (TTree*)tf->Get("testtree")
testtree->GetMinimum("iCount")
//returns 0

testtree->Draw(">>elist","iCount > 10")
TEventList* tel = (TEventList*)gDirectory->Get("elist") testtree->SetEventList(tel)
testtree->GetMinimum("iCount")
// returns 0 again

Is there a way to get the minimum/maximum value of a branch without having to loop over the remaining entries in the TEventList, storing values in a map,...? (Asking the TLeaf "iCount" for its minimum returns the same value: 0.).

I'm using ROOT v5.24 on a linux system.

Cheers,

        Matthias Received on Sun Aug 16 2009 - 19:08:59 CEST

This archive was generated by hypermail 2.2.0 : Wed Aug 26 2009 - 17:50:02 CEST