GSI Object Oriented Online Offline (Go4) GO4-6.4.0
|
This class manages all export and import conversions of objects to/from different file formats like ascii, radware, etc. More...
#include <TGo4ExportManager.h>
Public Member Functions | |
TGo4ExportManager () | |
TGo4ExportManager (const char *name) | |
virtual | ~TGo4ExportManager () |
void | Export (TCollection *dir) |
Recursive conversion of all objects in collection into ascii files. | |
void | Export (TDirectory *dir) |
Recursive conversion of all objects in directory into filter format. | |
void | Export (TFolder *fold) |
Recursive conversion of all objects in fold specified filter files. | |
void | Export (TGraph *graph) |
Conversion of graph into filter file. | |
void | Export (TH1 *histo) |
Conversion of histogram into filter format file. | |
void | Export (TObject *ob) |
Treat all general objects. | |
void | Export (TObject *ob, Go4Export_t format) |
Conversion of object into selected file format in working dir. | |
TH1 * | ImportHistogram (const char *filename, Go4Import_t format) |
create imported histogram from file of given name | |
TH1 * | ImportHistogramGo4Ascii (const char *nom) |
Provide reading back ascii histograms exported by another go4. | |
TH1 * | ImportHistogramOrtec (const char *filename) |
Convert from Ortec MCA (request U.Spillmann) | |
void | SetCurrentDir (const char *dir=nullptr) |
void | SetFilter (Go4Export_t format) |
void | SetOutFile (const char *filename=nullptr) |
void | SetOutFileComment (const char *comment=nullptr) |
void | SetStartDir (const char *dir=nullptr) |
Private Member Functions | |
void | ExportASCII (TGraph *graph) |
Conversion of graph into ascii file. | |
void | ExportASCII (TH1 *histo, Bool_t channels=kTRUE) |
Conversion of histogram into ascii file. | |
void | ExportRadware (TGraph *graph) |
Conversion of graph into radware file. | |
void | ExportRadware (TH1 *histo) |
Conversion of histogram into radware file. | |
void | ExportRadware (TH2 *histo) |
Conversion of 2d histogram into radware file. | |
void | ExportRoot (TObject *ob) |
Store object into root file. | |
void | ExportXML (TObject *ob) |
Store object into root xml file. | |
Private Attributes | |
Go4Export_t | fiFilter |
Active filter format. | |
TString | fxCurrentDir |
name of the current working directory. | |
TString | fxOutFile |
Name of the output file. | |
TString | fxOutFileComment |
Comment (title) of the output file. | |
TString | fxStartDir |
name of the start (top level) directory. | |
This class manages all export and import conversions of objects to/from different file formats like ascii, radware, etc.
Definition at line 51 of file TGo4ExportManager.h.
TGo4ExportManager::TGo4ExportManager | ( | ) |
Definition at line 53 of file TGo4ExportManager.cxx.
References fiFilter, and GO4EX_ROOT.
TGo4ExportManager::TGo4ExportManager | ( | const char * | name | ) |
Definition at line 47 of file TGo4ExportManager.cxx.
References fiFilter, fxOutFile, and GO4EX_ROOT.
|
virtual |
Definition at line 58 of file TGo4ExportManager.cxx.
void TGo4ExportManager::Export | ( | TCollection * | dir | ) |
Recursive conversion of all objects in collection into ascii files.
folder structure will be represented by subdirs on file system.
Definition at line 198 of file TGo4ExportManager.cxx.
References Export(), ExportRoot(), fiFilter, GO4EX_ROOT, and TGo4Log::Message().
void TGo4ExportManager::Export | ( | TDirectory * | dir | ) |
Recursive conversion of all objects in directory into filter format.
folder structure will be represented by subdirs on file system.
Definition at line 159 of file TGo4ExportManager.cxx.
References Export(), ExportRoot(), fiFilter, fxCurrentDir, fxStartDir, GO4EX_ROOT, and TGo4Log::Message().
void TGo4ExportManager::Export | ( | TFolder * | fold | ) |
Recursive conversion of all objects in fold specified filter files.
folder structure will be represented by subdirs on file system.
Definition at line 132 of file TGo4ExportManager.cxx.
References Export(), ExportRoot(), fiFilter, fxCurrentDir, fxStartDir, GO4EX_ROOT, and TGo4Log::Message().
void TGo4ExportManager::Export | ( | TGraph * | graph | ) |
Conversion of graph into filter file.
Definition at line 239 of file TGo4ExportManager.cxx.
References ExportASCII(), ExportRadware(), ExportRoot(), ExportXML(), fiFilter, GO4EX_ASCII, GO4EX_ASCII_CHANNELS, GO4EX_RADWARE, GO4EX_ROOT, GO4EX_XML, and TGo4Log::Message().
void TGo4ExportManager::Export | ( | TH1 * | histo | ) |
Conversion of histogram into filter format file.
Definition at line 214 of file TGo4ExportManager.cxx.
References ExportASCII(), ExportRadware(), ExportRoot(), ExportXML(), fiFilter, GO4EX_ASCII, GO4EX_ASCII_CHANNELS, GO4EX_RADWARE, GO4EX_ROOT, GO4EX_XML, and TGo4Log::Message().
void TGo4ExportManager::Export | ( | TObject * | ob | ) |
Treat all general objects.
Downcast types for overloaded export methods. Conversion format is to be specified with SetFilter method first.
Definition at line 93 of file TGo4ExportManager.cxx.
References Export(), ExportRoot(), ExportXML(), fiFilter, GO4EX_ASCII, GO4EX_ASCII_CHANNELS, GO4EX_RADWARE, GO4EX_ROOT, GO4EX_XML, and TGo4Log::Message().
void TGo4ExportManager::Export | ( | TObject * | ob, |
Go4Export_t | format ) |
Conversion of object into selected file format in working dir.
If object is a collection, folder or root directory, all contents of these are converted recursively. The substructure hierarchy is expressed by means of subdirectories of the file system, or within the output root file, respectively
Definition at line 85 of file TGo4ExportManager.cxx.
References Export(), and SetFilter().
Referenced by Export(), Export(), Export(), Export(), Export(), and TGo4BrowserProxy::ExportItemsTo().
|
private |
Conversion of graph into ascii file.
Definition at line 334 of file TGo4ExportManager.cxx.
References fxCurrentDir, fxStartDir, and TGo4Log::Message().
|
private |
Conversion of histogram into ascii file.
If channels is true, x/y/z coordinates are in absolute bin channel numbers. Otherwise, export value of bincenters, with respect to axis scale.
Definition at line 262 of file TGo4ExportManager.cxx.
References fxCurrentDir, fxStartDir, and TGo4Log::Message().
|
private |
Conversion of graph into radware file.
Definition at line 444 of file TGo4ExportManager.cxx.
References TGo4Log::Message().
|
private |
Conversion of histogram into radware file.
Definition at line 369 of file TGo4ExportManager.cxx.
References ExportRadware(), fxCurrentDir, fxStartDir, and TGo4Log::Message().
Referenced by Export(), Export(), and ExportRadware().
|
private |
Conversion of 2d histogram into radware file.
Definition at line 440 of file TGo4ExportManager.cxx.
References TGo4Log::Message().
|
private |
Store object into root file.
Filename can be set by SetOutFile()
Definition at line 465 of file TGo4ExportManager.cxx.
References fxOutFile, fxOutFileComment, and TGo4Log::Message().
Referenced by Export(), Export(), Export(), Export(), Export(), and Export().
|
private |
Store object into root xml file.
Filename derived from object name
Definition at line 449 of file TGo4ExportManager.cxx.
References TGo4Log::Message().
TH1 * TGo4ExportManager::ImportHistogram | ( | const char * | filename, |
Go4Import_t | format ) |
create imported histogram from file of given name
Definition at line 483 of file TGo4ExportManager.cxx.
References GO4IM_ASCII, GO4IM_ORTEC_MCA, ImportHistogramGo4Ascii(), ImportHistogramOrtec(), and TGo4Log::Message().
Referenced by TGo4BrowserProxy::ImportObjectFromFile().
TH1 * TGo4ExportManager::ImportHistogramGo4Ascii | ( | const char * | nom | ) |
Provide reading back ascii histograms exported by another go4.
Definition at line 589 of file TGo4ExportManager.cxx.
References GO4_EXMAN_CREATE_HISTOGRAM, and TGo4Log::Message().
Referenced by ImportHistogram().
TH1 * TGo4ExportManager::ImportHistogramOrtec | ( | const char * | filename | ) |
Convert from Ortec MCA (request U.Spillmann)
Definition at line 506 of file TGo4ExportManager.cxx.
References TGo4Log::Message().
Referenced by ImportHistogram().
void TGo4ExportManager::SetCurrentDir | ( | const char * | dir = nullptr | ) |
Definition at line 67 of file TGo4ExportManager.cxx.
References fxCurrentDir.
Referenced by TGo4BrowserProxy::ExportItemsTo(), and TGo4BrowserProxy::ImportObjectFromFile().
void TGo4ExportManager::SetFilter | ( | Go4Export_t | format | ) |
|
inline |
Definition at line 94 of file TGo4ExportManager.h.
References fxOutFile.
Referenced by TGo4BrowserProxy::ExportItemsTo().
|
inline |
Definition at line 97 of file TGo4ExportManager.h.
References fxOutFileComment.
Referenced by TGo4BrowserProxy::ExportItemsTo().
void TGo4ExportManager::SetStartDir | ( | const char * | dir = nullptr | ) |
Definition at line 77 of file TGo4ExportManager.cxx.
References fxStartDir.
Referenced by TGo4BrowserProxy::ExportItemsTo(), and TGo4BrowserProxy::ImportObjectFromFile().
|
private |
Active filter format.
Definition at line 154 of file TGo4ExportManager.h.
Referenced by TGo4ExportManager(), TGo4ExportManager(), Export(), Export(), Export(), Export(), Export(), Export(), and SetFilter().
|
private |
name of the current working directory.
Definition at line 143 of file TGo4ExportManager.h.
Referenced by Export(), Export(), ExportASCII(), ExportASCII(), ExportRadware(), and SetCurrentDir().
|
private |
Name of the output file.
Optionally, for ascii export the files are named according to object names.
Definition at line 147 of file TGo4ExportManager.h.
Referenced by TGo4ExportManager(), ExportRoot(), and SetOutFile().
|
private |
Comment (title) of the output file.
Optionally, for ascii export the files are named according to object names. For root export, this will be TFile t
Definition at line 151 of file TGo4ExportManager.h.
Referenced by ExportRoot(), and SetOutFileComment().
|
private |
name of the start (top level) directory.
If keys from a directory are read, it is required that this start directory is current dir.
Definition at line 140 of file TGo4ExportManager.h.
Referenced by Export(), Export(), ExportASCII(), ExportASCII(), ExportRadware(), and SetStartDir().