// -*- mode: c++ -*- /////////////////////////////////////////////////////////////////////// // // // BrDataTable // // // // BRAMS data container class. Raw data and the results of // // calibration and reconstruction operations are stored in // // BrDataTable objects, which in turn are managed and // // stored using the BrEvent class. // // // // Author : Kris Hagel from a template by Gunther Roland // // Created : July 13 1997 // // Version : 1.0 // // Changed : // // // /////////////////////////////////////////////////////////////////////// // // $Id: BrDataTable.h,v 1.2 2001/06/25 14:23:50 cholm Exp $ // $Author: cholm $ // $Date: 2001/06/25 14:23:50 $ // #ifndef BRAT_BrDataTable #define BRAT_BrDataTable // Root Classes #include "TObjArray.h" #include "TBrowser.h" // BRAHMS Classes #include "BrDataObject.h" class BrDataTable : public BrDataObject { public: BrDataTable(); BrDataTable(const Char_t *Name, const Char_t *Title = NULL); virtual ~BrDataTable(); virtual void Add(TObject *object); virtual void AddAt(TObject *object,Int_t idx); virtual TObjArray* GetObjectList() { return fObjectList; } Int_t Entries() { if(fObjectList) return fObjectList->GetEntries();else return 0; } Int_t GetEntries() const {if(fObjectList) return fObjectList->GetLast()+1; else return 0; } BrDataTable* At(Int_t i) const { return (BrDataTable*)fObjectList->At(i); } virtual Bool_t IsTable() const {return kTRUE;} void Sort(Int_t upto) {fObjectList->Sort(upto);} void Sort() {if(fObjectList)fObjectList->Sort(Entries());} void Clear() {if(fObjectList)fObjectList->Clear();} void Delete() {if(fObjectList)fObjectList->Delete();} void Remove(TObject *obj) {if(fObjectList)fObjectList->Remove(obj);} void RemoveAt(Int_t i) {if(fObjectList)fObjectList->RemoveAt(i);} void Compress() {if(fObjectList)fObjectList->Compress();} void DeleteAndCompress(TObject* obj); void DeleteAndCompressAt(Int_t i); void DeleteObject(TObject* obj); void DeleteObjectAt(Int_t i); virtual void SetOwner(Bool_t e=kTRUE) { #if ROOT_VERSION_CODE >= ROOT_VERSION(2,25,3) fObjectList->SetOwner(e); #endif } virtual Bool_t IsFolder(void) const { return kTRUE; } virtual void Browse(TBrowser* b); virtual void Print(Option_t* option="R") const; //*MENU* //BrDataTable operator + () const; BrDataTable& operator+=(const BrDataTable&); protected: TObjArray *fObjectList; // List of objects stored in container private: friend BrDataTable operator+(const BrDataTable& table1, const BrDataTable& table2); public: ClassDef(BrDataTable, 1) // BRAHMS data container class }; #endif //////////////////////////////////////////////////////////////////// // // $Log: BrDataTable.h,v $ // Revision 1.2 2001/06/25 14:23:50 cholm // packages/ // // Revision 1.1.1.1 2001/06/21 14:54:58 hagel // Initial revision of brat2 // // Revision 1.15 2001/06/01 15:46:15 cholm // Fixed creation id class to be more clean. Now sets the user name // (if avaliable) has a Print method. // PRint method in BrDataObject. // Print method in BrDataTable // Print method in BrEvent // Print method in BrEventNode // // Revision 1.14 2001/05/28 15:33:40 pchristi // Small changes. Added const methods to container. Added new tablenames. // Updated and added delete methods to BrDataTable. // // Revision 1.13 2000/10/04 11:09:59 cholm // Fix of method SetOwner not in pre ROOT 2.25/03 // // Revision 1.12 2000/10/03 19:29:43 cholm // Made IsFolder() const (since it is in TObject) which was needed for the // objects to be browsable. Aslo, as of ROOT version 2.25.02 there's a list // of special objects, which BrEventIO now is added to. Some doc to // BrEventNode::Clear() added! Added method BrEventNode::SetOwner(). // Christian Holm // // Revision 1.11 2000/06/03 18:17:03 videbaek // Changed inheritance of BrIOModule. Added utility to // BrDataObject.. See Update message for more info // // Revision 1.10 2000/04/13 00:01:57 cholm // Added methods for browsing BrEvents, either directly or via // a BrEventIO. Also added method GetROOTFile to BrEventIO. // // Revision 1.9 1999/09/13 21:06:44 videbaek // Modify constructor to deal properly with Title param // // Revision 1.8 1999/05/12 16:22:20 hagel // Implemented + , =+ and = operators for BrEventNode. These will be // useful for adding events together. Has been tested for single // pion events and seems to work. In the course of implementing this, // several conflicts with const were identified. These were cleaned // up by adding appropriate consts where needed. It was checked that // it did not break other things. // // Revision 1.7 1999/04/28 15:19:58 hagel // Benevolent changes to make more interchangable with TObjArray // // Revision 1.6 1999/04/25 20:35:34 hagel // Added RemoveAt and Compress methods // // Revision 1.5 1999/03/07 00:00:41 hagel // Revision 1.4 1999/01/21 23:23:18 hagel // 1. Changed convention for checking includes. Current convention is: // BRAT_Br...... eg BRAT_BrModule ala ROOT. // 2. Added CVS logs to .h files that didn't have them. // 3. Moved checking of include definition to first line for easier // reading // 4. Put checks before all includes in the include files as per BRAT // specifications // 5. Added BrGeantHeader to Geant Makefile // 6. All changes have been checked to compile on NT ala Cygnus // // Revision 1.3 1998/03/26 23:31:48 hagel // Added GetEntries to same as Entries // // Revision 1.2 1998/03/09 20:53:32 videbaek // Ensure that pointers are non-NULL before deleting // // Revision 1.1.1.1 1998/03/04 21:32:49 brahmlib // Brat base // //