RE: [ROOT] TTree::Scan Distinct-option

From: Philippe Canal (pcanal@fnal.gov)
Date: Mon Jun 28 2004 - 18:45:00 MEST


> 2. Is there something like a "LIKE"-function for the selector in
> TTree::Draw? 

You can could 'strstr' from a TTreeFormula (i.e from draw and scan).
For example:
	tree->Draw("...","strstr(column1,\"AB\")");
However this is equivalent to "column1 like \"%AB%\")

> 1. TTree::Scan("column1"); returns me all values of column1. Is there an
> option "DISTINCT", which returns each value in column1 exactly once?
> 3. Is there a GROUP BY-clause (along with some basic aggregate-functions:
> avg, std, min, max, count), when you think of the selector as the
> WHERE-clause?

Neither are available because TTree::Draw and TTree::Scan works on entry by
entry basis.

Cheers,
Philippe.

-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Bernd Reinhold
Sent: Monday, June 28, 2004 6:50 AM
To: roottalk@pcroot.cern.ch
Subject: [ROOT] TTree::Scan Distinct-option


Hi!

I'm filling a TTree from a SQL-recordset. This made me wonder, if there are
some options in TTree, that exist in SQL:
1. TTree::Scan("column1"); returns me all values of column1. Is there an
option "DISTINCT", which returns each value in column1 exactly once?
2. Is there something like a "LIKE"-function for the selector in
TTree::Draw? If column1 is of type C-string. Then I might want to have all
the entries, whose column1 starts with "AB". In SQL one could use something
like: "column1 like \"AB%\"" Is something like that possible in a
TTree-selector
3. Is there a GROUP BY-clause (along with some basic aggregate-functions:
avg, std, min, max, count), when you think of the selector as the
WHERE-clause?

Thank you,

Bernd.



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:08 MET