Log of /trunk/tree/tree/src/TBranchElement.cxx
Parent Directory
Revision
49245 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Apr 15 19:58:24 2013 UTC (21 months, 1 week ago) by
pcanal
File length: 212472 byte(s)
Diff to
previous 49054
Import revision 49244 from the v5-34-00 patch branch:
In InitializeOffsets, remove the collection branch name in all cases of collection splitting
Revision
49046 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:56:15 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 211895 byte(s)
Diff to
previous 49039
Import revision 49005 from the v5-34-00 patch branch:
When switching STL collection proxy we also need to update fSTLtype
Revision
49039 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:53:37 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 211926 byte(s)
Diff to
previous 49037
Import revision 48998 from the v5-34-00 patch branch:
Properly handle the evolution of an STL container containing a class with contains sub-object (don't claim the subobject also changed type)
Revision
49037 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:52:52 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 211778 byte(s)
Diff to
previous 49032
Import revision 48996 from the v5-34-00 patch branch:
In the MakeClass reading code when failing over to using the StreamerInfo, switch to using the action sequence
Revision
49032 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:50:54 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 211579 byte(s)
Diff to
previous 49029
Import revision 48986 from the v5-34-00 patch branch:
Extend the output of TTree::Print(debugInfo) to include the action sequence information (and add support for the sub option 'func' that also prints the function's (mangled) name
Revision
49029 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Mar 31 17:49:46 2013 UTC (21 months, 3 weeks ago) by
pcanal
File length: 211251 byte(s)
Diff to
previous 49014
Import revision 48982 from the v5-34-00 patch branch:
Add support for implicit conversion of stl collection (when they require schema evolution)
Revision
46322 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Oct 4 20:52:35 2012 UTC (2 years, 3 months ago) by
pcanal
File length: 208960 byte(s)
Diff to
previous 46089
In the case where the content of STL collection has one of its member removed, avoid mistakenly trying to read if SetAddress is called more than once on that branch
Revision
43993 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 27 16:23:16 2012 UTC (2 years, 8 months ago) by
pcanal
File length: 208706 byte(s)
Diff to
previous 43518
Fix coverity issues
Dereference null return:
32943,32945,36325,36329: TFormLeafInfo::GetLocalValuePointer
33253: TTreeFormula::EvalObject
33763: CloneTree
33258: GetBasket
34034: In DropBuffers (in addition avoid reading the basket when the intend is to drop the content from memory!)
36307: TTree::BuildIndex
36328: DrawCopy
36332: GetStreamerInfoCache
33025: BuildStreamerInfo
42469: Clone
33436: MakeIterator
Dereference after null check.
42470: in ImportStreamerInfo
33138: in TEntryListArray::Enter
Unchecked return value:
32049, 32050: TBranchProxy::Read and Setup
Mixed enums:
32705,32706: TClass::fStreamerType (and also name the enum type).
Revision
42967 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Feb 10 22:35:22 2012 UTC (2 years, 11 months ago) by
pcanal
File length: 208597 byte(s)
Diff to
previous 41697
Fix support for emulated class that derived from an abstract class.
This can happen when reading a file containing an ancient
class layout where the derived class is no longer provided in the
compiled code but the abstract base class is still provided.
It also happens when using schema evolution rules on a class derived
from an abstract base class (in which case the system introduce
implicitly an emulated class deriving from the same base classes
as the evolved from class).
To fix the issue, we introduce the TClass::GetStreamerInfoAbstractEmulated
which will return a StreamerInfo representing an emulated version of the
class even if it is loaded. To distinguish the real abstract base class
representation (let's take 'AbstractBase' as an example), the returned
StreamerInfo is attached to a different TClass which has the same name
but is suffixed with @@emulated ('AbstractBase@@emulated' in our example).
Revision
41520 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Oct 20 17:10:04 2011 UTC (3 years, 3 months ago) by
pcanal
File length: 206870 byte(s)
Diff to
previous 41318
Properly propagate the size of an array used/cached as part of the artificial elements. In TVirtualArray distinguish size and capacity
Revision
41318 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Oct 11 08:48:03 2011 UTC (3 years, 3 months ago) by
pcanal
File length: 206866 byte(s)
Diff to
previous 41244
Fix Coverity issues:
TTreePlayer.cxx: another instance of 34037 Dereference null return value
TBranchElement.cxx: 2nd attempt for 34040,34042 Dereference null return (stat)
TTabCom.cxx: another instance of 34168 Explicit null dereferenced
Revision
41244 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Oct 6 19:42:35 2011 UTC (3 years, 3 months ago) by
pcanal
File length: 206850 byte(s)
Diff to
previous 41038
Fix Coverity issues:
TBranchSTL: cov 34339 Resource leak (false positive)
TTableDescriptor.cxx: cov 34219,34220 explicit null dereference
TSQLStructure.cxx: cov 34204,34205,34206 Explicit null dereferenced
TTabCom.cxx: cov 34168 Explicit null dereferenced
TClassRef.cxx: cove 34165 Explicit null dereferenced (false positive but still confusing coding).
TBufferXML.cxx: 34070 Explicit null dereferenced
TFriendProxyDescriptor.cxx: cov 34066 Uninitialized scalar field
TTreeCloner.cxx: cov 34034057 Dereference null return (stat) 63 Uninitialized scalar field
TParallelCoordEditor.cxx: 34051,34059,34060,34061 Dereference null return value
TParallelCoord.cxx: 34050,34056, 34057 Dereference null return (stat)
TBranchProxy.h: 34048 Dereference null return value
TBranchProxy.cxx: 34043,34044,34045 Dereference null return value
TTree.cxx: 34039 Dereference null return value
TTreePlayer.cxx: 34037 Dereference null return value
TLeafC.cxx: 34036 Dereference null return value
Revision
41027 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Sep 27 14:10:16 2011 UTC (3 years, 3 months ago) by
pcanal
File length: 206580 byte(s)
Diff to
previous 41024
In revision 40830, we reduce the number of calls to ValidateAddress which check
if the users has deleting (and/or just zero-ed out) the underlying pointer/object.
In the case of a simple split top-level object, however, this meant that there was
no longer any call to ValidateAddress (because there is no ReadLeaves being called
for this type of branch/node).
This patch re-add it. Thanks to Federico and Alice for reporting this problem.
Revision
40872 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Sep 13 21:33:33 2011 UTC (3 years, 4 months ago) by
pcanal
File length: 205278 byte(s)
Diff to
previous 40830
From Chris Jones:
Put in place the infrastructure to optimize the I/O writes in the same way we optimized the I/O reads.
Rename TBuffer::ReadSequence to TBuffer::ApplySequence as they can be used both for reading and writing. The 3 new signatures:
1. virtual Int_t ApplySequence(const TStreamerInfoActions::TActionSequence &sequence, void *object);
2. virtual Int_t ApplySequenceVecPtr(const TStreamerInfoActions::TActionSequence &sequence, void *start_collection, void *end_collection);
3. virtual Int_t ApplySequence(const TStreamerInfoActions::TActionSequence &sequence, void *start_collection, void *end_collection);
The 1st version is optimized to read a single object. The 2nd version is optimized to read the content of TClonesArrays and vectors of pointers to objects.
The 3rd version is used to streamed any collections.
In TBranchElement, introduce a set FillLeaves member functions to precalculate many of the (existing) conditional. Introduction support for the StreamerInfo write actions and sequences.
Revision
40830 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Sep 7 16:58:28 2011 UTC (3 years, 4 months ago) by
pcanal
File length: 194410 byte(s)
Diff to
previous 40080
Improve performance of TTree::GetEntry. With this changes the 'overhead'
compare to protobuf goes from 48% to 24%. (This does not include the
cost of the file opening which can be comparatively large for small
files. For the example from Samvel the cost TFile::Open is 8% of the cost
of 100000 calls to TTree::GetEntry)
TClonesArray: update ExpandCreateFast to also reset the non-used slots
so that calling Clear (which does too much) is no longer necessary
when using ExpandCreateFast.
TObjectArray: Add GetObjectRef() to speed up get the beginning address
of the underlying array.
TBranchElement: Use R__likely, R__unlikely in a few places. Unroll
SetupAddresses (because it almost always return without doing any work).
Removed a few redundant if(xxx!=0). Add notes hinting at other possible
improvements.
Revision
40077 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jun 29 13:37:13 2011 UTC (3 years, 6 months ago) by
pcanal
File length: 192966 byte(s)
Diff to
previous 39786
Prevent the use of non-existent memory when reading in an object that is part of an STL collection and which used to contains an embedded object (and this data member has been removed)
Revision
39786 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jun 17 04:20:39 2011 UTC (3 years, 7 months ago) by
pcanal
File length: 192711 byte(s)
Diff to
previous 39696
Properly recognize a TClonesArray data member even if the requested type was a typedef (to TClonesArray) that is in a namespace (for example edm::Event::ContaierType)
Revision
39696 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jun 13 21:35:34 2011 UTC (3 years, 7 months ago) by
pcanal
File length: 192744 byte(s)
Diff to
previous 39694
From David Dagenhart:
Implement an option to allow ROOT to use the LZMA compression
algorithm to compress data instead of the ZLIB compression algorithm.
LZMA compression typically results in smaller files, but takes more
CPU time to compress data. To use the new feature, the external XZ
package must be installed when ROOT is configured and built:
Download 5.0.3 from here http://tukaani.org/xz/
and make sure to configure with fPIC:
./configure CFLAGS='-fPIC'
Then the client C++ code must call routines to explicitly request LZMA
compression.
ZLIB compression is still the default.
Setting the Compression Level and Algorithm:
There are three equivalent ways to set the compression level and
algorithm. For example, to set the compression to the LZMA algorithm
and compression level 5.
1. TFile f(filename, option, title);
f.SetCompressionSettings(ROOT::CompressionSettings(ROOT::kLZMA, 5));
OR
2. TFile f(filename, option, title, ROOT::CompressionSettings(ROOT::kLZMA, 5));
OR
3. TFile f(filename, option, title);
f.SetCompressionAlgorithm(ROOT::kLZMA);
f.SetCompressionLevel(5);
These methods work for TFile, TBranch, TMessage, TSocket, and TBufferXML.
The compression algorithm and level settings only affect compression of
data after they have been set. TFile passes its settings to its branches
only at the time the branches are created. This can be overidden by
explicitly setting the level and algorithm for the branch. These classes
also have the following methods to access the algorithm and level for
compression.
Int_t GetCompressionAlgorithm() const;
Int_t GetCompressionLevel() const;
Int_t GetCompressionSettings() const;
If the compression level is set to 0, then no compression will be
done. All of the currently supported algorithms allow the level to be
set to any value from 1 to 9. The higher the level, the larger the
compression factors will be (smaller compressed data size). The
tradeoff is that for higher levels more CPU time is used for
compression and possibly more memory. The ZLIB algorithm takes less
CPU time during compression than the LZMA algorithm, but the LZMA
algorithm usually delivers higher compression factors.
The header file core/zip/inc/Compression.h declares the function
"CompressionSettings" and the enumeration for the algorithms.
Currently the following selections can be made for the algorithm:
kZLIB (1), kLZMA (2), kOldCompressionAlgo (3), and kUseGlobalSetting
(0). The last option refers to an older interface used to control the
algorithm that is maintained for backward compatibility. The following
function is defined in core/zip/inc/Bits.h and it set the global
variable.
R__SetZipMode(int algorithm)
If the algorithm is set to kUseGlobalSetting (0), the global variable
controls the algorithm for compression operations. This is the
default and the default value for the global variable is kZLIB.
Note that the LZMA algorithm will only be available if the LZMA
libraries from the XZ package were available when the ROOT executable
being used was configured and built. If you are building ROOT and want
LZMA then you must do something similar to the following if XZ is not
already installed on your system.
Download XZ version 5.0.3 from http://tukaani.org/xz/
unwind the tarball
cd xz-5.0.3
./configure CFLAGS='-fPIC'
make
ROOT was tested with version 5.0.3 of XZ. It might work with earlier
versions and will probably work with later versions of XZ.
Then either use "make install" to put the library and headers into
/usr/local/* so the scripts building ROOT can find them or use
arguments to the ROOT configure script to point to the proper
directories containing the XZ library and headers. These are the
library and the included header (lzma.h includes other headers in the
lzma subdirectory).
src/liblzma/.libs/liblzma.a
src/liblzma/api/lzma.h
WARNING: Data compressed with the LZMA algorithm cannot be read by
ROOT executables that were not built with LZMA support.
Revision
39694 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jun 13 21:10:32 2011 UTC (3 years, 7 months ago) by
pcanal
File length: 192735 byte(s)
Diff to
previous 39611
Update TBranchElement::Unroll to no longer split a base class
that can not be split (i.e. respect the information returned
by TStreamerElement::CannotSplit (and thus TClass::CanSplit).
Add the ability to explicitly forbid (or allow) the splitting of a class
(TClass::SetSplit) so that user can inforce the use of a
custom streamer in all possible split cases.
This disabling is currently _not_ done automatically for
backward compatibility reasons and because
a) Without TClass::SetCanSplit there was no way to
force the splitting (short of setting the split level lower)
b) Some classes still requires a custom streamer solely to
read older data files (for example for file written before
the advent of StreamerInfo) and are such not necessary to
be used when writting (and schema evolution rules can not
yet be used in this case).
Revision
39611 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jun 8 19:35:17 2011 UTC (3 years, 7 months ago) by
pcanal
File length: 192621 byte(s)
Diff to
previous 38854
Introduce TMemFile and update TFileMerger to support incremental merges.
Add new tutorials ( net/treeClient.C + net/fastMergeServer.C )
demonstrating how a TMemFile can be used to do parallel merge
from many client. ( TMemFile still needs to be better integrated
with TMessage and TSocket).
The new TMemFile class support the TFile interface but only store
the information in memory. This version is limited to 32MB.
TMessage mess;
...
mess->ReadFastArray(scratch,length);
transient = new TMemFile("hsimple.memroot",scratch,length);
will copy the content of 'scratch' into the in-memory buffer
created by/for the TMemFile.
TMemFile *file = new TMemFile("hsimple.memroot","RECREATE");
Will create an empty in-memory of (currently fixed) size 32MB.
file->ResetAfterMerge(0);
Will reset the objects in the TDirectory list of objects
so that they are ready for more data accumulations (i.e.
returns the data to 0 but keep the customizations).
Introduce the new function TFileMerger::IncrementalMerge will
will Merge the list of file _with_ the content of the output
file (if any). This allows make several successive Merge
into the same TFile object.
Introduce non-static version of TFile::Cp allows the copy of
an existing TFile object.
Introduce new explicit interface for providing reseting
capability after a merge. If a class has a method with
the name and signature:
void ResetAfterMerge(TFileMergeInfo*);
it will be used by a TMemFile to reset its objects after
a merge operation has been done.
If this method does not exist, the TClass will use
a method with the name and signature:
void Reset(Optiont_t *);
TClass now provides a quick access to these merging
function via TClass::GetResetAfterMerge. The wrapper function
is automatically created by rootcint and can be installed
via TClass::SetResetAfterMerge. The wrapper function should have
the signature/type ROOT::ResetAfterMergeFunc_t:
void (*)(void *thisobj, TFileMergeInfo*);
ResetAfterMerge functions were added to the following classes:
TDirectoryFile, TMemFile, TTree, TChain, TBranch, TBranhcElement,
TBranchClones, TBranchObject and TBranchRef.
Revision
38854 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Apr 14 18:03:34 2011 UTC (3 years, 9 months ago) by
pcanal
File length: 192170 byte(s)
Diff to
previous 38757
In TBranchRef distinguish between the entry we need (now called RequestedEntry) and the
entry we have read (fReadEntry) so that we can avoid re-reading the same entry too many
times.
Revision
38393 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Mar 11 21:53:52 2011 UTC (3 years, 10 months ago) by
pcanal
File length: 192242 byte(s)
Diff to
previous 38261
Fix the case of a split collection which contains a class with one
data member which is an instance of a class with more than one base
class some of which are not split (for example if one the base class
is std::vector<int>).
Revision
38059 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Feb 13 21:12:16 2011 UTC (3 years, 11 months ago) by
pcanal
File length: 193104 byte(s)
Diff to
previous 37420
Significant improvement of the performance of SetBranchAddress/SetAddress (by a factor 3 to 10 depending on the length/complexity of the classname ).
Revision
37420 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Dec 8 21:25:20 2010 UTC (4 years, 1 month ago) by
pcanal
File length: 191554 byte(s)
Diff to
previous 37210
Add type information to the result of TTree::Print in the case of
TBranchElement. Now:
*Br 17 :fH : TH1F* *
*Entries : 20 : Total Size= 19334 bytes File Size = 1671 *
*Baskets : 2 : Basket Size= 16000 bytes Compression= 11.29 *
*............................................................................*
*Br 18 :fTriggerBits : TBits *
*Entries : 20 : Total Size= 1398 bytes File Size = 400 *
*Baskets : 1 : Basket Size= 16000 bytes Compression= 2.23 *
*............................................................................*
*Br 19 :fIsValid : Bool_t *
*Entries : 20 : Total Size= 582 bytes File Size = 92 *
*Baskets : 1 : Basket Size= 16000 bytes Compression= 1.00 *
Revision
37210 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Dec 2 22:56:23 2010 UTC (4 years, 1 month ago) by
pcanal
File length: 191374 byte(s)
Diff to
previous 37149
Avoid creating phantom branches for the artificial and the repeat elements (i.e. avoid creating a branch for a transient member with a schema evolution rule)
Revision
37127 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Nov 30 21:23:22 2010 UTC (4 years, 1 month ago) by
pcanal
File length: 191200 byte(s)
Diff to
previous 36169
Add protection in case where one call CloneTree with a class for which a data member has been removed (and hence (for now) the branch for the 'removed member' is an incorrect state
Revision
36168 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Oct 7 16:05:41 2010 UTC (4 years, 3 months ago) by
pcanal
File length: 190734 byte(s)
Diff to
previous 36061
Since we consider the base class as part of the main object and split it with the same level of the derived part, do not change the splitlevel value when calling Unroll for base class .. this has the side effect of properly insuring the de-optimization of the base class streamer info and thus fixes the problem reported at https://savannah.cern.ch/bugs/?73467
Revision
36061 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Oct 4 16:05:51 2010 UTC (4 years, 3 months ago) by
pcanal
File length: 190736 byte(s)
Diff to
previous 36031
Introduce an optimized infrastructure for reading objects using a StreamerInfo.
Rather than driving the streaming using a switch statement inside TStreamerInfo::ReadBuffer,
the streaming is now driven using a simple loop over a sequence of configured StreamerInfo actions.
This improves run-time performance by allowing a dramatic reduction in function calls and code
branches at the expense of some code duplication.
There are 3 versions of this loop implemented in TBufferFile and overloaded in TBufferXML and TBufferSQL:
1. virtual Int_t ReadSequence(const TStreamerInfoActions::TActionSequence &sequence, void *object);
2. virtual Int_t ReadSequenceVecPtr(const TStreamerInfoActions::TActionSequence &sequence, void *start_collection, void *end_collection);
3. virtual Int_t ReadSequence(const TStreamerInfoActions::TActionSequence &sequence, void *start_collection, void *end_collection);
The 1st version is optimized to read a single object. The 2nd version is optimized to read the content of TClonesArrays and vectors of pointers to objects.
The 3rd version is used to streamed any collections.
TBufferXML and TBufferSQL overload the loops to introduce extra code to help the buffer keep track of which streamer
element is being streamed (this functionality is not used by TBufferFile.)
A TStreamerInfoActions::TActionSequence is an ordered sequence of configured actions.
A configured action has both an action which is a free standing function and a configuration object deriving
from TStreamerInfoActions::TConfiguration. The configuration contains information that is specific to the action
but varies from use to use, including the offset from the beginning of the object that needs to be updated.
Other examples of configuration include the number of bits requested for storing a Double32_t or its factor and minimum.
When the sequence is intended for a collection, the sequence also has a configuration object deriving
from TStreamerInfoActions::TLoopConfiguration which contains for example the size of the element of
a vector or the pointers to the iterators functions (see below).
Each TStreamerInfo has 2 reading sequences, one for object-wise reading (GetReadObjectWiseActions)
and one for member-wise reading (GetReadMemberWiseActions) which is used when streaming a TClonesArray
of a vector of pointer to the type of objects described by the TClass.
Each collection proxy has at least one reading sequences, one for the reading each version of the
contained class layout.
Each case of the TStreamerInfo::ReadBuffer switch statement is replaced by 4 new action functions,
one for the object wise reading, one for the member wise reading for TClonesArray and vector of pointers,
one for the member wise reading for a vector of object and one for all other collections.
Each collection (proxy) needs to provide 5 new free standing functions:
// Set of functions to iterate easily throught the collection
static const Int_t fgIteratorArenaSize = 16; // greater than sizeof(void*) + sizeof(UInt_t)
typedef void (*CreateIterators_t)(void *collection, void **begin_arena, void **end_arena);
virtual CreateIterators_t GetFunctionCreateIterators(Bool_t read = kTRUE) = 0;
// begin_arena and end_arena should contain the location of a memory arena of size fgIteratorSize.
// If the collection iterator are of that size or less, the iterators will be constructed in place in those location (new with placement)
// Otherwise the iterators will be allocated via a regular new and their address returned by modifying the value of begin_arena and end_arena.
typedef void* (*CopyIterator_t)(void *dest, const void *source);
virtual CopyIterator_t GetFunctionCopyIterator(Bool_t read = kTRUE) = 0;
// Copy the iterator source, into dest. dest should contain the location of a memory arena of size fgIteratorSize.
// If the collection iterator is of that size or less, the iterator will be constructed in place in this location (new with placement)
// Otherwise the iterator will be allocated via a regular new and its address returned by modifying the value of dest.
typedef void* (*Next_t)(void *iter, const void *end);
virtual Next_t GetFunctionNext(Bool_t read = kTRUE) = 0;
// iter and end should be pointers to respectively an iterator to be incremented and the result of collection.end()
// If the iterator has not reached the end of the collection, 'Next' increment the iterator 'iter' and return 0 if
// the iterator reached the end.
// If the end was not reached, 'Next' returns the address of the content pointed to by the iterator before the
// incrementation ; if the collection contains pointers, 'Next' will return the value of the pointer.
typedef void (*DeleteIterator_t)(void *iter);
typedef void (*DeleteTwoIterators_t)(void *begin, void *end);
virtual DeleteIterator_t GetFunctionDeleteIterator(Bool_t read = kTRUE) = 0;
virtual DeleteTwoIterators_t GetFunctionDeleteTwoIterators(Bool_t read = kTRUE) = 0;
// If the size of the iterator is greater than fgIteratorArenaSize, call delete on the addresses,
// Otherwise just call the iterator's destructor.
This functions are currently only 'emulated' using the old infrastructure for the collections other than vector ; they
will later one be provided by the dictionaries.
Revision
34969 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Aug 24 19:01:19 2010 UTC (4 years, 5 months ago) by
pcanal
File length: 185475 byte(s)
Diff to
previous 34739
Replace the ReadLeaves virtual function by a fReadLeaves pointer to member function,
this allows the customization of the ReadLeaves function at run-time depending on the
underlying user class layout in TBranchElement. This removes many if statements whose
'answer' is known at initialization time. [ReadLeavesMakeClass and ReadLeavesCollection
still need further decomposition]
Introduce TBranch::Set/GetMakeClass to independently set each branch in MakeClass mode
and to have a good place to switch the ReadLeaves function appropriately (to and from
the MakeClass mode (also known as the decomposed object mode)). This can also be
used to reset the mode of some branch with a MakeClass/MakeSelector file.
Revision
34739 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Aug 6 01:26:08 2010 UTC (4 years, 5 months ago) by
pcanal
File length: 177089 byte(s)
Diff to
previous 34664
Introduce and use TTree::kSplitCollectionOfPointers to better specify the special number (100) to be added to the split level
Revision
33097 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Apr 19 21:47:55 2010 UTC (4 years, 9 months ago) by
pcanal
File length: 176213 byte(s)
Diff to
previous 32943
Remove reliance on gDirectory to set TBranch::fDirectory ; instead use the new function TBranch::UpdateFile to be called from TTree::DirectoryAutoAdd. This avoids forcing the user to explicitly cd to the input directory before calling TKey::ReadObj for a TTree object
Revision
32943 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Apr 12 12:05:11 2010 UTC (4 years, 9 months ago) by
pcanal
File length: 175624 byte(s)
Diff to
previous 32930
More precise implementation of revision 32860 so that it does not interfer with the MakeClass case.
( Add missing protection in the case we have an embedded object in a split branch which has been 'removed' from the current schema )
Revision
32930 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 9 16:18:32 2010 UTC (4 years, 9 months ago) by
pcanal
File length: 175623 byte(s)
Diff to
previous 32860
Prefer the use of InheritsFrom(TClass*) over InheritsFrom(const char*) as long as
it does not increase the library dependencies.
Revision
32860 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Mar 31 20:00:50 2010 UTC (4 years, 9 months ago) by
pcanal
File length: 175609 byte(s)
Diff to
previous 32368
Add missing protection in the case we have an embedded object in a split branch which has been 'removed' from the current schema
Revision
32368 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Feb 18 14:46:38 2010 UTC (4 years, 11 months ago) by
pcanal
File length: 175398 byte(s)
Diff to
previous 32159
Improve memory handling the in the emulated collection proxy, in particular
make it such that an emulated collection of pointers can become owner of its content.
The default, for backward compatibility and to avoid double delete (at the expense
of memory leak), the container of pointers are _still_ not owning their content
__unless__ they are a free standing container (i.e. itself not contained in another
object).
To make a container of pointers become owner of its content do something like:
cl = TClass::GetClass("ObjectVector<LHCb::MCRichDigitSummary>");
if (cl && cl->GetStreamerInfo()) {
TObject *el = cl->GetStreamerInfo()->GetElements()->FindObject("m_vector");
if (el) el->ResetBit(TStreamerElement::kDoNotDelete);
}
For MakeProject, use file->GetStreamerInfoCache() instead of the TClass GetStreamerInfo.
Revision
32159 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jan 29 17:17:09 2010 UTC (4 years, 11 months ago) by
pcanal
File length: 175264 byte(s)
Diff to
previous 31605
Improve thread safety and performance of TStreamerInfo creation and use.
Remove a spurrious error message when in MemberWise streaming mode (see r30751 and r30527)
Insure that the StreamerInfo using in MemberWise streaming in not optimized (previously this was checked/done only for the 'current' StreamerInfo).
Reduce (dramatically) the number of times a StreamerInfo is recompiled.
Add TVirtualStreamerInfo::IsCompiled (to replace use of GetOffset()!=0)
Implementation details:
Remove internal use of TVirtualStreamerInfo::Optimize(kFALSE), replace
by explicit setting of kCannotOptimize.
Remove virtually (and make inline) 3 time critical functions.
Revision
31396 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Nov 23 19:45:11 2009 UTC (5 years, 2 months ago) by
brun
File length: 175581 byte(s)
Diff to
previous 31345
From Philippe:
Even if the data member is not present in the target class, assign fID to the new value
to avoid any confusion.
Revision
31252 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Nov 17 20:12:32 2009 UTC (5 years, 2 months ago) by
pcanal
File length: 175128 byte(s)
Diff to
previous 31242
Properly recover the hierarchy of branch when the top level branch has a trailing dot
and the intermediary branch is TBranchSTL.
Correct the lookup of the CollectionProxy when the sub-branches of a TBranchSTL are
not split (Fixes Savannah #59011).
Expose the sub-branches of a TBranchSTL when calling TTree::Print (by implementing
TBranchSTL::Print()).
Revision
31170 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Nov 13 20:21:56 2009 UTC (5 years, 2 months ago) by
pcanal
File length: 174351 byte(s)
Diff to
previous 31113
In TBranchElement::SetupAddress do not confuse the case where we have not setup
the address yet and the case where we already tried but could not (because the
data member is no longer in the main class layout).
Revision
29599 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jul 27 15:42:23 2009 UTC (5 years, 5 months ago) by
pcanal
File length: 173637 byte(s)
Diff to
previous 29475
The default length fEntryOffset can now be set via TTree::SetDefaultEntryOffsetLen which can be optionially applied to the existing branches.
Revision
29388 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jul 7 16:54:42 2009 UTC (5 years, 6 months ago) by
pcanal
File length: 173409 byte(s)
Diff to
previous 28776
Fix the case involving nested classes inside an STL container,
when a data member is deleted from a class in the middle and root did not
properly recognize this when reading old data, and overwrites part
of the structure being read.
For example, suppose we have this:
struct C { int x; };
struct B { C b1; C b2; };
struct A { std::vector<B> aa; };
and then write an A to a tree. We then remove the `b2' member.
When reading an old file, the contents of `b1' will be written
with the old `b2'!
Revision
28610 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed May 13 16:21:06 2009 UTC (5 years, 8 months ago) by
pcanal
File length: 173641 byte(s)
Diff to
previous 28502
TStreamerInfo: Avoid forgetting that a member is missing even if the 'main' streamerinfo is 'only' emulated.
TBranchElement: Extend the fix in revision 28502 to also work if Set[Branch]Address is called.
Revision
28502 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri May 8 15:41:45 2009 UTC (5 years, 8 months ago) by
pcanal
File length: 173035 byte(s)
Diff to
previous 28357
Avoid reading 'removed' members into never never land (the major symptom was in the case of an std::vector of object that was remove from an object that is split. In this case reading the file was resulting in an infinite loop at the first atttempt at reading the branch holding the 'removed vector')
Revision
28357 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Apr 25 13:06:20 2009 UTC (5 years, 9 months ago) by
pcanal
File length: 172879 byte(s)
Diff to
previous 28091
In TBranchElement::Reset, also reset fBranchID to match the reseting of the
TRefTable done in TBranchRef::Reset.
This fixes the issue #42068 in savannah
Revision
28090 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 3 10:43:06 2009 UTC (5 years, 9 months ago) by
pcanal
File length: 172798 byte(s)
Diff to
previous 27936
Prevent the use of MapObject for a 'sub branch' containing a vector of simple type (this is an addition to revision 26430)
Also do not use MapObject for string/TString branches.
Revision
26141 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Nov 11 14:47:49 2008 UTC (6 years, 2 months ago) by
pcanal
File length: 171486 byte(s)
Diff to
previous 25657
Add support for top level object that do not inherit from TObject _AND_ have a custom streamer (like std::string and TString); Their TBranchElement has fType==-1 (i.e. new value)
Revision
25574 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Sep 27 16:03:37 2008 UTC (6 years, 3 months ago) by
pcanal
File length: 170288 byte(s)
Diff to
previous 25572
Reduce 'cost' of revision 25572 for stress -b 30 by 90% (it was about 1%)
Replace 'expensive' iterators by their 'fast' alternative (i.e TIter vs UncheckedAt); Avoid
creating TString and std::string object unless really necessary; And when a string temporary
is necessary, make sure it is allocating the underlying memory buffer only once
(instead of 2 or 3 times in some the case where we need to 'append' to the string).
Revision
25572 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Sep 27 07:03:25 2008 UTC (6 years, 3 months ago) by
pcanal
File length: 169604 byte(s)
Diff to
previous 25473
Fix tree->Draw("s1.value"); when the top level branch does not have a trailing dot
(and hence the real branch name is only 'value').
TTreeFormula was properly parsing the string and finding the correct branch, however
it was recorded only the end branch name as the result of the parse (i.e. in the
above case, just 'value') and hence UpdateFormulaLeaves was not restoring the leaf
correctly (and hence EvalInstance returned 0s).
To solve the issue we now record the 'full pathname' of the branch (i.e. including
the omitted top level branch names) and we upgrade TTree::FindBranch and
TBranchElement::FindBranch to be able to handle those path.
Fix TTree::Scan("*") to properly requested the distinct leaf even if the branch
name are ambiguous (previously it would repetively print the first match).
Revision
25455 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Sep 19 04:52:34 2008 UTC (6 years, 4 months ago) by
pcanal
File length: 169269 byte(s)
Diff to
previous 25450
Re-add build of StreamerInfo when retrieve via a checksum (inadvertently removed in revision 25210 (datamodelevolution branch). Also no longer update fClassVersion in the case of Foreign class so that we can re-init fInfo if the user is passing us a class that require (another) conversion
Revision
25450 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Sep 18 21:13:42 2008 UTC (6 years, 4 months ago) by
pcanal
File length: 168758 byte(s)
Diff to
previous 25369
Import the code from the branch dev/datamodelevolution revision 25436
This implements the infrastructure for the new Data Model Evolution Scheme.
This Data Model Evolution is brought to your courtesy of BNL/STAR/ATLAS/Fermi/Cern
Current Capabilities:
Assign values to transient data members
Rename classes
Rename data members
Change the shape of the data structures or convert one class structure to another
Change the meaning of data members
Ability to access the TBuffer directly when needed
Ensure that the objects in collections are handled in the same way as the ones stored separately
Supported in object-wise, member-wise and split modes.
Coming soon:
Make things operational also in bare ROOT mode
Ability to transform data before writing
Support for changing the class type of nested object in a split branch
Support for access to onfile version of nested objects from within the parent rule
LinkDef rule syntax:
Setting a transient member:
#pragma read sourceClass="ACache" targetClass="ACache" source="" version="[1-]" target="zcalc" \
code="{ zcalc = false; }"
Setting a new member from 2 removed members
#pragma read sourceClass="ACache" targetClass="ACache" source="int x; int y; char c" version="[8]" target="z" \
code="{ z = onfile.x*1000 + onfile.y*10; }"
Renaming a class
#pragma read sourceClass="ACache" version="[8]" targetClass="Axis" \
source="int x; int y;" target="z" \
code="{ z = onfile.x*1000 + onfile.y*
#pragma read sourceClass="ACache" version="[9]" targetClass="Axis";
Selection XML syntax
<read sourceClass="ACache" targetClass="ACache" source="" version="[1-]" target="zcalc">
<![CDATA[
{ zcalc = false; }
]]></read>
Revision
24635 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Jul 3 11:58:26 2008 UTC (6 years, 6 months ago) by
pcanal
File length: 160024 byte(s)
Diff to
previous 24454
restore support for IsAutoDelete in a TBranchElement (IsAutoDelete is an explicit request by the user to have the object deleted/newed each time GetEntry is called)
Revision
24454 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Jun 21 03:13:04 2008 UTC (6 years, 7 months ago) by
pcanal
File length: 159635 byte(s)
Diff to
previous 24233
Disk and Memory Space Gain
In ROOT older than v5.20/00, the branches' last basket, also known as the write basket, was always saved in the same "key" as the TTree object and was always present in memory when reading or writing. When reading this write basket was always present in memory even if the branch was never accessed.
Starting in v5.20/00, TTree::Write closes out, compresses (when requested) and writes to disk in their own file record the write baskets of all the branches. (This is implemented via the new function TTree::FlushBaskets, TBranch::FlushBaskets, TBranch::FlushOneBaskets)
TTree::AutoSave supports a new option "FlushBaskets" which will call FlushBaskets before saving the TTree object.
Benefits
- Flushing the write baskets has several advantages:
- Reduce the file size of the TTree object (it not longer contains the last basket), improving read time of the TTree object
- Reduce memory footprint of the TTree object.
- In a TTree which "flushed" buffer, there is now usually only zero or one buffer in memory.
- Previously each branch always had at least one basket in memory and usually 2 (the write basket and one read basket).
- Now only the basket of the branches actually read are loaded in memory.
- allow for the basket to be compressed and stored separated, increasing the compression factor.
Note: Calling FlushBaskets too often (either directly of via AutoSave("FlushBaskets")) can lead to unnecessary fragmentation of the ROOT file, since it write the baskets to disk (and a new basket will be started at the next fill) whether or not the content was close to filling the basket or not.
The fast tree cloning (TTreeCloner) was enhanced to support copying in-memory TTrees (that have been save as a single key on file). This issue was preventing hadd to fast clone files containing any 'in-memory' tree.
Revision
24198 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jun 10 12:53:18 2008 UTC (6 years, 7 months ago) by
brun
File length: 160406 byte(s)
Diff to
previous 24034
From Anna:
a fix for TFFTRealComplex::GetPointComplex(Int_t *,...) function, for the case of transforms of more than 2 dimensions. The real index in the internal 1-d flat array is now computed correctly, taking into account that only ~half of entries are stored because of Hermitian symmetry. And thanks to Christophe Yeche for pointing it out.
Revision
24034 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue May 27 17:50:11 2008 UTC (6 years, 7 months ago) by
pcanal
File length: 160359 byte(s)
Diff to
previous 24016
Insure that kBranchAny or kBranchObject is set even if the file was
created by a version of ROOT older than 5-18-00c and the top level
branch is not split.
Revision
23230 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Apr 15 15:33:32 2008 UTC (6 years, 9 months ago) by
pcanal
File length: 159404 byte(s)
Diff to
previous 23224
Introduce a way to create branch using directly
an object:
MyClass object;
TBranch *branch = tree->Branch(branchname, &object, bufsize, splitlevel)
Revision
23224 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Apr 15 08:04:26 2008 UTC (6 years, 9 months ago) by
pcanal
File length: 159078 byte(s)
Diff to
previous 23219
From Paul:
Clarify the ownership rules of user objects in a TTree.
This clarification (and the improved auto-add-to-directory behavior
of the TH1*) allows for the TTree to now delete the memory that
its has allocated and whose ownsership was _not_ transfer back
to the user (this is happens any time the user give the TTree
the address of a pointer):
// For a top-level branch the meaning of addr is as follows:
//
// If addr is zero, then we allocate a branch object
// internally and the branch is the owner of the allocated
// object, not the caller. However the caller may obtain
// a pointer to the branch object with GetObject().
//
// Example:
//
// branch->SetAddress(0);
// Event* event = branch->GetObject();
// ... Do some work.
//
// If addr is not zero, but the pointer addr points at is
// zero, then we allocate a branch object and set the passed
// pointer to point at the allocated object. The caller
// owns the allocated object and is responsible for deleting
// it when it is no longer needed.
//
// Example:
//
// Event* event = 0;
// branch->SetAddress(&event);
// ... Do some work.
// delete event;
// event = 0;
//
// If addr is not zero and the pointer addr points at is
// also not zero, then the caller has allocated a branch
// object and is asking us to use it. The caller owns it
// and must delete it when it is no longer needed.
//
// Example:
//
// Event* event = new Event();
// branch->SetAddress(&event);
// ... Do some work.
// delete event;
// event = 0;
//
// These rules affect users of TTree::Branch(),
// TTree::SetBranchAddress(), and TChain::SetBranchAddress()
// as well because those routines call this one.
//
// An example of a tree with branches with objects allocated
// and owned by us:
//
// TFile* f1 = new TFile("myfile_original.root");
// TTree* t1 = (TTree*) f->Get("MyTree");
// TFile* f2 = new TFile("myfile_copy.root", "recreate");
// TTree* t2 = t1->Clone(0);
// for (Int_t i = 0; i < 10; ++i) {
// t1->GetEntry(i);
// t2->Fill();
// }
// t2->Write()
// delete f2;
// f2 = 0;
// delete f1;
// f1 = 0;
//
// An example of a branch with an object allocated by us,
// but owned by the caller:
//
// TFile* f = new TFile("myfile.root", "recreate");
// TTree* t = new TTree("t", "A test tree.")
// Event* event = 0;
// TBranchElement* br = t->Branch("event.", &event);
// for (Int_t i = 0; i < 10; ++i) {
// ... Fill event with meaningful data in some way.
// t->Fill();
// }
// t->Write();
// delete event;
// event = 0;
// delete f;
// f = 0;
//
// Notice that the only difference between this example
// and the following example is that the event pointer
// is zero when the branch is created.
//
// An example of a branch with an object allocated and
// owned by the caller:
//
// TFile* f = new TFile("myfile.root", "recreate");
// TTree* t = new TTree("t", "A test tree.")
// Event* event = new Event();
// TBranchElement* br = t->Branch("event.", &event);
// for (Int_t i = 0; i < 10; ++i) {
// ... Fill event with meaningful data in some way.
// t->Fill();
// }
// t->Write();
// delete event;
// event = 0;
// delete f;
// f = 0;
//
Revision
22359 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Feb 26 23:15:01 2008 UTC (6 years, 10 months ago) by
pcanal
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 157139 byte(s)
Diff to
previous 21861
In TBranchElement::Streamer when writing, call ForceWriteInfo
not only for the TStreamerInfo directly concerning this branch
but also (in the case of the top level branch of a split TClonesArray
or a split STL container) call ForceWriteInfo for the class of
the value.
This omission meant that slow CloneTree was (fataly) missing in
some cases the copy of the TStreamerInfo for class that are part
part of the TTree but had only a base and no member or in
some cases where it had only object data members.
Revision
21861 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Jan 26 09:47:41 2008 UTC (6 years, 11 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 155250 byte(s)
Diff to
previous 21659
From Lukasz Janyst:
* TBranch: add a possibility of starting from non-zero entry
* TBranchSTL and TIndArray: new classes for handling STL collections
of pointers
* TTree, TBranchElement, TTreeFormula: code handling new type of
branch added
Revision
21353 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Dec 13 07:11:49 2007 UTC (7 years, 1 month ago) by
pcanal
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 150230 byte(s)
Diff to
previous 21321
NOTICE:
This version introduces support for transitioning classes
from the mode where no class version is specified
(and the checksum is always used for lookup) and a mode
where the user specifies an explicit version number for
the class (Allow for simplier, clearer data model evolution).
The class version can be specified in 3 different ways:
a) Use rootcint and add a ClassDef macro in the class declaration:
class MyClass {
...
ClassDef(MyClass,10);
};
b) Use rootcint and add a RootClassVersion macro in the class source file:
RootClassVersion(MyClass,10);
c) Use genreflex and specify a ClassVersion property in the selection.xml :
<class name="MyClass" ClassVersion="10"/>
Those 3 solutions set the class version of MyClass's TClass object
to 10.
IMPORTANT:
In order to avoid a clash between this class version (and any future
class versions) and the class versions given by default to the
non-versioned layout of the class, you MUST set this class version to
a number that is greater than the number of distinct non-versioned layout.
Otherwise you may see warning messages like:
Warning in <TStreamerInfo::BuildCheck>:
The class MyClass transitioned from not having a specified class version
to having a specified class version (the current class version is 2).
However too many different non-versioned layouts of the class have been
loaded so far. This prevent the proper reading of objects written with
the class layout version 3, in particular from the file:
myclass3.root.
Addition Details:
When loading a file containing a non-versioned layout of a class, this
layout is assigned the next 'free' number in the list of StreamerInfo.
In particular this means that if many files with non-versioned layout
of the class are loaded before the loading of a library containing a
versioned class layout, the slot reserved for this version layout may
already be occupied and you will get the following error message:
The class MyClass transitioned from not having a specified class version
to having a specified class version (the current class version is 2).
However too many different non-versioned layouts of the class have
already been loaded so far. To work around this problem you can
load fewer 'old' file in the same ROOT session or load the C++ library
describing the class MyClass before opening the files or increase the version
number of the class for example ClassDef(MyClass,3).
Do not try to write objects with the current class definition,
the files might not be readable.
Also if many files with non-versioned layout of the class are read
before a file with a versioned layout (and this number is too low), you
may get the following error message:
Warning in <TStreamerInfo::BuildCheck>:
The class MyClass transitioned from not having a specified class version
to having a specified class version (the current class version is 2).
However too many different non-versioned layouts of the class have been
loaded so far. This prevent the proper reading of objects written with
the class layout version 3, in particular from the file:
myclass3.root.
Additional note:
For classes with no specified version (i.e. Foreign classes), the current
TStreamerInfo is stored at index -1 in the list of StreamerInfo and the
class version (gROOT->GetClass("MyClass")->GetClassVersion()) is set to -1.
Revision
18209 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Mar 8 23:29:01 2007 UTC (7 years, 10 months ago) by
pcanal
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 141785 byte(s)
Diff to
previous 17826
From Paul:
Modify TRefTable, TBranchRef, and TBranchElement so that the small
integer which is assigned to identify a TBranchElement by TRefTable
is cached so that we need to find it only once, instead of at every
call to TBranchElement::GetEntry() or TBranchElement::Fill().
Revision
17731 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Feb 6 15:30:25 2007 UTC (7 years, 11 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 141303 byte(s)
Diff to
previous 17711
In the Streamer functions replace the lines like
TPad::Class()->ReadBuffer(b, this, v, R__s, R__c);
TPad::Class()->WriteBuffer(b,this);
by
b.ReadClassBuffer(TPad::Class(), this, v, R__s, R__c);
b.WriteClassBuffer(TPad::Class(),this);
Revision
17522 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Jan 25 22:53:05 2007 UTC (7 years, 11 months ago) by
pcanal
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 140660 byte(s)
Diff to
previous 17306
When the master tree of a tree 'clone' relationship is deleted, we need
to reset the address of the branches of the clone ... however we need to
reset the address only for the cloned branches. In particular this means
that calling ResetBranchAddresses on the clone tree is over-zealous (it
reset branches that may have been added by the user after the cloning).
Also in the reseting of the branch depends (because of TNtuple and TNtupleD)
not only of the type of the branch object but also on the type of the TTree.
(See TNtuple::ResetBranchAddress(TBranch*) for the explanation why).
Revision
17306 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jan 12 16:03:17 2007 UTC (8 years ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 140634 byte(s)
Diff to
previous 17122
TMath::Abs, TMath::Min, TMath::Max, TMath::Sign, TMath::Range
These functions are unfortunately not defined in a standard way in std::
This include is referenced by a new version of TMath.h.
As a result, TMath.h is back compatible with the previous version.
TMathBase.h is used in place of TMath.h in all the classes
that will go into the future miniCore library.
TMath.h and the TMath implementation will go into a new math sub-directory.
TString.h uses TMathBase.h instead of TMath.h.
As a result, it was necessary to include "TMath.h" in some classes
assuming that TMath was included via TString and using other functions
than the ones defined in TMathBase.h
----------------------------------------------------------------------
Revision
16247 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Sep 13 07:14:20 2006 UTC (8 years, 4 months ago) by
pcanal
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 140540 byte(s)
Diff to
previous 16036
Fix a problem introduce in version 1.208 of this file.
The fBranchCount was sometimes not properly set, resulting
in crashes when trying to read the branch in MakeClass mode.
This patch fixes the original problem and add a work around
the issues for the file produced incorrectly.
Revision
15955 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Aug 8 20:56:25 2006 UTC (8 years, 5 months ago) by
pcanal
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 139739 byte(s)
Diff to
previous 15849
From Paul:
o Clean up the treatment of fReadEntry in a TBranch/TBranchElement.
It now consistently and predictably remembers the most recent
entry number passed to a GetEntry() call. (This is in particular
useful when dealing with TRef::Object being called from a streamer
and need the BranchRef facility ; This fixes a problem seen by DZero)
Revision
15849 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jul 26 13:36:44 2006 UTC (8 years, 6 months ago) by
rdm
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 139541 byte(s)
Diff to
previous 15837
Instead of providing default implementations for copy ctor's and assignment
operators we better make them private (and not implemented) to avoid people
from accidentally using them. Especially the collections classes and the
TQObject derived classes. In these classes the default implementations would
cause havoc due to multiple deletions of the same objects and other
potential memory corruptions.
Revision
15785 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Jul 13 05:19:52 2006 UTC (8 years, 6 months ago) by
pcanal
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 140970 byte(s)
Diff to
previous 15778
From Paul Russo:
o (Constructor) Initialize all data members.
o (Constructor), (InitializeOffsets), (SetAddress), (Unroll)
Extensive additions to internal documentation.
o (Constructor), (Unroll)
Reorganized to interact through function parameters only.
o (Destructor) Delete any object allocated by SetAddress(),
which fixes the emulated class memory leak.
o (Branch) Removed, unused junk code.
o (CheckBranchID) Removed, no longer used.
o (Fill)
Check to make sure the user did not change the object
pointer on us.
Change usage of fAddress to check for an allocated
object to use fObject instead.
Do not corrupt the i/o byte count after an
i/o error occurs.
o (FillLeaves) Check to see if the user changed the
object pointer.
o (FillLeaves) Changed STL top-level branch logic so that
the proxy helper which was used to get the size of the
container is destroyed before the i/o begins, this helps
reduce the number of stacked proxy helpers.
o (GetAddress) New member function. Override base class
function so that we may catch the case where the user
changed the object pointer without using SetAddress()
to notify us.
o (GetDataMemberOffset), (GetDataMemberOffsetEx)
Removed, implementation-only member functions which
are no longer used.
o (GetInfo) Made const and reorganized for clarity.
o (GetEntry) Check to see if the user changed the object
pointer. Do proper error checking for container master
branch i/o and terminal branch i/o, and do not corrupt
the byte count on error, and exit with the error code
on error.
o (GetValue) Check to see if the user changed the address.
o (InitializeOffsets) Rewritten using a much simpler and
easier to understand algorithm.
o (PrintValue) Check to see if the user changed the address.
o Correct usage of fInfo to GetInfo() to support schema
evolution in many places.
o (ReleaseObject) New implementation-only member function.
Used by ResetAddress() and SetAddress() to delete any
objects which were allocated by a call to SetAddress().
o (ResetAddress) Check if user changed the address on
us and to release memory allocated by SetAddress().
o (ResetDeleteObject) New member function. Gives cloned
trees a way of making themselves not the owner of the
allocated object.
o (SetAddress) Substantially rewritten, greatly extended
documentation.
o (SetAutoDelete) Removed, we can inherit it from TBranch.
o (SetBranchCount) Issues warning messages on error
conditions.
o (SetupAddresses) Check to see if the user changed the
object pointer.
o (Streamer) Make sure to reset the object ownership bit
on reading, right after a read we don't own anything.
o (Unroll) Reorganized, extensively documented.
o (ValidateAddress) New member function. Checks to see
if the user changed the object pointer without calling
SetAddress(), and if so, calls SetAddress() for him.
Revision
15134 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue May 23 04:47:42 2006 UTC (8 years, 8 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 110540 byte(s)
Diff to
previous 15047
From Federico Carminati:
"I have implemented all copy and equal operators needed to silence all
warnings in AliRoot, as requested. I have implemented shallow copies as
would do the default operators synthetized by the compiler.
Most operators are protected. If users complain, you just have to move
them into the public area, but class derivation is of course supported.
It has been a terrible job, I have modified 278 files, but the changes
are backward compabile, and this goes a long way to permitting user to
use the effc++ flag with root headers."
Revision
14745 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Apr 19 08:22:26 2006 UTC (8 years, 9 months ago) by
rdm
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 108689 byte(s)
Diff to
previous 14336
Change the TError.h macros:
Assert -> R__ASSERT
Check -> R__CHECK
Change the TCollection.h macro:
ForEach -> R__FOR_EACH
This to avoid potential problems due too trivial macro names.
The old macros will be removed in the next release. Currently
they will print out warning messages with the advice to move
to the new macro names.
Revision
14336 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Mar 20 21:43:44 2006 UTC (8 years, 10 months ago) by
pcanal
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 108860 byte(s)
Diff to
previous 14148
Reduce direct dependencies on TClass.h, TROOT.h and TStreamerInfo.h.
Warning: This means that some file that relied on the indirect
inclusion of these header file might now fail to compile with
an error message mention that gROOT is no known or that TClass,
TROOT or TStreamerInfo is incompletely defined. Simply add the
proper include directive.
Revision
14148 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Mar 2 07:45:47 2006 UTC (8 years, 10 months ago) by
pcanal
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 108881 byte(s)
Diff to
previous 14138
Resolve an issue in SetAddress (introduced in r1.186) where it was
applying a correction (kept in fParentOffset) even if the address
was being directly passed (for example by CopyAddress instead of
indrectly by a parent branch's SetAddress)
Revision
13357 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Nov 25 05:39:33 2005 UTC (9 years, 2 months ago) by
pcanal
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 106927 byte(s)
Diff to
previous 13332
Fix a problem in TBranch::SetAddress when we are dealing with a
TClonesArray containing an object containing an object inheriting
from a non-virtual base class and from TObject. Without this patch
the address of the basic type data members of the base class it not
calculated properly.
Revision
13008 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Oct 24 18:20:32 2005 UTC (9 years, 3 months ago) by
pcanal
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 105251 byte(s)
Diff to
previous 12970
Fix an issue in TBranchElement::SetAddress (and auxiliary methods)
when encountering a sub-object of a base class of an object contained
inside another object which is stored in a split branch.
(I.e. The base class is stored at least under level of branches
as opposed to being just under the main branch).
Revision
12715 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Sep 13 14:35:01 2005 UTC (9 years, 4 months ago) by
pcanal
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 104283 byte(s)
Diff to
previous 12548
From Jeroen Hegeman:
Last week I got really stuck looking at memory addresses and missing
fBits when I got some help from Paul Russo. We found out that the
core of the problem is pretty simple.
In TStreamerBuffer::WriteBufferAux there is a bit of code that writes
the fBits and if the object is referenced it also writes the pidf.
The problem is that no offset table is generated for this 'fBits' branch so
reading this branch will result in corruption. (You write variable-
size things and always read fixed-size things.)
The solution is to force (in TBranchElement's constructor) to support a
variable size in the case of fBits (case kBits).
Revision
11999 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jun 8 21:19:36 2005 UTC (9 years, 7 months ago) by
pcanal
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 103129 byte(s)
Diff to
previous 11848
From Markus and Philippe.
Improve the performance of TBranchElement::SetAddress by increasing the
caching of TClass pointers and offsets. Also leverage the use of TClassRef
to reduce the number of calls to gROOT->GetClass. Optimize a couple of
additional functions. The improvement is dramatic for the 2nd call to
SetAddress on the same branch object (90%)!
Revision
11464 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Mar 31 17:52:25 2005 UTC (9 years, 9 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 100196 byte(s)
Diff to
previous 11457
From Philippe:
TStreamerInfo::PrintValue
lookup the TStreamerElement only when needed
add printing of array of fBits (need in MakeClass mode)
TBranchElement::PrintValue
In MakeClass mode, print the char as unsigned char instead
of as strings.
Revision
11457 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Mar 30 21:09:19 2005 UTC (9 years, 9 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 99837 byte(s)
Diff to
previous 11376
From Philippe:
TBranch::fOffset stores permanently the offset of the data member in the
object.
When the branch is reloaded without the library, this offset might be
incorrect.
We introduce SetupAddresses (called by GetEntry and TTreeFormula) which
insures
the offset are correctly set.
In case of a fixed size char array nested inside a collection, the indexing
was inconsistent (It is drawn as a string but one of the inner mechanism was
still using the fixed size to calculate the index)
In case of string (like char* or char array) was within a collection,
the TFormLeafInfo 'chain' was incorrectly set (it was not using the
fact the branch has the address of the collection instead of the
addresses of the container of the collection).
Revision
10958 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jan 19 18:30:58 2005 UTC (10 years ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 100891 byte(s)
Diff to
previous 10917
From Philippe:
This patch implement support for bool of various in memory size. They are
always written using only 1 bytes. This solves problem on MacOS where
sizeof(bool)==4 instead of 1.
Note that there should still be a problem with the old-style splitted branch
(tested in Event.old.split.root.
A fix for this will come later on.
Revision
10917 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Jan 13 20:07:46 2005 UTC (10 years ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 100458 byte(s)
Diff to
previous 10898
From Philippe:
TBranchElement: Insure that fSTLtype is always positive (was preventing the
reading of sets and maps in some case of split mode).
TTree, TTreePlayer: fix to TTree::Draw documentation
TTreeFormula: insures that TTree::Draw properly reads strings within a
collection
Revision
10898 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jan 12 07:50:03 2005 UTC (10 years ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 100446 byte(s)
Diff to
previous 10861
From Philippe:
A) Support for top level STL Containers. You can now do
list<int> *ptr = new list<int>;
tree->Branch("mystl","list<int>",&ptr);
B) Autodetection of the pointer type passed to the branch constructor.
So you can now do:
list<int> *ptr = new list<int>;
tree->Branch("mystl",&ptr);
C) Check of the type of the pointer type passed to the branch constructor.
So that you now get an error:
list<int> *ptr = new list<int>;
tree->Branch("mystl","list<float>",&ptr);
Error in <TTree::Branch>: The class requested (list<float>) for the branch
"mystl" is different from the type of the pointer passed (list<int>)
D) TTree's SetBranchAddress now also check its input address (unless the
user explicitly specify (char*) or (void*).
Test/Event and the tree tutorials have been updated to take advantage of the
new syntax.
Revision
10555 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Nov 18 06:13:14 2004 UTC (10 years, 2 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 99492 byte(s)
Diff to
previous 10549
From Philippe:
The crash for iobug.C(1,0) was fixed in a previous patch.
The bad results in iobug.C(1,1) and iobug.C(2,1) were a result of badly
formed files (i.e. the file produce do not contain the correct data!).
This patch resolves the solution by insuring that all the level of base
classes have their own TBranchElement object except when inside a split
collection.
When the base class or any of its own base class has no data member, there
is no branch created (this was already the case).
The TBranchElement corresponding to the base class itself does NOT have a
TLeafElement (but has at least one sub-TBranchElement). Its fObject points
to the start of the sub-part of the object which correspond to its base
class.
In addition, this patch corrects TBranch::GetSubBranch to give the correct
result even if the hiearchy of branch is more than 2 deep.
This patch also correct GetValueClones and GetValueSTL to add the base class
offset only once.
Revision
10549 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Nov 17 17:56:53 2004 UTC (10 years, 2 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 98458 byte(s)
Diff to
previous 10545
From Philippe,
This patch implements the schema evolution to and from selected containers.
The following cases are currently implemented:
TClonesArray object -> STL object containing the same type
TClonesArray pointer -> STL pointer containing the same type
STL object -> STL object containing the same type
STL pointer -> STL pointer containing the same type
STL split branches -> TClonesArray
In addition this patch implement the ability to have schema evolution
between various version of a foreign class when the library is not present.
This patch also support in in TTree::Draw for the schema evolution of simple
type stored in a non-split branch.
Revision
10541 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Nov 17 06:02:52 2004 UTC (10 years, 2 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 98458 byte(s)
Diff to
previous 10488
From Philippe:
This patch implements the schema evolution to and from selected containers.
The following cases are currently implemented:
TClonesArray object -> STL object containing the same type
TClonesArray pointer -> STL pointer containing the same type
STL object -> STL object containing the same type
STL pointer -> STL pointer containing the same type
STL split branches -> TClonesArray
In addition this patch implement the ability to have schema evolution
between various version of a foreign class when the library is not present.
This patch also support in in TTree::Draw for the schema evolution of simple
type stored in a non-split branch.
Revision
10456 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Nov 2 21:51:10 2004 UTC (10 years, 2 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 90813 byte(s)
Diff to
previous 10452
From Markus Frank:
I have produced an updated version of the Proxies, rootcint and
Tbranchelement:
- Avoid compilation errors on VC++6 (AIX still has to be seen),
but probably the problems there are similar.
- Fix the errors reported by Philippe:
> TFile *_file0 = TFile::Open("mksm.root");
> mk->Draw("iem.mt","","",2,22);
> cd roottest/root/io/newstl
> root.exe -b -l 4-01-03/vector.root
> root [] stltree->GetEntry(0);
> root [] stltree->GetEntry(1);
> Or
> cd roottest/root/treeformula/parse
> root.exe -b -l runBoolOrder.C
There is a bit a nasty side effect:
sets and maps maybe split, but all members are
read at once. This however should not affect
the persistent schema and can be subject of
further investigations.
I compiled the stuff on VC6, VC7 and gcc323.
- bench executed on all three
- roottest/root/io/newstl executed on WIN32/VC7.
Note: bench and newstl are supposed to __FAIL__
on VC6 due to the lousy map implementation with
static storage.
Revision
10452 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Nov 2 16:24:42 2004 UTC (10 years, 2 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 88037 byte(s)
Diff to
previous 10431
Several fixes in TBranchElement.
-in GetEntry remove the special code for STL Allocating the buffers
-move part of this code in ReadLeaves
-in the constructor, do not split STL collections that are
associative containers (this will be implemented later)
Revision
10431 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Oct 29 18:03:11 2004 UTC (10 years, 2 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 88808 byte(s)
Diff to
previous 10333
from Markus Frank (main work) + Philippe & Rene
Add support for all STL collections, including collections
of collections.
TTree has been extended to support split mode for most STL
collections.
The test program bench.cxx/TBench.cxx has been extended to test
STL collections of objects or pointers.
Revision
10331 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Oct 17 11:55:47 2004 UTC (10 years, 3 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 87343 byte(s)
Diff to
previous 10267
From Axel Naumann:
I've written a small patch + one extra class that allows the TBrowser to
browse simple member methods (called "browsable" methods: public, not
pure virtual, const, no args without default value, return type not
void, and none of those Impl/DeclFile/IsA/... methods). Here's what I did:
When TBranchElement::Browse is called,
TBranchElement::GetBrowsableMethods creates a list of browsable methods,
containing an object of type TMethodBrowsable for each browsable TMethod
of the current BranchElement's object (or its clone) and all of its base
classes. This list is needed for deleting these objects when the
TBranchElement ceases to be. All these objects are added to the TBrowser
in TBranchElement::Browse. TMethodBrowsable implements Browse, and calls
TBranchElement::GetTree()->Draw(branchname.methodname).
If a method returns a class object (or a pointer to one) which is known
to ROOT, fReturnClass is set. If that method is browsed, it expands to a
folder, giving access to the returned class's methods.
I added icon for methods - a leaf with a red exclamation mark (as in
"execute!") for methods not returning a class, and a folder with an
exclamation mark for methods returning a class. You are more than
welcome to change them, obviously! :-]
I've put the class TMethodBrowsable into its own source/header file
(instead of adding them to TBranchElement), as it's really only needed
by TBranchElement.cxx, and I wanted to minimize how often the code needs
to be parsed. These two new files are in tree/; dunno whether that's a
good place.
I've tested it on the D0 tmb_trees; works well for them.
Revision
9831 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Aug 24 10:41:58 2004 UTC (10 years, 5 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 85566 byte(s)
Diff to
previous 9803
Improve the functionality of the TRefTable.
The new algorithm
-does not require a pointer to the TRefTable in TFile.
-can automatically load the branch of a Tree when calling TRef::GetObject
-works when writing/reading multiple Trees in parallel
Revision
9803 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Aug 20 21:02:10 2004 UTC (10 years, 5 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 85408 byte(s)
Diff to
previous 9802
From Philippe:
This patch is an important step toward the implementation of the member-wise
saving of stl containers.
Mainly, the code does not require anymore the collection proxy to be able
to provide a C-style array of pointer to its content. This avoid the
problems of having to iterate twice through some collection and/or to have to
keep in memory a version of this array. Concretely this also mean that the
I/O routine will now be able to recurse through stl containers.
Technically, this is done by templating TStreamerInfo::ReadBuffer and
TStreamerInfo::WriteBufferAux (as well as the ReadBufferSkip And
ReadBufferConv) so that you can use it directly with a char** or
with a TVirtualCollection (to which we added an operator [] and
removed the method GetPtrArray).
In addition, we added 2 new method to TVirtualCollectionProxy:
PushProxy and PopProxy that will allow to keep some state on
where we are in the iteration for a collection when we recurse.
(This is required for a reasonable implementation of the
TVirtualCollection for std::list).
Also (in an unrelated fix) we update TTreePlayer::Scan to
properly display the columns when they are more expressions
in the request than leaves in the tree.
Revision
9802 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Aug 20 14:59:50 2004 UTC (10 years, 5 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 85330 byte(s)
Diff to
previous 9615
Add a new data member
TBranchRef *fBranchRef
and the corresponding function:
TBranch *TTree::BranchRef()
// Build the optional branch supporting the TRefTable
// This branch will keep all the information to find the branches
// containing referenced objects
//
// at each Tree::Fill, the branch numbers containing the
// referenced objects are saved to the TBranchRef basket
// When the Tree header is saved (via TTree::Write), the branch
// is saved keeping the information with the pointers to the branches
// having referenced objects.
TTree::Fill is modified to:
-call fBranchRef->Clear before filling the branches
-call fBranchRef->Fill once all the branches have been filled.
TTree::Print is modified to also call
fBranchRef->Print
TBranchElement::Fill is modified to call fBranchRef->SetParent
when the parent Tree has a TBranchRef.
eVS: ----------------------------------------------------------------------
Revision
9615 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Jul 29 10:54:55 2004 UTC (10 years, 5 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 85085 byte(s)
Diff to
previous 9283
*****************WARNING*****************
With this mega patch, we introduce support for TTree/TChain with more than
2 billion entries. Several class data members have been changed from
Int_t (or Stat_t) to Long64_t.
==>Trees written with this new version cannot be read with older versions
******************************************
TBranch:
========
- replace the members with type Int_t or Stat_t by Long64_t
Long64_t fEntryNumber; // Current entry number (last one filled in this branch)
Long64_t fReadEntry; //! Current entry number when reading
Long64_t fEntries; // Number of entries
Long64_t fTotBytes; // Total number of bytes in all leaves before compression
Long64_t fZipBytes; // Total number of bytes in all leaves after compression
Long64_t *fBasketEntry; //[fMaxBaskets] Table of first entry in eack basket
- corresponding changes in the member functions
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall = 0);
virtual Int_t GetEntryExport(Long64_t entry, Int_t getall, TClonesArray *list, Int_t n);
Int_t GetEvent(Long64_t entry=0) {return GetEntry(entry);}
Long64_t *GetBasketEntry() const {return fBasketEntry;}
Long64_t GetReadEntry() const {return fReadEntry;}
Long64_t GetTotalSize() const;
Long64_t GetTotBytes() const {return fTotBytes;}
Long64_t GetZipBytes() const {return fZipBytes;}
Long64_t GetEntryNumber() const {return fEntryNumber;}
Long64_t GetEntries() const {return fEntries;}
TBranch::Streamer has been modified to read old files and automatically translate
the old types to the new types.
The new version of Streamer uses the TClass::ReadBuffer/WriteBuffer.
TBranch::Print has been modified to take into account the new data types.
ClassDef version increased to 10.
TBranchClones:
==============
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall = 0);
TBranchElement:
===============
Int_t GetEntry(Long64_t entry=0, Int_t getall = 0);
TBranchObject:
==============
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall = 0);
TChain:
=======
Long64_t *fTreeOffset; //[fTreeOffsetLen]Array of variables
virtual Int_t Add(const char *name, Long64_t nentries=kBigNumber);
virtual Int_t AddFile(const char *name, Long64_t nentries=kBigNumber);
virtual Long64_t Draw(const char *varexp, const TCut &selection, Option_t *option=""
,Long64_t nentries=kBigNumber, Long64_t firstentry=0);
virtual Long64_t Draw(const char *varexp, const char *selection, Option_t *option=""
,Long64_t nentries=kBigNumber, Long64_t firstentry=0); // *MENU*
virtual Long64_t GetChainEntryNumber(Long64_t entry) const;
virtual Long64_t GetEntries() const;
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0);
Long64_t LoadTree(Long64_t entry);
virtual void Loop(Option_t *option="",Long64_t nentries=kBigNumber, Long64_t firstentry=0); // *MENU*
virtual Long64_t Merge(const char *name);
virtual Long64_t Merge(TCollection *list);
virtual Long64_t Merge(TFile *file, Int_t basketsize, Option_t *option="");
virtual Long64_t Process(const char *filename,Option_t *option="", Long64_t nentries=kBigNumber, Long64_t firstentry=0); // *MENU*
virtual Long64_t Process(TSelector *selector,Option_t *option="", Long64_t nentries=kBigNumber, Long64_t firstentry=0);
ClassDef version changed from 4 to 5
TSelector
=========
virtual Bool_t ProcessCut(Long64_t /*entry*/) { return kTRUE; }
virtual void ProcessFill(Long64_t /*entry*/) { }
virtual Bool_t Process(Long64_t /*entry*/) { return kFALSE; }
TSelectorCint
=============
virtual Bool_t ProcessCut(Long64_t entry);
virtual void ProcessFill(Long64_t entry);
virtual Bool_t Process(Long64_t entry);
TSelectorDraw
=============
Long64_t fDraw; //! Last entry loop number when object was drawn
Long64_t fSelectedRows; // Number of selected entries
Long64_t fOldEstimate; // value of Tree fEstimate when selector is called
Double_t *fV1; //![fSelectedRows]Local buffer for variable 1
Double_t *fV2; //![fSelectedRows]Local buffer for variable 2
Double_t *fV3; //![fSelectedRows]Local buffer for variable 3
Double_t *fV4; //![fSelectedRows]Local buffer for variable 4
Double_t *fW; //![fSelectedRows]Local buffer for weights
virtual Long64_t GetSelectedRows() const {return fSelectedRows;}
virtual Bool_t Process(Long64_t /*entry*/) { return kFALSE; }
virtual void ProcessFill(Long64_t entry);
virtual void ProcessFillMultiple(Long64_t entry);
virtual void ProcessFillObject(Long64_t entry);
virtual void SetEstimate(Long64_t n);
TTree
=====
Modified data types
Long64_t fEntries; // Number of entries
Long64_t fTotBytes; // Total number of bytes in all branches before compression
Long64_t fZipBytes; // Total number of bytes in all branches after compression
Long64_t fSavedBytes; // Number of autosaved bytes
Long64_t fMaxEntryLoop; // Maximum number of entries to process
Long64_t fMaxVirtualSize; // Maximum total size of buffers kept in memory
Long64_t fAutoSave; // Autosave tree when fAutoSave bytes produced
Long64_t fEstimate; // Number of entries to estimate histogram limits
Long64_t fChainOffset; //! Offset of 1st entry of this Tree in a TChain
Long64_t fReadEntry; //! Number of the entry being processed
Long64_t fTotalBuffers; //! Total number of bytes in branch buffers
Long64_t fDebugMin; //! First entry number to debug
Long64_t fDebugMax; //! Last entry number to debug
New function signatures
virtual Long64_t AutoSave(Option_t *option="");
virtual TTree *CloneTree(Long64_t nentries=-1, Option_t *option="");
virtual Long64_t CopyEntries(TTree *tree, Long64_t nentries=-1);
virtual TTree *CopyTree(const char *selection, Option_t *option=""
,Long64_t nentries=1000000000, Long64_t firstentry=0);
virtual Long64_t Draw(const char *varexp, const TCut &selection, Option_t *option=""
,Long64_t nentries=1000000000, Long64_t firstentry=0);
virtual Long64_t Draw(const char *varexp, const char *selection, Option_t *option=""
,Long64_t nentries=1000000000, Long64_t firstentry=0); // *MENU*
virtual Long64_t Fit(const char *funcname ,const char *varexp, const char *selection="",Option_t *option="" ,Option_t *goption=""
,Long64_t nentries=1000000000, Long64_t firstentry=0); // *MENU*
virtual Long64_t GetChainEntryNumber(Long64_t entry) const {return entry;}
virtual Long64_t GetChainOffset() const { return fChainOffset; }
Long64_t GetDebugMax() const {return fDebugMax;}
Long64_t GetDebugMin() const {return fDebugMin;}
virtual Long64_t GetEntries() const {return fEntries;}
virtual Long64_t GetEntriesFast() const {return fEntries;}
virtual Long64_t GetEntriesFriend() const;
virtual Long64_t GetEstimate() const { return fEstimate; }
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0);
Int_t GetEvent(Long64_t entry=0, Int_t getall=0) {return GetEntry(entry,getall);}
virtual Long64_t GetEntryNumberWithBestIndex(Int_t major, Int_t minor=0) const;
virtual Long64_t GetEntryNumberWithIndex(Int_t major, Int_t minor=0) const;
virtual Long64_t GetEntryNumber(Long64_t entry) const;
virtual Long64_t GetMaxEntryLoop() const {return fMaxEntryLoop;}
static Long64_t GetMaxTreeSize();
virtual Long64_t GetMaxVirtualSize() const {return fMaxVirtualSize;}
virtual Long64_t GetReadEntry() const {return fReadEntry;}
virtual Long64_t GetReadEvent() const {return fReadEntry;}
virtual Long64_t GetSelectedRows() {return GetPlayer()->GetSelectedRows();}
virtual Long64_t GetTotBytes() const {return fTotBytes;}
virtual Long64_t GetZipBytes() const {return fZipBytes;}
virtual Long64_t LoadTree(Long64_t entry);
virtual Long64_t LoadTreeFriend(Long64_t entry, TTree *T);
virtual Long64_t Merge(TCollection *list);
TPrincipal *Principal(const char *varexp="", const char *selection="", Option_t *option="np"
,Long64_t nentries=1000000000, Long64_t firstentry=0);
virtual Long64_t Process(const char *filename,Option_t *option="", Long64_t nentries=1000000000, Long64_t firstentry=0); // *MENU*
virtual Long64_t Process(TSelector *selector, Option_t *option="", Long64_t nentries=1000000000, Long64_t firstentry=0);
virtual Long64_t Project(const char *hname, const char *varexp, const char *selection="", Option_t *option=""
,Long64_t nentries=1000000000, Long64_t firstentry=0);
virtual TSQLResult *Query(const char *varexp="", const char *selection="", Option_t *option=""
,Long64_t nentries=1000000000, Long64_t firstentry=0);
virtual Long64_t Scan(const char *varexp="", const char *selection="", Option_t *option=""
,Long64_t nentries=1000000000, Long64_t firstentry=0); // *MENU*
virtual void SetDebug(Int_t level=1, Long64_t min=0, Long64_t max=9999999); // *MENU*
virtual void SetEntries(Long64_t n);
virtual void SetEstimate(Long64_t nentries=10000);
virtual void SetMaxEntryLoop(Long64_t maxev=1000000000) {fMaxEntryLoop = maxev;} // *MENU*
static void SetMaxTreeSize(Long64_t maxsize=1900000000);
virtual void SetMaxVirtualSize(Long64_t size=0) {fMaxVirtualSize = size;} // *MENU*
virtual void Show(Long64_t entry=-1, Int_t lenmax=20);
virtual Long64_t UnbinnedFit(const char *funcname ,const char *varexp, const char *selection="",Option_t *option=""
,Long64_t nentries=1000000000, Long64_t firstentry=0);
TTree::Streamer has been modified to real old files.
TTree::Print has been modified to take into account the new data types.
ClassDef version number incremented to 13.
TVirtualTreePlayer
==================
virtual TTree *CopyTree(const char *selection, Option_t *option=""
,Long64_t nentries=1000000000, Long64_t firstentry=0) = 0;
virtual Long64_t DrawScript(const char* wrapperPrefix,
const char *macrofilename, const char *cutfilename,
Option_t *option, Long64_t nentries, Long64_t firstentry) = 0;
virtual Long64_t DrawSelect(const char *varexp, const char *selection, Option_t *option
,Long64_t nentries, Long64_t firstentry) = 0;
virtual Long64_t Fit(const char *formula ,const char *varexp, const char *selection,Option_t *option ,Option_t *goption
,Long64_t nentries, Long64_t firstentry) = 0;
virtual Long64_t GetSelectedRows() const = 0;
virtual TPrincipal *Principal(const char *varexp="", const char *selection="", Option_t *option="np"
,Long64_t nentries=1000000000, Long64_t firstentry=0) = 0;
virtual Long64_t Process(const char *filename,Option_t *option="", Long64_t nentries=1000000000, Long64_t firstentry=0) = 0;
virtual Long64_t Process(TSelector *selector,Option_t *option="", Long64_t nentries=1000000000, Long64_t firstentry=0) = 0;
virtual Long64_t Scan(const char *varexp, const char *selection, Option_t *option
,Long64_t nentries, Long64_t firstentry) = 0;
virtual TSQLResult *Query(const char *varexp, const char *selection, Option_t *option
,Long64_t nentries, Long64_t firstentry) = 0;
virtual void SetEstimate(Long64_t n) = 0;
virtual Long64_t UnbinnedFit(const char *formula ,const char *varexp, const char *selection,Option_t *option
,Long64_t nentries, Long64_t firstentry) = 0;
TTreeFormula
============
TLeaf* GetLeafWithDatamember(const char* topchoice, const char* nextchice, Long64_t readentry) const;
Bool_t BranchHasMethod(TLeaf* leaf, TBranch* branch,
const char* method,const char* params,
Long64_t readentry) const;
TTreePlayer
===========
Long64_t fSelectedRows; // Number of selected entries
virtual TTree *CopyTree(const char *selection, Option_t *option
,Long64_t nentries, Long64_t firstentry);
virtual Long64_t DrawScript(const char* wrapperPrefix,
const char *macrofilename, const char *cutfilename,
Option_t *option, Long64_t nentries, Long64_t firstentry);
virtual Long64_t DrawSelect(const char *varexp, const char *selection, Option_t *option
,Long64_t nentries, Long64_t firstentry);
virtual Long64_t Fit(const char *formula ,const char *varexp, const char *selection,Option_t *option ,
Option_t *goption ,Long64_t nentries, Long64_t firstentry);
virtual Long64_t GetSelectedRows() const {return fSelectedRows;}
TPrincipal *Principal(const char *varexp, const char *selection, Option_t *option
,Long64_t nentries, Long64_t firstentry);
virtual Long64_t Process(const char *filename,Option_t *option, Long64_t nentries, Long64_t firstentry);
virtual Long64_t Process(TSelector *selector,Option_t *option, Long64_t nentries, Long64_t firstentry);
virtual Long64_t Scan(const char *varexp, const char *selection, Option_t *option
,Long64_t nentries, Long64_t firstentry);
virtual TSQLResult *Query(const char *varexp, const char *selection, Option_t *option
,Long64_t nentries, Long64_t firstentry);
virtual void SetEstimate(Long64_t n);
virtual Long64_t UnbinnedFit(const char *formula ,const char *varexp, const char *selection,Option_t *option
,Long64_t nentries, Long64_t firstentry);
The generated code by TTreePlayer::MakeCode, MakeClass, MakeProxy
uses Long64_t instead of Int_t
TTreeViewer
===========
Long64_t Process(const char* filename, Option_t *option="", Long64_t nentries=1000000000, Long64_t firstentry=0); // *MENU*
void SetCurrentRecord(Long64_t entry);
THbookBranch
============
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0);
virtual void SetEntries(Long64_t n) {fEntries=n;}
THbookTree
==========
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0);
virtual void InitBranches(Long64_t entry);
virtual void SetEntries(Long64_t n);
TProofDraw
==========
virtual Bool_t Process(Long64_t /*entry*/);
TProofPlayer
============
virtual Long64_t Process(TDSet *set,
virtual Long64_t DrawSelect(TDSet *set, const char *varexp,
Long64_t Process(TDSet *set, const char *selector,
Long64_t DrawSelect(TDSet *set, const char *varexp,
Revision
9147 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jun 9 06:10:21 2004 UTC (10 years, 7 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 85150 byte(s)
Diff to
previous 8429
From Philippe:
This patches implements splitting of TClonesArray and vectors which are embedded in a base class (as opposed to pointed to).
Also more of the 'CanSplit' decision making has been move into TClass (where it belongs).
In TTree::Merge and MergeLists, add more cleanup of the addresses
being set to reduce the side-effects.
Revision
8343 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Mar 9 08:16:27 2004 UTC (10 years, 10 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 83729 byte(s)
Diff to
previous 8222
From Philippe:
In the previous implementation in the case where the user set the pointer
(used by SetBranchAddress) pointing to a TClonesArray to zero after
constructing the branch that is split, NOTHING was saved in the main branch
(where the size of the collection is supposed to go).
In this new version, we insert the value zero that when reading back,
it is considered as an empty collection.
In addition we updated the read mechanism so that it detects case where
the value read for the index is greater than the maximum.
When this is the case, we check whether we are in the case where
nothing has been saved in which case we set the length to 0 (instead of
the random value used in the previous implementation) and rewind the
buffer appropriately.
If we are not in this known case, we issue an error message and set the
length to 0 and we do NOT rewind the buffer.
Revision
8222 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Feb 18 07:28:02 2004 UTC (10 years, 11 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 81235 byte(s)
Diff to
previous 8180
From Philippe:
This patch implements TTree::Draw for vector. The current convention is the same
as for TClonesArray, namely after dereferencing a collection, the right hand of
the expression is request for the content and not for the container.
TBranchElement.cxx
Make sure that a non-split branch containing an stl container contain
one leaf.
TVirtualCollectionProxy, TEmulatedVectorProxy, TVectorProxy
Add the ability to retrieve the data type when it is a numerical type
TVectorProxy
Fix some problem in the addressing caching mechanism
TClass.h
Correct the ROOT::GetClass templates to properly return the TClass
object in case when the parameter is a pointer to pointer (or more).
TClassEdit.cxx:
Avoid thinking that vector<xxx>::iterator is an stl container!
TTreeFormula.cxx
Add support for stl container (actually ANY container which a
know TVirtualCollectionProxy). Added TFormLeafInfoCollection and
TFormLeafInfoNumerical (non struct, non class container content).
Revision
7880 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Jan 10 10:52:31 2004 UTC (11 years ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 80708 byte(s)
Diff to
previous 7810
From Philippe:
This mega patch introduces a new implementation of the STL I/O
which is backward and forward compatible. In addition this is more
exactly a new implementation or an extension of the container I/O.
We are introducing a new abstract interface:
"TVirtualContainerProxy", which can be implemented to present a
proxy to any collection which the I/O (and TTreeFormula) can use
then transparently.
The TVirtualContainerProxy interface allows to the I/O system to
request some information and to execute some essential function of
the container:
what kind of object/data does it contain
does it contain pointers
how to insert data into the container
how to retrieve an array of pointer to the elements inside
how to create a collection object
how to clear the collection
how to resize the collection
how to streamer the collection (if needed)
how to calculate the sizeof the collection
how to calculate the number of elements of the collection.
Using those primitives, the I/O and TTreeFormula should be able to
access any collection. The I/O should also be able to handle the
splitting of collections that can be split (i.e. contains a single
type of object/data).
The current compromise selected between code duplication,
performance of the I/O of TClonesArray and vector of pointers and
the performance of the I/O of other containers, was to have on
function handle all collection as if they were a C-style array of
pointers to data. This implies for example that the I/O of vector
of object current passes via the construction of temporary array
of pointer. The cost of this construction is usually ~Qjust~R the
cost of calculating the addresses of the elements and assigning it
to an array element.
Registering a collection proxy will be similar to
static int dummy = GenerateInitInstance((CollectType*)0x0)-
>AdoptCollectionProxy(new CollectTypeProxy));
Follows a few details on the modifications made to some of the
files and classes.
Bytes.h:
Work around a problem in the MSVC++ 6.0 optimizer. This should
not affect other compilers.
String:
Included the std::string dictionary into G__Base2.cxx, this
insures its presence at all time.
Added a new file string.cxx holding the streamer for
std::string.
RConfig.h
Added proper ansi stream configuration for AIX, KCC
Added template specialization defect for MSVC
TBrowser
Start adding the ability to browser non TObject classes
TBuffer
To handle the reading and writing array of objects, added:
Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const
TClass *clss, const char* classname);
Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const
char *classname);
void ReadFastArray(void *start , TClass *cl, Int_t n=1,
TMemberStreamer *s=0);
void ReadFastArray(void **startp, TClass *cl, Int_t n=1,
Bool_t isPreAlloc=kFALSE, TMemberStreamer *s=0);
void WriteFastArray(void *start, TClass *cl, Int_t n=1,
TMemberStreamer *s=0);
Int_t WriteFastArray(void **startp, TClass *cl, Int_t n=1,
Bool_t isPreAlloc=kFALSE, TMemberStreamer *s=0);
TROOT
Enhancement to make the access to gROOT not dependent for the
library loading order. In particular we added:
ROOT::GetROOT()
which should be used instead of gROOT.
Improve support for STL. In particular, now STL containers do
have a corresponding TClass object
TRealData
Replace SetStreamer by AdoptStreamer that allow to use not only
a streamer function but also streamer object (allowing streamer
with a state for Foreign classes)
TString:
Improve streamer performance
TSystem:
More consistency of the return value of TSystem::CompileMacro
build/unix/makecintdlls.sh
Stop making the string.dll
config:
enhance sgicc makefiles
cont:
fix TBits::operator=
TClassTable now warns for duplicate only for non stl classes
TClonesArray fix a typo
gpad:
Add a new class TInspectObject to enable inspect non TObject
classes
TRootBrowser : enable inspect non TObject classes
TFormula/TTreeFormula
To enhance performance switch from using one array fOper which
contained the operation code and its arguments to using 2 arrays
fActions and fActionParams to store respectively the operation and
its parameters.
A new function Convert is used to convert old version from the
fOper to fActions. This allows cleaner coding and offer
optimization opportunities.
TTreePlayer
Start adding support in MakeClass for STL containers.
TRint/TProofServ
Insure the loading of the string support
Event.cxx
make sure to avoid memory over-write
stress.cxx
Add new parameters
stress <nevent> <style> <subbench> <portion>
if <subbench> is 1 or higher, print the benchmark results after
each test. This allows understand
which test is affect by a performance change.
portion is a binary field to indicate which test to run. This
allows to focus on a particular test.
TVirtualCollectionProxy
Abstract interface used to access any type of containers from
the I/O system and TTreeFormula. See TVectorProxy and
TEmulatedVectorProxy for examples.
TEmulatedVectorProxy
Implementation of a std::vector proxy to be able to read a
std::vector without any libraries.
TVectorProxy
Implementation of TVirtualCollectionProxy for a std::vector for
which we have the library.
TStreamerInfo.cxx
Split in 3 files: TStreamerInfo.cxx
TStreamerInfoReadBuffer.cxx TStreamerInfoWriteBuffer.cxx
All the ReadBuffer, ReadBufferClones and the new ReadBufferSTL
(similarly for WriteBuffer) have been factorized into one
function and 2 short wrappers. The new main function expect an
array of pointer to the objects (this array is most often of size
one).
TClonesArray objects pass GetObjectRef(0) to the common
ReadBuffer
vector<bla*> v pass &(v[0])
vector<bla> needs to create an intermediary array to hold the
address
This mechanism is sometimes not optimal (vector<blah>) but
allows extremely flexibly and extension. Basically, to add
support for a new container type using the StreamerInfo mechanism
(in particular allows splitting), one 'just' need to implement a
TVirtualCollectionProxy, which, in particular, will return an
array of address to the object it contains. Even std::map can be
handled with this mechanism, since, for I/O purposes, it can be
consider as a container of pairs.
Add a few optimization, including more caching via a new array
of a new struct (fComp).
Fixed a problem (re)introduced while implementing the Foreign
class CheckSum. Doing:
class Event;
f = new TFile("Event.root");
resulted in errors.
TCint
Add proper support for TClass of STL containers. Fix a memory
leak.
Add support for load TClass via a typedef.
Fix a problem with multiple inheritance
TClass
Fixed a problem (re)introduced while implementing the Foreign
class CheckSum. Doing:
class Event;
f = new TFile("Event.root");
resulted in errors.
Add a
TClass/TGenericClassInfo/TDataMember
Add support for a new interface (TVirtualCollectionProxy)
useable for STL containers or any user defined containers.
Add support for streamer with are objects (as opposed to free
standing function or methods). This allows the user a greater
flexibility in writing a streamer.
Add a few optimizations
Add CanSplit to answer the question for a whole Class (for
example some collection can not be splitted).
TClassStreamer
New class to wrap a class wide streamer
ClassStreamerFunc_t
typedef for a class wide streamer function
TMemberStreamer
New class to wrap a specific class member streamer
MemberStreamerFunc_t
typedef for a specific class member streamer function
RootStreamer
Macro to specify a free standing streamer object or function
for a class
For example:
RootStreamer(string,std_string_streamer);
TStreamerElement:
A couple of optimization/simplification.
Add support for the new STL I/O
Extend the useful
TBranchElement:
add a connection to the proper TVirtualCollectionProxy
add support for STL containers (non-split and split mode)
TTree
Make the function TTree::GetMakeClass NON-virtual for better
efficiency
Add support for STL containers
TBasket
Left (in comment) a yet unproved improvement proposed by
Victor. The preliminary tests were inconclusive performance wise
and it had (seemingly) problem with backward and forward
compatibility.
TBranch
Performance improvements
metautils
This is a new package for C++ files shared between rootcint and
meta.
It contains TClassEdit a class to help determine some property
of a class given its class name (stl, template, etc).
utils
Introduced a new file RStl.cxx to start separating rootcint in
modules.
Modified rootcint to support the new STL I/O methods.
In particular a new class RStl is in charge of doing the
generating of code for STL containers.
Revision
7810 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Dec 30 13:16:51 2003 UTC (11 years ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 73730 byte(s)
Diff to
previous 7805
Mega patch to add support for large files (bigger than 2 GBytes)
----------------------------------------------------------------
==========>NEW VERSION 4.00/00 <===========
Because this new version has a considerable number of changes,
and new important additions by Philippe are scheduled for the coming days
we are starting a new major version 4.
-Support for large files
-Automatic schema evolution for foreign classes
-New data type Double32_t
Large files are currently tested only under Linux with gcc3.2.
Support for other systems will be gradually added in the coming days.
By default under Linux, files are created with the option LARGEFILE.
Note that when creating a Tree, the default maximum size for a Tree
is set to 1.9 GBytes. You can change this default value by calling
TTree::SetMaxTreeSize(Long64_t maxsize)
The implementation of this new feature has required changes in many places.
The files produced by this new version can still be read by old ROOT versions
if their size if smaller than 2 GBytes. And obviously, the new version
can digest old ROOT files.
WARNING: note the following backward incompatibility:
-TSystem::GetPathInfo has a new signature: (also TUnixSystem, TWinNTSystem, etc)
old: GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime);
new: GetPathInfo(const char *path, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime);
-TFile::SysSeek and TFile::SysStat have a new signature (also TNetFile, TWebFile, etc)
old: Int_t SysSeek(Int_t fd, Long_t offset, Int_t whence);
Int_t SysStat(Int_t fd, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime);
new: Long64_t SysSeek(Int_t fd, Long64_t offset, Int_t whence);
Int_t SysStat(Int_t fd, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime);
-TTree::SetMaxTreeSize has a new signature:
old: void TTree::SetMaxTreeSize(Int_t maxsize)
new: void TTree::SetMaxTreeSize(Long64_t maxsize)
All references to Seek_t have been replaced by Long64_t.
Revision
7802 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Dec 25 17:55:20 2003 UTC (11 years, 1 month ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 72636 byte(s)
Diff to
previous 7702
Add a new member fCheckSum and corresponding getter GetCheckSum.
Classversion incremented to version 8.
In TBranchElement::GetInfo, use the fCheckSum member to find the right
TStreamerInfo object in TClass.
With this change and the previous changes in TBuffer, TClass and TStreamerInfo,
automatic schema evolution is supported for foreign classes written in a TTree
or as classes written as a TKey.
Revision
7622 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Nov 20 17:25:54 2003 UTC (11 years, 2 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 71995 byte(s)
Diff to
previous 7597
Patch from Philippe that prevent the splitting of TCollection objects. TClonesArray are allowed to be split except when they are embedded inside an object which in embedded inside an already split object (they are case
where it would be technically possible to split it properly but it is not implemented yet)
Revision
7597 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Nov 14 11:11:21 2003 UTC (11 years, 2 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 71802 byte(s)
Diff to
previous 7563
TTree::Show has a new optional argument (Int_t lenmax=20).
This argument is used to limitate the number of array elements
to be printed in case of variable length arrays, or the
number of objects in a TClonesArray. (previous default was 10
for integer elements and 5 for float elements.
This change has required the following other mods:
-The previously unused argument of TBranchElement::PrintValue
is now the argument lenmax (as given by TTree::Show).
-TStreamerInfo::PrintValue has a new optional argument lenmax
-TStreamerInfo::PrintValueClones has a new optional argument lenmax
-PrintValue and PrintValueClones have a new logic to limitate
the number of printed elements (via macros PrintCR and PrintCCR).
Revision
6824 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jul 4 13:27:35 2003 UTC (11 years, 6 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 70832 byte(s)
Diff to
previous 6775
From Philippe:
This update remove the need to set the addresses before calling CloneTree or CopyTree. This is accomplished by
- making sure that default addresses are created before passing it to the clone.
- keep a list of cloned trees and inform them when an address change.
Also hard to trace memory errors due to the 'link' between the original and the cloned tree are removed by
making the original reset all the addresses of the cloned tree whenever the original tree/chain is deleted.
Revision
6775 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jun 25 07:16:22 2003 UTC (11 years, 7 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 70527 byte(s)
Diff to
previous 6765
Fix by Victor:
TStreamerInfo::GetElems() returns array of pointers to TStreamerElements
TBranchElement::GetID() returns index in this array.
It is OK.
But in files TTreeFormula.cxx and TBranchElement.cxx this index is used for the list
provided by TStreamerInfo::GetElements()
Generally these lists are different, but often the same.
In our case these lists are different because of TClass::IgnoreTObjectStreamer() method used
In GetElements() TObject element exists but
in GetElems() NOT.
Revision
6749 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Jun 21 06:07:47 2003 UTC (11 years, 7 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 70536 byte(s)
Diff to
previous 6671
From Philippe:
The following patch solves aproblem reported by Otto Schaile in tutorial clonesA_Event.C
by modifying TBranchElement::SetAddress so that it properly increments the object
or offset when the branch hierarchy does not contain a branch for the (sub)object itself
and leaves the object or offset
alone if the branch hiearchy does contain a branch for the (sub)object itself.
Revision
6468 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 18 16:42:31 2003 UTC (11 years, 9 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 63290 byte(s)
Diff to
previous 6415
From Philippe:
In TBranchElement::SetAddress we have something like:
TClass *clm = gROOT->GetClass(GetClassName());
Int_t *offsets = clm->GetStreamerInfo()->GetOffsets();
...
if (mOffset > 0) fOffset = mOffset -offsets[fID];
However, if the class has been modified so that the order of the data member in the "live" class is different from
the version that was used to write the file, the fID does NOT point to the index of the needed datamember in the new
StreamerInfo. We have to retrieve it by name instead (hence the patch).
Revision
6415 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Apr 10 12:58:34 2003 UTC (11 years, 9 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 63121 byte(s)
Diff to
previous 6394
Protection added in TBranchElememnt::Streamer in case a Tree has been read
from a file, then written again to the same file without any I/O
in between. In this case the TStreamerInfo of the referenced classes
is not available. (thanks to Peter Hristov for showing a simple case).
Revision
6394 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Apr 6 22:03:05 2003 UTC (11 years, 9 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 63110 byte(s)
Diff to
previous 6386
Add new function;
Int_t TBranchElement::GetDataMemberOffset(TClass *cl, const char *name)
returning the offset of member name in class cl, one of its base class or class by composition.
TBranchElement::SetAddress uses this new function.
Revision
6255 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Mar 5 23:33:29 2003 UTC (11 years, 10 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 61152 byte(s)
Diff to
previous 6244
Implement a custom Streamer for TBranchElement and TBranchObject.
The custom Streamer is required for two reasons:
- to call ForceWriteInfo for all classes referenced by the class in the branch
- to avoid a recursivity problem when the branch is diverted to a separate file.
Revision
5717 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Dec 2 18:50:12 2002 UTC (12 years, 1 month ago) by
rdm
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 60898 byte(s)
Diff to
previous 5704
mega patch to remove almost all compiler warnings on MacOS X where the
compiler is by default in pedantic mode (LHCb also like to use this option).
The following issues have been fixed:
- removal of unused arguments
- comparison between signed and unsigned integers
- not calling of base class copy ctor in copy ctor's
To be done, the TGeo classes where we get still many hundred warnings of
the above nature. List forwarded to Andrei.
Revision
5697 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Nov 28 21:16:56 2002 UTC (12 years, 1 month ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 60444 byte(s)
Diff to
previous 5673
Modify TBranchElement::FillLeaves to support the case when a Tree
is in FakeClass mode.
For example, if a new Tree is created via CloneTree in a Loop
function of a class generated by MakeClass, one has to rebuild
the new Tree in a way compatible with a future reading using
the shared library or not.
Revision
5670 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Nov 26 17:35:18 2002 UTC (12 years, 2 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 59439 byte(s)
Diff to
previous 5661
In Unroll function, remove the limitation that a TClonesArray cannot be split
when the pointer is in a base class. However, there are still changes
required in the browse functions to get this feature operational.
one change from Dave Morrison to escape the slash character.
Revision
5576 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Nov 13 17:32:06 2002 UTC (12 years, 2 months ago) by
rdm
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 60403 byte(s)
Diff to
previous 5436
add special icons for TBranchElements that are folders as opposed to leaves.
This is done by overriding TObject::GetIconName() which returns a different
name for a branch folder than for a branch leave. In the mime types file
this icon name is specified with the corresponding icons.
Revision
5417 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Oct 11 06:54:35 2002 UTC (12 years, 3 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 59891 byte(s)
Diff to
previous 5380
Fix a problem in TBranchElement::SetAddress in case of an object
with a level of inheritance greater than 3 and when data members are simple types
following classes at the same level (thanks Susan Kasahara for reporting
an example).
The new function has been simplified, taking advantage of the work already
done by TClass::BuildRealData.
Revision
4997 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jul 19 22:52:49 2002 UTC (12 years, 6 months ago) by
rdm
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 60402 byte(s)
Diff to
previous 4881
TBranchElement: when in MakeClass mode correctly read empty variable
length array stored inside a TClonesArray.
TTreeFormula: properly deal with empty variable length arrays stored
inside a TClonesArray when in split mode (it still does not work when
NOT split).
-- Philippe
Revision
4367 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Apr 14 14:38:39 2002 UTC (12 years, 9 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 59267 byte(s)
Diff to
previous 4356
Add the 3 following Branch functions in TBranchElement.
virtual Int_t Branch(const char *folder, Int_t bufsize=32000, Int_t splitlevel=99);
virtual TBranch *Branch(const char *name, void *address, const char *leaflist, Int_t bufsize=32000);
virtual TBranch *Branch(const char *name, const char *classname, void *addobj, Int_t bufsize=32000, Int_t splitlevel=99);
With these new functions a true branch hierarchy can be created.
Revision
4356 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 12 19:19:53 2002 UTC (12 years, 9 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 50649 byte(s)
Diff to
previous 4317
From Philippe:
The files produced by MakeClass/MakeSelector were incorrect if the tree
is containing a TClonesArray which contains a variable length array. This
fix correct the situation.
Also is included is a short documentation of the TTreeFormula special functions.
Revision
3876 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Feb 5 17:04:23 2002 UTC (12 years, 11 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 47466 byte(s)
Diff to
previous 3737
From Philippe:
This fix ensures that when receiving a 'name' with a duplicated
branch name in it, TTree::Draw wont crash.
Also fix TBrowser to properly draw the correct leaf even if the
branch name was copied inside the leaf names.
Revision
3737 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jan 23 08:38:59 2002 UTC (13 years ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 47193 byte(s)
Diff to
previous 3693
TBranch::SetBasketSize moved to the implementation file. The function checks
that the specified basket size is greater than fEntryOffsetLen.
The functions SetBasketSize in all derived classes call TBranch::SetBasketSize
to get the same protection.
Revision
3687 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jan 16 18:12:25 2002 UTC (13 years ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 47147 byte(s)
Diff to
previous 3656
Modify the TBranchElement constructor in case of a TClonesArray.
The TClonesArray branch counter does not need an fEntryOffset in its basket.
The new function Tbasket::deleteEntryOffset is called in this case.
This makes the buffer for the TClonesArray counter much shorter.
It was a non negligible overhead in case of very small objects
in the array.
Revision
3491 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Dec 18 14:01:47 2001 UTC (13 years, 1 month ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 45085 byte(s)
Diff to
previous 3479
Fix a bug in the TBranchElement constructor in case of a TClonesArray.
The class version for TClonesArray was erroneously set to 1 instead of the current
version of the class TClonesArray.
As a result, when reading a Tree with branches having TClonesArray, the StreamerInfo
for TClonesArray itself was rebuilt each time the branch was rebuilt.
When reading more than 2500 Trees from the same file (or TChain),
the index of classes was overwritten and TFile::Close was crashing when
writing the class index to the file.
Revision
3036 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Oct 15 16:04:20 2001 UTC (13 years, 3 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 44095 byte(s)
Diff to
previous 3031
In TBranchElement::UnRoll add support for members that cannot be split.
Members that cannot be split are the ones marked with the comment "||"
as the first characters in the data member comment field or special classes
such as TRef and the TArray classes.
Revision
3031 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Oct 15 06:59:52 2001 UTC (13 years, 3 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 44073 byte(s)
Diff to
previous 3030
Add new member fSplitLevel in TBranch with correspondig getter GetSplitLevel.
Modify the various branch constructors to store the branch splitlevel..
When reading old files, the fSplitLevel is set to 1 if the branch
has subbranches.
Revision
2842 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Sep 25 07:58:15 2001 UTC (13 years, 4 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 43719 byte(s)
Diff to
previous 2741
In TBranchElement::GetInfo, use fClassVersion to retrieve the correct StreamerInfo
corresponding to the class version with which the branch was created.
This fix is required in particular in case of the top level branch of a Tree.
Revision
2740 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Aug 24 16:43:01 2001 UTC (13 years, 5 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 43758 byte(s)
Diff to
previous 2684
Fix a bug in TBranchElement constructor. When a branch is in split=1 and
the fStreamerType=0 (case of a base class), the array fEntryOffset must be created
because the base class may have variable length structures.
The consequence of this bug was events corrupted in the buffer.
Thanks to Christian Holm Christensen for reporting a real life example.
Revision
2658 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Aug 10 10:07:19 2001 UTC (13 years, 5 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 42902 byte(s)
Diff to
previous 2656
When the StreamerInfo is forced in non-optimzed mode during the creation of a branch,
one must restore the previous optimization status once the branch is created.
Instead of restoring with the flag kTRUE, the previous optimization status is restored.
Revision
2587 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jul 17 10:29:45 2001 UTC (13 years, 6 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 42001 byte(s)
Diff to
previous 2520
Replace last unused argument of TBranchElement by the argument btype.
This argument is set when Unrolling a class and is used by the TBranchElement
constructor to build or not the array fEntryOffset.
This array does not need to be built in case one branch contains only basic types.
This may save a considerable space on disk for simple Tree configurations.
Revision
2511 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jul 3 11:07:12 2001 UTC (13 years, 6 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 41203 byte(s)
Diff to
previous 2501
Modify TBranchElement::Unroll to recover in case a branch cannot be split.
A new branch is created in non-split mode.
This situation may happen when a class inside a class derives from an abstract
base class (eg all TArray classes).
Revision
2501 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jul 2 08:16:17 2001 UTC (13 years, 6 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 41015 byte(s)
Diff to
previous 2412
Several mods in TBranchElement::SetAddress to support complex cases with more than
3 levels of hierarchy.
In particular, classes containing other classes like TLorentzVector are now
supported, including for classes in TClonesArray.
Revision
2277 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu May 24 16:37:43 2001 UTC (13 years, 8 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 39675 byte(s)
Diff to
previous 2270
Several mods to take into account the additional argument in the
TStreamerInfo functions WriteBufferClones, ReadBufferClones, etc.
Add support in TBranchElement::SetAddress for classes in TClonesArray
with multiple levels of composition.
Revision
2270 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed May 23 16:12:51 2001 UTC (13 years, 8 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 38728 byte(s)
Diff to
previous 2259
Reorganize the logic around the processing of TClonesArray supporting additional
cases.
Set the bit kBranchObject in case a data member is a kTObject, kObject or kAny.
New function BuildTitle.
TBranchElement has still several restrictions regarding the type of classes
in a TClonesArray. Hope to improve this part before the release in June.
Revision
2252 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon May 21 11:10:59 2001 UTC (13 years, 8 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 38162 byte(s)
Diff to
previous 2245
Add support for top level branches to use the Streamer function.
By default the new branch style does not use the Streamer function.
In case the user has a custom Streamer, he can force a call to Streamer
by specifying splitlevel=-1 in TTree::Branch or call directly TTree::BranchOld.
Revision
2176 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri May 11 17:06:59 2001 UTC (13 years, 8 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 38293 byte(s)
Diff to
previous 2101
Add a new member fBranchCount2.
This new member points to the secondary branchcount
in case a TClonesArray element has itself a branchcount.
Example in Event class with TClonesArray fTracks of Track objects.
if the Track object has two members
Int_t fNpoint;
Float_t *fPoints; //[fNpoint]
In this case the TBranchElement fTracks.fPoints has
-its primary branchcount pointing to the branch fTracks
-its secondary branchcount pointing to fTracks.fNpoint
In TBranchElement::GetValue, the branches holding the primary and secondary
branchcount must be read before reading the branch itself.
TTreeFormula must still be adapted (Philippe) to take into account this case.
Revision
2055 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Apr 23 14:03:04 2001 UTC (13 years, 9 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 36433 byte(s)
Diff to
previous 2037
Many changes to support the special case of code generated by TTree::MakeClass.
In particular, the functions GetValue, PrintValue and ReadLeaves support two cases:
-case MakeClass. Care must be taken to access the data and store the data
in the way expected by the code of MakeClass. This was quite tricky
to implement for TClonesArray and pointers to basic types of
variable length.
- normal case
The function SetAddress has been modified to take into account the addressing
mechanism of MakeClass.
New function TBranchElement::GetTypename returning the type name of the element
in the branch.
Normalize branch names and titles, leaf names and titles to be coherent
with the other type of branches.
Revision
2037 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Apr 21 12:08:06 2001 UTC (13 years, 9 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 30945 byte(s)
Diff to
previous 2035
The branch bit kBranchObject is set in the constructors when
the branch is a TObject*. When this bit is set, the functions FillLeaves
and ReadLeaves will enter this object into the buffer MapObject
in case this object is in turn pointed by its sub objects.
Revision
2035 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Apr 21 08:56:19 2001 UTC (13 years, 9 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 30729 byte(s)
Diff to
previous 2030
Modify FillLeaves and ReadLeaves for cases witg fID < 0.
For the top branches call TBuffer::MapObject with the pointer to the top level
object in the branch in case subobjects point to this top level object.
Note that in this case, the branch can be split.
Revision
2030 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 20 21:21:38 2001 UTC (13 years, 9 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 30631 byte(s)
Diff to
previous 2019
From Philippe:
In tree, now allows to draw complete arrays with a double click in the browser
(before it was attempting draw one out-of-bounds element: array[max_size])
In meta, use SetReadingObject in ReadBuffer before processing the
following cases: kObjectp, kObjectP, kObject, kAny, kStreamer, kStreamLoop.
Also update the function TStreamerInfo::GetStreamerElement, to allow
TTreeFormula to properly cache the offset and type information.
In treeplayer, now correctly handle all datamember and method calls
(plus a little bit of clean-up in some calls) when in split mode.
Non-split(or streamed) mode needs more works.
Revision
2019 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 20 09:15:13 2001 UTC (13 years, 9 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 30428 byte(s)
Diff to
previous 2013
Mods in SetAddress to avoid recomputing addresses if not necessary.
Add a special case for a missing class having a TClonesArray.
SetAddress is now able to automatically instatiate the TClonesArray
even when "->" is not specified in the comment field.
Revision
1988 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Apr 16 19:16:21 2001 UTC (13 years, 9 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 30444 byte(s)
Diff to
previous 1980
Add a new data member fObject to TBranchElement.
The convention is to store:
- the address of the pointer in fAddress when fID < 0
- the pointer to the object in fObject for all cases.
This solves the problem of objects created and deleted during the Fill loop.
Revision
1530 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Feb 6 11:02:00 2001 UTC (13 years, 11 months ago) by
brun
Original Path:
trunk/tree/src/TBranchElement.cxx
File length: 19100 byte(s)
Diff to
previous 1464
Split mode now operational for a TBranchElement.
Still a lot of work to be done before releasing the new facility.
In particular, one must be able to click on a leaf with the browser
or use the TreeViewer without the original class.
This form allows you to request diffs between any two revisions of this file.
For each of the two "sides" of the diff,
enter a numeric revision.