Re: once again about TClonesArray

From: Valery Fine (fine@bnl.gov)
Date: Wed Dec 23 1998 - 18:58:17 MET


On 23 Dec 98 at 0:43, Pasha Murat wrote:

> Date:          Wed, 23 Dec 1998 00:43:54 GMT
> From:          Pasha Murat <murat@cdfsga.fnal.gov>
> To:            <roottalk@hpsalo.cern.ch>
> Subject:       once again about TClonesArray

> 
> I recognize that TClonesArray is a very smart and intelligent
> container but at first sight it seems to be a little bit of an
> overkill:
> 
> - it is clear that one needs a dictionary to browse the object or to
> do I/O
>   in split mode;
> - it also looks like the significant part of functionality - namely
> the 
>   functionality of container class itself plus the I/O in sequential
>   mode does not require a dictionary to be generated.
> 
> So my question is if there are serious reasons to disable the
> functionality of TClonesArray by 100% when a dictionary for the
> corresponding class is not available and the whole ROOT system is
> not initialized? 
> 

  I hope this definition of the TClass object answers your question:

http://root.cern.ch/root/html/TClass.html#TClass:description

//  The ROOT global object gROOT contains a list of all defined         //
//  classes. This list is build when a reference to a class dictionary  //
//  is made. When this happens, the static "class"::Dictionary()        //
//  function is called to create a TClass object describing the         //
//  class. The Dictionary() function is defined in the ClassDef         //
//  macro and stored (at program startup or library load time) together //
//  with the class name in the TClassTable singleton object.            //
//  For a description of all dictionary classes see TDictionary.        //

  Now look up the ctor of the class TClonesArray:

http://root.cern.ch/root/html/TClonesArray.html#TClonesArray:TClonesArray

TClonesArray(Text_t *classname, Int_t s, Bool_t) 

  To be able to *create* (instantiate) an object by its class name the class
TClonesArray should get some access to RTTI (CINT dictionary) i.e. it needs 
an access to the list of TClass objects mentioned above via gROOT global object.

  This means the ctor of TClonesArray can NOT work without dictionary at all. It
is not a question of "enable 80 % / disable 20 % of functionality"

                          "by definition"

  With my regards,
                          Valery

=================================================================
Dr. Valeri Faine (Fine)
    -------------------          Phone: +1 516 344 7806
Brookhaven National Laboratory   FAX  : +1 516 344 4206
Bldg. 510A /STAR                 mailto:fine@bnl.gov
Upton, New York, 11973-5000      http://nicewww.cern.ch/~fine
USA
                                 
Dr. Valery Fine                  Telex : 911621 dubna su
    -----------
LCTA/Joint Inst.for Nuclear Res. Phone : +7 09621 6 40 80
141980 Dubna, Moscow region      Fax   : +7 09621 6 51 45
Russia                           mailto:fine@main1.jinr.dubna.su                              



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:41 MET