GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TGo4AnalysisObjectNames.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 
15 
16 #include "TROOT.h"
17 #include "TList.h"
18 #include "TFolder.h"
19 
21  TGo4Status()
22 {
23 }
24 
26  TGo4Status(name)
27 {
28 }
29 
31 {
32  if(fxTopFolder) {
33  delete fxTopFolder;
34  fxTopFolder = nullptr;
35  }
36 }
37 
39 {
40  if(fxTopFolder)
41  return dynamic_cast<TList *> (fxTopFolder->GetListOfFolders());
42 
43  return nullptr;
44 }
45 
47 {
48  TFolder *reval = fxTopFolder;
49  if(chown) fxTopFolder = nullptr;
50  return reval;
51 }
52 
53 
54 void TGo4AnalysisObjectNames::Print(Option_t *) const
55 {
56  gROOT->SetDirLevel(0);
57  PrintLine("G-OOOO-> Analysis Object Names Printout <-OOOO-G");
58  PrintLine("G-OOOO-> ---------------------------------------------- <-OOOO-G");
60 }
61 
62 void TGo4AnalysisObjectNames::PrintFolder(TFolder *fold) const
63 {
64  if (!fold) return;
65 
66  gROOT->IncreaseDirLevel();
67 
68  PrintLine("G-OOOO-> Status Folder %s Printout <-OOOO-G", fold->GetName());
69  PrintLine("G-OOOO-> ---------------------------------------------- <-OOOO-G");
70 
71  TIter iter(fold->GetListOfFolders());
72 
73  while(auto entry = iter()) {
74  if(entry->InheritsFrom(TFolder::Class())) {
75  PrintFolder(dynamic_cast<TFolder *>(entry));
76  } else if (entry->InheritsFrom(TGo4Status::Class())) {
77  entry->Print();
78  } else {
79  entry->ls();
80  }
81  }
82 
83  PrintLine("G-OOOO-> ---------------------------------------------- <-OOOO-G");
84 
85  gROOT->DecreaseDirLevel();
86 }
TFolder * GetNamesFolder(Bool_t chown=kFALSE)
void PrintFolder(TFolder *fold) const
void Print(Option_t *opt="") const override
static void PrintLine(const char *text,...)
Definition: TGo4Status.cxx:101