PandaRoot
TGo4EventElement.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 // $Id: TGo4EventElement.h 760 2011-06-22 12:03:48Z linev $
14 //-----------------------------------------------------------------------
15 // The GSI Online Offline Object Oriented (Go4) Project
16 // Experiment Data Processing at EE department, GSI
17 //-----------------------------------------------------------------------
18 // Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
19 // Planckstr. 1, 64291 Darmstadt, Germany
20 // Contact: http://go4.gsi.de
21 //-----------------------------------------------------------------------
22 // This software can be used under the license agreements as stated
23 // in Go4License.txt file which is part of the distribution.
24 //-----------------------------------------------------------------------
25 
26 #ifndef TGO4EVENTELEMENT_H
27 #define TGO4EVENTELEMENT_H
28 
29 #include "TNamed.h"
30 
31 class TGo4EventSource;
32 class TBranch;
33 class TTree;
34 
48 class TGo4EventElement : public TNamed {
49  public:
51 
52  TGo4EventElement(const char *name);
53  TGo4EventElement(const char *aName, const char *aTitle, Short_t aBaseCat = 0);
54 
55  virtual ~TGo4EventElement(void);
56 
58  void SetValid(Bool_t on) { fbIsValid = on; }
59 
61  Bool_t IsValid() const { return fbIsValid; }
62 
64  void SetEventSource(TGo4EventSource *src) { fxEventSource = src; }
65 
67  void SetParent(TGo4EventElement *par) { fxParent = par; }
68 
69  inline TGo4EventElement *GetParent() const { return fxParent; }
70 
71  inline TGo4EventSource *GetEventSource() const { return fxEventSource; }
72 
77  Bool_t CheckEventSource(const char *classname);
78 
87  virtual Int_t Fill();
88 
92  virtual Int_t Init();
93 
95  virtual void PrintEvent();
96 
97  virtual void makeBranch(TBranch *parent);
98  virtual void deactivate();
99  virtual void activate();
100 
101  virtual void Clear(Option_t *t = "");
102  virtual void clearAll(Int_t) {}
103  virtual Bool_t isComposed() { return kFALSE; }
104  virtual Short_t getId() { return fIdentifier; }
105  virtual void setDebug(Bool_t debug) { fDebug = debug; }
106  virtual TGo4EventElement &operator[](Int_t) { return *this; }
107 
108  virtual void Print(Option_t *option = "") const;
109 
111  virtual void synchronizeWithTree(TTree *tree, TGo4EventElement **var_ptr = nullptr);
112 
113  virtual Int_t activateBranch(TBranch *branch, Int_t index = 0, TGo4EventElement **var_ptr = 0);
114 
115  private:
118  Bool_t fbIsValid;
119 
122  TGo4EventElement *fxParent;
123 
130  TGo4EventSource *fxEventSource;
131 
132  protected:
133  Short_t fIdentifier; // Identifier
134  Bool_t fDebug;
135 
137 };
138 
139 #endif // TGO4EVENTELEMENT_H
virtual void makeBranch(TBranch *parent)
TGo4EventSource * GetEventSource() const
virtual Int_t activateBranch(TBranch *branch, Int_t index=0, TGo4EventElement **var_ptr=0)
virtual void Print(Option_t *option="") const
virtual void activate()
virtual void deactivate()
void SetValid(Bool_t on)
virtual Bool_t isComposed()
ClassDef(TGo4EventElement, 3)
Debug level.
virtual ~TGo4EventElement(void)
virtual Int_t Fill()
Bool_t IsValid() const
virtual Short_t getId()
Bool_t CheckEventSource(const char *classname)
virtual void PrintEvent()
virtual void Clear(Option_t *t="")
TGo4EventElement * GetParent() const
virtual void setDebug(Bool_t debug)
void SetParent(TGo4EventElement *par)
virtual TGo4EventElement & operator[](Int_t)
virtual void clearAll(Int_t)
void SetEventSource(TGo4EventSource *src)
virtual void synchronizeWithTree(TTree *tree, TGo4EventElement **var_ptr=nullptr)
virtual Int_t Init()