// -*- mode: c++ -*- // $Id: BrEventNode.h,v 1.4 2001/08/21 16:15:21 cholm Exp $ // /////////////////////////////////////////////////////////////////////// // // // BrEventNode // // // // Brahms event class // // // // BrEventNode manages access to the raw and reconstructed data // // for one event branch in the BRAT environment. // // environment // // // // Author : F.Videbaek // // Created : // // Version : 1.0 // // Changed : 2/24/1998 // // // // // // // /////////////////////////////////////////////////////////////////////// #ifndef BRAT_BrEventNode #define BRAT_BrEventNode #include "TBrowser.h" #include "TNamed.h" #include "THashTable.h" #include "TObjArray.h" #include "BrDataObject.h" #include "BrDataTable.h" class BrEvent; class BrEventNode : public BrDataObject { public: BrEventNode(); BrEventNode(const Char_t* Name, const Char_t* Title = NULL); BrEventNode(const BrEventNode &node); //copy constructor virtual ~BrEventNode(); //Enable and Disable Verbose mode. Diagnostice out put occurs //at each call of the Event memebr functions. virtual Int_t AddObject(BrDataObject* Object); virtual Int_t AddDataTable(BrDataTable* table); virtual Int_t AddEventNode(BrEventNode* node); virtual void Browse(TBrowser* b); virtual void Clear(Option_t* o=""); virtual void Copy(BrEventNode &eventnode); virtual BrDataTable* GetDataTable(const Char_t *ObjectName) const; virtual BrEventNode* GetEventNode(const Char_t *NodeName) const; virtual BrDataObject* GetObject(const Char_t *ObjectName) const; virtual TObjArray* GetObjectList() const {return fObjectList;} virtual Bool_t IsNode() const {return kTRUE;} virtual Bool_t IsFolder(void) const {return kTRUE; } virtual void ListObjects() const; // *MENU* virtual void RemoveDataObject(BrDataObject *object); virtual void SetOwner(Bool_t e=kTRUE); virtual void SetVerbose(Int_t i) { fVerbose = i;} virtual void Print(Option_t* option="R") const; //*MENU* //BrEventNode operator + () const; BrEventNode& operator +=(const BrEventNode&); BrEventNode& operator=(const BrEventNode &rhs); // idem BrEventNode& operator=(const BrEvent &rhs); // idem private: void CheckList(); // Check that list exists. TObjArray* fObjectList; // List of data objects Int_t fVerbose; //! Controls debugging and monitoring output friend BrEventNode &operator+(const BrEventNode& node1, const BrEventNode& node2); public: ClassDef(BrEventNode,1) // BRAHMS event data class }; //____________________________________________________________________ inline Int_t BrEventNode::AddDataTable(BrDataTable *table) { return AddObject(table); } //____________________________________________________________________ inline Int_t BrEventNode::AddEventNode(BrEventNode *node) { return AddObject(node); } //____________________________________________________________________ inline void BrEventNode::SetOwner(Bool_t e) { #if ROOT_VERSION_CODE >= ROOT_VERSION(2,25,3) CheckList(); fObjectList->SetOwner(e); #endif } // $Log: BrEventNode.h,v $ // Revision 1.4 2001/08/21 16:15:21 cholm // Added method CheckLis for on-demand allocation, and moved inline // methods out of the class declaration. // // Revision 1.3 2001/08/08 21:52:08 hagel // Eliminate memory leak by creating on demand fObjectList and fEventHeader // // Revision 1.2 2001/06/25 14:24:04 cholm // packages/ // // Revision 1.1.1.1 2001/06/21 14:54:58 hagel // Initial revision of brat2 // // Revision 1.18 2001/06/01 15:46:24 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.17 2001/04/14 17:31:16 videbaek // Moved cvs log to end`:wq // // Revision 1.16 2000/10/04 11:10:07 cholm // Fix of method SetOwner not in pre ROOT 2.25/03 // // Revision 1.15 2000/10/03 19:29:46 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.14 2000/06/15 14:16:49 alv // Made more of the Get-methods const member functions // // Revision 1.13 2000/04/13 00:01:59 cholm // Added methods for browsing BrEvents, either directly or via // a BrEventIO. Also added method GetROOTFile to BrEventIO. // // Revision 1.12 2000/01/06 16:02:58 videbaek // Added method RemoveDataObject(object) // // Revision 1.11 1999/09/13 21:06:45 videbaek // Modify constructor to deal properly with Title param // // Revision 1.10 1999/06/01 20:38:41 hagel // Added GetEventNode(...) // // Revision 1.9 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 const's where needed. // It was checked that it did not break other things. // // Revision 1.8 1999/01/21 23:23:19 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.7 1998/08/20 14:20:17 hagel // Add Copy method + clean up // // Revision 1.6 1998/08/14 21:26:23 videbaek // Some cleanup mods // // Revision 1.5 1998/08/05 15:40:15 hagel // Add Clear to BrEventNode // // Revision 1.4 1998/07/28 16:41:12 hagel // Add GetObjectList() to BrEventNode.h // // Revision 1.3 1998/04/06 21:11:48 videbaek // Clean up and additions for Win95 // // #endif