[ROOT] Drawing in a TEventList

From: Sebastian Boeser (sboeser@ifh.de)
Date: Tue Feb 19 2002 - 15:12:48 MET


Hello ROOTs,
i tried to generate TEventLists using TTree:Draw() on an array of TTrees
(Trees[])

for (int ds = min; ds <  max; ds++){

  //Reseting Tree-EventList
  Trees[ds]->SetEventList(0);

  // Draw into list
  cout << ((TTree*)Trees[ds])->Draw(">> list",Sel.GetTitle());

  // Get the list
  TEventList * list = (TEventList*)gDirectory->Get("list");

  cout << "\t " << list->GetN() << " Events\n";

}

As this would only work if i did a TTree::Draw() in a histogram before, i
tried to circumvent this by accesing the TTreePlayer

  // Print the events in a list
  TEventList * list = new TEventList("list",Sel.GetTitle());

  list->SetDirectory(0);

  //Lets play with this tree
  TTreePlayer * tPlay = ((TTree*)Trees[ds])->GetPlayer();

  //Assign selection to tree
  tPlay->CompileVariables("",Sel.GetTitle());

  //Now run the TreePlayer loop (5 means assign to elist)
  tPlay->EntryLoop(5,list);

Unfortunatley this would not work either. If i specify a variable in
addition to the selection in TTreePlayer::CompileVariables I would just
get the last event of the tree in the list, otherwise i got an empty list
as before.

Now my question is if there is a way to generate a TEventList from a Tree
w/o drawing something from the Tree before ?

	Thanks

		Sebastian


---------------------------------------------------

    \|/     Sebastian Böser
   /  ~~
   @--OO    Rinkartstr. 3
   \   ?    12437 Berlin
    \  v    Tel: 030 / 532 19 008
     ||     sboeser@ph.tum.de



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:42 MET