Hi, This looks like a toughy, both conceptually and implementation wise. First, how should the Draw command decide what the user means by: t->Draw("hit.t","hit.id == hit_list.id"); or by t->Draw("hit.t","hit.size == hit_ref.size"); In which case should it do a lookup to find two different index that match (as David is looking for) or do a simple index match (as it is now)? I suppose, a new syntax could be invented to express these two differents semantics, but it is really worth the extra complexity in syntax? In addition, codewise it would be a non-trivial change to add this concept. Philippe. > -----Original Message----- > From: owner-roottalk@pcroot.cern.ch > [mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of David Bailey (Antares > Post Graduate) > Sent: Thursday, July 06, 2000 10:25 AM > To: Roottalk (E-mail) > Subject: [ROOT] TTree::Draw and arrays > > > Hi, > > I've been trying to use the TTree::Draw method to loop over different > TClonesArrays and compare the values of data members of the > objects in each > array. Reading the release notes for v2.25, as I understand it, > it will only > loop over the number of entries in each array corresponding to the smaller > of the two array sizes and will only compare entries with the same index. > What I would like to be able to do is a double loop over all > entries in both > arrays and compare the values for each possible pair of entries: > > e.g. > > t->Draw("hit.t","hit.id == hit_list.id"); > > where: hit is a TClonesArray of "hits" ( with members "t" and "id" ) > hit_list is a TClonesArray of some "hit_id" object which > has a member > "id" giving the corresponding value of hit.id. > > i.e. What I want is to be able to draw some property of "hit" iff its "id" > corresponds to one in the "hit_list". Clearly, I could write a macro with > the loops explicitly to do this but it would be nice to be able to do it > automatically... Is this possible with the current release or can it be > easily added? > > Thanks for your help, > > Cheers, Dave > > /------------------------------------------/ > David Bailey : Antares post-Graduate / > Nuclear and Astrophysics Laboratory / > Keble Road, Oxford OX1 3RH /-------/ > (01865) 273395 /------------/ > -----------------/ d.bailey2@physics.ox.ac.uk > >
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:29 MET