111 fFromBranches( from ? from->GetListOfLeaves()->GetEntries()+1 : 0),
112 fToBranches( to ? to->GetListOfLeaves()->GetEntries()+1 : 0),
128 if (opt.
Contains(
"sortbasketsbybranch")) {
131 }
else if (opt.
Contains(
"sortbasketsbyentry")) {
153 from ? from->
GetName() :
"no tree");
159 fWarningMsg.
Form(
"The output TTree (%s) must be associated with a directory.",
166 fWarningMsg.
Form(
"The output TTree (%s) must be associated with a directory (%s) that is in a file.",
174 fWarningMsg.
Form(
"The output TTree (%s) must be associated with a writable file (%s).",
177 fWarningMsg.
Form(
"The output TTree (%s) must be associated with a writable directory (%s in %s).",
258 if (nb != fnb && (nb == 0 || fnb == 0)) {
261 fWarningMsg.
Form(
"The export branch and the import branch do not have the same split level. (The branch name is %s.)",
271 fWarningMsg.
Form(
"The export branch and the import branch do not have the same streamer type. (The branch name is %s.)",
287 fWarningMsg.
Form(
"The export branch and the import branch (%s) do not have the same number of leaves (%d vs %d)",
295 for (
Int_t i=0;i<nb;i++) {
299 if (toleaf_gen->IsA() != fromleaf_gen->IsA() ) {
301 fWarningMsg.
Form(
"The export leaf and the import leaf (%s.%s) do not have the data type (%s vs %s)",
416 fWarningMsg.
Form(
"One of the export top level branches (%s) is not present in the import TTree.",
424 fWarningMsg.
Form(
"One of the export sub-branches (%s) is not present in the import TTree.",
466 for(
UInt_t i=0,bi=0; i<len; ++i) {
563 while ((key = (
TKey*)next())) {
564 if (!strcmp(key->GetClassName(),
"TProcessID")) {
573 for (
Int_t i=0;i<npids;i++) {
584 snprintf(name,32,
"ProcessID%d",npids);
588 Info(
"WriteProcessID",
"name=%s, file=%s", name, tofile->
GetName());
590 if (dirsav) dirsav->
cd();
594 Error(
"CopyProcessIDs",
"Copied %s from %s might already exist!\n",
758 if (frombasket && frombasket->
GetNevBuf()>0) {
Describe Streamer information for one class version.
virtual Bool_t cd(const char *path=0)
Change current directory to "this" directory.
TTreeCloner(const TTreeCloner &)=delete
Int_t ReadBasketBytes(Long64_t pos, TFile *file)
Read basket buffers in memory and cleanup.
virtual void SetMaximum(Char_t max)
virtual const char * GetName() const
Returns name of object.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
A TLeaf for an 8 bit Integer data type.
UInt_t * fBasketIndex
[fMaxBaskets] ordered list of basket indices to be written.
Long64_t * GetBasketEntry() const
void ImportClusterRanges()
Set the entries and import the cluster range of the.
void RestoreCache()
Restore the TFileCacheRead to its previous value.
Long64_t * fBasketEntry
[fMaxBaskets] list of basket start entries.
friend class CompareEntry
TObjArray * GetListOfBaskets()
Int_t FlushOneBasket(UInt_t which)
If we have a write basket in memory and it contains some entries and has not yet been written to disk...
A cache when reading files over the network.
void WriteBaskets()
Transfer the basket from the input file to the output file.
virtual void SetMinimum(Int_t min)
virtual void SetCacheRead(TFileCacheRead *cache, TObject *tree=0, ECacheAction action=kDisconnect)
Set a pointer to the read cache.
Bool_t TestBit(UInt_t f) const
virtual void SetMaximum(Bool_t max)
virtual void SetMinimum(Long64_t min)
virtual Int_t GetMaximum() const
virtual const char * GetTypeName() const
Long64_t fToStartEntries
Number of entries in the target tree before any addition.
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist...
TObjArray * GetListOfProcessIDs() const
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
virtual Int_t GetMaximum() const
void ForceWriteInfo(TFile *file, Bool_t force=kFALSE)
Recursively mark streamer infos for writing to a file.
virtual Int_t GetMinimum() const
TBranch * fBranchCount
Branch with clones count.
void ToLower()
Change string to lower-case.
virtual void Prefetch(Long64_t pos, Int_t len)
Add block of length len at position pos in the list of blocks to be prefetched.
A TLeaf for a bool data type.
ROOT::NewFunc_t GetNew() const
TObject * At(Int_t idx) const
virtual void SetMinimum(Bool_t min)
A TLeaf for a variable length string.
virtual Int_t GetMinimum() const
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
void SetBranch(TBranch *branch)
virtual void SetMaximum(Short_t max)
virtual Int_t GetMaximum() const
virtual TObjArray * GetListOfBranches()
virtual Int_t GetMaximum() const
Int_t * GetBasketBytes() const
virtual void SetMinimum(Char_t min)
void ImportClusterRanges(TTree *fromtree)
Appends the cluster range information stored in 'fromtree' to this tree, including the value of fAuto...
virtual Bool_t IsWritable() const
virtual void SetLen(Int_t len=1)
Int_t fMaximum
Maximum entries for a TClonesArray or variable array.
Bool_t IsLoaded() const
Return true if the shared library of this class is currently in the a process's memory.
void CloseOutWriteBaskets()
Before we can start adding new basket, we need to flush to disk the partially filled baskets (the Wri...
virtual Int_t GetMinimum() const
void Info(const char *location, const char *msgfmt,...)
Long64_t fFlushedBytes
Number of auto-flushed bytes.
TObjArray * GetListOfBranches()
TBasket * GetBasket(Int_t basket)
Return pointer to basket basketnumber in this Branch.
void SortBaskets()
Sort the basket according to the user request.
Book space in a file, create I/O buffers, to fill them, (un)compress them.
A TProcessID identifies a ROOT job in a unique way in time and space.
TFileCacheRead * fPrevCache
Cache that set before the TTreeCloner ctor for the 'from' TTree if any.
void Error(const char *location, const char *msgfmt,...)
virtual TFile * GetFile() const
virtual TTree * GetTree() const
virtual void IncrementProcessIDs()
virtual void AddLastBasket(Long64_t startEntry)
Add the start entry of the write basket (not yet created)
virtual void IncrementPidOffset(UShort_t offset)
Increment fPidOffset by 'offset'.
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
TVirtualStreamerInfo * FindStreamerInfo(TObjArray *arr, UInt_t checksum) const
Find the TVirtualStreamerInfo in the StreamerInfos corresponding to checksum.
UInt_t GetCheckSum() const
virtual void SetEntries(Long64_t entries)
Set the number of entries in this branch.
void CopyProcessIds()
Make sure that all the needed TStreamerInfo are present in the output file.
void CopyStreamerInfos()
Make sure that all the needed TStreamerInfo are present in the output file.
virtual void SetMinimum(Short_t min)
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual Int_t GetMinimum() const
Int_t GetWriteBasket() const
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Int_t IncrementCount()
Increase the reference count to this object.
TFile * GetCurrentFile() const
Return pointer to the current file.
Manages buffers for branches of a Tree.
The ROOT global object gROOT contains a list of all defined classes.
virtual TList * GetStreamerInfoList()
Read the list of TStreamerInfo objects written to this file.
virtual TBranchRef * GetBranchRef() const
void Warning(const char *location, const char *msgfmt,...)
Bool_t operator()(UInt_t i1, UInt_t i2)
virtual Int_t GetLenStatic() const
A Branch for the case of an object.
virtual Long64_t GetBasketSeek(Int_t basket) const
Return address of basket in the file.
void CreateCache()
Create a TFileCacheRead if it was requested.
virtual void SetMaximum(Long64_t max)
UInt_t CollectBranches()
Fill the array of branches, matching the branches of the 'from' and 'to' TTrees Returns the total num...
Bool_t Exec()
Execute the cloning.
TObject * UncheckedAt(Int_t i) const
virtual Int_t GetMaximum() const
virtual Int_t GetMinimum() const
UInt_t * fBasketNum
[fMaxBaskets] index of the basket within the branch.
Long64_t GetCacheAutoSize(Bool_t withDefault=kFALSE) const
Used for automatic sizing of the cache.
Bool_t operator()(UInt_t i1, UInt_t i2)
Describe directory structure in memory.
TDirectory * GetDirectory() const
virtual Int_t GetBufferSize() const
UInt_t FillCache(UInt_t from)
Fill the file cache with the next set of basket.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
UShort_t fPidOffset
Offset to be added to the copied key/basket.
TObjArray * GetListOfLeaves()
TFileCacheRead * fFileCache
File Cache used to reduce the number of individual reads.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
virtual Long64_t GetEntries() const
UInt_t fCloneMethod
Indicates which cloning method was selected.
void SetCacheSize(Int_t size)
Set the TFile cache size to be used.
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
virtual TBranch * BranchRef()
Build the optional branch supporting the TRefTable.
UInt_t * fBasketBranchNum
[fMaxBaskets] Index of the branch(es) of the basket.
Int_t GetClassVersion() const
A TLeaf for a 16 bit Integer data type.
virtual void SetMaximum(Int_t max)
Long64_t GetEntries() const
virtual void SetMinimum(Int_t min)
Class implementing or helping the various TTree cloning method.
virtual Bool_t cd(const char *path=0)
Change current directory to "this" directory.
A Branch for the case of an array of clone objects.
virtual TList * GetListOfKeys() const
virtual Int_t GetMaximum() const
virtual Int_t GetNProcessIDs() const
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
virtual void AddBasket(TBasket &b, Bool_t ondisk, Long64_t startEntry)
Add the basket to this branch.
A TLeaf for a 64 bit Integer data type.
Int_t GetEntries() const
Return the number of objects in array (i.e.
Bool_t fNeedConversion
True if the fast merge is not possible but a slow merge might possible.
TFileCacheRead * GetCacheRead(TObject *tree=0) const
Return a pointer to the current read cache.
virtual void AddLast(TObject *obj)
Add object in the next empty slot in the array.
A TTree object has a header with a name and a title.
TString fWarningMsg
Text of the error message lead to an 'invalid' state.
Long64_t CopyTo(TFile *to)
Copy the basket of this branch onto the file to.
virtual Int_t GetMinimum() const
virtual TFile * GetFile(Int_t mode=0)
Return pointer to the file where branch buffers reside, returns 0 in case branch buffers reside in th...
virtual Long64_t SetEntries(Long64_t n=-1)
Change number of entries in the tree.
A TTree is a list of TBranches.
virtual void SetMaximum(Int_t max)
Long64_t * fBasketSeek
[fMaxBaskets] list of basket position to be read.
virtual ~TTreeCloner()
TTreeCloner destructor.
void CopyMemoryBaskets()
Transfer the basket from the input file to the output file.
void CollectBaskets()
Collect the information about the on-file basket that need to be copied.
TBranch * GetMother() const
Get our top-level parent branch in the tree.
A TLeaf for an Integer data type.
Int_t fCacheSize
Requested size of the file cache.
Int_t LoadBasketBuffers(Long64_t pos, Int_t len, TFile *file, TTree *tree=0)
Load basket buffers in memory without unziping.
const char * Data() const