GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TGo4CompositeEvent.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 TGO4COMPOSITEEVENT_H
15 #define TGO4COMPOSITEEVENT_H
16 
17 #include "TGo4EventElement.h"
18 
19 class TObjArray;
20 class TTree;
21 
24  protected:
25 
27  Short_t fNElements{0};
28 
30  TObjArray *fEventElements{nullptr};
31 
33  Short_t fMaxIndex{0};
34 
35  public:
37  TGo4CompositeEvent(const char *aName, const char *aTitle, Short_t aBaseCat = 0);
38  virtual ~TGo4CompositeEvent();
39 
40  TGo4EventElement *GetChild(const char *name) override;
41 
42  void makeBranch(TBranch *parent) override;
43 
44  Int_t activateBranch(TBranch *branch, Int_t init = 0, TGo4EventElement **var_ptr = nullptr) override;
45 
46  void deactivate() override;
47  void activate() override;
48 
49  Bool_t addEventElement(TGo4EventElement *aElement, Bool_t reading = kFALSE);
50 
51  TTree *CreateSampleTree(TGo4EventElement **sample = nullptr) override;
52 
54  TGo4EventElement *getEventElement(const char *name, Int_t final_element = 0);
55  void Clear(Option_t *opt = "") override;
56  Short_t getNElements() const { return fNElements; }
57  Short_t getMaxIndex() const { return fMaxIndex; }
58  Bool_t isComposed() override { return kTRUE; }
59  TObjArray *getElements() const { return fEventElements;}
60  TObjArray *getListOfComposites(Bool_t toplevel=kTRUE);
61  TGo4EventElement& operator[](Int_t i) override;
62 
63  protected:
64 
65  void ProvideArray();
66 
67  ClassDefOverride(TGo4CompositeEvent,2)
68 };
69 
70 #endif
TGo4EventElement & operator[](Int_t i) override
Bool_t addEventElement(TGo4EventElement *aElement, Bool_t reading=kFALSE)
void activate() override
void deactivate() override
TObjArray * getListOfComposites(Bool_t toplevel=kTRUE)
TObjArray * fEventElements
TGo4EventElement * GetChild(const char *name) override
TTree * CreateSampleTree(TGo4EventElement **sample=nullptr) override
void makeBranch(TBranch *parent) override
void Clear(Option_t *opt="") override
TGo4EventElement * getEventElement(Int_t idx)
Bool_t isComposed() override
Short_t getNElements() const
Int_t activateBranch(TBranch *branch, Int_t init=0, TGo4EventElement **var_ptr=nullptr) override
Short_t getMaxIndex() const
TObjArray * getElements() const