GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4MainTree.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 TGO4MAINTREE_H
15#define TGO4MAINTREE_H
16
17#include "TObject.h"
18
19class TTree;
20class TFile;
21
33class TGo4MainTree : public TObject {
34 friend class TGo4TreeSource;
35 friend class TGo4TreeStore;
36
37 protected:
40 TTree *GetTree() const { return fxTree; }
41
43
44 public:
45
46 virtual ~TGo4MainTree();
47
49 static const char *fgcTREENAME;
50
52 static const char *fgcFILENAME;
53
55 static const Int_t fgiCOMPRESS;
56
58 static const Int_t fgiAUTOSAVESIZE;
59
60 static TGo4MainTree *Instance();
61
65 static Bool_t Exists() { return fxInstance != nullptr; }
66
67 Int_t GetCurrentIndex() const { return fiCurrentIndex; }
68
72 Int_t IncCurrentIndex() { return ++fiCurrentIndex; }
73
74 void SetCurrentIndex(Int_t number = 0) { fiCurrentIndex = number; }
75
76 Int_t GetMaxIndex();
77
79 void SetAutoSave(Int_t bytesinterval);
80
84 void Update();
85
87 Int_t Write(const char *dummy = nullptr, Int_t option = 0, Int_t bufsize = 0) override;
88 Int_t Write(const char *dummy = nullptr, Int_t option = 0, Int_t bufsize = 0) const override;
89
90 private:
91
93
94 TFile *fxFile{nullptr};
95
96 TTree *fxTree{nullptr};
97
100 Int_t fiMaxIndex{0};
101
104
105 ClassDefOverride(TGo4MainTree,1)
106};
107
108#endif //TGO4MAINTREE_H
Singleton containing and managing the main tree of the go4 analysis.
TTree * GetTree() const
Access to the tree.
Int_t fiMaxIndex
Number of events stored in the Tree.
void SetAutoSave(Int_t bytesinterval)
Set the tree autosave byte interval.
static const Int_t fgiCOMPRESS
Default compression level.
virtual ~TGo4MainTree()
Int_t Write(const char *dummy=nullptr, Int_t option=0, Int_t bufsize=0) override
Write tree content to file.
void SetCurrentIndex(Int_t number=0)
static TGo4MainTree * Instance()
static Bool_t Exists()
True if instance of tree already exists.
TTree * fxTree
static TGo4MainTree * fxInstance
TFile * fxFile
Int_t GetCurrentIndex() const
static const char * fgcTREENAME
Standard go4 name of the main tree.
static const char * fgcFILENAME
Standard suffix for file name.
void Update()
Update the tree entry information without processing any branch.
static const Int_t fgiAUTOSAVESIZE
Default tree autosave size.
friend class TGo4TreeSource
friend class TGo4TreeStore
Int_t fiCurrentIndex
Index number of the current event.
Int_t IncCurrentIndex()
Increments current index in the main tree by one.
Int_t GetMaxIndex()