#include "hordclonesarray.h" #include "TROOT.h" #include "TClass.h" #include "assert.h" //-- Author : Denis Bertini //-- Modified : 19/09/00 by D. Bertini // //*************************************************************************// // This Class allows the TClonesArray to create sub-sets of HDataObjects // when filling its structure. This is done creating an additionnal ptr-array // like structure for a special bookeeping of TObject* pointers (bkeep* array) // according the sub-sets defined in the HOrdCategory. // Overloaded Methods : // // TClonesArray::operator[](int); // TClonesArra::Clear(); // //*************************************************************************// ClassImp(HOrdClonesArray) HOrdClonesArray::HOrdClonesArray() : TClonesArray(){ currentLevel=0; } HOrdClonesArray::HOrdClonesArray( Int_t nLevel, Int_t* sizes, const Char_t *classname, Int_t s, Bool_t b, Int_t flag): TClonesArray(classname,s,b) { currentLevel=0; maxSize=1; #if DEBUG_LEVEL>0 Warning("HOrdClonesArray()"," class name%s",classname); #endif for (Int_t i=0;iDelete(); delete bKeep[i]; bKeep[i]=0; } delete bKeep; bKeep=0; } } void HOrdClonesArray::createPtrArray(void){ bKeep = new TObjArray* [maxSize]; for(Int_t i=0; i0 printf("nb of object in Clones==> \ ndataobj:%i idx:%i getlast:%i \n", fNDataObjects, idx,GetLast()+1); #endif update(currentLevel); return obj; } void HOrdClonesArray::Clear(){ TObjArray::Clear(); currentLevel=0; // remove ptr from substructure for(Int_t i=0; i0 Warning("Clear","sub array contents ===> :%i \n", bKeep[i]->GetEntriesFast()); #endif bKeep[i]->Clear(); } }