00001 // $Id: TGo4CompositeEvent.h 815 2011-12-02 16:34:08Z linev $ 00002 //----------------------------------------------------------------------- 00003 // The GSI Online Offline Object Oriented (Go4) Project 00004 // Experiment Data Processing at EE department, GSI 00005 //----------------------------------------------------------------------- 00006 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH 00007 // Planckstr. 1, 64291 Darmstadt, Germany 00008 // Contact: http://go4.gsi.de 00009 //----------------------------------------------------------------------- 00010 // This software can be used under the license agreements as stated 00011 // in Go4License.txt file which is part of the distribution. 00012 //----------------------------------------------------------------------- 00013 00014 #ifndef TGO4COMPOSITEEVENT_H 00015 #define TGO4COMPOSITEEVENT_H 00016 00017 #include "TGo4EventElement.h" 00018 00019 class TObjArray; 00020 class TTree; 00021 00023 class TGo4CompositeEvent : public TGo4EventElement { 00024 protected: 00025 00027 Short_t fNElements; 00028 00030 TObjArray *fEventElements; 00031 00033 Short_t fMaxIndex; 00034 00035 public: 00036 TGo4CompositeEvent(); 00037 TGo4CompositeEvent(const char* aName, const char* aTitle, Short_t aBaseCat=0); 00038 virtual ~TGo4CompositeEvent(); 00039 00040 virtual TGo4EventElement* GetChild(const char* name); 00041 00042 void makeBranch(TBranch *parent); 00043 00044 virtual Int_t activateBranch(TBranch *branch, Int_t init = 0, TGo4EventElement** var_ptr = 0); 00045 00046 virtual void deactivate(); 00047 virtual void activate(); 00048 00049 Bool_t addEventElement(TGo4EventElement* aElement, Bool_t reading = kFALSE); 00050 00051 TGo4EventElement *getEventElement(Int_t idx); 00052 TGo4EventElement *getEventElement(const char* name,Int_t final=0); 00053 void Clear(Option_t *opt=""); 00054 Short_t getNElements() const { return fNElements; } 00055 Short_t getMaxIndex() const { return fMaxIndex; } 00056 virtual Bool_t isComposed() { return kTRUE; } 00057 TObjArray* getElements() { return fEventElements;} 00058 TObjArray* getListOfComposites(Bool_t toplevel=kTRUE); 00059 TGo4EventElement& operator[]( Int_t i ); 00060 00061 protected: 00062 00063 void ProvideArray(); 00064 00065 00066 ClassDef(TGo4CompositeEvent,2) 00067 }; 00068 00069 #endif