class HCategory: public TObject

_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


Function Members (Methods)

public:
HCategory()
HCategory(const HCategory&)
virtual~HCategory()
voidTObject::AbstractMethod(const char* method) const
virtual voidactivateBranch(TTree* tree, Int_t splitLevel)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidClear(Option_t* opt = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual Bool_tfilter(HFilter& aFilter)
virtual Bool_tfilter(HLocation& aLoc, HFilter& aFilter)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
Int_tgetBranchingLevel()
Cat_tgetCategory()
TObject*getCatHeader()
virtual TClass*getClass()
virtual const Text_t*getClassName()
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual Int_tgetEntries()
virtual const char*TObject::GetIconName() const
virtual Int_tgetIndex(HLocation& loc)
virtual Int_tgetIndex(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_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
virtual TObject*&getSlot(HLocation& aLoc, Int_t* pIndex = 0)
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tIsFolder() const
Bool_tTObject::IsOnHeap() const
Bool_tIsPersistent()
virtual Bool_tisSelfSplitable()
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTObject::ls(Option_t* option = "") const
virtual voidmakeBranch(TBranch* parent)
virtual TIterator*MakeIterator(Option_t* opt = "catIter", Bool_t dir = kIterForward)
TIterator*MakeReverseIterator()
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::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 voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTObject::Print(Option_t* option = "") const
virtual Bool_tquery(TCollection* aCol, HFilter& aFilter)
virtual Bool_tquery(TCollection* aCol, HLocation& aLoc)
virtual Bool_tquery(TCollection* aCol, HLocation& aLoc, HFilter& aFilter)
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidsetBranchingLevel(Int_t nLevel)
voidsetCategory(Cat_t aCat)
voidsetCatHeader(TObject* fObj)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
static voidTObject::SetObjectStat(Bool_t stat)
voidsetPersistency(Bool_t per)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidsort()
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()

Data Members

public:
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
Int_tfBranchingLevelNumber of levels for the data in the category
Cat_tfCatIdentifier for this category
TObject*fHeaderCategory header.
Bool_tfPersistency! Indicates whether this category is stored in output.

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

HCategory(const HCategory& )
Default constructor
~HCategory(void)
Destructor.
void activateBranch(TTree* tree, Int_t splitLevel)
 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
void setBranchingLevel(Int_t nLevel)
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.
void setCategory(Cat_t aCat)
Sets the identifier for this particular category
Cat_t getCategory(void)
Returns the identifier of this particular category
Int_t getBranchingLevel(void)
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.
Bool_t IsPersistent(void)
Returns kTRUE if the category is persistent and kFALSE if it is not.
void setPersistency(Bool_t per)
 Sets the persistency of the category

 Input:
   per=kTRUE  --> The category is persistent
   per=kFALSE --> The category is not persistent.
Bool_t IsFolder(void)
TIterator * MakeReverseIterator(void)
Makes an HIterator which iterates backwards
Bool_t query(TCollection *aCol,HFilter &aFilter)
 Stores in the collection aCol pointers to all the objects in the category
verifying the condition given by the filter aFilter.

 Returns kTRUE if everything works Ok, kFALSE in other case
Bool_t query(TCollection *aCol,HLocation &aLoc)
 Stores in the collection aCol pointers to all the objects in the category
corresponding to the location aLoc.

 Returns kTRUE if everything works Ok, kFALSE in other case
Bool_t query(TCollection* aCol, HLocation& aLoc, HFilter& aFilter)
 Stores in the collection aCol pointers to all the objects in the category
verifying the condition given by the filter aFilter and corresponding to
the location aLoc

 Returns kTRUE if everything works Ok, kFALSE in other case.
const Text_t * getClassName(void)
void makeBranch(TBranch* parent)
TObject *& getNewSlot(HLocation& aLoc, Int_t* pIndex = 0)
TObject *& getSlot(HLocation& aLoc, Int_t* pIndex = 0)
TObject * getObject(HLocation &aLoc)
Bool_t filter(HFilter& aFilter)
Bool_t filter(HLocation& aLoc, HFilter& aFilter)
void Clear(Option_t* opt = "")
Bool_t isSelfSplitable(void)
TIterator * MakeIterator(Option_t* opt = "catIter", Bool_t dir = kIterForward)
void Streamer(TBuffer& b)
 Stream an object of class HCategory.
HCategory(const HCategory& )
void setCatHeader(TObject* fObj)
{fHeader=fObj;}
TObject * getCatHeader(void)
{return fHeader;}
TClass * getClass(void)
  virtual TClass *getClass(void) {};
{return NULL;}
TObject * getObject(HLocation &aLoc)
Int_t getIndex(HLocation& loc)
{return -1;}
Int_t getIndex(TObject* pObj)
{return -1;}
Int_t getEntries()
{return 0;}
void sort(void)
{}

Last change: Sat May 22 12:53:46 2010
Last generated: 2010-05-22 12:53

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.