Re: variable length array leafs in TTree

From: gerontas <gerontas_at_gmail.com>
Date: Wed, 19 Jan 2011 15:43:32 +0100


Hello,
sorry for the 3 mails. I hope you get this once.  (well, not quite, sorry!)

> you could use
> Alt$(Array[0]==1 && Array[1]==-1, Array[0]==-1)
> where the second parameter is used if the first doesn't exist. See the
> documentation for TTree::Draw():
> <http://root.cern.ch/root/html/TTree#TTree:Draw%2>

I get an error:
root [1] mini->Project("hh","TrackAA[0]","Alt$((NTracksB>0 &&Charge[0]==-1),NTracks>=1 && (Charge[0]==1 &&Charge[1]==-1))") Error in <TTreeFormula::DefinedVariable>: The 2nd arguments in Alt$((NTracksB>0&&Charge[0]==-1),NTracksB>=1&&(Charge[0]==1&&Charge[1]==-1)) can not be an array (NTracksB>=1&&(Charge[0]==1&&Charge[1]==-1),-1)! Error in <TTreeFormula::Compile>: Bad numerical expression : "Alt$((NTracksB>0&&Charge[0]==-1),NTracksB>=1&&(Charge[0]==1&&Charge[1]==-1))" I understand I may have not been clear enough on what I want to do; the problem arrays are in the condition, not to be plotted/selected. If the above is still unclear, I will try to provide a minimal example.

Thanks a lot in advance!
Panos Received on Wed Jan 19 2011 - 15:43:38 CET

This archive was generated by hypermail 2.2.0 : Wed Jan 19 2011 - 17:50:01 CET