Hi Anton, The tree writes the name of the class at the beginning of each buffer to enable polymorphism in the tree. The pointer that is passed to the Tree can legally (C++ wise) point to a THistoricalData or ANY of its descendant class. In order to be able to recreate the proper object when reading back the system needs to store the information on the actually class be used for each entry. If you are absolutely sure and can guaranteee that you are going to use only ONE class throughout the tree, you can retrieve the TLeafObject corresponding to the historical data and call SetVirtual(kFalse). Note that you MUST do that before filling ANY entries and that you must use root 3.05 or above. When using compression most of this repetition is compressed away. Philippe. -----Original Message----- From: owner-roottalk@pcroot.cern.ch [mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Anton Fokin Sent: Sunday, February 25, 2001 6:10 AM To: roottalk; Rene Brun Subject: [ROOT] TTree in nonsplit mode Hi Rene and rooters, I have already asked this question but got no answer. I have THistoricalData class derived from TObject. I have a tree and write objects of this class in the tree in NONSPLIT mode in a file with NO COMPRESSION level set. -- fHistoricalData = new THistoricalData(); TTree *Tree = new TTree(Asset->GetName(), "Asset quote tree"); Int_t SplitMode = 0; Tree->Branch("HistoricalData", "THistoricalData", &fHistoricalData, 32*1024, SplitMode); Tree->Write(Asset->GetName()); -- Here is a simple bin dump of the resulting file (sorry if it may cause beeps on some old terminals). Question: Why ROOT writes class name in the beginning of every record? From several hundreds of KB of raw data I get 5MB ROOT file !!! Regards, Anton k( ¤THistoricalData @ 2 d @ d @Aç Aç Aë Aå Aç T ¤T } ¤THistoricalData @ 2 d @ d JAè Aè Aì Aè Aè ¦_ ¤T uX ¤THistoricalData @ 2 d @ d QAç Aç Aê Aà Aç !_ ¤ _L ¤THistoricalData @ 2 d @ d ^AàüAàüAë AäüAàü -ä ¤T 0n ¤THistoricalData @ 2 d @ d cAé Aé Aå AÇüAé ±£ ¤T +ê ¤THistoricalData @ 2 d @ d fA}A}Aü A| A} _@ ¤T Å_ ¤THistoricalData @ 2 d @ d qAuAuAyAt Au ¤$É ¤T ¿ ¤THistoricalData @ 2 d @ d tAkAkAmAj Ak §än ¤TH ° ¤THistoricalData @ 2 d @ d zA[A[A^ AP A[ rt ¤TH Ç ¤THistoricalData @ 2 d @ d ÇA[A[A^ AZ A[ Y + ¤THistoricalData @ 2 d @ d ¦A« A« A_ A¼ A« ± ¤T 4¶ ¤THistoricalData @ 2 d @ d +A»üA»üA_ +A« A»ü I@ ¤T ++ ¤THistoricalData @ 2 d @ d !Aö Aö Aò Aæ Aö vP ¤T R( ¤THistoricalData @ 2 d @ d ! ¤T http://www.smartquant.com
This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:37 MET