GSI Object Oriented Online Offline (Go4) GO4-6.4.5
Loading...
Searching...
No Matches
TGo4ExportManager.h
Go to the documentation of this file.
1// $Id$
2//-----------------------------------------------------------------------
3// The GSI Online Offline Object Oriented (Go4) Project
4// Experiment Data Processing at EE department, GSI
5//-----------------------------------------------------------------------
6// Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7// Planckstr. 1, 64291 Darmstadt, Germany
8// Contact: http://go4.gsi.de
9//-----------------------------------------------------------------------
10// This software can be used under the license agreements as stated
11// in Go4License.txt file which is part of the distribution.
12//-----------------------------------------------------------------------
13
14#ifndef TGO4EXPORTMANAGER_H
15#define TGO4EXPORTMANAGER_H
16
17#include "TNamed.h"
18#include "TString.h"
19
20class TH1;
21class TH2;
22class TCollection;
23class TFolder;
24class TDirectory;
25class TGraph;
26
27
36
37
43
51class TGo4ExportManager : public TNamed {
52 public:
53
55
56 TGo4ExportManager(const char *name);
57
59
64 void Export(TObject *ob, Go4Export_t format);
65
68 void Export(TObject *ob);
69
71 void Export(TH1 *histo);
72
74 void Export(TGraph *graph);
75
78 void Export(TFolder *fold);
79
82 void Export(TDirectory *dir);
83
86 void Export(TCollection *dir);
87
88 void SetFilter(Go4Export_t format);
89
90 void SetCurrentDir(const char *dir = nullptr);
91
92 void SetStartDir(const char *dir = nullptr);
93
94 void SetOutFile(const char *filename = nullptr)
95 { fxOutFile = filename ? filename : "Go4Export"; }
96
97 void SetOutFileComment(const char *comment = nullptr)
98 { fxOutFileComment= comment ? comment : "Saved from Go4"; }
99
100 /****** new 2024: add some most wanted import functions*****************************/
101
103 TH1 *ImportHistogram(const char *filename, Go4Import_t format);
104
106 TH1 *ImportHistogramOrtec(const char *filename);
107
109 TH1 *ImportHistogramGo4Ascii(const char *nom);
110
111
112 private:
113
118 void ExportASCII(TH1 *histo, Bool_t channels=kTRUE);
119
121 void ExportASCII(TGraph *graph);
122
124 void ExportRadware(TH1 *histo);
125
127 void ExportRadware(TH2 *histo);
128
130 void ExportRadware(TGraph *graph);
131
133 void ExportRoot(TObject *ob);
134
136 void ExportXML(TObject *ob);
137
140 TString fxStartDir;
141
143 TString fxCurrentDir;
144
147 TString fxOutFile;
148
151 TString fxOutFileComment;
152
155};
156
157#endif //TGO4EXPORTMANAGER_H
Go4Import_t
@ GO4IM_ORTEC_MCA
@ GO4IM_ASCII
Go4Export_t
@ GO4EX_RADWARE
@ GO4EX_ROOT
@ GO4EX_ASCII
@ GO4EX_ASCII_CHANNELS
@ GO4EX_XML
This class manages all export and import conversions of objects to/from different file formats like a...
TString fxOutFileComment
Comment (title) of the output file.
TH1 * ImportHistogramGo4Ascii(const char *nom)
Provide reading back ascii histograms exported by another go4.
void ExportRadware(TH2 *histo)
Conversion of 2d histogram into radware file.
void SetFilter(Go4Export_t format)
void Export(TFolder *fold)
Recursive conversion of all objects in fold specified filter files.
TH1 * ImportHistogramOrtec(const char *filename)
Convert from Ortec MCA (request U.Spillmann).
void SetOutFileComment(const char *comment=nullptr)
void Export(TH1 *histo)
Conversion of histogram into filter format file.
TString fxOutFile
Name of the output file.
void SetStartDir(const char *dir=nullptr)
Go4Export_t fiFilter
Active filter format.
void SetOutFile(const char *filename=nullptr)
void Export(TCollection *dir)
Recursive conversion of all objects in collection into ascii files.
void ExportXML(TObject *ob)
Store object into root xml file.
virtual ~TGo4ExportManager()
void ExportRoot(TObject *ob)
Store object into root file.
void Export(TDirectory *dir)
Recursive conversion of all objects in directory into filter format.
void Export(TObject *ob, Go4Export_t format)
Conversion of object into selected file format in working dir.
void ExportRadware(TGraph *graph)
Conversion of graph into radware file.
void ExportRadware(TH1 *histo)
Conversion of histogram into radware file.
TString fxStartDir
name of the start (top level) directory.
void SetCurrentDir(const char *dir=nullptr)
void Export(TObject *ob)
Treat all general objects.
void ExportASCII(TH1 *histo, Bool_t channels=kTRUE)
Conversion of histogram into ascii file.
void ExportASCII(TGraph *graph)
Conversion of graph into ascii file.
TString fxCurrentDir
name of the current working directory.
TGo4ExportManager(const char *name)
TH1 * ImportHistogram(const char *filename, Go4Import_t format)
create imported histogram from file of given name
void Export(TGraph *graph)
Conversion of graph into filter file.
Go4Import_t
Go4Export_t