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());
201 fxEvent->makeBranch(topbranch);
243 auto dsav = gDirectory;
244 TString oldname = ob->GetName();
245 ob->SetName(TString::Format(
"%s_%d", oldname.Data(),
fiFillCount).Data());
250 ob->Write(
nullptr, TObject::kOverwrite);
251 ob->SetName(oldname.Data());
252 if (dsav) dsav->cd();
The abstract base class for the data elements of which the unpacked events (or detector structure dat...
Int_t IsOverwriteMode() const
Int_t GetCompression() const
Int_t GetSplitlevel() const
Int_t GetAutosaveSize() const
TGo4EventElement * fxEvent
Points to event structure to be filled into branch.
void WriteToStore(TNamed *ob)
used by all Store methods to write with referencing event number in name
Int_t fiFillCount
counter of filled events.
static Long64_t GetMaxTreeSize()
Int_t Store(TGo4EventElement *event) override
Stores eventelement event into the storage implementation.
static void SetMaxTreeSize(Long64_t sz)
void SetAutoSave(Int_t interval)
Set the tree autosave interval.
static const char * fgcFILESUF
Standard suffix for file name.
Int_t fiSplit
TBranch splitlevel.
Bool_t fbBranchExists
True if branch already exists.
void SetCompression(Int_t comp)
Set the file compression level.
static const char * fgcEVBRANCHNAME
Standard go4 name of the branch used in all treestore and treesource implementations.
static const char * fgcTREESUF
Standard go4 suffix for tree name.
Int_t fiBufsize
buffer size for tree branch.
static Long64_t fgiFILESPLITSIZE
size in bytes for root tree-filesplit mechanism.
Central class of Go4Fit package.
static void Info(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 1.
static void Debug(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 0.
static void Error(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 3.
Base class for all parameter aggregations, e.g.