Re: [ROOT] detector mapping in root

From: Rene Brun (Rene.Brun@cern.ch)
Date: Sun Jun 24 2001 - 08:40:53 MEST


Hi Valery,

TTable is a possibility, but far less efficient that the simple solution
I posted yesterday with a simple TTree. With a TTable, you have to read
all the elements of an entry to sort the table. With a simple TTree,
you have the possibility to read only the branches (Board, then Module,
etc). In case of a large table, this will make a substantial difference in
time.

Rene Brun

On Sat, 23 Jun 2001, Valeri Fine wrote:

> You can do this either with TTree or TTable.
> 
> With TTable approach create the class derived  from TTable and apply
> TTableSorter as many times as you need  to get all  your mappings. (I fact
> this is the canonical approach that works with ROOT I/O).
> http://root.cern.ch/root/htmldoc/TTable.html#TTable:description
> I'd like to call your attention the class TTableSorter doesn't change the
> table it is applied agaist of.
> Neither it copies that table data.
> 
> Since TTable class allocates the continuous memory block internally this
> block can be mapped
>  to some hardware registries and populated by "electronics" directly or by
> parallel process via
> "real" share memory (Just in case);
> 
> 
>  #include "TTable.h"
> 
>  typedef struct detector_t  {
>    int  BoardID;    /* Board ID */
>    int  ModuleID; /* Module ID */
>    int ChannelID;  /* Channel ID */
>    int  WireNumber; /* Wire number */
>    int  WireType; /* Wire type */
> };
>   class  TDetector : public TTable
>   {
>    public:
>      ClassDefTable(TDetector,detector_t)
>      ClassDef(TDetector,2) //C++ wrapper for <dst_track> StAF table
>   };
>   #endif
> 
>  At the moment the TTable object can be stored with "root" I/O, MySQL,
> XDF (Corba-like) and ASCII( via SavePrimitive) formats.
> 
>  I wonder if you need further exaplanations. Let me know.
>   Best regrads, Valeri
> 
> ----- Original Message -----
> From: "Jacek M. Holeczek" <holeczek@us.edu.pl>
> To: "roottalk" <roottalk@pcroot.cern.ch>
> Sent: Friday, June 22, 2001 7:35 PM
> Subject: [ROOT] detector mapping in root
> 
> 
> > Hi,
> > Assume one has a set of numbers (describing the wire mapping) in form :
> > BoardID ModuleID ChannelID WireNumber WireType
> > ...
> >   34      12       0         121         4
> >   34      12       1         126         1
> > ...
> >   55      15       7         121         4
> >   55      37       288       5878        2
> > ...
> > Now I would like to have functions like :
> > GetWireID(BoardID,ModuleID,ChannelID)
> > GetBoardID(WireNumber,WireType)
> > The canonical approach would be to create a "database", feed it with this
> > table, and then make queries. But ... I would like to do this without any
> > database connection. Just "pure" root.
> > I can't seem to have any good idea how to do this (mapping in both
> > directions between "electronic" channels and detector wires).
> > Any help appreciated.
> > Thanks in advance,
> > Jacek.
> >
> >
> 



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