00001 // $Id: TGo4FileStore.h 731 2011-02-27 17:47:17Z linev $ 00002 //----------------------------------------------------------------------- 00003 // The GSI Online Offline Object Oriented (Go4) Project 00004 // Experiment Data Processing at EE department, GSI 00005 //----------------------------------------------------------------------- 00006 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH 00007 // Planckstr. 1, 64291 Darmstadt, Germany 00008 // Contact: http://go4.gsi.de 00009 //----------------------------------------------------------------------- 00010 // This software can be used under the license agreements as stated 00011 // in Go4License.txt file which is part of the distribution. 00012 //----------------------------------------------------------------------- 00013 00014 #ifndef TGO4FILESTORE_H 00015 #define TGO4FILESTORE_H 00016 00017 #include "TGo4EventStore.h" 00018 00019 class TFile; 00020 class TTree; 00021 00022 class TGo4EventCalibration; 00023 class TGo4EventElement; 00024 class TGo4FileStoreParameter; 00025 00036 class TGo4FileStore : public TGo4EventStore { 00037 public: 00038 00039 TGo4FileStore(); 00040 00041 TGo4FileStore(const char* name, 00042 Int_t splitlevel=1, 00043 Int_t compression=1, 00044 Bool_t overwrite=kFALSE, 00045 Int_t autosavesize=10000000, 00046 Int_t bufsize=64000); 00047 00048 TGo4FileStore(TGo4FileStoreParameter* par); 00049 00050 virtual ~TGo4FileStore(); 00051 00054 virtual Int_t Store(TGo4EventElement* event); 00055 00057 virtual Int_t Store(TGo4Parameter* cali); 00058 00060 virtual Int_t Store(TGo4Condition* conny); 00061 00063 virtual Int_t Store(TGo4Fitter* fitter); 00064 00066 virtual Int_t Store(TFolder* fold); 00067 00069 void SetCompression(Int_t comp); 00070 00072 void SetAutoSave(Int_t bytesinterval); 00073 00074 static void SetMaxTreeSize(Long64_t sz); 00075 00076 static Long64_t GetMaxTreeSize(); 00077 00080 static const char* fgcEVBRANCHNAME; 00081 00083 static const char* fgcFILESUF; 00084 00086 static const char* fgcTREESUF; 00087 00089 static Long64_t fgiFILESPLITSIZE; 00090 00092 virtual TTree* GetTree() { return fxTree; } 00093 00094 private: 00095 00097 void WriteToStore(TNamed* ob); 00098 00099 TFile* fxFile; 00100 00101 TTree * fxTree; 00102 00105 Bool_t fbBranchExists; 00106 00108 TGo4EventElement * fxEvent; 00109 00111 Int_t fiSplit; 00112 00114 Int_t fiBufsize; 00115 00117 Int_t fiFillCount; 00118 00119 ClassDef(TGo4FileStore,1) 00120 }; 00121 00122 #endif //TGO4FILESTORE_H