37 fbBranchExists(kFALSE),
43 GO4TRACE((15,
"TGo4FileStore::TGo4FileStore()", __LINE__, __FILE__));
64 GO4TRACE((15,
"TGo4FileStore::TGo4FileStore(char*,...)", __LINE__, __FILE__));
70 fxFile = TFile::Open(buffer.Data(),
"RECREATE",
"Go4 file store", compression);
71 TGo4Log::Info(
"TGo4FileStore: Open file %s RECREATE", buffer.Data());
73 fxFile = TFile::Open(buffer.Data(),
"UPDATE",
"Go4 file store", compression);
74 TGo4Log::Info(
"TGo4FileStore: Open file %s UPDATE", buffer.Data());
78 const char *lastname = name;
79 const char *oldname = name;
80 lastname = strstr(oldname,
"/");
83 lastname = strstr(oldname,
"/");
87 fxTree =
dynamic_cast<TTree *
> (
fxFile->Get(buffer.Data()));
92 fxTree =
new TTree(buffer.Data(),
"Go4FileStore");
93 fxTree->SetAutoSave(autosavesize);
107 GO4TRACE((15,
"TGo4FileStore::TGo4FileStore(TGo4FileStoreParameter* par)", __LINE__, __FILE__));
110 TGo4Log::Error(
"TGo4FileStore::TGo4FileStore(.., TGo4FileStoreParameter* is not specified");
119 TString buffer = par->GetName();
120 SetName(buffer.Data());
124 TGo4Log::Info(
"TGo4FileStore: Open file %s RECREATE", buffer.Data());
127 TGo4Log::Info(
"TGo4FileStore: Open file %s UPDATE", buffer.Data());
131 const char *lastname = par->GetTitle();
132 const char *oldname=lastname;
133 lastname = strstr(oldname,
"/");
135 oldname = lastname+1;
136 lastname = strstr(oldname,
"/");
141 fxTree =
dynamic_cast<TTree *
> (
fxFile->Get(buffer.Data()));
146 fxTree =
new TTree(buffer.Data(),
"Go4FileStore");
156 GO4TRACE((15,
"TGo4FileStore::~TGo4FileStore()", __LINE__, __FILE__));
160 fxTree->Write(
nullptr, TObject::kOverwrite);
169 GO4TRACE((15,
"TGo4FileStore::SetAutoSave(Int_t)", __LINE__, __FILE__));
170 fxTree->SetAutoSave(bytesinterval);
175 GO4TRACE((12,
"TGo4FileStore::SetCompression(Int_t)", __LINE__, __FILE__));
176 fxFile->SetCompressionLevel(comp);
181 GO4TRACE((12,
"TGo4FileStore::Store(TGo4EventElement *)", __LINE__, __FILE__));
187 TString topbranchname = TString::Format(
"%s.",
fxEvent->GetName());
188 TBranch *go4branch =
fxTree->GetBranch(topbranchname.Data());
193 go4branch->SetAddress(&
fxEvent);
199 TGo4Log::Debug(
" FileStore: Created new branch %s ", topbranchname.Data());
243 auto dsav = gDirectory;
244 TString oldname = ob->GetName();
245 ob->SetName(TString::Format(
"%s_%d", oldname.Data(),
fiFillCount).Data());
248 ob->Write(
nullptr, TObject::kOverwrite);
249 ob->SetName(oldname.Data());
250 if (dsav) dsav->cd();
static Long64_t fgiFILESPLITSIZE
virtual void makeBranch(TBranch *parent)
Int_t GetAutosaveSize() const
void WriteToStore(TNamed *ob)
static void Info(const char *text,...) GO4_PRINTF_ARGS
static void SetMaxTreeSize(Long64_t sz)
void SetCompression(Int_t comp)
Int_t Store(TGo4EventElement *event) override
static void Debug(const char *text,...) GO4_PRINTF_ARGS
TGo4EventElement * fxEvent
Int_t IsOverwriteMode() const
void SetAutoSave(Int_t interval)
static const char * fgcTREESUF
Int_t GetSplitlevel() const
static void Error(const char *text,...) GO4_PRINTF_ARGS
Int_t GetCompression() const
static const char * fgcFILESUF
static Long64_t GetMaxTreeSize()
static const char * fgcEVBRANCHNAME