| #include "KanTreeBase.hh" |
KanTreeBase
class description - source file - inheritance tree (.pdf)
private:
KanTreeBase(const KanTreeBase& other)
virtual TFriendElement* AddFriend(const char* treename, const char* filename)
virtual TFriendElement* AddFriend(const char* treename, TFile* file)
virtual TFriendElement* AddFriend(TTree* tree, const char* alias, Bool_t warn = kFALSE)
virtual TTree* CloneTree(Long64_t nentries, Option_t* opt)
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)
protected:
KanTreeBase(const char* collName, KanCompMap::Index idx, Dna::Scope scope)
KanTreeBase(const char* name, const char* title, Dna::Scope scope, Int_t splitLevel, Int_t tid)
UShort_t addWriteObject(KanBranch& obj)
void attachObjects()
void fillMaps() const
KanPersistable* findObjByBid(UShort_t bid) const
KanBranch* findOwnerByBid(UShort_t bid) const
UShort_t replaceWriteObject(KanBranch& obj, UShort_t bid)
void setCollectionName(const Char_t* collName)
void setEventReader(KanEventReader& eR)
void setEventWriter(KanEventWriter& eW)
void setNextFile(const char* next)
virtual void setup(KanTreeBase* meta)
public:
KanTreeBase()
virtual ~KanTreeBase()
virtual TFriendElement* addFriend(KanTreeBase& aTree)
Int_t addWriteObject(KanBranch& owner, const char* branchName, Bool_t replace = kFALSE, Int_t bufSize = 32*Kan::kiloByte(), Int_t split = 0)
const char* collectionName() const
KanEventReader* eventReader() const
bool eventReaderSet() const
KanEventWriter* eventWriter() const
bool eventWriterSet() const
virtual Int_t Fill()
KanPersistable* findObj(UShort_t bid, UShort_t oid) const
void getMasterBranches(KanTreeBase::NameAndBranchList& masterList) const
KanPersistable* getObj(UShort_t bid, UShort_t oid)
Int_t getReadObject(const char* branchName, KanBranch*& owner)
KanTreeBase* getTree(Dna::Scope sc) const
Bool_t isLastTree() const
virtual Long64_t LoadTree(Long64_t entry)
virtual KanTreeBase* metaDataTree() const
const TString& nextFile() const
const TObjArray& objects() const
virtual void print(ostream& os = std::cout) const
Dna::Scope scope() const
UShort_t tid() const
Bool_t writeDone() const
private:
KanEventReader* _reader ! The reader used by this tree
KanEventWriter* _writer ! The writer used by this tree
Bool_t _ready ! Are the BranchVector and BranchIdMap ready
vector<pair<KanBranch*,KanPersistable*>,allocator<pair<KanBranch*,KanPersistable*> > > _ownVect ! Vector of KanBranch / KanPersistable pairs
map<const KanBranch*,unsigned short,less<const KanBranch*>,allocator<pair<const KanBranch* const,unsigned short> > > _ownMap ! Map from owner object -> bid
string _collectionName ! The name of the collection
Dna::Scope _scope The scope of this tree
UShort_t _tid This tree's id;
TString _nextFile The File with the successor to this tree
TObjArray _objects Persistent List of Master Obbjects
This sub-class of TTree implements some special functionality for Kanga
and provides an interface for adding/getting Kanga objects to/from TTrees.
On writing the interface is:
aKanTreeBase->addWriteObject(aKanBranch,"BranchName");
This will create a new branch (and it's sub-branches) on the tree
On reading the interfaces is:
KanBranch* branchPtr(0);
aKanTreeBase->getReadObject("BranchName",branchPtr)
branchPtr will be set to the address used by ROOT to read in the
KanBranch object
KanTreeBase also manages part of the persistent object look up from KanID:
aKanTreeBase->findObj(UShort_t bid, UShort_t oid)
will return the object with id TreeID:bid:oid for the current event,
if that object has already by read in
aKanTreeBase->getObj(UShort_t bid, UShort_t oid)
will return the object with id TreeID:bid:oid for the current event,
and will acutally read the branch if the object has not been read yet
KanTreeBase() //
KanTreeBase(const char* name, KanCompMap::Index idx,
Dna::Scope scope)
:TTree(makeTreeName(idx,scope).c_str(),"BaBar ROOT Tree"),
KanBranchOwner(),
_reader(0),
_writer(0),
_ready(kTRUE),
_collectionName(name),
_scope(scope),
_tid(idx),
_objects()
standard c'tor, builds a TTree with name, title and splitlevel
KanTreeBase(const char* name, const char* title,
Dna::Scope scope, Int_t splitLevel, Int_t tid)
:TTree(name, title,splitLevel),
KanBranchOwner(),
_reader(0),
_writer(0),
_ready(kTRUE),
_collectionName("not a collection"),
_scope(scope),
_tid(tid),
_objects()
standard c'tor, builds a TTree with name, title and splitlevel
~KanTreeBase()
d'tor
void getMasterBranches(NameAndBranchList& masterList) const
Int_t getReadObject(const char* branchName, KanBranch*& owner)
Int_t addWriteObject(KanBranch& owner,const char* branchName,
Bool_t replace,
Int_t bufSize, Int_t split)
make cache for writing
void print(ostream& os) const
KanPersistable* findObj(UShort_t bid, UShort_t oid) const
find the branch id for an object
KanPersistable* getObj(UShort_t bid, UShort_t oid)
find the branch id for an object
void setEventReader(KanEventReader& eR)
set the registry for this tree,
void setEventWriter(KanEventWriter& eW)
set the registry for this tree,
Long64_t LoadTree(Long64_t entry)
override of TTree::LoadTree();
Int_t Fill()
TFriendElement* addFriend(KanTreeBase& aTree)
Bool_t writeDone() const
KanPersistable* findObjByBid(UShort_t bid) const
KanBranch* findOwnerByBid(UShort_t bid) const
UShort_t addWriteObject(KanBranch& owner)
Add a branch object to the index map in the registry
UShort_t replaceWriteObject(KanBranch& owner, UShort_t bid)
Add a branch object to the index map in the registry
void fillMaps() const
void attachObjects()
Inline Functions
const TObjArray& objects() const
KanEventReader* eventReader() const
bool eventReaderSet() const
KanEventWriter* eventWriter() const
bool eventWriterSet() const
Dna::Scope scope() const
UShort_t tid() const
KanTreeBase* getTree(Dna::Scope sc) const
Bool_t isLastTree() const
const TString& nextFile() const
KanTreeBase* metaDataTree() const
const char* collectionName() const
void setNextFile(const char* next)
void setCollectionName(const Char_t* collName)
void setup(KanTreeBase* meta)
KanTreeBase KanTreeBase(const KanTreeBase& other)
TFriendElement* AddFriend(const char* treename, const char* filename)
TFriendElement* AddFriend(const char* treename, TFile* file)
TFriendElement* AddFriend(TTree* tree, const char* alias, Bool_t warn = kFALSE)
TTree* CloneTree(Long64_t nentries, Option_t* opt)
Long64_t CopyEntries(TTree* tree, Long64_t nentries = -1)
TTree* CopyTree(const char* selection, Option_t* option, Long64_t nentries = 1000000000, Long64_t firstentry = 0)
Author: E. Charles
Last update: KanTreeBase.cc,v 1.32 2004/11/10 19:11:04 gowdy Exp $
Copyright (C) 2003 LBNL
ROOT page - Class index - Class Hierarchy - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.
|