GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4AnalysisStepStatus.cxx
Go to the documentation of this file.
1 // $Id: TGo4AnalysisStepStatus.cxx 2755 2020-04-16 11:23:02Z linev $
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 "TGo4AnalysisStepStatus.h"
15 
16 #include "TROOT.h"
17 
18 #include "TGo4Log.h"
19 
21  TGo4Status(),
22  fxSourceType(0),
23  fxStoreType(0),
24  fxProcessorType(0),
25  fbSourceEnabled(kFALSE),
26  fbStoreEnabled(kFALSE),
27  fbProcessEnabled(kFALSE),
28  fbErrorStopEnabled(kFALSE),
29  fbErrorStopped(kFALSE),
30  fiProcessStatus(0)
31 {
32 }
33 
35  TGo4Status(name, "Go4 AnalysisStep Status Object"),
36  fxSourceType(0),
37  fxStoreType(0),
38  fxProcessorType(0),
39  fbSourceEnabled(kFALSE),
40  fbStoreEnabled(kFALSE),
41  fbProcessEnabled(kFALSE),
42  fbErrorStopEnabled(kFALSE),
43  fbErrorStopped(kFALSE),
44  fiProcessStatus(0)
45 {
46  GO4TRACE((15,"TGo4AnalysisStepStatus::TGo4AnalysisStepStatus(const char*)",__LINE__, __FILE__));
47 
48 }
49 
51 {
52  GO4TRACE((15,"TGo4AnalysisStepStatus::~TGo4AnalysisStepStatus()",__LINE__, __FILE__));
53  delete fxSourceType;
54  delete fxStoreType;
55  delete fxProcessorType;
56 }
57 
58 Int_t TGo4AnalysisStepStatus::PrintStatus(Text_t* buffer, Int_t buflen)
59 {
60  GO4TRACE((12,"TGo4AnalysisStepStatus::PrintStatus()",__LINE__, __FILE__));
61  //
62 
63  Int_t locallen=64000;
64  Text_t localbuf[64000];
65  if(buflen<0 && buffer!=0)
66  return 0;
67  Int_t size=0;
68 
69  Text_t* current=localbuf;
70  Int_t restlen=locallen;
71  current=PrintIndent(current,restlen);
72  current=PrintBuffer(current,restlen, "++++ Analysis Step %s ++++\t \n",GetName());
73  TROOT::IncreaseDirLevel();
74  if(IsProcessEnabled())
75  {
76  if(IsSourceEnabled())
77  {
79  if( spar!=0 )
80  {
81  Int_t delta=spar->PrintParameter(current,restlen);
82  restlen-=delta;
83  current+=delta;
84  }
85  else
86  {
87  current=PrintIndent(current,restlen);
88  current=PrintBuffer(current,restlen, "EventSource Type: undefined \n");
89  } // if( spar!=0 )
90  }
91  else
92  {
93  current=PrintIndent(current,restlen);
94  current=PrintBuffer(current,restlen, "EventSource is disabled. \n");
95  }
96 
98  if(ppar !=0)
99  {
100  Int_t delta=ppar->PrintParameter(current,restlen);
101  restlen-=delta;
102  current+=delta;
103  }
104  else
105  {
106  // for the moment, suppress unnecessary confusing output!
107  // current=PrintIndent(current,restlen);
108  // current=PrintBuffer(current,restlen, "EventProcessor Type: undefined \n");
109  } // if( ppar!=0 )
110 
111 
112  if(IsStoreEnabled())
113  {
115  if(tpar!=0)
116  {
117  Int_t delta=tpar->PrintParameter(current,restlen);
118  restlen-=delta;
119  current+=delta;
120  }
121  else
122  {
123  current=PrintIndent(current,restlen);
124  current=PrintBuffer(current,restlen, "EventStore Type: undefined \n");
125  } // if( tpar!=0 )
126  }
127  else
128  {
129  current=PrintIndent(current,restlen);
130  current=PrintBuffer(current,restlen, "EventStore is disabled.\n");
131  }
132  // current=PrintIndent(current,restlen);
133  // current=PrintBuffer(current,restlen, "Error stop enabled: %d\n",IsErrorStopEnabled());
134  // current=PrintIndent(current,restlen);
135  // current=PrintBuffer(current,restlen, "Error stopped: %d\n",IsErrorStopped());
136  current=PrintIndent(current,restlen);
137  current=PrintBuffer(current,restlen, "Process Status: %d\n",GetProcessStatus());
138  }
139  else
140  {
141  current=PrintIndent(current,restlen);
142  current=PrintBuffer(current,restlen, "Step is disabled.\n");
143  }
144  TROOT::DecreaseDirLevel();
145  current=PrintIndent(current,restlen);
146  current = PrintBuffer(current, restlen, "---------------------------------------------- \n");
147  if (buffer == 0) {
148  std::cout << localbuf << std::endl;
149  } else {
150  size = locallen - restlen;
151  if (size > buflen - 1)
152  size = buflen - 1;
153  strncpy(buffer, localbuf, size);
154  }
155  return size;
156 }
157 
159 {
160  if(fxSourceType) delete fxSourceType;
161  if(kind)
162  fxSourceType=dynamic_cast<TGo4EventSourceParameter*>(kind->Clone());
163  else
164  fxSourceType=0;
165 }
166 
168 {
170  fxSourceType = 0;
171  return res;
172 }
173 
175 {
176  if(fxStoreType) delete fxStoreType;
177  if(kind)
178  fxStoreType=dynamic_cast<TGo4EventStoreParameter*>(kind->Clone());
179  else
180  fxStoreType=0;
181 }
182 
184 {
185  if(fxProcessorType) delete fxProcessorType;
186  if(kind)
187  fxProcessorType=dynamic_cast<TGo4EventProcessorParameter*>(kind->Clone());
188  else
189  fxProcessorType=0;
190 }
TGo4EventStoreParameter * fxStoreType
TGo4EventStoreParameter * GetStorePar() const
virtual Int_t PrintStatus(Text_t *buffer=0, Int_t buflen=0)
TGo4EventProcessorParameter * GetProcessorPar() const
TGo4EventSourceParameter * fxSourceType
TGo4EventProcessorParameter * fxProcessorType
void SetStorePar(TGo4EventStoreParameter *kind)
static Text_t * PrintIndent(Text_t *buffer, Int_t &buflen)
Definition: TGo4Status.cxx:72
virtual Int_t PrintParameter(Text_t *buffer=0, Int_t buflen=0)
void SetSourcePar(TGo4EventSourceParameter *kind)
TGo4EventSourceParameter * GetSourcePar() const
TGo4EventSourceParameter * TakeSourcePar()
void SetProcessorPar(TGo4EventProcessorParameter *kind)
virtual const char * GetName() const
#define GO4TRACE(X)
Definition: TGo4Log.h:26
virtual Int_t PrintParameter(Text_t *buffer=0, Int_t buflen=0)
static Text_t * PrintBuffer(char *buffer, Int_t &buflen, const char *text,...)
Definition: TGo4Status.cxx:84
virtual Int_t PrintParameter(Text_t *buffer=0, Int_t buflen=0)