GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4ExportManager.cxx
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#include "TGo4ExportManager.h"
15
16#include <fstream>
17#include <istream>
18
19#include "TSystem.h"
20#include "TFolder.h"
21#include "TDirectory.h"
22#include "TKey.h"
23#include "TFile.h"
24#include "TH1.h"
25#include "TH2.h"
26#include "TH3.h"
27#include "TGraph.h"
28
29#include "Riostream.h"
30
31#include "TGo4Log.h"
32
33// JAM7-2024:
34#define GO4_EXMAN_CREATE_HISTOGRAM(X,Y) \
35 switch(X){ \
36 case 1:\
37 theHisto = new TH1##Y(name.Data(), title.Data(), bins[0], axmin[0], axmax[0]);\
38 break;\
39 case 2:\
40 theHisto = new TH2##Y(name.Data(), title.Data(), bins[0], axmin[0], axmax[0], bins[1], axmin[1], axmax[1]);\
41 break;\
42 case 3:\
43 theHisto = new TH3##Y(name.Data(), title.Data(), bins[0], axmin[0], axmax[0], bins[1], axmin[1], axmax[1], bins[2], axmin[2], axmax[2]);\
44 break;\
45 }
46
48 : TNamed(name,"This is a Go4 export manager"),fiFilter(GO4EX_ROOT)
49{
50 fxOutFile = "Go4Export";
51}
52
57
61
63{
64 fiFilter = format;
65}
66
68{
69 if (dir) {
70 fxCurrentDir = dir;
71 gSystem->cd(dir);
72 } else {
73 fxCurrentDir = gSystem->WorkingDirectory();
74 }
75}
76
77void TGo4ExportManager::SetStartDir(const char *dir)
78{
79 if (dir)
80 fxStartDir = dir;
81 else
82 fxStartDir = gSystem->WorkingDirectory();
83}
84
85void TGo4ExportManager::Export(TObject *ob, Go4Export_t format)
86{
87 if(!ob) return;
88 SetFilter(format);
89 Export(ob);
90}
91
92
93void TGo4ExportManager::Export(TObject *myobject)
94{
95 if(!myobject) return;
96
97 if (myobject->InheritsFrom(TDirectory::Class())) {
98 TDirectory *subdir = dynamic_cast<TDirectory *>(myobject);
99 Export(subdir);
100 } else if (myobject->InheritsFrom(TFolder::Class())) {
101 TFolder *subfold = dynamic_cast<TFolder *>(myobject);
102 Export(subfold);
103 } else if (myobject->InheritsFrom(TCollection::Class())) {
104 TCollection *col = dynamic_cast<TCollection *>(myobject);
105 Export(col);
106 } else if (myobject->InheritsFrom(TH1::Class())) {
107 TH1 *histo = dynamic_cast<TH1 *>(myobject);
108 Export(histo);
109 } else if (myobject->InheritsFrom(TGraph::Class())) {
110 TGraph *graph = dynamic_cast<TGraph *>(myobject);
111 Export(graph);
112 } else {
113 switch (fiFilter) {
114 case GO4EX_ROOT:
115 ExportRoot(myobject);
116 break;
117 case GO4EX_XML:
118 ExportXML(myobject);
119 break;
120 case GO4EX_ASCII:
122 case GO4EX_RADWARE:
123 default:
125 "ExportManager: NOT Converting object %s of class %s",
126 myobject->GetName(), myobject->ClassName());
127 }
128 }
129}
130
131
132void TGo4ExportManager::Export(TFolder *fold)
133{
134 if (!fold)
135 return;
136 TGo4Log::Message(0, "ExportManager: Converting contents of folder %s",
137 fold->GetName());
138 if (fiFilter == GO4EX_ROOT) {
139 // root filter will write collection completely into one root file
140 // otherwise, each object would be written separately into flat hierarchy
141 ExportRoot(fold);
142 return;
143 }
144
145 TString dirname = fold->GetName();
146 gSystem->cd(fxCurrentDir.Data()); // create subdirectory in file system
147 TString com = "mkdir " + dirname;
148 gSystem->Exec(com);
149 gSystem->cd(dirname.Data());
150 fxCurrentDir = gSystem->WorkingDirectory();
151 TCollection *folderlist = fold->GetListOfFolders();
152 Export(folderlist);
153 gSystem->cd(fxCurrentDir.Data());
154 gSystem->cd("..");
155 fxCurrentDir = gSystem->WorkingDirectory(); // go up one directory level again
156 gSystem->cd(fxStartDir.Data());
157}
158
159void TGo4ExportManager::Export(TDirectory *source)
160{
161 if (!source)
162 return;
163 TGo4Log::Message(0, "ExportManager: Converting contents of directory %s", source->GetName());
164 if (fiFilter == GO4EX_ROOT) {
165 // root filter will write collection completely into one root file
166 // otherwise, each object would be written separately into flat hierarchy
167 ExportRoot(source);
168 return;
169 }
170
171 TString dirname = source->GetName();
172 if (!dirname.Contains(".root")) {
173 gSystem->cd(fxCurrentDir.Data()); // create subdirectory in file system
174 TString com = "mkdir " + dirname;
175 gSystem->Exec(com);
176 gSystem->cd(dirname.Data());
177 fxCurrentDir = gSystem->WorkingDirectory();
178 }
179 source->cd();
180 gSystem->cd(fxStartDir.Data());
181 TIter iter(source->GetListOfKeys());
182 while (auto mykey = (TKey *)iter()) {
183 auto myobject = mykey->ReadObj();
184 if (myobject) {
185 Export(myobject);
186 } else {
187 TGo4Log::Message(2, "ExportManager: Could not read key %s", mykey->GetName());
188 }
189 } // while
190 if (!dirname.Contains(".root")) {
191 gSystem->cd(fxCurrentDir.Data());
192 gSystem->cd("..");
193 fxCurrentDir = gSystem->WorkingDirectory(); // go up one directory level again
194 gSystem->cd(fxStartDir.Data());
195 }
196}
197
198void TGo4ExportManager::Export(TCollection *col)
199{
200 if(!col) return;
201 TGo4Log::Message(0,"ExportManager: Converting contents of collection %s",col->GetName());
202 if(fiFilter == GO4EX_ROOT) {
203 // root filter will write collection completely into one root file
204 // otherwise, each object would be written separately into flat hierarchy
205 ExportRoot(col);
206 return;
207 }
208
209 TIter iter(col);
210 while(auto ob = iter())
211 Export(ob);
212}
213
215{
216 switch(fiFilter) {
217 case GO4EX_ASCII:
218 ExportASCII(histo,kFALSE);
219 break;
221 ExportASCII(histo,kTRUE);
222 break;
223 case GO4EX_RADWARE:
224 ExportRadware(histo);
225 break;
226 case GO4EX_ROOT:
227 ExportRoot(histo);
228 break;
229 case GO4EX_XML:
230 ExportXML(histo);
231 break;
232 default:
233 TGo4Log::Message(2,"ExportManager: Unknown Export filter %d!",fiFilter);
234 break;
235 };
236
237}
238
240{
241 switch(fiFilter) {
242 case GO4EX_ASCII:
244 ExportASCII(gra);
245 break;
246 case GO4EX_RADWARE:
247 ExportRadware(gra);
248 break;
249 case GO4EX_XML:
250 ExportXML(gra);
251 break;
252 case GO4EX_ROOT:
253 ExportRoot(gra);
254 break;
255 default:
256 TGo4Log::Message(2,"ExportManager: Unknown Export filter %d!",fiFilter);
257 break;
258 };
259
260}
261
262void TGo4ExportManager::ExportASCII(TH1 *histo, Bool_t channels)
263{
264if(!histo) return;
265try{
266 TString objectname=histo->GetName();
267 TString outname=objectname;
268 outname.Append(".hdat");
269 gSystem->cd(fxCurrentDir.Data());
270
271 std::ofstream outfile(outname.Data());
272 if(!outfile) {
273 TGo4Log::Message(3,"ExportManager: Error opening outputfile %s",outname.Data());
274 return;
275 }
276 TGo4Log::Message(0,"ExportManager: Converting histogram %s to ASCII",histo->GetName());
277 Int_t maxbinX = histo->GetNbinsX();
278 Int_t maxbinY = histo->GetNbinsY();
279 Int_t maxbinZ = histo->GetNbinsZ();
280 Int_t globalbin = 0;
281 Stat_t cont = 0;
282 outfile <<"# Histogram "<<histo->ClassName() <<": "<<histo->GetName()<< std::endl;
283 if(channels)
284 outfile <<"# Xbin \tYbin \tZbin \tContent"<< std::endl;
285 else
286 outfile <<"# X \tY \tZ \tContent"<< std::endl;
287 for(Int_t x=1; x<=maxbinX; ++x)
288 {
289 for(Int_t y=1; y<=maxbinY; ++y)
290 {
291 for(Int_t z=1; z<=maxbinZ; ++z)
292 {
293 globalbin=histo->GetBin(x,y,z);
294 cont=histo->GetBinContent(globalbin);
295 if(channels)
296 {
297 outfile <<x<<" \t"<<y<<" \t"<<z<<" \t"<<cont<< std::endl;
298 }
299 else
300 {
301 Axis_t xval = 0;
302 TAxis *xax = histo->GetXaxis();
303 //if(xax) xval=xax->GetBinCenter(x);
304 if(xax) xval=xax->GetBinLowEdge(x);
305 Axis_t yval = 0;
306 TAxis *yax = histo->GetYaxis();
307 //if(yax) yval=yax->GetBinCenter(y);
308 if(yax) yval = yax->GetBinLowEdge(y);
309 Axis_t zval = 0;
310 TAxis *zax = histo->GetZaxis();
311 //if(zax) zval=zax->GetBinCenter(z);
312 if(zax) zval = zax->GetBinLowEdge(z);
313 outfile <<xval<<" \t"<<yval<<" \t"<<zval<<" \t"<<cont<< std::endl;
314 }
315 }
316 }
317
318 }
319 outfile.close();
320 gSystem->cd(fxStartDir.Data()); // needed in case of TKey read from (file) directory
321}// try
322catch(std::exception& ex) // treat standard library exceptions
323{
324 TGo4Log::Message(3,"standard exception %s in TGo4ExportManager::ExportASCII(TH1 *)",
325 ex.what());
326}
327catch(...)
328{
329 TGo4Log::Message(3,"!!! Unexpected exception in TGo4ExportManager::ExportASCII(TH1 *)!!!");
330} // catch
331
332}
333
335{
336 if (!graph)
337 return;
338 try {
339 TString objectname = graph->GetName();
340 TString outname = objectname;
341 outname.Append(".gdat");
342 gSystem->cd(fxCurrentDir.Data());
343 std::ofstream outfile(outname.Data());
344 if (!outfile) {
345 TGo4Log::Message(3, "ExportManager: Error opening outputfile %s", outname.Data());
346 return;
347 }
348 TGo4Log::Message(0, "ExportManager: Converting graph %s to ASCII", graph->GetName());
349 Int_t maxpoints = graph->GetN();
350 outfile << "# Graph " << graph->ClassName() << ": " << graph->GetName() << std::endl;
351 outfile << "# Point \tX \tY" << std::endl;
352 for (Int_t point = 0; point < maxpoints; ++point) {
353 Double_t xg = 0, yg = 0;
354 graph->GetPoint(point, xg, yg);
355 outfile << point << " \t\t" << xg << " \t" << yg << std::endl;
356 }
357 outfile.close();
358 gSystem->cd(fxStartDir.Data());
359 } // try
360
361 catch (std::exception &ex) // treat standard library exceptions
362 {
363 TGo4Log::Message(3, "standard exception %s in TGo4ExportManager::ExportASCII(TGraph *)", ex.what());
364 } catch (...) {
365 TGo4Log::Message(3, "!!! Unexpected exception in TGo4ExportManager::ExportASCII(TGraph *)!!!");
366 } // catch
367}
368
370{
371 if (histo->InheritsFrom(TH2::Class())) {
372 TH2 *map = dynamic_cast<TH2 *>(histo);
373 ExportRadware(map);
374 } else if (histo->InheritsFrom(TH3::Class())) {
375 TGo4Log::Message(2, "ExportManager: Converting 3d histogram %s to radware not supported yet!", histo->GetName());
376 } else {
377
378 try {
379 TString objectname = histo->GetName();
380 TString outname = objectname;
381 outname.Append(".spe");
382 TString hname = objectname;
383 hname.Append(" ");
384 Int_t maxbinX = histo->GetNbinsX();
385 Int_t l_chan = maxbinX; // get record size from histo here...
386 Int_t l_head[6];
387 l_head[0] = l_chan;
388 l_head[1] = 1;
389 l_head[2] = 1;
390 l_head[3] = 1;
391 l_head[4] = 24;
392 l_head[5] = l_chan * 4; /* record size */
393 gSystem->cd(fxCurrentDir.Data());
394 std::ofstream outfile(outname.Data());
395 if (!outfile) {
396 TGo4Log::Message(3, "ExportManager: Error opening outputfile %s", outname.Data());
397 return;
398 }
399 TGo4Log::Message(0, "ExportManager: Converting 1d histogram %s to RADWARE", histo->GetName());
401 Int_t first = 24;
402 outfile.write((char *)&first, sizeof(Int_t));
404 outfile.write(hname.Data(), 8); // name limited to 8 characters
406 outfile.write((char *)l_head, 6 * sizeof(Int_t));
408 Float_t cont = 0;
409 for (Int_t xbin = 0; xbin < maxbinX; ++xbin) {
410 cont = (Float_t)histo->GetBinContent(xbin);
411 outfile.write((char *)&cont, sizeof(Float_t));
412 }
414 Int_t charnum = l_chan * sizeof(Float_t);
415 outfile.write((char *)&charnum, sizeof(Int_t));
416 Int_t hislen = l_chan * 4 + 40;
417 Int_t byteswritten = outfile.tellp();
418 // consistency check: chars written are data field+header size
419 if (byteswritten == hislen) {
420 TGo4Log::Message(1, "Histogram %s: %d bytes (data %d) written to %s", hname.Data(), byteswritten, hislen,
421 outname.Data());
422 } else {
423 TGo4Log::Message(3, "Histogram %s: Size mismatch: %d bytes written to %s, datalength is %d", hname.Data(),
424 byteswritten, outname.Data(), hislen);
425 }
426 outfile.close();
427 gSystem->cd(fxStartDir.Data());
428 } // try /////////////////////////////////////////////
429
430 catch (std::exception &ex) // treat standard library exceptions
431 {
432 TGo4Log::Message(3, "standard exception %s in TGo4ExportManager::ExportRadware(TH1 *)", ex.what());
433 } catch (...) {
434 TGo4Log::Message(3, "!!! Unexpected exception in TGo4ExportManager::ExportRadware(TH1 *)!!!");
435 } // catch
436
437 } // if(histo->InheritsFrom...)
438}
439
441{
442 TGo4Log::Message(2,"ExportManager: Converting 2d histo %s to radware not supported yet!",histo->GetName());
443}
445{
446 TGo4Log::Message(2,"ExportManager: Converting graph %s to radware not supported yet!",graph->GetName());
447}
448
450{
451 if (!ob) return;
452 TString fname=ob->GetName();
453 fname += ".xml";
454
455 TFile *f = TFile::Open(fname.Data(), "recreate");
456 if (!f) return;
457 f->cd();
458 ob->Write();
459 delete f;
460 TGo4Log::Message(0,"ExportManager: Wrote object %s of class %s to root file %s",
461 ob->GetName(), ob->ClassName(),fname.Data() );
462}
463
464
466{
467 if(!ob) return;
468 TString fname=fxOutFile;
469 TString ftitle=fxOutFileComment;
470 if(!fname.Contains(".root")) fname.Append(".root");
471 TFile *f = TFile::Open(fname.Data(), "recreate");
472 if (!f) return;
473 f->SetTitle(ftitle.Data());
474 f->cd();
475 ob->Write();
476 delete f;
477 TGo4Log::Message(0,"ExportManager: Wrote object %s of class %s to root file %s",
478 ob->GetName(), ob->ClassName(),fname.Data() );
479}
480
481
482
483TH1 *TGo4ExportManager::ImportHistogram(const char *filename, Go4Import_t format)
484{
485 switch (format) {
486 case GO4IM_ASCII:
487 return ImportHistogramGo4Ascii(filename);
488// TGo4Log::Message(2,
489// "ExportManager: not yet implemented plain ascii histogram import,could not use file %s ",
490// filename);
491 break;
492
493 case GO4IM_ORTEC_MCA:
494 return ImportHistogramOrtec(filename);
495 break;
496
497 default:
499 "ExportManager: Can not import histogram from file %s with unknown import type %d ",
500 filename, format);
501 }
502 return nullptr;
503}
504
505
507{
508// here duplicate functionality of script import_spe.C:
509 TString path = nom;
510 if (!path.Contains(".Spe")) {
511 path.Append(".Spe");
512 }
513 std::ifstream in;
514 in.open(path.Data());
515 if (!in.good()) {
517 "ExportManager: could not open file %s for Ortec MCA histogram import",
518 path.Data());
519 return nullptr;
520 }
521
522 Double_t value = 0;
523 Int_t numbins = 1024;
524 Int_t xmin = 0;
525 Int_t xmax = 1024;
526
527 // TODO: evaluate histogram specs from header first
528 std::string header;
529 std::string date = "unknown date";
530 std::string desc = "no id";
531 Int_t headerlines = 12;
532 for (Int_t i = 0; i < headerlines; ++i) {
533 getline(in, header);
534 //cout << "getting header "<<i<<":"<<header.c_str() << endl;
535 if (header.find("$DATA:") != std::string::npos) {
536 in >> xmin >> xmax;
537 xmax += 1; // root TH1 upper limit is exclusive...
538 numbins = xmax - xmin;
539 i++;
540 //cout << " - got xmin="<<xmin<<", xmax="<<xmax<<", numbins="<<numbins << endl;
541
542 } else if (header.find("$DATE_MEA:") != std::string::npos) {
543 getline(in, date);
544 i++;
545 //cout << " - got measurement date="<<date.c_str() << endl;
546 } else if (header.find("$SPEC_ID:") != std::string::npos) {
547 getline(in, desc);
548 i++;
549 //cout << " - got description="<<desc.c_str() << endl;
550 }
551
552 }
553
554 TString name = path;
555 // strip leading path and suffix:
556 Ssiz_t lastslash = name.Last('/');
557 name = name(lastslash + 1, name.Length());
558 Ssiz_t lastdot = name.Last('.');
559 name = name(0, lastdot);
560
561 TString title = TString::Format("%s of MCA from %s, %s", name.Data(),
562 date.c_str(), desc.c_str());
563 TH1D *theHisto = new TH1D(name.Data(), title.Data(), numbins, xmin, xmax);
564
565 for (Int_t b = 0; b < numbins; ++b) {
566 in >> value;
567 if (!in.good())
568 break;
569 //theHisto->Fill(b, value);
570 theHisto->SetBinContent(b + 1, value);
571 //cout << "got bin "<<b<<":"<<value << endl;
572 }
573 theHisto->ResetStats(); // because we do not Fill() have to calculate stats afterwards
574
575 // TODO: optionally evaluate footer infos here?
576 getline(in, header); // dummy read to handle intermediate line feed ??
577 //cout << "getting intermdiate line :"<<header.c_str()<<":" << endl;
578 Int_t footerlines = 14;
579 for (Int_t i = 0; i < footerlines; ++i) {
580 getline(in, header);
581 //cout << "getting footer "<<i<<":"<<header.c_str() << endl;
582 }
584
585 return theHisto;
586}
587
588
590{
591 TH1 *theHisto = nullptr;
592 TString path = nom;
593 if (!path.Contains(".hdat")) {
594 path.Append(".hdat");
595 }
596 std::ifstream in;
597 in.open(path.Data());
598 if (!in.good()) {
600 "ExportManager: could not open file %s for go4 ASCII histogram import",
601 path.Data());
602 return nullptr;
603 }
604 TString name = path;
605 // strip leading path and suffix:
606 Ssiz_t lastslash = name.Last('/');
607 name = name(lastslash + 1, name.Length());
608 Ssiz_t lastdot = name.Last('.');
609 name = name(0, lastdot);
610 TString title = TString::Format("%s imported from ASCII %s.hdat",
611 name.Data(), name.Data());
612
613 // TODO: evaluate histogram specs from header first
614 std::string header, dummy;
615
616 getline(in, header);
617 //std::cout << "getting header " << header.c_str() << std::endl;
618 getline(in, dummy);
619
620 Int_t hdim = 0;
621 Char_t type = '0';
622 std::size_t pos1=header.find("TH1");
623 std::size_t pos2=header.find("TH2");
624 std::size_t pos3=header.find("TH3");
625
626
627 if (pos1 != std::string::npos) {
628 hdim = 1;
629 type=header.at(pos1+3);
630 } else if (pos2 != std::string::npos) {
631 hdim = 2;
632 type=header.at(pos2+3);
633 } else if (pos3!= std::string::npos) {
634 hdim = 3;
635 type=header.at(pos3+3);
636 }
637 //std::cout << "got histogram dimension " << hdim <<", type is "<< type <<std::endl;
638
639 // TODO: scan number of bins and range
640 // JAM7-2024: this works for fixed bin size histograms only. TODO: evaluate bin steps indivually?
641
642 // Int_t totalbins = 0;
643 //Int_t xbins = 0, ybins = 0, zbins = 0;
644 Double_t val = 0;
645 Double_t axval[3]={0.};
646 Double_t axmin[3]={0.};
647 Double_t axmax[3]={0.};
648 Int_t bins[3]={0};
649 Bool_t firstline=kTRUE;
650
651 while (in.good()) {
652 in >> axval[0]>> axval[1]>> axval[2] >> val;
653 for (Int_t i = 0; i < 3; ++i) {
654 if(firstline){
655 // for negative axis values we need to initialize with actual first value instead 0
656 axmin[i] = axmax[i] = axval[i];
657 }
658 if (axval[i] <= axmin[i]) {
659 axmin[i] = axval[i];
660 }
661 if (axval[i] > axmax[i]) {
662 axmax[i] = axval[i];
663 bins[i]++;
664 }
665 } // for
666 // totalbins++;
667 firstline = kFALSE;
668 } // while
669
670 // adjust ROOT upper limit: add one binsize
671 for (Int_t i = 0; i < 3; ++i) {
672 if(bins[i]==0) continue;
673 bins[i]++; // first increment is not counted as bin, add one more
674 Double_t binsize = (axmax[i] - axmin[i]) / (bins[i]);
675 axmax[i]+=binsize;
676
677// std::cout <<" -- axmin["<<i<<"]="<< axmin[i] << std::endl;
678// std::cout <<" -- axmax["<<i<<"]="<< axmax[i] << std::endl;
679// std::cout <<" -- bins["<<i<<"]="<< bins[i] << std::endl;
680 }
681
682
683
684 in.clear(); // reset eof/error flag
685 in.seekg(in.beg); // read once again
686 getline(in, dummy);
687 getline(in, dummy); // skip known headers
688
689 // create histogram of given binsize and range:
690 switch(type){
691 default:
692 case 'D':
694 break;
695 case 'F':
697 break;
698 case 'I':
700 break;
701// case 'L':
702// GO4_EXMAN_CREATE_HISTOGRAM(hdim, L);
703// break;
704 case 'S':
706 break;
707 case 'C':
709 break;
710 };
711
712 // fill histogram:
713 while (in.good()) {
714 in >> axval[0]>> axval[1] >> axval[2] >> val;
715 Int_t globalbin=theHisto->FindBin(axval[0], axval[1], axval[2]);
716 //std::cout<<"Read x:"<< axval[0]<<", y:"<<axval[1]<<", z:"<< axval[2]<<", val="<<val<<"- globalbin:"<<globalbin<<std::endl;
717 theHisto->SetBinContent(globalbin, val);
718 } // while
719
720 theHisto->ResetStats();
721 return theHisto;
722}
723
#define GO4_EXMAN_CREATE_HISTOGRAM(X, Y)
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)
TString fxOutFile
Name of the output file.
void SetStartDir(const char *dir=nullptr)
Go4Export_t fiFilter
Active filter format.
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
static const char * Message(Int_t prio, const char *text,...) GO4_PRINTF2_ARGS
Display a message.
Definition TGo4Log.cxx:206