GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4ExportManager Class Reference

This class manages all export and import conversions of objects to/from different file formats like ascii, radware, etc. More...

#include <TGo4ExportManager.h>

+ Inheritance diagram for TGo4ExportManager:

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.
 

Detailed Description

This class manages all export and import conversions of objects to/from different file formats like ascii, radware, etc.

Author
J. Adamczewski
Since
05-Apr-2004

Definition at line 51 of file TGo4ExportManager.h.

Constructor & Destructor Documentation

◆ TGo4ExportManager() [1/2]

TGo4ExportManager::TGo4ExportManager ( )

Definition at line 53 of file TGo4ExportManager.cxx.

References fiFilter, and GO4EX_ROOT.

◆ TGo4ExportManager() [2/2]

TGo4ExportManager::TGo4ExportManager ( const char * name)

Definition at line 47 of file TGo4ExportManager.cxx.

References fiFilter, fxOutFile, and GO4EX_ROOT.

◆ ~TGo4ExportManager()

TGo4ExportManager::~TGo4ExportManager ( )
virtual

Definition at line 58 of file TGo4ExportManager.cxx.

Member Function Documentation

◆ Export() [1/7]

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().

◆ Export() [2/7]

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().

◆ Export() [3/7]

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().

◆ Export() [4/7]

void TGo4ExportManager::Export ( TGraph * graph)

◆ Export() [5/7]

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().

◆ Export() [6/7]

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().

◆ Export() [7/7]

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().

◆ ExportASCII() [1/2]

void TGo4ExportManager::ExportASCII ( TGraph * graph)
private

Conversion of graph into ascii file.

Definition at line 334 of file TGo4ExportManager.cxx.

References fxCurrentDir, fxStartDir, and TGo4Log::Message().

◆ ExportASCII() [2/2]

void TGo4ExportManager::ExportASCII ( TH1 * histo,
Bool_t channels = kTRUE )
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().

Referenced by Export(), and Export().

◆ ExportRadware() [1/3]

void TGo4ExportManager::ExportRadware ( TGraph * graph)
private

Conversion of graph into radware file.

Definition at line 444 of file TGo4ExportManager.cxx.

References TGo4Log::Message().

◆ ExportRadware() [2/3]

void TGo4ExportManager::ExportRadware ( TH1 * histo)
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().

◆ ExportRadware() [3/3]

void TGo4ExportManager::ExportRadware ( TH2 * histo)
private

Conversion of 2d histogram into radware file.

Definition at line 440 of file TGo4ExportManager.cxx.

References TGo4Log::Message().

◆ ExportRoot()

void TGo4ExportManager::ExportRoot ( TObject * ob)
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().

◆ ExportXML()

void TGo4ExportManager::ExportXML ( TObject * ob)
private

Store object into root xml file.

Filename derived from object name

Definition at line 449 of file TGo4ExportManager.cxx.

References TGo4Log::Message().

Referenced by Export(), Export(), and Export().

◆ ImportHistogram()

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().

◆ ImportHistogramGo4Ascii()

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().

◆ ImportHistogramOrtec()

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().

◆ SetCurrentDir()

void TGo4ExportManager::SetCurrentDir ( const char * dir = nullptr)

◆ SetFilter()

void TGo4ExportManager::SetFilter ( Go4Export_t format)

Definition at line 62 of file TGo4ExportManager.cxx.

References fiFilter.

Referenced by Export().

◆ SetOutFile()

void TGo4ExportManager::SetOutFile ( const char * filename = nullptr)
inline

Definition at line 94 of file TGo4ExportManager.h.

References fxOutFile.

Referenced by TGo4BrowserProxy::ExportItemsTo().

◆ SetOutFileComment()

void TGo4ExportManager::SetOutFileComment ( const char * comment = nullptr)
inline

Definition at line 97 of file TGo4ExportManager.h.

References fxOutFileComment.

Referenced by TGo4BrowserProxy::ExportItemsTo().

◆ SetStartDir()

void TGo4ExportManager::SetStartDir ( const char * dir = nullptr)

Field Documentation

◆ fiFilter

Go4Export_t TGo4ExportManager::fiFilter
private

Active filter format.

Definition at line 154 of file TGo4ExportManager.h.

Referenced by TGo4ExportManager(), TGo4ExportManager(), Export(), Export(), Export(), Export(), Export(), Export(), and SetFilter().

◆ fxCurrentDir

TString TGo4ExportManager::fxCurrentDir
private

name of the current working directory.

Definition at line 143 of file TGo4ExportManager.h.

Referenced by Export(), Export(), ExportASCII(), ExportASCII(), ExportRadware(), and SetCurrentDir().

◆ fxOutFile

TString TGo4ExportManager::fxOutFile
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().

◆ fxOutFileComment

TString TGo4ExportManager::fxOutFileComment
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().

◆ fxStartDir

TString TGo4ExportManager::fxStartDir
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().


The documentation for this class was generated from the following files: