#ifndef ROOT_TTreeCloner
#define ROOT_TTreeCloner
#ifndef ROOT_TObjArray
#include "TObjArray.h"
#endif
#include <vector>
#ifdef R__OLDHPACC
namespace std {
using ::string;
using ::vector;
}
#endif
class TBranch;
class TTree;
class TTreeCloner {
TString fWarningMsg;
Bool_t fIsValid;
Bool_t fNeedConversion;
UInt_t fOptions;
TTree *fFromTree;
TTree *fToTree;
Option_t *fMethod;
TObjArray fFromBranches;
TObjArray fToBranches;
UInt_t fMaxBaskets;
UInt_t *fBasketBranchNum;
UInt_t *fBasketNum;
Long64_t *fBasketSeek;
Long64_t *fBasketEntry;
UInt_t *fBasketIndex;
UShort_t fPidOffset;
UInt_t fCloneMethod;
Long64_t fToStartEntries;
enum ECloneMethod {
kDefault = 0,
kSortBasketsByBranch = 1,
kSortBasketsByOffset = 2,
kSortBasketsByEntry = 3
};
class CompareSeek {
TTreeCloner *fObject;
public:
CompareSeek(TTreeCloner *obj) : fObject(obj) {}
bool operator()(UInt_t i1, UInt_t i2);
};
class CompareEntry {
TTreeCloner *fObject;
public:
CompareEntry(TTreeCloner *obj) : fObject(obj) {}
bool operator()(UInt_t i1, UInt_t i2);
};
friend class CompareSeek;
friend class CompareEntry;
void ImportClusterRanges();
public:
enum EClonerOptions {
kNone = 0,
kNoWarnings = BIT(1),
kIgnoreMissingTopLevel = BIT(2)
};
TTreeCloner(TTree *from, TTree *to, Option_t *method, UInt_t options = kNone);
virtual ~TTreeCloner();
void CloseOutWriteBaskets();
UInt_t CollectBranches(TBranch *from, TBranch *to);
UInt_t CollectBranches(TObjArray *from, TObjArray *to);
UInt_t CollectBranches();
void CollectBaskets();
void CopyMemoryBaskets();
void CopyStreamerInfos();
void CopyProcessIds();
const char *GetWarning() const { return fWarningMsg; }
Bool_t Exec();
Bool_t IsValid() { return fIsValid; }
Bool_t NeedConversion() { return fNeedConversion; }
void SortBaskets();
void WriteBaskets();
ClassDef(TTreeCloner,0);
};
#endif