Re: [ROOT] MakeClass and TEventList

From: Rene Brun (Rene.Brun@cern.ch)
Date: Fri Oct 26 2001 - 10:42:33 MEST


Hi Heather,

Heather Kelly wrote:
> 
> Hi,
> 
> I am using ROOT 3.00.06 on Windows.
> 
> 2 questions:
> 
> In the code generated by TTree::MakeClass, would it be possible to include
> code that would use a TEventList if the TTree is setup to use a TEventList?
>  It is certainly possible to modify the code to use the eventlist - but it
> would be nice if it were done automatically...or am I using the MakeClass
> code incorrectly?
> 

I am somehow reluctant to implement this suggestion. With the current code,
it is easy to Set the eventlist without modifying the generated code (one line)
Assuming that you have generated Heather.h and Heather.C, do
  .L Heather.C
  Heather t;
  t->fChain->SetEventlist(mylist);

and your loop in Heather::Loop does not need to be modified.
I agree that I could add this last line in Heather::Loop just before
the main loop, but what about saving the TEventList itself?

> Second question:
> Is it possible to call TMath::Min from within a TCut passed to a
> TTree:Draw?  It does not seem to work for me:
> 
> t->Draw("Event_Id", "TMath::Min(entry1, entry2) < 5");
> 
> I've tried Min as well..

Philippe has already answered the point about TMath. One could consider
implementing in general t->Draw("xx","myfunc(v1,v2,v3,..vn).C").
We know how to do this, but may be the solution via MakeClass/MakeSelector
is a better alternative.

Rene Brun



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:04 MET