GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TGo4EventElement.h
Go to the documentation of this file.
1 // $Id$
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #ifndef TGO4EVENTELEMENT_H
15 #define TGO4EVENTELEMENT_H
16 
17 #include "TNamed.h"
18 
19 class TGo4EventSource;
20 class TBranch;
21 class TTree;
22 
36 class TGo4EventElement : public TNamed {
37  public:
38 
40 
41  TGo4EventElement(const char *name);
42  TGo4EventElement(const char *aName, const char *aTitle, Short_t aBaseCat = 0);
43 
44  virtual ~TGo4EventElement();
45 
47  void SetValid(Bool_t on) { fbIsValid = on; }
48 
50  Bool_t IsValid() const { return fbIsValid; }
51 
54 
56  void SetParent(TGo4EventElement *par) { fxParent = par; }
57 
58  void SetKeepContents(Bool_t on = kTRUE) { fbKeepContents = on; }
59 
60  inline TGo4EventElement *GetParent() const { return fxParent; }
61 
62  virtual TGo4EventElement *GetChild(const char *name);
63 
64  inline TGo4EventSource *GetEventSource() const { return fxEventSource; }
65 
70  Bool_t CheckEventSource(const char *classname);
71 
80  virtual Int_t Fill();
81 
85  virtual Int_t Init();
86 
88  virtual void PrintEvent();
89 
90  virtual void makeBranch(TBranch *parent) {}
91  virtual void deactivate();
92  virtual void activate();
93 
94  void Clear(Option_t *opt = "") override;
95  virtual void clearAll(Int_t) {}
96  virtual Bool_t isComposed() { return kFALSE; }
97  virtual Short_t getId() { return fIdentifier; }
98  virtual void setDebug (Bool_t debug) { fDebug = debug; }
99  virtual TGo4EventElement &operator[](Int_t) { return *this; }
100 
101  void Print(Option_t *option = "") const override;
102 
104  virtual void synchronizeWithTree(TTree *tree, TGo4EventElement **var_ptr = nullptr);
105 
106  virtual Int_t activateBranch(TBranch *branch, Int_t index = 0, TGo4EventElement **var_ptr = nullptr);
107 
108  virtual TTree *CreateSampleTree(TGo4EventElement **sample = nullptr);
109 
110  void ShowSampleTree();
111 
112  private:
113 
117  Bool_t fbIsValid{kTRUE};
118 
122 
130 
131  protected:
132  Short_t fIdentifier{-1}; // Identifier
133  Bool_t fDebug{kFALSE};
134 
136  Bool_t fbKeepContents{kFALSE};
137 
138  ClassDefOverride(TGo4EventElement,3)
139 };
140 
141 #endif //TGO4EVENTELEMENT_H
virtual void makeBranch(TBranch *parent)
TGo4EventSource * GetEventSource() const
virtual TGo4EventElement * GetChild(const char *name)
void SetValid(Bool_t on)
virtual Bool_t isComposed()
virtual TTree * CreateSampleTree(TGo4EventElement **sample=nullptr)
virtual void deactivate()
virtual void PrintEvent()
Bool_t IsValid() const
virtual void synchronizeWithTree(TTree *tree, TGo4EventElement **var_ptr=nullptr)
virtual Short_t getId()
Bool_t CheckEventSource(const char *classname)
virtual Int_t Fill()
TGo4EventElement * fxParent
TGo4EventElement * GetParent() const
virtual void setDebug(Bool_t debug)
void Clear(Option_t *opt="") override
void SetParent(TGo4EventElement *par)
void Print(Option_t *option="") const override
virtual TGo4EventElement & operator[](Int_t)
virtual Int_t Init()
virtual void clearAll(Int_t)
void SetEventSource(TGo4EventSource *src)
virtual void activate()
Bool_t fbKeepContents
Debug level.
TGo4EventSource * fxEventSource
void SetKeepContents(Bool_t on=kTRUE)
virtual Int_t activateBranch(TBranch *branch, Int_t index=0, TGo4EventElement **var_ptr=nullptr)
virtual ~TGo4EventElement()