Log of /trunk/tree/tree/src/TChain.cxx
Parent Directory
Revision
46324 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Oct 4 21:03:48 2012 UTC (2 years, 3 months ago) by
pcanal
File length: 92222 byte(s)
Diff to
previous 46069
From 'Will E. Coyote', make ESetBranchAddressStatus public and have TChain::SetBranchAddress return kMissingBranch when it can tell
Revision
45931 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Sep 11 14:39:57 2012 UTC (2 years, 4 months ago) by
pcanal
File length: 91439 byte(s)
Diff to
previous 45033
Cleanup TChain::SetCacheSize to avoid redundant operation and avoid creating a TTreeCache when no TTree is available. Remove obsolete comment.
Revision
44761 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jun 27 13:41:06 2012 UTC (2 years, 6 months ago) by
pcanal
File length: 90942 byte(s)
Diff to
previous 43162
From Elvin (and Brian):
I looked over the optimisation suggestions that you sent me and I implemented 4/5 of them. Below is the summary.
1) 60% of the time spent in TFileCacheRead::ReadBuffer is from TStorage::ReAllocChar. ReAllocChar spends 86% of its time in memcpy, 8% in alloc, and 6% in memset. It appears that, when a buffer is recycled, the contents of the old buffer (which are then overwritten) are
copied over.
I modified the call to ReAllocChar not to copy the old contents.
Unfortunately, in my testing, this wasn't enough - later on in ReAllocChar, it zeros out the contents of the array, which has basically the same overhead as copying.
There is no version of TStorage:ReAlloc that would satisfy the current requirements so I'm using the classic realloc for the TFPBlock buffer.
2) There are a few function calls that could be inlined which aren't inlined by the compiler (GCC 4.6.2). Particularly, TFPBlock::GetLen, TFPBlock::GetBuffer, TFPBlock::GetNoElem, and TFPBlock::GetPos.
Done - I in-lined them explicitly, this should do the trick.
3) TTreeCache and TFilePrefetch both keep a sorted list of buffers that TFilePrefetch maintains. When TFileCacheRead::ReadBuffer is called, a binary search is called on both. We can eliminate one of the binary searches and save 3%.
This would require some major changes and it would also affect the normal reading pattern (i.e. when reading without the prefetching enabled). I suggest to keep it as it is for the time being so that we maintain the compatibility with the normal reading without prefetching.
4) TFilePrefetch::ReadBuffer calculates the offset into the block's buffer (ptrInt) on-demand. You could probably win a few more percent here by pre-calculating these offsets for the TFPBlock.
Done - added a new vector of relative offsets of the pieces in the buffer (in TFPBlock).
5) The deadlock issue.
Done - I moved to a cleaner and simpler way to kill the thread by using cancellation. The deadlock situation was introduced in the last patch that I sent you when I was dealing with the TChain issue. The mutex locking was not related to the condition variable, but with the synchronisation with TChain.
Brian: Thread cancellation scares the heck out of me - it's much harder to get correct than condition variables, and goes against most best practices. I'd much rather fixing the usage of conditions and have an explicit synchronization for killing the helpers.
Elvin also reverted to classic condition variables and semaphores when killing the worker thread.
Revision
43162 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Feb 28 17:58:47 2012 UTC (2 years, 10 months ago) by
pcanal
File length: 91005 byte(s)
Diff to
previous 43144
From Peter:
Index: io/io/src/TFile.cxx
* Have TFile SetCacheRead() disassociate itself from cache, when cache is set to 0.
Index: tree/tree/src/TTreeCache.cxx
* Let TFile handle association between file and cache.
Index: tree/tree/src/TChain.cxx
* Let TFile handle association between file and cache.
Revision
42754 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jan 20 20:13:07 2012 UTC (3 years ago) by
pcanal
File length: 91035 byte(s)
Diff to
previous 42752
From Peter van Gemmeren:
Allow multiple read caches per file by adding a fCacheReadMap member and owner arguments to GetCacheRead() and SetCacheRead()
to TFile.
Index: io/io/inc/TFileCacheRead.h
Index: io/io/src/TFileCacheRead.cxx
* Adding new argument for constructor to specify TTree owner
* whitespace indents
Index: tree/tree/inc/TBasket.h
Index: tree/tree/src/TBasket.cxx
* Add optional tree owner argument to LoadBasketBuffers() to retrieve cache.
* In LoadBasketBuffers() and ReadBuffers() check the cache first than call TFile::ReadBuffer only if needed.
Index: tree/tree/inc/TChain.h
Index: tree/tree/src/TChain.cxx
* Override SetCacheSize() function to update TTree owner on the current cache.
* whitespace indents
Index: tree/tree/src/TTree.cxx
* Get TTreeCache for current TTree, by specifying owner in GetCacheRead() calls
* Always delete owned cache
Index: tree/tree/src/TTreeCache.cxx
* Adding new argument for constructor for TFileCacheRead to specify TTree owner
Index: tree/treeplayer/src/TTreePlayer.cxx
* Get TTreeCache for current TTree, by specifying owner in GetCacheRead() calls
Index: tree/tree/src/TTreeCloner.cxx
* Call TBasket::LoadBasketBuffers() with current TTree as owner of cache
Index: proof/proofplayer/src/TEventIter.cxx
* Get TTreeCache for current TTree, by specifying owner in GetCacheRead() and SetCacheRead() calls
Revision
42752 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jan 20 18:03:01 2012 UTC (3 years ago) by
pcanal
File length: 90697 byte(s)
Diff to
previous 42751
Repair the support for chain->GetTree()->CloneTree(0) in LoadTree (broken in previous revision and failing roottest/root/tree/cloning)
Revision
41698 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Nov 1 21:22:54 2011 UTC (3 years, 2 months ago) by
pcanal
File length: 89612 byte(s)
Diff to
previous 41111
From Elvin:
Last week Martin Vala from ALICE came to me with a problem that he had
while using the asynchronous prefetching. There were basically two
main problems:
1. Trying to read a root file from an archive. Here the problem was
that when reading from an archive there is an offset of the file which
was not taken into consideration when the file was saved in the cache.
And this lead to a miss when reading the file from cache. I fixed it,
but I had to expose the value of fArchiveOffset from TFile.
2. The second problem was when reading using a TChain. There were some
synchronization issues concerned to the asynchronous thread that
actually does the reading. All this was happening because in the case
of TChain there is only one file cache which is re-utilized as we move
from one file to another. This was a pretty tricky issue.
I attached a patch made against the current trunk which fixes both
this problems. I gave the patch first to Martin to test it, and he was
satisfied with it. There is a small delay when the TChain moves from
one file to another because I have to wait for the async thread to
finish it's worked but over all Martin said that the performance is
way better than before. When I initially did the asyn pre-fetching I
had no idea about these two use cases, so that's why they popped up
now.
Revision
40993 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Sep 23 18:54:14 2011 UTC (3 years, 4 months ago) by
pcanal
File length: 88746 byte(s)
Diff to
previous 40792
Introduce GetLeaf(branchname,leafname) used in TTreeFormula to avoid ambiguity in the syntax introduced by too many slashes
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: 87521 byte(s)
Diff to
previous 39611
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
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: 87515 byte(s)
Diff to
previous 39588
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
39365 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue May 24 19:53:19 2011 UTC (3 years, 8 months ago) by
pcanal
File length: 87077 byte(s)
Diff to
previous 39059
Remove hard dependencies of TFileMerger on TH1 and TTree.
(Soft dependencies still exist to be able to disable the
merging of TTrees and to be able to disable the AutoAdd
behavior of TH1).
Introduce new explicit interface for providing merging
capability. If a class has a method with the name and
signature:
Long64_t Merge(TCollection *input, TFileMergeInfo*);
it will be used by a TFileMerger to merge one or more
other objects into the current object. Merge should
return a negative value if the merging failed.
If this method does not exist, the TFileMerger will use
a method with the name and signature:
Long64_t Merge(TColletion *input);
TClass now provides a quick access to these merging
function via TClass::GetMerge. The wrapper function
is automatically created by rootcint and can be installed
via TClass::SetMerge. The wrapper function should have
the signature/type ROOT::MergeFunc_t:
Long64_t (*)(void *thisobj, TCollection *input, TFileMergeInfo*);
Added the new Merge function to TTree and THStack.
Also add the new Merge function to TQCommand as the
existing TQCommand::Merge does _not_ have the right
semantic (in part because TQCommand is a collection).
Fix the return value of TEfficiency::Merge
In TFileMerger, add a PrintLevel to allow hadd to request
more output than regular TFileMerger.
The object TFileMergeInfo can be used inside the Merge
function to pass information between runs of the Merge
(see below). In particular it contains:
TDirectory *fOutputDirectory; // Target directory where the merged object will be written.
Bool_t fIsFirst; // True if this is the first call to Merge for this series of object.
TString fOptions; // Additional text based option being passed down to customize the merge.
TObject *fUserData; // Place holder to pass extra information. This object will be deleted at the end of each series of objects.
The default in TFileMerger is to call Merge for every object
in the series (i.e the collection has exactly one element) in
order to save memory (by not having all the object in memory
at the same time).
However for histograms, the default is to first load all the
objects and then merge them in one go ; this is customizable
when creating the TFileMerger object.
Revision
39059 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Apr 30 20:28:06 2011 UTC (3 years, 8 months ago) by
pcanal
File length: 86808 byte(s)
Diff to
previous 39038
Introduce support for TTree with variable cluster size (i.e. value of fAutoFlush).
The information is kept in the new data members: fNClusterRange, fMaxClusterRange, fClusterRangeEnd, fClusterSize.
(See TTree::SetAutoFlush for more details).
Iterating through the cluster should be done via the new class TTree::TClusterIterator (i.e. this replaces += fAutoFlush):
TTree::TClusterIterator clusterIter = tree->GetClusterIterator(which_entry_to_start_from);
Long64_t clusterStart;
while( (clusterStart = clusterIter()) < tree->GetEntries()) {
printf("The cluster starts at %lld and ends at %lld\n",clusterStart,clusterIter.GetNextEntry()-1);
}
See TTreeCache::FillBuffer for a concrete usage example.
Revision
39038 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Apr 27 13:00:40 2011 UTC (3 years, 8 months ago) by
pcanal
File length: 86385 byte(s)
Diff to
previous 39026
Make sure the TChain can be found (and thus removed) from the list of cleanups even when its name is 'changed' by the Streamer
Revision
38595 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Mar 24 00:40:37 2011 UTC (3 years, 10 months ago) by
pcanal
File length: 86208 byte(s)
Diff to
previous 37836
In TChain::ls, print the name of the chain and indent the list
of files (this fixes https://savannah.cern.ch/bugs/?79909).
In TObject::ls, add support for the option 'noaddr' which
prevents the printing of the address of the object. This
is useful in particular in roottest. Use this in hadd
and TFileMerger
Revision
33354 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon May 3 19:46:03 2010 UTC (4 years, 8 months ago) by
pcanal
File length: 85269 byte(s)
Diff to
previous 33073
Make sure that a TChain object is informed if its current TFile object is deleted externally (for example at shutdown) ; this should help fixing Savannah #66448
Revision
33073 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 16 17:53:12 2010 UTC (4 years, 9 months ago) by
pcanal
File length: 84535 byte(s)
Diff to
previous 32952
In TTree::CloneTree, TChain::Merge and TTree::CopyEntries introduces more flexibility
in the handling of the case where an index is 'missing' index in one or more of the
TTree being collated.
// If the tree or any of the underlying tree of the chain has an index, that index and any
// index in the subsequent underlying TTree objects will be merged.
//
// There are currently three 'options' to control this merging:
// NoIndex : all the TTreeIndex object are dropped.
// DropIndexOnError : if any of the underlying TTree object do no have a TTreeIndex,
// they are all dropped.
// AsIsIndexOnError [default]: In case of missing TTreeIndex, the resulting TTree index has gaps.
// BuildIndexOnError : If any of the underlying TTree object do no have a TTreeIndex,
// all TTreeIndex are 'ignored' and the mising piece are rebuilt.
The default (AsIsIndexOnError) is the same as before except that the 'first' TTree
of a chain is no longer the deciding factor on whether the indexed are kept or dropped:
the default is to collate all existing indexes (with 'gaps' if there are missing indexes).
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: 84530 byte(s)
Diff to
previous 32908
Prefer the use of InheritsFrom(TClass*) over InheritsFrom(const char*) as long as
it does not increase the library dependencies.
Revision
32908 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Apr 8 19:27:43 2010 UTC (4 years, 9 months ago) by
pcanal
File length: 84523 byte(s)
Diff to
previous 32894
Properly re-update the friend branch address when the friend is a chain composed of 'smaller' trees than the main chain is. This fixes savannah #65431
Revision
32894 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Apr 7 15:00:21 2010 UTC (4 years, 9 months ago) by
pcanal
File length: 83578 byte(s)
Diff to
previous 32032
Merge near indentical code in TChain::Merge, TTree::Clone and TTree::CopyEntries
into TTree::CopyEntries (and call it from the other 2 places). Some small behavior
changes:
TChain::Merge: no longer disable TTreeCache in fast copy mode.
TTree::CopyEntries: also copy the TTreeIndices if any; add proper support for TChain objects; add support for fast cloning.
TTree::CloneTree: also copy the TTreeIndices if any.
Improve the output of TTree::Scan but insert blank space whenever a value is not available because there is no proper row in a friend.
(Previously it was re-printing the previous value). This required changeis in TTree and TChain LoadTree where fReadEntry is now
set to -1 in case of failure to find the proper row.
Revision
30121 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Sep 11 16:43:51 2009 UTC (5 years, 4 months ago) by
pcanal
File length: 85675 byte(s)
Diff to
previous 28842
Add a return value to SetBranchAddress, a return value greater or equal to zero indicate success, a negative value indicates failure (in both case, the address is still updated). Example:
if (tree->SetBranchAddress(mybranch,&myvar) < 0 ) {
cerr << "Something went wrong\n";
return;
}
The possible return values are:
kMissingBranch (-5) : Missing branch
kInternalError (-4) : Internal error (could not find the type corresponding to a data type number.
kMissingCompiledCollectionProxy (-3) : Missing compiled collection proxy for a compiled collection.
kMismatch (-2) : Non-Class Pointer type given does not match the type expected by the branch.
kClassMismatch (-1) : Class Pointer type given does not match the type expected by the branch.
kMatch (0) : perfect match.
kMatchConversion (1) : match with (I/O) conversion.
kMatchConversionCollection (2) : match with (I/O) conversion of the content of a collection.
kMakeClass (3) : MakeClass mode so we can not check.
kVoidPtr (4) : void* passed so no check was made.
kNoCheck (5) : Underlying TBranch not yet available so no check was made.
Revision
28842 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Jun 7 14:20:07 2009 UTC (5 years, 7 months ago) by
pcanal
File length: 85387 byte(s)
Diff to
previous 28385
In the case where a TEntryList is created by TEventList:
TTree::GetEntryList no longer transfer the ownership to the TTree's directory
(This was not working properly because RecursiveRemove is not called on the
content of the currently delete TDirectory).
TTree::GetEntryList no longer relinquish ownership of the fEntryList
(Note that prior to r28831, even when the TTree 'owned' the EntryList,
the EntryList was delete 'only' if the TTree was also cloned via CloneTree
(due to a typo in ~TTree).
Update TChain to also reflect this changes and the change in r28831)
Revision
28355 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 24 19:53:11 2009 UTC (5 years, 9 months ago) by
pcanal
File length: 84890 byte(s)
Diff to
previous 28277
TTree::CloneTree and TChain::Merge in fast mode now can recover from some mismatch errors between
the input and output TTrees by falling back to using the 'slow' mode. In particular this allow
a 'fast cloning' to handle files that requires schema evolution (albeit it is of course much slower).
The TTreeCloner constructor takes an additional argument to indicate whether the TTreeCloner should
directly print the mismatch error/warning or if the caller we handle them. The message of the
warning can be retriever via TTreeCloner::GetWarning. TTreeCloner::NeedConversion return true
if there is a mismatch but the TTree will/should be able to be process properly in slow mode.
This fixes the issue #33743 in savannah
Revision
28277 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 17 20:20:58 2009 UTC (5 years, 9 months ago) by
pcanal
File length: 84255 byte(s)
Diff to
previous 27600
Since a TChain is not attached to the current directory and that in almost all cases the current directory will not be part of the chain, let's set fFile and fDirectory to zero in the constructor (Leading chain->GetCurrentFile() to properly return 0 until a valid file in the chain is opened
Revision
27600 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Feb 25 08:17:22 2009 UTC (5 years, 10 months ago) by
brun
File length: 84189 byte(s)
Diff to
previous 27539
From Matthew Strait:
* Fix spelling and grammar errors
* Fold long lines so they don't spill off the right side
* Add spaces for readability
* Standardize notation and style within sections.
Revision
27539 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Feb 20 08:17:45 2009 UTC (5 years, 11 months ago) by
brun
File length: 84138 byte(s)
Diff to
previous 26399
From Thiemo Nagel:
the wildcard behaviour of TChain::Add() caused me a bit of a headache,
so I thought I'd send in a patch to clarify its documentation a bit.
Revision
26399 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Nov 24 01:44:18 2008 UTC (6 years, 2 months ago) by
rdm
File length: 84069 byte(s)
Diff to
previous 26390
From Gerri:
- huge simplification for PROOF-Lite, as the chain is local there is no need
to set special arguments in SetProof() to get the Tree header. The client
can just use the TChain directly to get the tree header and GetEntries().
- fix for TChain::Draw() on PROOF-Lite when doing repeated Draw() queries.
Revision
26390 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Nov 22 23:45:13 2008 UTC (6 years, 2 months ago) by
rdm
File length: 83699 byte(s)
Diff to
previous 25654
From Gerri:
The retrieval of the tree header in PROOF (which enables calls like
TChain::GetEntries) is broken. At a certain point we disabled retrieval
by default (it was too heavy in some cases) and we added the third argument
to TChain::SetProof() to control it. But this argument is never used to
get the tree. Infact we need to change the main constructor of TProofChain
(done already) and the related plug-in handler.
Revision
24602 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jun 30 05:16:06 2008 UTC (6 years, 6 months ago) by
pcanal
File length: 83677 byte(s)
Diff to
previous 24522
allow .root in the name of directory in TChain::Add and TChain::AddFile (however in this case the root file must be ending .root)
Revision
23685 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed May 7 15:18:39 2008 UTC (6 years, 8 months ago) by
brun
File length: 82830 byte(s)
Diff to
previous 23466
Introducing a parallel unzipping algorithm for pre-fetched buffers. Since we already know what buffers are going to be read, we can decompress a few of them in advance in an additional thread and give the impression that the data decompression comes for free (we gain up to 30% in reading intensive jobs).
The size of this unzipping cache is 20% the size of the TTreeCache and can be modified with TTreeCache::SetUnzipBufferSize(Long64_t bufferSize). Theoretically, we only need one buffer in advance but in practice we might fall short if the unzipping cache is too small (synchronization costs).
This experimental feature is disabled by default, to activate it use the static function TTreeCache::SetParallelUnzip(TTreeCacheUnzip::EParUnzipMode option = TTreeCacheUnzip::kEnable). The possible values to pass are: TTreeCacheUnzip::kEnable to enable it,TTreeCacheUnzip::kDisable to disable it and TTreeCacheUnzip::kForce to force it. Since it will only work if you have more than one core, the TTreeCacheUnzip::kForce option is useful to run it even if you have only one cpu (to measure the overhead, for example).
Revision
22992 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Apr 5 09:43:01 2008 UTC (6 years, 9 months ago) by
pcanal
File length: 82769 byte(s)
Diff to
previous 22972
Use the DirectoryAutoAdd facility for the classes:
TTree, TH1, TEventList, TEntryList, TGraph2D
(and hence their derived classes).
The instances of those classes are now added automatically
to the current directory only when Constructe'd with arguments or Clone'd
and to the directory they are read from when their are stored
directly in a TKey. [Note: the default constructor never adds
the object to the current directory]
The directory auto add can still be disabled for instance
of TH1 and TGraph2D by setting TH1::AddDirectory.
Additionally one can disable the directory auto add for
a specific class by doing:
TClass::GetClass("myclass")->SetDirectoryAutoAdd(0)
However you might want to also be able to restore the
behavior in which case you ought to do:
TClass *cl = TClass::GetClass("myclass");
ROOT::DirAutoAdd_t func = cl->GetDirectoryAutoAdd();
cl->SetDirectoryAutoAdd(0);
TROOT::ReadingObject is marked as deprecated.. It is still
set (as it was) but is no longer used by the above mention
classes.
NOTE: One side effect of this change, is that instnace
of TTree, TH1, TEventList, TEntryList, TGraph2D that are
retrieved from a TMessage (i.e. from a socket) no longer
auto register themselves to the current ROOT directory.
Add a new optional parameter to TDirectory::Append: 'replace'
If replace is true (the default is false), the Append will
first remove from the directory any existing object and
print the message:
Replacing existing OldClass: thename (Potential memory leak).
Add a new option parameter to TDirectory::CloneObject: 'autoadd'
If autoadd is true (the default), CloneObject will call the
object 'DirectoryAutoAdd' function (if any)
In TDirectory::CloneObject add support for multiple inheritance
from TObject where TObject is not the left most base class.
Fix memory leak in TGraph2D::operator= (and add TGraph2D::Clear)
Cleanup some documentation
Revision
22972 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Apr 3 19:58:33 2008 UTC (6 years, 9 months ago) by
pcanal
File length: 81877 byte(s)
Diff to
previous 22902
Introduce a new member function TDirectory::Remove which is the reverse of
TDirectory::Append. This allows more 'hiding' of the internal list as
well as simplifying code (now) using Append/Remove.
Revision
19785 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Sep 11 09:45:03 2007 UTC (7 years, 4 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 80539 byte(s)
Diff to
previous 19666
From Anna:
Remember the bug #28505 about dcache and entry lists? After lots of communication with dcache guys, it looks like I've fixed it. The attached patch has the following changes:
1. TEntryList::GetEntryList() now performs all the necessary changes to the file names, such as extending to full path for local files, and using TUrl::GetUrl() for not local. This, hopefully, solves the problem of dcache:/// being added to dcache files and the same possible problem for other protocols.
2. TEntryList::SetTree(TTree *tree) does the same changes to the file name. TEntryList::SetEntryList(const char *treename, const char *filename), however, takes the names "as is".
3. in TChain::SetEntryList() function, most of the code has been replaced with calls to TEntryList::GetEntryList(). Because of this, option parameter, previously in TChain::SetEntryList() had to be added to TEntryList::GetEntryList().
4. TChain::SetEventList() function now doesn't call TChain::LoadTree() if all the tree offsets are already known.
5. TChain::GetEntryNumber() function now doesn't load the current tree, if all the tree offsets are already known.
6. TEntryList::Print() function is fixed for the case of empty sub-lists (didn't print anything for them before)
Special thanks to Dmitry Ozerov for his help.
Revision
19220 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jul 2 14:28:39 2007 UTC (7 years, 6 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 81442 byte(s)
Diff to
previous 19116
From Anna:
In TTree::SetEventList() and TChain::SetEventList() functions:
- The name of the automatically created TEntryList is now not the same as the name of the TEventList argument
- Set the ReapplyCut flag of the automatically created TEntryList to the same value as that of the TEventList argument
In TTree::SetEventList():
- Properly delete the old automatically created TEntryList when a new one is set
Revision
19112 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Jun 21 15:42:50 2007 UTC (7 years, 7 months ago) by
pcanal
Original Path:
trunk/tree/src/TChain.cxx
File length: 79793 byte(s)
Diff to
previous 18679
Modify TChain::GetReadEntry to now returns the current entry of the chain
instead of the underlying tree. (To get the previous value do
mychain->GetTree()->GetReadEntry()). Thus Entry$ nows returns/draws/scans
the value of the entry number in the chain.
Revision
18648 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu May 3 15:27:40 2007 UTC (7 years, 8 months ago) by
rdm
Original Path:
trunk/tree/src/TChain.cxx
File length: 79665 byte(s)
Diff to
previous 18449
From Gerri:
This is the last patch to synchronize with the CAF:
TDSet.h, .cxx
- Use TCollection instead of TList
- Support thre object types in TDSet::Add(TCollection *): TFileInfo, TUrl
and TObjString .
- Conserve the looked-up status of TChainElements when instantiating
from a TChain.
TChainElement.h, .cxx
- Use BIT(15) to flag the looked-up status
TChain.h, .cxx
- Use TCollection instead of TList
- Support thre object types in TDSet::Add(TCollection *): TFileInfo, TUrl
and TObjString .
- Save / Test the looked-up status of elements to avoid multiple lookup;
an option is available in TChain::Lookup(Bool_t force = kFALSE) to
force a new lookup.
Revision
18449 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Mar 30 16:44:34 2007 UTC (7 years, 9 months ago) by
rdm
Original Path:
trunk/tree/src/TChain.cxx
File length: 78544 byte(s)
Diff to
previous 18282
From Gerri:
Anna reported to me the following problem:
TChain::Lookup (and TDSet::Lookup) makes now use of TFileStager::Locate
to locate the files. But for local URLs TFileStager is not defined, so
the lookup fails.
This patch adds default functionality (based on TSystem::AccessPathName)
to the base TFileStager, so that it works trasparently for local files.
Revision
18282 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Mar 16 08:15:29 2007 UTC (7 years, 10 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 78417 byte(s)
Diff to
previous 18277
To avoid overloading ambiguities (eg calling chain.SetEntryList(0), rename function
virtual void SetEntryList(const char *filename="", Option_t *opt="");
to
virtual void SetEntryListFile(const char *filename="", Option_t *opt="");
Revision
18277 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Mar 15 11:33:00 2007 UTC (7 years, 10 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 78415 byte(s)
Diff to
previous 18272
From Anna:
Add new functionlity to the TEntryList class to support automatically
multiple TEntryList (one per TChain file). A new class TEntryListFromFile
has been developed. It is a utility class called by TChain when a TEntryList
is set.
// TEntryListFromFile
//
// Manages entry lists from different files, when they are not loaded
// in memory at the same time.
//
// This entry list should only be used when processing a TChain (see
// TChain::SetEntryList() function). File naming convention:
// - by default, filename_elist.root is used, where filename is the
// name of the chain element.
// - xxx$xxx.root - $ sign is replaced by the name of the chain element
// If the list name is not specified (by passing filename_elist.root/listname to
// the TChain::SetEntryList() function, the first object of class TEntryList
// in the file is taken.
// It is assumed that there are as many lists, as there are chain elements,
// and they are in the same order.
//
// If one of the list files can't be opened, or there is an error reading a list
// from the file, this list is skipped and the entry loop continues on the next
// list.
Revision
18255 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Mar 14 07:24:11 2007 UTC (7 years, 10 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 75816 byte(s)
Diff to
previous 18194
From Philippe:
Change the definition of kBigNumber from 1234567890 to 1<<63 -1
The previous definition was in an enum. The new one is a static variable of type Long64_t.
This fixes a problem when calling TChain::GetEntries with chains containing more than 1 billion entries.
Revision
18194 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Mar 8 12:09:09 2007 UTC (7 years, 10 months ago) by
rdm
Original Path:
trunk/tree/src/TChain.cxx
File length: 75763 byte(s)
Diff to
previous 18086
From Gerri:
This patch introduces TFileStager::Locate and uses it to improve lookup
performances in TDSetElement::Lookup and TChain::Lookup.
There is a further optimization to be done in XrdClientAdmin under discussion
with Fabrizio. But that should have no (or very little) impact on this
implementation.
Revision
18086 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Feb 26 15:01:24 2007 UTC (7 years, 10 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 75465 byte(s)
Diff to
previous 17731
From Anna:
Because of my TEntryList connected changes, TEventLists stopped working on proof. This fix should solve this problem.
So, now for proof everything should be the same way it was before TEntryList introduction.
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/TChain.cxx
File length: 75431 byte(s)
Diff to
previous 17591
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/TChain.cxx
File length: 75656 byte(s)
Diff to
previous 17422
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
17422 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jan 22 07:57:14 2007 UTC (8 years ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 75413 byte(s)
Diff to
previous 17306
From Anna:
Extend the functionality of TEntryList and add the following info in TTree::Draw
// Saving the result of Draw to a TEventList or a TEntryList
// =========================================================
// TTree::Draw can be used to fill a TEventList object (list of entry numbers)
// instead of histogramming one variable.
// If varexp0 has the form >>elist , a TEventList object named "elist"
// is created in the current directory. elist will contain the list
// of entry numbers satisfying the current selection.
// If option "entrylist" is used, a TEntryList object is created
// Example:
// tree.Draw(">>yplus","y>0")
// will create a TEventList object named "yplus" in the current directory.
// In an interactive session, one can type (after TTree::Draw)
// yplus.Print("all")
// to print the list of entry numbers in the list.
// tree.Draw(">>yplus", "y>0", "entrylist")
// will create a TEntryList object names "yplus" in the current directory
//
// By default, the specified entry list is reset.
// To continue to append data to an existing list, use "+" in front
// of the list name;
// tree.Draw(">>+yplus","y>0")
// will not reset yplus, but will enter the selected entries at the end
// of the existing list.
//
// Using a TEventList or a TEntryList as Input
// ===========================
// Once a TEventList or a TEntryList object has been generated, it can be used as input
// for TTree::Draw. Use TTree::SetEventList or TTree::SetEntryList to set the
// current event list
// Example1:
// TEventList *elist = (TEventList*)gDirectory->Get("yplus");
// tree->SetEventList(elist);
// tree->Draw("py");
// Example2:
// TEntryList *elist = (TEntryList*)gDirectory->Get("yplus");
// tree->SetEntryList(elist);
// tree->Draw("py");
// If a TEventList object is used as input, a new TEntryList object is created
// inside the SetEventList function. In case of a TChain, all tree headers are loaded
// for this transformation. This new object is owned by the chain and is deleted
// with it, unless the user extracts it by calling GetEntryList() function.
// See also comments to SetEventList() function of TTree and TChain.
//
// If arrays are used in the selection critera, the entry entered in the
// list are all the entries that have at least one element of the array that
// satisfy the selection.
// Example:
// tree.Draw(">>pyplus","fTracks.fPy>0");
// tree->SetEventList(pyplus);
// tree->Draw("fTracks.fPy");
// will draw the fPy of ALL tracks in event with at least one track with
// a positive fPy.
//
// To select only the elements that did match the original selection
// use TEventList::SetReapplyCut or TEntryList::SetReapplyCut.
// Example:
// tree.Draw(">>pyplus","fTracks.fPy>0");
// pyplus->SetReapplyCut(kTRUE);
// tree->SetEventList(pyplus);
// tree->Draw("fTracks.fPy");
// will draw the fPy of only the tracks that have a positive fPy.
//
// Note: Use tree->SetEventList(0) if you do not want use the list as input.
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/TChain.cxx
File length: 68380 byte(s)
Diff to
previous 16967
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
16955 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Nov 27 14:14:24 2006 UTC (8 years, 1 month ago) by
rdm
Original Path:
trunk/tree/src/TChain.cxx
File length: 68359 byte(s)
Diff to
previous 16686
From Gerri:
This is the patch to move TDSet and TChainProof in 'proof' and remove
any dependence on PROOF in 'tree'. I have renamed TChainProof as TProofChain,
for consistency. TProofChain is now deriving from TChain and overrides only
the required methods. It is loaded via PluginManager by TChain in SetProof.
TQueryResult stores now all the input-related objects in fInputList. There
is a new method
TObject *TQueryResult::GetInputObject(const char *classname)
to retrieve the first instance of a class from the input list, so for the
TDSet:
TQueryResult *qr;
TDSet *dset = (TDSet *) qr->GetInputObject("TDSet")
The changes in TSessionViewer are needed to adapt to this new way of
accessing TDSets.
Revision
15935 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Aug 6 07:15:01 2006 UTC (8 years, 5 months ago) by
rdm
Original Path:
trunk/tree/src/TChain.cxx
File length: 67971 byte(s)
Diff to
previous 15856
Handle several issues related to the TTree::Process() and TTree::Draw()
return values:
- TSelector: fStatus increased from Int_t to Long64_t. It is used to
return the number of selected events by TTree::Draw() which returns
a Long64_t.
- TVirtualProof, TProof, TDSet, TProofPlayer: Process() and Draw() were
returning an Int_t, now a Long64_t to be consistent with TTree/TChain.
Actually returning of TSelector::GetStatus() from the workers to be
done tomorrow.
Also added proper comments describing the return values for Draw()
(number of selected events), and Process() (value returned by
TSelector::GetStatus()).
- TTree, TChain, TSelectorDraw: added proper comments describing the
return values of Draw() and Process().
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/TChain.cxx
File length: 67251 byte(s)
Diff to
previous 15816
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
15795 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Jul 13 05:41:37 2006 UTC (8 years, 6 months ago) by
pcanal
Original Path:
trunk/tree/src/TChain.cxx
File length: 67942 byte(s)
Diff to
previous 15680
From Paul Russo:
o (LoadTree) We no longer delete clones from the trees in
the chain, those trees still need to be able to synchronize
their clones' branch addresses. We now copy the chain's
clone list into the newly fetched tree's clone list because
it is the tree's destructor (which is called when we switch
to the next file in the chain) that is responsible for
resetting the addresses of the branches of the clone trees.
If this is not done, the branches of the clone trees will
be pointing at memory which was deallocated when the master
tree was destroyed at the file switch.
o (Merge) Improve documentation.
Revision
15680 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jul 4 10:23:53 2006 UTC (8 years, 6 months ago) by
rdm
Original Path:
trunk/tree/src/TChain.cxx
File length: 62482 byte(s)
Diff to
previous 15572
From Gerri:
Attached is the patch to improve the default speed of TChain::SetProof.
I have added two flags:
- to control whether the tree header has to be retrieved or not
(default kFALSE).
- to force refreshing of the associated fChainProof; default is kFALSE;
this is used internally by the "Add..." methods if fChainProof is defined,
so that the new additions to the chain are automatically taken into account
in the associated data set (this was one of the problems Jan-Fiete had).
TChainProof::StartViewer now checks if the tree header is available and,
if not, tries to get it from PROOF; so the behaviour is always the same,
except that now one waits only when the viewer is started, and not for
normal processing.
Revision
15572 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jun 27 14:36:28 2006 UTC (8 years, 6 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 61548 byte(s)
Diff to
previous 15536
-Rename class TFilePrefetch -> TFileCacheRead
-Rename class TTreeFilePrefetch -> TTreeCache
-Add new class TFileCacheWrite that implements automatic caching
when writing network files. This class replaces the previous class TCache.
-old TCache class deleted.
-TFileCacheRead can read buffers from the wite cache in TFileCacheWrite.
-As a result TFile::UseCache is obsolete. The function is kept for
backward compatibility.
-Remove references to TCache from TXMLFile, TSQLFile, TwebFile, TNetFile
-remove pointer TFile::fCache
-Add pointers TFile::fCacheRead and TFile::fCacheWrite
-Remove members fMaxCacheSize and fPageSize from TChain
NOTE that it is recommended to
rm -f base/src/*.d base/src/*.o
rm -f net/src/*.d net/src/*.o
rm -f tree/src/*.d tree/src/*.o
Revision
15536 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Jun 25 14:14:11 2006 UTC (8 years, 7 months ago) by
pcanal
Original Path:
trunk/tree/src/TChain.cxx
File length: 62214 byte(s)
Diff to
previous 15476
Enhance SetBranchAddress so that the curent recommended code:
chain->SetBranchAddres(branchname,&userdata); // once per chain
....
branchptr = chain->GetBranch(branchname); // once per tree in the chain
can be replaced by:
chain->SetBranchAddres(branchname,&userdata,&branchptr); // once per chain
As a result, branchptr will be either set to 0 when the branch does
not exist or the tree is not loaded yet and will be 'refreshed'
automatically everytime the chain loads a new tree.
MakeClass and MakeSelector have been updated to take advantage of
this new feature. This removed most the code from the Notify
method.
Revision
15455 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jun 16 11:01:17 2006 UTC (8 years, 7 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 61406 byte(s)
Diff to
previous 15421
Introduce two new major optimizations for the Tree cache.
-in case of a TChain, the list of branches computed during the
training phase of the first file is reused for all the other files.
-add support for TEventlist. Only the baskets referenced by the list
are added to the cache. This has requested a new function in TEventlist
Bool_t TEventList::ContainsRange(Long64_t entrymin, Long64_t entrymax)
// Return TRUE if list contains entries from entrymin to entrymax included.
Revision
15421 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Jun 14 13:15:55 2006 UTC (8 years, 7 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 61443 byte(s)
Diff to
previous 15381
mprove the prefetching algorithm in case of Trees.
A learning phase is introduced (by default one percent of
all entries) to find the list of branches referenced.
The learning fraction can be changed via TTreeFilePrefetch::SetLearnRatio
Revision
15369 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Jun 8 12:46:45 2006 UTC (8 years, 7 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 61088 byte(s)
Diff to
previous 15332
Several enhancements in the Tree file cache
-support for TChain
-Reuse the same cache when loading a new Tree
WARNING!!!!
==============================================
The TTree File cache is now set ON by default
==============================================
You can test the effect of the cache by setting
mytree.SetCacheSize(0); //default is 10000000 bytes
mychain.SetCacheSize(0);
The cache has no negative impact on the performnace when reading
local files. It improves drastically the performance when reading
a remote file through a high latency network.
Revision
15332 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jun 5 20:30:28 2006 UTC (8 years, 7 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 60757 byte(s)
Diff to
previous 15168
New class TTreeFilePrefetch:
//////////////////////////////////////////////////////////////////////////
// //
// TTreeFilePrefetch //
// //
// A specialized TFilePrefetch object for a TTree //
// This class acts as a file cache, registering automatically the //
// baskets from the branches being processed (TTree::Draw or //
// TTree::Process and TSelectors. //
// This cache speeds-up considerably the performance, in particular //
// when the Tree is accessed remotely via a high latency network. //
// //
// The default cache size (10 Mbytes) may be changed via the function //
// TTreeFilePrefetch::SetCacheSize //
// //
// Only the baskets for the requested entry range are put in the cache //
// //
// For each Tree being processed a TTreeFilePrefetch object is created.//
// This object is automatically deleted when the Tree is deleted or //
// when the file is deleted.
// //
//////////////////////////////////////////////////////////////////////////
For the time being activate this cache with
mytree.SetCacheSize();
New transient member fCacheSize added to TTree and the corresponding
Get/Set function.
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/TChain.cxx
File length: 60657 byte(s)
Diff to
previous 14745
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/TChain.cxx
File length: 59645 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/TChain.cxx
File length: 59637 byte(s)
Diff to
previous 14037
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
13265 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Nov 16 20:25:59 2005 UTC (9 years, 2 months ago) by
pcanal
Original Path:
trunk/tree/src/TChain.cxx
File length: 58640 byte(s)
Diff to
previous 13207
Add an 'option' argument to the Merge method
Implement support for an option "fast" to TChain::Merge.
When using the "fast" option, TChain::Merge do not unzip nor unstream
the content of the TTress but copy directly the raw bytes of the baskets
from one file to another.
Revision
12957 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Oct 14 10:50:22 2005 UTC (9 years, 3 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 57668 byte(s)
Diff to
previous 12955
Implement possibility to reset the circularity in a TTree.
in function : void TTree::SetCircular(Long64_t maxEntries)
// Enable/Disable circularity with this Tree
// if maxEntries > 0 a maximum of maxEntries is kept in one buffer/basket
// per branch in memory.
// Note that when this function is called (maxEntries>0) the Tree
// must be empty or having only one basket per branch.
// if maxEntries <= 0 the tree circularity is disabled.
//
// NOTE 1:
// Circular Trees are interesting in online real time environments
// to store the results of the last maxEntries events.
// NOTE 2:
// Calling SetCircular with maxEntries <= 0 is necessary before
// merging circular Trees that have been saved on files.
// NOTE 3:
// SetCircular with maxEntries <= 0 is automatically called
// by TChain::Merge
// NOTE 4:
// A circular Tree can still be saved in a file. When read back,
// it is still a circular Tree and can be filled again.
Also added the following functionality:
//in case the Tree was originally created in gROOT, the branch
//compression level was set to -1. If the Tree is now associated to
//a file, reset the compression level to the file compression level
In TChain::Merge, the Tree circularity is automatically reset
to permit the merge of circular TTrees saved to a file.
Revision
12955 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Oct 13 19:58:27 2005 UTC (9 years, 3 months ago) by
pcanal
Original Path:
trunk/tree/src/TChain.cxx
File length: 57589 byte(s)
Diff to
previous 12911
TChain::FindBranch and TChain::FindLeaf now properly call their
counterpart in the interlying TTree object (fTree) instead of the
inherited version.
This results in TTree::Draw properly looking at the friend of
both the underlying TTree object and the TChain object (instead
of just the TChain object).
Revision
12911 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Oct 6 19:20:42 2005 UTC (9 years, 3 months ago) by
pcanal
Original Path:
trunk/tree/src/TChain.cxx
File length: 57504 byte(s)
Diff to
previous 12846
The name of the new tree created in TChain::Merge is now set to the name of the chain
__without__ the potential directory name. Added comments on how to reproduce
the directory structure of the input files.
Revision
12825 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Sep 23 13:04:53 2005 UTC (9 years, 4 months ago) by
rdm
Original Path:
trunk/tree/src/TChain.cxx
File length: 56427 byte(s)
Diff to
previous 12812
From Andreas:
here are my modifications to interface the Grid file catalog
(AliEn in this case) with TChain data sets. Some changes are just
one-liner changes to make some base class things virtual or to set
some members. With these changes one can do:
// connect
TGrid::Connect("alien://");
// query
TGridResult* result = gGrid->Query("/alice/cern.ch/user/p/peters/analysis/miniesd/","*.root","","");
or
TGridResult* result = gGrid->Query("/alice/cern.ch/user/p/peters/analysis/miniesd/","*.root","","-l 50"); // to query maximum 50 files
result->Print(""); // or result->Print("l") or result->Print("all"); => Tells you also the complete size of the TDSet (the ALICE one is 68 GB)
// build chain for ALICE files
TChain* mychain = new TChain("esdTree","AliceSession");
// Get a list of FileInfo Objects
// -> I cannot use directly a list of FileInfo objects in TGridResult,
// because TGridResult can be also a list of jobs etc ....
TList* list = result->GetFileInfoList()
// add them to a chain
mychain->AddFileInfoList(list); // adds all
mychain->AddFileInfoList(list,10); // adds only the first 10
// to use PROOF then, you need to do
mychain->Lookup(); // open's all files via TAlienFile over
the redirector and replaces the
alien URL with the physical location
of the file on the cluster
(including the access token)
mychain->SetProof();
mychain->Draw("ESD.fTrigger");
Revision
12722 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Sep 16 08:48:39 2005 UTC (9 years, 4 months ago) by
rdm
Original Path:
trunk/tree/src/TChain.cxx
File length: 54677 byte(s)
Diff to
previous 12284
From Gerri:
Big patch supporting query queueing on the PROOF master, interogation and
interaction with the queue. Retrieval, finalization and archival of query
results and multiple PROOF sessions. Some other fixes:
- TMacro.h, .cxx
add method Checksum to get the MD5 of the current context
(needed for optimized selector reinitialization)
- Changes needed to create and fill the list of data sets (TROOT,
TDSet, TChain, TChainProof)
- A new method TSelector::IsStandardDraw() to check if a selector
is for standard draw actions
- TEventIter: fix for the missing last update (see above)
- Few protections in TPacketizers destructors
- Fix for code conventions in TPerfStats (the other will follow)
- Occasional missing last update of the progress bar (systematically
reproduced with SetParallel(1)): all this part is quite involved
and I have found a solution which does not harm but perhaps is not
the most elegant.
- SetParallel(0): the progress bar was not working at all in such a
case, since no packetizer is involved. Still it is useful to see
that things are not stuck, so I have added some progress messages
there too. The problem is that I have not found a way to get the total
number of entries from a data set without doing all the machinery
done in the packetizer.
Revision
11786 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri May 13 16:26:40 2005 UTC (9 years, 8 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 51625 byte(s)
Diff to
previous 11740
From Philippe:
This patch repairs the tutorials treefriend.C.
In particular it solves a problem introduced by the locking mechanism
preventing infinitie recursions in the treatement of the Tree Friend.
The previous implementation was used only one lock for all methods
recursing through the friend (thus 2 unrelated methods were locking
each other out). The new implementation uses a different lock for
each methods. This new implementation also solves Thomas Bretz's
issue (http://root.cern.ch/root/roottalk/roottalk05/1020.html).
Revision
11740 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri May 6 08:57:45 2005 UTC (9 years, 8 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 51595 byte(s)
Diff to
previous 11715
From Philippe:
In TTree, improve the lookup of the alias of a leaf when we have a circular
list of friends.
In TChain, insure that the sub-tree of the chain which is a friend are
properly update in the current tree even if there was additional friends
added since the last TChain::LoadTree was executed.
Revision
11681 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Apr 28 07:29:24 2005 UTC (9 years, 8 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 51340 byte(s)
Diff to
previous 11590
From Philippe:
This patch solves a couple of issue with chains friends when the
chains were also manipulated on their own (some cached TTree pointers
were not refreshed properly).
We now fully support nested and recursive friends.
To support recursive friends, we introduced TTree::TFriendLock which
is used to set and reset the kFriendLock bit in the TTree (or TChain)
object once it has been seen during a recursion handling nested
friends. Hence each objects is guaranteed to best used only once.
The current implementation is not yet thread safe but it would be
straightforward to add it (and then we should also use the same
lock in AddFriend).
Revision
11393 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Mar 21 16:20:56 2005 UTC (9 years, 10 months ago) by
rdm
Original Path:
trunk/tree/src/TChain.cxx
File length: 50828 byte(s)
Diff to
previous 11281
change name of TProofChain to TChainProof, this class does not directly
belong to PROOF but it provides a chain proxy that runs on PROOF.
To compile you need to clean *.d's that reference the old file. To find these
files do: rm `find . -name \*.d -exec grep -l TProofChain {} \;`
Revision
11281 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Mar 10 17:57:05 2005 UTC (9 years, 10 months ago) by
rdm
Original Path:
trunk/tree/src/TChain.cxx
File length: 50829 byte(s)
Diff to
previous 11152
From Marek Biskup:
major new PROOF developments:
- access to PROOF directly via the TChain interface (creating a TDSet
in the background).
- access to PROOF based trees via the TTreeViewer
- fully implemented the TChain/TDSet::Draw() interface.
- PROOF sessions can now be browsed via the TBrowser
Revision
10983 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jan 25 17:05:16 2005 UTC (10 years ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 47510 byte(s)
Diff to
previous 10898
From Marco van Leeuwen:
I've made some small modifications (see attachment) to TChain::LoadTree(), which enables a TChain to skip corrupted files while looping to a chain. My modifications are in fact a simple extension of Philippe Canals fix for empty files,.
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/TChain.cxx
File length: 47317 byte(s)
Diff to
previous 10757
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
10757 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Dec 11 08:26:45 2004 UTC (10 years, 1 month ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 46412 byte(s)
Diff to
previous 10438
Implement TChain::LoasBaskets
// This function overrides TTree::LoadBaskets and is dummy.
// It could be implemented and load all baskets of all trees in the chain.
// For the time being use TChain::Merge and TTree::LoadBasket
// on the resulting tree.
Revision
10438 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Oct 31 09:28:06 2004 UTC (10 years, 2 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 45969 byte(s)
Diff to
previous 9851
Add an optional argument to TChain::AddFile.
By default the chain loads a Tree from the file having the name
specified in the Tree constructor. If the argument is specified,
it will override the default.
Revision
9851 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Aug 27 11:23:40 2004 UTC (10 years, 4 months ago) by
rdm
Original Path:
trunk/tree/src/TChain.cxx
File length: 45711 byte(s)
Diff to
previous 9615
From Philippe:
this patch corrects the calculation of the TreeOffset when
adding a chain to a chain. The previous implementation
ended up adding kBigNumber together, resulting in incorrect
values for fEntryOffset (and thus for fEntries).
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/TChain.cxx
File length: 45593 byte(s)
Diff to
previous 9275
*****************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
8353 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Mar 9 21:17:06 2004 UTC (10 years, 10 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 44488 byte(s)
Diff to
previous 8340
From Philippe:
With this updates, TChain handles more elegantly the case where
one of the tree is 'missing' (i.e. could not open the file, TTree
not present in the file, etc.).
Instead of just failing (and doing a bad job at error recovery),
we set up the TreeOffset in such a way that the missing tree is
counted as an empty tree.
In particular, this allows the perfect usage of a chain with a
missing tree.
Revision
7273 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Sep 12 15:54:16 2003 UTC (11 years, 4 months ago) by
rdm
Original Path:
trunk/tree/src/TChain.cxx
File length: 43651 byte(s)
Diff to
previous 7153
new TString::MaybeWildcard() that returns true if a filename contains
a wildcard character: []*?
Use MaybeWildcard() in TChain::Add() instead of TString::MaybeRegexp()
which tested if a file contained any regexp character: ^$.[]*+?
Revision
7153 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Aug 25 17:31:42 2003 UTC (11 years, 5 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 43665 byte(s)
Diff to
previous 7111
From Philippe:
This patch solves 2 problems.
If a simple tree was made the friend of a chain, the simple tree was loaded using the 'entry in the tree (inside the
chain)' instead of the 'entry in the chain'. This resulted in ONLY the first part of the simple tree to be used (over
and over again)!
TTree::Scan (Query and CopyTree) could not handle the case where a TChain was made a friend of a TTree (and problably
more cases of uneven length chain friends). This was
because, it never detected that a new file was open since it only looked a the main Tree (and none of its friend). In
consequence the formula were not updated when they should.
Revision
7005 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jul 25 17:41:37 2003 UTC (11 years, 6 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 42576 byte(s)
Diff to
previous 6990
m Philippe:
TChain::Add was broken since the latest improvement to the
regular expression. Now it seems that:
c = new TChain("T2");
c->Add("event.root/T");
is taken has a regular expression. This would have been 'okay' if it was
not for the fact that the regular expression par of TChain::Add never
supported the '/treename' syntax. In addition, if (and only if) a path was
specified then the filename had to end with '.root' (if the path was not
specified the filename could end in anything the user wanted!).
This patch fix those problems (and add support for any file name length!)
Revision
6990 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jul 22 16:12:32 2003 UTC (11 years, 6 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 42434 byte(s)
Diff to
previous 6974
Implement a new function:
void TChain::CanDeleteRefs(Bool_t flag)
when closing a file during the chain processing, the file
may be closed with option "R" if flag is set to kTRUE.
by default flag is kTRUE.
When closing a file with option "R", all TProcessIDs referenced by this
file are deleted.
Calling TFile::Close("R") might be necessary in case one reads a long list
of files having TRef, writing some of the referenced objects or TRef
to a new file. If the TRef or referenced objects of the file being closed
will not be referenced again, it is possible to minimize the size
of the TProcessID data structures in memory by forcing a delete of
the unused TProcessID.
Revision
6848 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jul 7 21:08:24 2003 UTC (11 years, 6 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 41567 byte(s)
Diff to
previous 6839
From Philippe;
This patch adds support in the new tree cloning scheme for
TTree *clone = chain->GetTree()->CloneTree(0);
If chain is really a TChain, need to make sure that it keeps track of the clones even when the tree that was
actually cloned is deleted by LoadTree.
Revision
6838 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Jul 6 19:41:49 2003 UTC (11 years, 6 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 41107 byte(s)
Diff to
previous 6824
From Philippe:
This patch comments the fact after TTree::CloneTree and until the original is deleted, the addresses of the original
are passed on to all the clones. Also the addresses of the clones are reset when the original is deleted.
This patch also simplify the implementation of TChain::Merge to take advantage of the new TTree::CloneTree feature.
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/TChain.cxx
File length: 42684 byte(s)
Diff to
previous 6805
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
6805 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jun 30 15:45:52 2003 UTC (11 years, 6 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 41661 byte(s)
Diff to
previous 6773
From Philippe:
The following patch implements TTree variable alias.
To use them:
mytree->SetAlias("mult","fPx*fPy");
mytree->Draw("mult");
Note that the aliases have been added to the TTree object so that they can be persistent (with the tree) if you choose.
Also note that the alias are not checked for validity until they are used in a Draw or Scan command.
Existing alias are silently replaced.
The new functions are:
TTree::SetAlias
TTree::GetAlias
TChain::GetAlias
TTree::GetListOfAliases
This patch also adds operator= for TFormula, TF1, TF2, TF3 (it calls the respective Copy member functions). It makes TTreeFormula::operator= private (Copy has not been implemented yet).
Also some of the TFormula and TTreeFormula codes (those stored in fOper) has been aliased to enums (this renders the code is little bit more readable and searchable).
TFormula and TTreeFormula have been updated to handle strings in a more flexible (and for TTreeFormula to be able to return them).
Revision
6263 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Mar 6 23:07:06 2003 UTC (11 years, 10 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 39970 byte(s)
Diff to
previous 5902
From Philippe;
This patch corrects 2 problems.
The first one is one where the list of friends of a tree of a chain was not properly updated if the friend was added after the tree was
loaded (i.e c->LoadTree(); c->AddFriend(); ).
The second one was a failure of TTreeFormula to request (sometime) the proper entry of a branch if this branch was part of a friends of a
chain where the tree where uneven in lenght(but the 2 chains were of the same length).
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/TChain.cxx
File length: 39097 byte(s)
Diff to
previous 5544
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
4893 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Jul 13 11:35:52 2002 UTC (12 years, 6 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 40679 byte(s)
Diff to
previous 4827
Add a new function
TChain::SetAutoDelete(Bool_t autodelete=kTRUE).
This function can be called to set the branch AutoDelete flag
when a new Tree is loaded by LoadTree.
Add new comments in GetBranch, GetLeaf.
Revision
4827 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Jul 6 06:54:35 2002 UTC (12 years, 6 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 41421 byte(s)
Diff to
previous 4773
From Philippe
This patch solves an ownership problem (friend chains on the stack were
delete), it also fix a problem with refreshing the pointer to the leaf
when the leaf was accessed using a tree-alias name. It also enables the
befriending of chains contains series of trees of unequal size (in
parallel).
It also re-enable using string (char*) store into a TClonesArray using a
TTree::Draw command (in the current version it was reading repetitively
the string of the 1st element).
Revision
4773 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jun 25 05:47:51 2002 UTC (12 years, 7 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 39822 byte(s)
Diff to
previous 4710
Fixes by Philippe to support Tree friends with TChains.
Still some limitations.The chains have to have a list of file
which have (in parallel) the same number of event. (This is because
(for now) the length of each tree is compared with the other trees).
Also I did not test saving and reloading chains with friend.
Revision
4131 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Feb 28 17:07:07 2002 UTC (12 years, 10 months ago) by
rdm
Original Path:
trunk/tree/src/TChain.cxx
File length: 37934 byte(s)
Diff to
previous 4126
cast fEntries to int to remove warning in calling LoadTree() in GetEntries().
Also return Double_t instead of Stat_t (although equivalent) to be in sync
with TTree which returns a Double_t. Brought kBigNumber in TChain scope
(and is now automatically available via CINT).
Revision
3852 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Feb 3 17:32:27 2002 UTC (12 years, 11 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 37255 byte(s)
Diff to
previous 3707
New functions GetWeight and SetWeight redefining the functions in TTree.
void TChain::SetWeight(Double_t w, Option_t *option)
{
// Set chain weight.
// The weight is used by TTree::Draw to automatically weight each
// selected entry in the resulting histogram.
// For example the equivalent of
// chain.Draw("x","w")
// is
// chain.SetWeight(w,"global");
// chain.Draw("x");
//
// By default the weight used will be the weight
// of each Tree in the TChain. However, one can force the individual
// weights to be ignored by specifying the option "global".
// In this case, the TChain global weight will be used for all Trees.
Double_t TChain::GetWeight() const
{
// return the chain weight.
// by default, the weight is the weight of the current Tree in the TChain.
// However, if the weight has been set in TChain::SetWeight with
// the option "global", each Tree will use the same weight stored
// in TChain::fWeight.
Revision
3707 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Jan 19 11:04:41 2002 UTC (13 years ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 35944 byte(s)
Diff to
previous 3702
Add a new function TTree::GetEntriesFast. In case of a Tree,
both GetEntries and GetEntriesFast return directly fEntries.
In case of a TChain, GetEntries will force the read of the Tree headers
in all the files to get the number of entries and set the table of offsets.
The new function GetEntriesFast is used internally by TChain
or TTreePlayer to make sure that the TChain files are processed
only once in a given query.
TTreePlayer::MakeStats has been modified to call GetEntriesFast
instead of GetEntries.
These changes make the new functionality of TChain::Add backward compatible.
Revision
3695 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jan 18 11:32:13 2002 UTC (13 years ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 35995 byte(s)
Diff to
previous 3664
Change the default option for nentries when calling TChain::Add
The previous default (-1) is changed to 1000000000.
TChain::Add modified to support the new default. By default
the file is not opened when calling TChain::Add
Int_t TChain::Add(const char *name, Int_t nentries)
// A- if nentries <= 0, the file is connected and the tree header read
// in memory to get the number of entries.
//
// B- if (nentries > 0, the file is not connected, nentries is assumed to be
// the number of entries in the file. In this case, no check is made that
// the file exists and the Tree existing in the file. This second mode
// is interesting in case the number of entries in the file is already stored
// in a run data base for example.
//
// C- if (nentries == 1000000000) (default), the file is not connected.
// the number of entries in each file will be read only when the file
// will need to be connected to read an entry.
// This option is the default and very efficient if one process
// the chain sequentially. Note that in case TChain::GetEntry(entry)
// is called and entry refers to an entry in the 3rd file, for example,
// this forces the Tree headers in the first and second file
// to be read to find the number of entries in these files.
// Note that if one calls TChain::GetEntries() after having created
// a chain with this default, GetEntries will return 1000000000!
// One can force the Tree headers of all the files to be read
// by calling TChain::GetEntry(bigentry) with bigentry greater than
// the first entry number of the last file, eg 999999999.
// To compute the number of entries in a chain built with this option, do:
// chain.GetEntry(999999999);
// chain.GetEntries();
Revision
3404 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Dec 5 21:07:52 2001 UTC (13 years, 1 month ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 32708 byte(s)
Diff to
previous 3384
in TChain::Merge, add support for automatic file overflow:
When merging many files, it may happen that the resulting file
reaches a size > fgMaxMergeSize (default = 1.9 GBytes). In this case
the current file is automatically closed and a new file started.
If the name of the merged file was "merged.root", the subsequent files
will be named "merged_1.root", "merged_2.root", etc.
fgMaxMergeSize may be modified via the static function SetMaxMergeSize.
The function Merge returns the total number of files generated.
Revision
2860 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Sep 26 09:43:08 2001 UTC (13 years, 4 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 30126 byte(s)
Diff to
previous 2833
In TChain::Merge, remove the statement file->cd() to permit writing
to a subdirectory of file.
To write to a subdirectory, the user has to open the output file, create a subdir,
cd(subdir) and call TChain::Merge(TFile *file..
Revision
2666 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Aug 11 08:27:40 2001 UTC (13 years, 5 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 29328 byte(s)
Diff to
previous 2635
In the TChain destructor, do not delete fFile. The file will be delete by fFiles->Delete().
fFile might have been deleted already in some cases, eg by the code generated by MakeClass
when the objects are created on the stack.
Revision
2391 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Jun 7 08:56:05 2001 UTC (13 years, 7 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 29190 byte(s)
Diff to
previous 2058
In TChain::Addfile remove the limitation that the file name must contain
the string ".root". ".root" is necessary only in case one wants to specify
a Tree in a subdirectory of a Root file with eg, the format:
//machine/file_name.root/subdir/tree_name
Revision
1291 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Dec 26 14:22:46 2000 UTC (14 years, 1 month ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 26070 byte(s)
Diff to
previous 1205
Add new function TChain::Add(TChain *chain) to add an existing chain to
the chain.
Modify function TChain::Add(const char *name,..) to support wildcarding.
One can do:
chain.Add("xxx*.root");
to add all files starting with xxx in the current directory.
The TChain::Add functions call internally a new function TChain::AddFile.
The TChain::Add functions return an Int_t with the number of files
effectively connected to the TChain.
Implement TChain::Fill() as a dummy function with an error message to prevent
filling an existing chain.
TChain::ls reports the number of entries for each chain element.
TChain::Print invokes TTree::Print for each chain element.
Revision
1205 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Dec 13 15:13:57 2000 UTC (14 years, 1 month ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 22771 byte(s)
Diff to
previous 985
W A R N I N G !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
==================================================================
A very long list of changes in this pre-release of version 3.00.
We have modified the signature of many functions (in particular TObject)
to introduce more constness in the system.
You must change your code if your class derives from TObject and uses
one of the modified functions such as ls, Print, Compare, Hash, etc.
The modified functions in TObject have the following signature:
virtual TObject *Clone() const;
virtual Int_t Compare(const TObject *obj) const;
virtual void Delete(Option_t *option=""); // *MENU*
virtual void DrawClass() const; // *MENU*
virtual void DrawClone(Option_t *option="") const; // *MENU*
virtual void Dump() const; // *MENU*
virtual TObject *FindObject(const TObject *obj) const;
virtual char *GetObjectInfo(Int_t px, Int_t py) const;
virtual ULong_t Hash() const;
virtual void Inspect() const; // *MENU*
virtual Bool_t IsEqual(const TObject *obj) const;
virtual void ls(Option_t *option="") const;
virtual void Print(Option_t *option="") const;
A similar operation has been done with classes such as TH1, TVirtualPad,
TTree, etc.
Revision
382 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jul 17 10:26:41 2000 UTC (14 years, 6 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 22624 byte(s)
Diff to
previous 367
TTree.h, TChain
=======
New data member TString fProcessOption in the class TTree
This string contains the option passed to TTree::Process.
The option can be queried by TTree::GetProcessOption.
New function Int_t TTree::GetChainEntryNumber(Int_t entry)
This function returns directly entry
New function Int_t TChain::GetChainEntryNumber(Int_t entry)
This function returns the absolute entry number in the chain
corresponding to the local TTree entry number entry.
The TTree::Process functions have a new optional argument Option_t (option.
same for TChain::Process, TVirtualTreePlayer and TTreePlayer
TSelector, TSelectorCint
=========
Add new functions
virtual Bool_t ExecuteNotify();
virtual Bool_t Notify() {return kTRUE;}
ExecuteNotify calls the user class function Notify when
TTree::Process starts the first entry in a file of a chain.
TTreePlayer
===========
Implememt the logic to call the new functions TSelector::ExecuteNotify
Revision
346 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jul 10 06:17:57 2000 UTC (14 years, 6 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 21903 byte(s)
Diff to
previous 318
Implement the new function TTree::Process and the corresponding function(s)
in TTreePlayer.
The main function in TTreePlayer is
TTreePlayer::Process(TSelector *selector, Int_t nentries, Int_t firstentry)
This new function exploits the new class TSelector to initialize, select,
analyze and terminate the user code referenced by the selector.
This function is now called by
TTreePlayer::Process(const char *filename, Int_t nentries, Int_t firstentry)
The code in the class derived from TSelector may be interpreted or compiled.
Revision
318 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jul 3 10:11:04 2000 UTC (14 years, 6 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 21927 byte(s)
Diff to
previous 223
The following functions have their signature changed from void to Int_t
The TTree::Draw, Fit, Process, Project and Scan functions returns the number
of selected events.
virtual Int_t Draw(TCut varexp, TCut selection, Option_t *option=""
,Int_t nentries=1000000000, Int_t firstentry=0);
virtual Int_t Draw(const char *varexp, const char *selection, Option_t *option=""
,Int_t nentries=1000000000, Int_t firstentry=0); // *MENU*
virtual Int_t Fit(const char *funcname ,const char *varexp, const char *selection="",Option_t *option="" ,Option_t *goption=""
,Int_t nentries=1000000000, Int_t firstentry=0); // *MENU*
virtual Int_t Process(const char *filename, Option_t *option=""
,Int_t nentries=1000000000, Int_t firstentry=0); // *MENU*
virtual Int_t Project(const char *hname, const char *varexp, const char *selection="", Option_t *option=""
,Int_t nentries=1000000000, Int_t firstentry=0);
virtual Int_t Scan(const char *varexp="", const char *selection="", Option_t *option=""
,Int_t nentries=1000000000, Int_t firstentry=0); // *MENU*
The function TTree::Process is a new function:
// The code in filename is loaded (interpreted or compiled , see below)
// filename must contain a valid class implementation derived from TTreeProcess.
// where TTreeProcess has the following member functions:
// void TTreeProcess::Begin(). This function is called before looping on the
// events in the Tree. The user can create his histograms in this function.
//
// Bool_t TTreeProcess::Select(Int_t entry). This function is called
// before processing entry. It is the user's responsability to read
// the corresponding entry in memory (may be just a partial read).
// The function returns kTRUE if the entry must be processed,
// kFALSE otherwise.
// void TTreeProcess::Analyze(Int_t entry). This function is called for
// all selected events. User fills histograms in this function.
// void TTreeProcess::Finish(). This function is called at the end of
// the loop on all events.
//
// if filename is of the form file.C, the file will be interpreted.
// if filename is of the form file.C++, the file file.C will be compiled
// and dynamically loaded. The corresponding binary file and shared library
// will be deleted at the end of the function.
// if filename is of the form file.C+, the file file.C will be compiled
// and dynamically loaded. The corresponding binary file and shared library
// will be kept at the end of the function. At next call, if file.C
// is older than file.o and file.so, the file.C is not compiled, only
// file.so is loaded.
//
// The function returns the number of processed entries. It returns -1
// in case of an error.
The correesponding modifications have been made in TChain, TVirtualTreePlayer
and TTreePlayer
Revision
122 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jun 13 09:27:08 2000 UTC (14 years, 7 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 21267 byte(s)
Diff to
previous 91
- Mods in all the tree classes to reflect the changes from Float_t to Double_t
in the graphics and histogram classes. The TLeaf::GetValue in particular
are now of type Double_t.
TTree::GetMaximum, GetMinimum return a Double_t.
TChain::GetMaximum, GetMinimum return a Double_t.
TTree::GetV1, GetV2 and GetV3 return a Double_t* instead of a Float_t*.
Revision
91 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Jun 8 08:02:02 2000 UTC (14 years, 7 months ago) by
brun
Original Path:
trunk/tree/src/TChain.cxx
File length: 21264 byte(s)
Diff to
previous 3
- Fix a problem in TChain::LoadTree.
When a entry is asked which is not available in all the trees of
the chain (i.e. entryNumber > chain.GetEntries() ), the LoadTree() function
deletes the currently file opened and returns an error code. That's perfect,
but when deleting the file the "fFile" pointer is not set to 0, therefore
in the destructor of the class
if (fFile) delete fFile;
calls the TFile destructor a second time generating a SEGV
(Thanks Manuel Sanchez for reporting)
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.