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