_HADES_CLASS_DESCRIPTION HCategory (ABC) The HCategory class is an abstract base class. So the real work is made by the derived classes. These derived classes correspond to different strategies to store the data objects in memory and in file. The classes derived from HCategory can also indicate the way they want to be stored in a Root tree (the TBranch layout), for that purpose the makeBranch() function can be overloaded. A HCategory encapsulates one category of data; that is one kind of data (mdc raw data,rich rings...), and it is responsible of giving the user access to the objects held by that category. The category is also able to hold one header with common information for all the objects in the category. The class provides functions to access the objects in the category: Each data object in the category is stored in a particular location (see HLocation), so to access an object you must give its location and use the method: getObject(HLocation &aLoc). This method returns one only object, if you want a collection with all the objects corresponding to a particular location (i.e, all the raw data in the second chamber of the first sector...) then use query(TCollection *col,HLocation &aLoc) with col being the collection where to store the result. You can also iterate on all the objects in the category or the objects corresponding to a particular location using the HIterator created by MakeIterator() or MakeReverseIterator() The category is also responsible of allocating new objects, this can be done through the functions getSlot(HLocation &aLoc) and getNewSlot(HLocation &aLoc) which return a place in memory where to allocate the new object (a slot) corresponding to the location aLoc. The strategy of letting the HCategory to manage the memory has the advantage that it allows the category to have the memory preallocated. Example: { HLocation loc; //Allocates loc pointing to a location HMdcRaw *raw; //Declaration of a pointer to a TObject HCategory *cat; //Pointer to a generic category //loc is set to point to the location (2,2,1); this could be something //like: sector 2, mdc 2, plane 1. loc.set(3,2,2,1); //Ask for the slot at location "loc" and stores its address in raw //if there is not such a slot, the getSlot() method will return NULL raw=cat->getSlot(loc); //If we have a valid slot (raw!=NULL) then allocate a new object of //class HMdcRaw at the addres given by raw using the operator //"new with placement" if (raw!=NULL) raw=new(raw) HMdcRaw; } Each category can be persistent or not; so if it's persistent it will be stored in the output file (if any) and if it's not, then it won't be stored in the output file. To control the persistency of a category the setPersistency() method is provided Here follows a description of the common methods every class inherited from HCategory provides: TObject *&getNewSlot(HLocation &aLoc) Returns a memory slot for location aLoc where you can place a new object aLoc gives the indexes for the location of the new object except the last one. So the function returns the first empty slot in aLoc. TObject *&getSlot(HLocation &aLoc) The same as before, but now aLoc gives the complete location of the new object TObject *getObject(HLocation &aLoc) Returns the object at the location aLoc TClonesArray *getClones(HLocation &aLoc) Returns a clones array with the objects corresponding to the HLocation aLoc. Bool_t query(TCollection *aCol,HLocation &aLoc,HFilter &aFilter) Adds to aCol all objects in the category corresponding to the location aLoc and passing the filter aFilter. There are also functions without aFilter or without aLoc Bool_t filter(HLocation &aLoc,HFilter &aFilter) Bool_t filter(HFilter &aFilter) The same as before but now the objects not verifying the conditions are deleted off the category
HCategory() | |
HCategory(const HCategory&) | |
virtual | ~HCategory() |
void | TObject::AbstractMethod(const char* method) const |
virtual void | activateBranch(TTree* tree, Int_t splitLevel) |
virtual void | TObject::AppendPad(Option_t* option = "") |
virtual void | TObject::Browse(TBrowser* b) |
static TClass* | Class() |
virtual const char* | TObject::ClassName() const |
virtual void | Clear(Option_t* opt = "") |
virtual TObject* | TObject::Clone(const char* newname = "") const |
virtual Int_t | TObject::Compare(const TObject* obj) const |
virtual void | TObject::Copy(TObject& object) const |
virtual void | TObject::Delete(Option_t* option = "")MENU |
virtual Int_t | TObject::DistancetoPrimitive(Int_t px, Int_t py) |
virtual void | TObject::Draw(Option_t* option = "") |
virtual void | TObject::DrawClass() constMENU |
virtual TObject* | TObject::DrawClone(Option_t* option = "") constMENU |
virtual void | TObject::Dump() constMENU |
virtual void | TObject::Error(const char* method, const char* msgfmt) const |
virtual void | TObject::Execute(const char* method, const char* params, Int_t* error = 0) |
virtual void | TObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0) |
virtual void | TObject::ExecuteEvent(Int_t event, Int_t px, Int_t py) |
virtual void | TObject::Fatal(const char* method, const char* msgfmt) const |
virtual Bool_t | filter(HFilter& aFilter) |
virtual Bool_t | filter(HLocation& aLoc, HFilter& aFilter) |
virtual TObject* | TObject::FindObject(const char* name) const |
virtual TObject* | TObject::FindObject(const TObject* obj) const |
Int_t | getBranchingLevel() |
Cat_t | getCategory() |
TObject* | getCatHeader() |
virtual TClass* | getClass() |
virtual const Text_t* | getClassName() |
virtual Option_t* | TObject::GetDrawOption() const |
static Long_t | TObject::GetDtorOnly() |
virtual Int_t | getEntries() |
virtual const char* | TObject::GetIconName() const |
virtual Int_t | getIndex(HLocation& loc) |
virtual Int_t | getIndex(TObject* pObj) |
virtual const char* | TObject::GetName() const |
virtual TObject*& | getNewSlot(HLocation& aLoc, Int_t* pIndex = 0) |
virtual TObject* | getObject(HLocation& aLoc) |
virtual TObject* | getObject(Int_t index) |
virtual char* | TObject::GetObjectInfo(Int_t px, Int_t py) const |
static Bool_t | TObject::GetObjectStat() |
virtual Option_t* | TObject::GetOption() const |
virtual TObject*& | getSlot(HLocation& aLoc, Int_t* pIndex = 0) |
virtual const char* | TObject::GetTitle() const |
virtual UInt_t | TObject::GetUniqueID() const |
virtual Bool_t | TObject::HandleTimer(TTimer* timer) |
virtual ULong_t | TObject::Hash() const |
virtual void | TObject::Info(const char* method, const char* msgfmt) const |
virtual Bool_t | TObject::InheritsFrom(const char* classname) const |
virtual Bool_t | TObject::InheritsFrom(const TClass* cl) const |
virtual void | TObject::Inspect() constMENU |
void | TObject::InvertBit(UInt_t f) |
virtual TClass* | IsA() const |
virtual Bool_t | TObject::IsEqual(const TObject* obj) const |
virtual Bool_t | IsFolder() const |
Bool_t | TObject::IsOnHeap() const |
Bool_t | IsPersistent() |
virtual Bool_t | isSelfSplitable() |
virtual Bool_t | TObject::IsSortable() const |
Bool_t | TObject::IsZombie() const |
virtual void | TObject::ls(Option_t* option = "") const |
virtual void | makeBranch(TBranch* parent) |
virtual TIterator* | MakeIterator(Option_t* opt = "catIter", Bool_t dir = kIterForward) |
TIterator* | MakeReverseIterator() |
void | TObject::MayNotUse(const char* method) const |
virtual Bool_t | TObject::Notify() |
static void | TObject::operator delete(void* ptr) |
static void | TObject::operator delete(void* ptr, void* vp) |
static void | TObject::operator delete[](void* ptr) |
static void | TObject::operator delete[](void* ptr, void* vp) |
void* | TObject::operator new(size_t sz) |
void* | TObject::operator new(size_t sz, void* vp) |
void* | TObject::operator new[](size_t sz) |
void* | TObject::operator new[](size_t sz, void* vp) |
HCategory& | operator=(const HCategory&) |
virtual void | TObject::Paint(Option_t* option = "") |
virtual void | TObject::Pop() |
virtual void | TObject::Print(Option_t* option = "") const |
virtual Bool_t | query(TCollection* aCol, HFilter& aFilter) |
virtual Bool_t | query(TCollection* aCol, HLocation& aLoc) |
virtual Bool_t | query(TCollection* aCol, HLocation& aLoc, HFilter& aFilter) |
virtual Int_t | TObject::Read(const char* name) |
virtual void | TObject::RecursiveRemove(TObject* obj) |
void | TObject::ResetBit(UInt_t f) |
virtual void | TObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU |
virtual void | TObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "") |
void | TObject::SetBit(UInt_t f) |
void | TObject::SetBit(UInt_t f, Bool_t set) |
void | setBranchingLevel(Int_t nLevel) |
void | setCategory(Cat_t aCat) |
void | setCatHeader(TObject* fObj) |
virtual void | TObject::SetDrawOption(Option_t* option = "")MENU |
static void | TObject::SetDtorOnly(void* obj) |
static void | TObject::SetObjectStat(Bool_t stat) |
void | setPersistency(Bool_t per) |
virtual void | TObject::SetUniqueID(UInt_t uid) |
virtual void | ShowMembers(TMemberInspector& insp, char* parent) |
virtual void | sort() |
virtual void | Streamer(TBuffer& b) |
void | StreamerNVirtual(TBuffer& b) |
virtual void | TObject::SysError(const char* method, const char* msgfmt) const |
Bool_t | TObject::TestBit(UInt_t f) const |
Int_t | TObject::TestBits(UInt_t f) const |
virtual void | TObject::UseCurrentStyle() |
virtual void | TObject::Warning(const char* method, const char* msgfmt) const |
virtual Int_t | TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) |
virtual Int_t | TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const |
virtual void | TObject::DoError(int level, const char* location, const char* fmt, va_list va) const |
void | TObject::MakeZombie() |
enum TObject::EStatusBits { | kCanDelete | |
kMustCleanup | ||
kObjInCanvas | ||
kIsReferenced | ||
kHasUUID | ||
kCannotPick | ||
kNoContextMenu | ||
kInvalidObject | ||
}; | ||
enum TObject::[unnamed] { | kIsOnHeap | |
kNotDeleted | ||
kZombie | ||
kBitMask | ||
kSingleKey | ||
kOverwrite | ||
kWriteDelete | ||
}; |
If a category generates its own branches in a different way than that provided with HTree::makeBranch (see isSelfSplitable()) then it must override the makeBranch function as well as the activateBranch function.. The activate branch is intended to activate those branches in the TTree tree whose names correspond to the names of the branches that would be created by makeBranch() in this category. To do such a thing the Root methods: TTree::SetBranchAddress() and TTree::SetBranchStatus() need to be called. As a default activateBranch() does nothing
Sets the branching level. The branching level is directly related with the number of indexes needed to identify an object in the category (the number of indexes in the object's location). For example, in the HMatrixCategory those two numbers are equal; however in HSplitCategory the branching level is equal to the number of indexes needed to unambiguosly identify an object in the category minus 1.
Returns the branching level for this category. The branching level is directly related with the number of indexes needed to identify an object in the category (the number of indexes in the object's location). For example, in the HMatrixCategory those two numbers are equal; however in HSplitCategory the branching level is equal to the number of indexes needed to unambiguosly identify an object in the category minus 1.