00001 // $Id: TGo4EventElement.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 TGO4EVENTELEMENT_H 00015 #define TGO4EVENTELEMENT_H 00016 00017 #include "TNamed.h" 00018 00019 class TGo4EventSource; 00020 class TBranch; 00021 class TTree; 00022 00036 class TGo4EventElement : public TNamed { 00037 public: 00038 00039 TGo4EventElement(); 00040 00041 TGo4EventElement(const char* name); 00042 TGo4EventElement(const char* aName, const char* aTitle, Short_t aBaseCat=0); 00043 00044 virtual ~TGo4EventElement(void); 00045 00047 void SetValid(Bool_t on) { fbIsValid=on; } 00048 00050 Bool_t IsValid() const { return fbIsValid; } 00051 00053 void SetEventSource(TGo4EventSource * src) { fxEventSource=src; } 00054 00056 void SetParent(TGo4EventElement * par) { fxParent=par; } 00057 00058 void SetKeepContents(Bool_t on=kTRUE) {fbKeepContents=on;} 00059 00060 inline TGo4EventElement* GetParent() const { return fxParent; } 00061 00062 virtual TGo4EventElement* GetChild(const char* name); 00063 00064 inline TGo4EventSource * GetEventSource() const { return fxEventSource; } 00065 00070 Bool_t CheckEventSource(const char* classname); 00071 00080 virtual Int_t Fill(); 00081 00085 virtual Int_t Init(); 00086 00088 virtual void PrintEvent(); 00089 00090 virtual void makeBranch(TBranch *parent); 00091 virtual void deactivate(); 00092 virtual void activate(); 00093 00094 virtual void Clear(Option_t *t=""); 00095 virtual void clearAll(Int_t) {} 00096 virtual Bool_t isComposed() { return kFALSE; } 00097 virtual Short_t getId() { return fIdentifier; } 00098 virtual void setDebug (Bool_t debug) { fDebug=debug; } 00099 virtual TGo4EventElement& operator[](Int_t) { return *this; } 00100 00101 virtual void Print(Option_t* option = "") const; 00102 00104 virtual void synchronizeWithTree(TTree *tree, TGo4EventElement** var_ptr = 0); 00105 00106 virtual Int_t activateBranch(TBranch *branch, Int_t index=0, TGo4EventElement** var_ptr = 0); 00107 00108 private: 00109 00113 Bool_t fbIsValid; 00114 00117 TGo4EventElement * fxParent; 00118 00125 TGo4EventSource * fxEventSource; 00126 00127 00128 00129 protected: 00130 Short_t fIdentifier; // Identifier 00131 Bool_t fDebug; 00132 00134 Bool_t fbKeepContents; 00135 00136 ClassDef(TGo4EventElement,3) 00137 }; 00138 00139 #endif //TGO4EVENTELEMENT_H