38 fbBranchExists(kFALSE),
44 GO4TRACE((15,
"TGo4FileStore::TGo4FileStore()", __LINE__, __FILE__));
59 fbBranchExists(kFALSE),
65 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()));
95 fxTree =
new TTree(buffer.Data(),
"Go4FileStore");
96 fxTree->SetAutoSave(autosavesize);
105 fbBranchExists(kFALSE),
111 GO4TRACE((15,
"TGo4FileStore::TGo4FileStore(TGo4FileStoreParameter* par)", __LINE__, __FILE__));
114 TGo4Log::Error(
"TGo4FileStore::TGo4FileStore(.., TGo4FileStoreParameter* is not specified");
123 TString buffer = par->GetName();
124 SetName(buffer.Data());
128 TGo4Log::Info(
"TGo4FileStore: Open file %s RECREATE", buffer.Data());
131 TGo4Log::Info(
"TGo4FileStore: Open file %s UPDATE", buffer.Data());
135 const char* lastname = par->GetTitle();
136 const char* oldname=lastname;
137 lastname=strstr(oldname,
"/");
140 lastname=strstr(oldname,
"/");
146 fxTree =
dynamic_cast<TTree*
> (
fxFile->Get(buffer.Data()));
151 fxTree =
new TTree(buffer.Data(),
"Go4FileStore");
161 GO4TRACE((15,
"TGo4FileStore::~TGo4FileStore()", __LINE__, __FILE__));
165 fxTree->Write(0, TObject::kOverwrite);
174 GO4TRACE((15,
"TGo4FileStore::SetAutoSave(Int_t)", __LINE__, __FILE__));
175 fxTree->SetAutoSave(bytesinterval);
180 GO4TRACE((12,
"TGo4FileStore::SetCompression(Int_t)", __LINE__, __FILE__));
181 fxFile->SetCompressionLevel(comp);
186 GO4TRACE((12,
"TGo4FileStore::Store(TGo4EventElement*)", __LINE__, __FILE__));
193 TString topbranchname = TString::Format(
"%s.",
fxEvent->GetName());
194 TBranch* go4branch =
fxTree->GetBranch(topbranchname.Data());
199 go4branch->SetAddress(&
fxEvent);
205 TGo4Log::Debug(
" FileStore: Created new branch %s ", topbranchname.Data());
251 TDirectory* dsav=gDirectory;
252 TString oldname = ob->GetName();
253 ob->SetName(Form(
"%s_%d" , oldname.Data(),
fiFillCount));
256 ob->Write(0, TObject::kOverwrite);
257 ob->SetName(oldname.Data());
258 if (dsav) dsav->cd();
static Long64_t fgiFILESPLITSIZE
virtual void makeBranch(TBranch *parent)
void WriteToStore(TNamed *ob)
static void SetMaxTreeSize(Long64_t sz)
void SetCompression(Int_t comp)
Int_t IsOverwriteMode() const
Int_t GetAutosaveSize() const
TGo4EventElement * fxEvent
Int_t GetCompression() const
void SetAutoSave(Int_t interval)
virtual Int_t Store(TGo4EventElement *event)
static const char * fgcTREESUF
Int_t GetSplitlevel() const
static const char * fgcFILESUF
static Long64_t GetMaxTreeSize()
static const char * fgcEVBRANCHNAME
static void Error(const char *text,...)
static void Info(const char *text,...)
static void Debug(const char *text,...)