Hi Luis, It is currently not possible to use compiled user defined function within the TTree::Draw mechanism (your cases). It is possible to use user defined function that are defined using the simple TFormula mechanisms (for example TF1 functions that are solely described using a character string). If what you really want to do is a 'search an array and depending on the value of one of its elements, reject the event', this would not be solved anyway by having the ability to use a compiled function (at least not by a simple implementation). Due to the nature of the problem (involving different looping), it is not adapted to TTree::Draw, so you should be using the MakeSelector mechanism. If you did not try yet, you should try to run your analysis by compiling your script file using ACLiC. To use it, just add ++ to the name of your selector file: h1->Process("h1.C++"); This will compile h1.C and create a shared library. This assumes that h1.C does not use any CINT shortcuts. Using the compiled version should speed the running time, quite a bit. Cheers, Philippe -----Original Message----- From: owner-roottalk@pcroot.cern.ch [mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Luiz Martins Mundim Filho Sent: Wednesday, September 05, 2001 2:57 PM To: roottalk@pcroot.cern.ch Subject: [ROOT] how to cut ntuple events based on an user function II Luiz Martins Mundim Filho wrote: > Hello > > I need to plot several variables using several cuts. One of these cuts > is not a trivial one, but I need to search an array and depending on the > value of one of its elements, reject the event. This cannot be done on > the Draw command, one needs to write a C function to do it. Some one can > tell me how can I do that and use it on the Draw command? Lets call this > function ngamma.C. What I need is something like the following: > > root> h1->Draw("var",cut1&&cut2&&...&&ngamma==0) > > I have written a whole analysis program, using h1->MakeSelector, but I > need to draw several variables to test (and look for) new cuts and it > has been hard and slow to do that using h1->Process("h1.C"). > > Thanks in advance. > > Luiz
This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:59 MET