GSI Object Oriented Online Offline (Go4) GO4-6.4.0
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
58 virtual ~TGo4ExportManager();
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
144
147 TString fxOutFile;
148
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
TString fxOutFileComment
Comment (title) of the output file.
TH1 * ImportHistogramGo4Ascii(const char *nom)
Provide reading back ascii histograms exported by another go4.
void SetFilter(Go4Export_t format)
TH1 * ImportHistogramOrtec(const char *filename)
Convert from Ortec MCA (request U.Spillmann)
void SetOutFileComment(const char *comment=nullptr)
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 ExportXML(TObject *ob)
Store object into root xml file.
void ExportRoot(TObject *ob)
Store object into root file.
void Export(TObject *ob, Go4Export_t format)
Conversion of object into selected file format in working dir.
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 ExportASCII(TH1 *histo, Bool_t channels=kTRUE)
Conversion of histogram into ascii file.
TString fxCurrentDir
name of the current working directory.
TH1 * ImportHistogram(const char *filename, Go4Import_t format)
create imported histogram from file of given name