GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TGo4FileStore.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 TGO4FILESTORE_H
15 #define TGO4FILESTORE_H
16 
17 #include "TGo4EventStore.h"
18 
19 class TFile;
20 class TTree;
21 
23 class TGo4EventElement;
25 
36 class TGo4FileStore : public TGo4EventStore {
37  public:
38 
39  TGo4FileStore();
40 
41  TGo4FileStore(const char *name,
42  Int_t splitlevel = 1,
43  Int_t compression = 1,
44  Bool_t overwrite = kFALSE,
45  Int_t autosavesize = 10000, // positive: entries, negative: bytes
46  Int_t bufsize = 64000);
47 
49 
50  virtual ~TGo4FileStore();
51 
54  Int_t Store(TGo4EventElement *event) override;
55 
57  Int_t Store(TGo4Parameter *cali) override;
58 
60  Int_t Store(TGo4Condition *conny) override;
61 
63  Int_t Store(TGo4Fitter *fitter) override;
64 
66  Int_t Store(TFolder *fold) override;
67 
69  void SetCompression(Int_t comp);
70 
73  void SetAutoSave(Int_t interval);
74 
75  static void SetMaxTreeSize(Long64_t sz);
76 
77  static Long64_t GetMaxTreeSize();
78 
81  static const char *fgcEVBRANCHNAME;
82 
84  static const char *fgcFILESUF;
85 
87  static const char *fgcTREESUF;
88 
90  static Long64_t fgiFILESPLITSIZE;
91 
93  TTree *GetTree() override { return fxTree; }
94 
95  private:
96 
98  void WriteToStore(TNamed *ob);
99 
100  TFile *fxFile{nullptr};
101 
102  TTree *fxTree{nullptr};
103 
106  Bool_t fbBranchExists{kFALSE};
107 
110 
112  Int_t fiSplit{0};
113 
115  Int_t fiBufsize{0};
116 
118  Int_t fiFillCount{0};
119 
120  ClassDefOverride(TGo4FileStore,1)
121 };
122 
123 #endif //TGO4FILESTORE_H
static Long64_t fgiFILESPLITSIZE
Definition: TGo4FileStore.h:90
virtual ~TGo4FileStore()
void WriteToStore(TNamed *ob)
static void SetMaxTreeSize(Long64_t sz)
void SetCompression(Int_t comp)
Int_t Store(TGo4EventElement *event) override
Bool_t fbBranchExists
TGo4EventElement * fxEvent
void SetAutoSave(Int_t interval)
static const char * fgcTREESUF
Definition: TGo4FileStore.h:87
static const char * fgcFILESUF
Definition: TGo4FileStore.h:84
static Long64_t GetMaxTreeSize()
static const char * fgcEVBRANCHNAME
Definition: TGo4FileStore.h:81
TTree * GetTree() override
Definition: TGo4FileStore.h:93