37 fbBranchExists(kFALSE),
43 GO4TRACE((15,
"TGo4FileStore::TGo4FileStore()", __LINE__, __FILE__));
58 fbBranchExists(kFALSE),
64 GO4TRACE((15,
"TGo4FileStore::TGo4FileStore(char*,...)", __LINE__, __FILE__));
69 fxFile = TFile::Open(buffer.Data(),
"RECREATE",
"Go4 file store", compression);
70 TGo4Log::Info(
"TGo4FileStore: Open file %s RECREATE", buffer.Data());
72 fxFile = TFile::Open(buffer.Data(),
"UPDATE",
"Go4 file store", compression);
73 TGo4Log::Info(
"TGo4FileStore: Open file %s UPDATE", buffer.Data());
77 const char* lastname = name;
78 const char* oldname = name;
79 lastname = strstr(oldname,
"/");
82 lastname=strstr(oldname,
"/");
86 fxTree =
dynamic_cast<TTree*
> (
fxFile->Get(buffer.Data()));
94 fxTree =
new TTree(buffer.Data(),
"Go4FileStore");
95 fxTree->SetAutoSave(autosavesize);
104 fbBranchExists(kFALSE),
110 GO4TRACE((15,
"TGo4FileStore::TGo4FileStore(TGo4FileStoreParameter* par)", __LINE__, __FILE__));
113 TGo4Log::Error(
"TGo4FileStore::TGo4FileStore(.., TGo4FileStoreParameter* is not specified");
122 TString buffer = par->GetName();
123 SetName(buffer.Data());
127 TGo4Log::Info(
"TGo4FileStore: Open file %s RECREATE", buffer.Data());
130 TGo4Log::Info(
"TGo4FileStore: Open file %s UPDATE", buffer.Data());
134 const char* lastname = par->GetTitle();
135 const char* oldname=lastname;
136 lastname=strstr(oldname,
"/");
139 lastname=strstr(oldname,
"/");
145 fxTree =
dynamic_cast<TTree*
> (
fxFile->Get(buffer.Data()));
150 fxTree =
new TTree(buffer.Data(),
"Go4FileStore");
160 GO4TRACE((15,
"TGo4FileStore::~TGo4FileStore()", __LINE__, __FILE__));
164 fxTree->Write(0, TObject::kOverwrite);
173 GO4TRACE((15,
"TGo4FileStore::SetAutoSave(Int_t)", __LINE__, __FILE__));
174 fxTree->SetAutoSave(bytesinterval);
179 GO4TRACE((12,
"TGo4FileStore::SetCompression(Int_t)", __LINE__, __FILE__));
180 fxFile->SetCompressionLevel(comp);
185 GO4TRACE((12,
"TGo4FileStore::Store(TGo4EventElement*)", __LINE__, __FILE__));
192 TString topbranchname = TString::Format(
"%s.",
fxEvent->GetName());
193 TBranch* go4branch =
fxTree->GetBranch(topbranchname.Data());
198 go4branch->SetAddress(&
fxEvent);
204 TGo4Log::Debug(
" FileStore: Created new branch %s ", topbranchname.Data());
250 TDirectory* dsav=gDirectory;
251 TString oldname = ob->GetName();
252 ob->SetName(Form(
"%s_%d" , oldname.Data(),
fiFillCount));
255 ob->Write(0, TObject::kOverwrite);
256 ob->SetName(oldname.Data());
257 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,...)