00001 // $Id: TGo4AnalysisStep.h 832 2012-01-12 16:05:43Z linev $ 00002 //----------------------------------------------------------------------- 00003 // The GSI Online Offline Object Oriented (Go4) Project 00004 // Experiment Data Processing at EE department, GSI 00005 //----------------------------------------------------------------------- 00006 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH 00007 // Planckstr. 1, 64291 Darmstadt, Germany 00008 // Contact: http://go4.gsi.de 00009 //----------------------------------------------------------------------- 00010 // This software can be used under the license agreements as stated 00011 // in Go4License.txt file which is part of the distribution. 00012 //----------------------------------------------------------------------- 00013 00014 #ifndef TGO4ANALYSISSTEP_H 00015 #define TGO4ANALYSISSTEP_H 00016 00017 #include "TNamed.h" 00018 #include "TString.h" 00019 00020 class TFolder; 00021 00022 class TGo4Parameter; 00023 class TGo4Condition; 00024 class TGo4Fitter; 00025 00026 class TGo4Analysis; 00027 class TGo4AnalysisStepStatus; 00028 class TGo4AnalysisStatus; 00029 class TGo4Condition; 00030 class TGo4Fitter; 00031 class TGo4EventProcessorParameter; 00032 class TGo4EventStoreParameter; 00033 class TGo4EventSourceParameter; 00034 00035 class TGo4EventElement; 00036 class TGo4EventFactory; 00037 class TGo4EventSource; 00038 class TGo4EventStore; 00039 //class TGo4EventProcessor; 00040 #include "TGo4EventProcessor.h" 00041 00058 class TGo4AnalysisStep : public TNamed { 00059 public: 00060 00062 TGo4AnalysisStep(); 00065 TGo4AnalysisStep(const char* name, 00066 TGo4EventFactory* eventfactory, 00067 TGo4EventSourceParameter* sourcetype = 0, 00068 TGo4EventStoreParameter* storetype = 0, 00069 TGo4EventProcessorParameter* processortype = 0); 00070 00071 virtual ~TGo4AnalysisStep(); 00072 00077 void SetEventSource(TGo4EventSourceParameter* kind); 00078 00080 Bool_t IsEventSourceParam() const; 00081 00088 void NewEventSource(TGo4EventSourceParameter * kind); 00089 00091 TGo4EventSourceParameter* GetEventSource() const { return fxSourceType; } 00092 00094 void CloseEventSource(); 00095 00100 void SetEventStore(TGo4EventStoreParameter* kind); 00101 00103 TGo4EventStoreParameter* GetEventStore() const { return fxStoreType; } 00104 00106 Bool_t IsEventStoreParam() const; 00107 00114 void NewEventStore(TGo4EventStoreParameter * kind); 00115 00117 void CloseEventStore(); 00118 00123 void SetEventProcessor(TGo4EventProcessorParameter* kind); 00124 00131 void NewEventProcessor(TGo4EventProcessorParameter * kind); 00132 00134 void CloseEventProcessor(); 00135 00137 void NewInputEvent(); 00138 00140 void DeleteInputEvent(); 00141 00143 void NewOutputEvent(); 00144 00146 void DeleteOutputEvent(); 00147 00150 virtual void InitEventClasses(); 00151 00153 void SetSourceEnabled(Bool_t on=kTRUE) { fbSourceEnabled=on; } 00154 00156 void SetStoreEnabled(Bool_t on=kTRUE) { fbStoreEnabled=on; } 00157 00159 void SetProcessEnabled(Bool_t on=kTRUE) { fbProcessEnabled=on; } 00160 00162 void SetErrorStopEnabled(Bool_t on) { fbErrorStopEnabled=on; } 00163 00167 void ResetErrorStop() { fbErrorStopped=0; } 00168 00173 void SetInputEvent(TGo4EventElement* in) { fxInputEvent=in; } 00174 00176 void SetPreviousStep(TGo4AnalysisStep * pre) { fxPrevious=pre; } 00177 00179 TGo4AnalysisStep* GetPreviousStep() const { return fxPrevious; } 00180 00184 TGo4EventElement* GetOutputEvent() const { return fxOutputEvent; } 00185 00190 TGo4EventElement* GetInputEvent() const { return fxInputEvent; } 00191 00194 TGo4EventProcessor * GetEventProcessor() const { return fxEventProcessor; } 00195 00198 TGo4EventFactory * GetStepFactory() const { return fxEventFactory; } 00199 00200 Bool_t IsStoreEnabled() const { return fbStoreEnabled; } 00201 00202 Bool_t IsStoreImplemented() const { return fbStoreImplemented; } 00203 00204 Bool_t IsSourceImplemented() const { return fbSourceImplemented; } 00205 00206 Bool_t IsSourceEnabled() const { return fbSourceEnabled; } 00207 00208 Bool_t IsProcessEnabled() const { return fbProcessEnabled; } 00209 00210 Bool_t IsKeepInputEvent() { return fxEventProcessor ? fxEventProcessor->IsKeepInputEvent() : kFALSE; } 00211 00212 Bool_t IsKeepOutputEvent() { return fxEventProcessor ? fxEventProcessor->IsKeepOutputEvent() : kFALSE; } 00213 00215 Bool_t IsErrorStopped() const { return fbErrorStopped; } 00216 00218 Bool_t IsErrorStopEnabled() const { return fbErrorStopEnabled; } 00219 00221 Int_t GetProcessStatus() const { return fiProcessStatus; } 00222 00224 const char* GetStatusMessage() const { return fcStatusMessage.Data(); } 00225 00227 void SetStatusMessage(const char* txt) { fcStatusMessage = txt; } 00228 00234 Bool_t IsMatchingPrevious(); 00235 00238 const char* GetEventStoreName(); 00239 00242 const char* GetEventSourceName(); 00243 00246 void StoreCalibration(); 00247 00249 Int_t Store(TGo4Parameter* cali); 00250 00252 Int_t Store(TGo4Condition* conny); 00253 00255 Int_t Store(TGo4Fitter* fitter); 00256 00258 Int_t Store(TFolder* fold); 00259 00264 void Process(); 00265 00268 void Close(); 00269 00271 void SetStatus(TGo4AnalysisStepStatus * state); 00272 00274 TGo4AnalysisStepStatus * CreateStatus(); 00275 00276 private: 00277 00279 TGo4Analysis* fxOwner; 00280 00283 TGo4AnalysisStep * fxPrevious; 00284 00288 TGo4EventFactory * fxEventFactory; 00289 00293 TGo4EventStore * fxEventStore; 00294 00299 TGo4EventSource * fxEventSource; 00300 00305 TGo4EventProcessor * fxEventProcessor; 00306 00310 TGo4EventElement * fxInputEvent; 00311 00316 TGo4EventElement * fxOutputEvent; 00317 00322 TGo4EventSourceParameter* fxSourceType; 00323 00328 TGo4EventStoreParameter* fxStoreType; 00329 00334 TGo4EventProcessorParameter* fxProcessorType; 00335 00339 Bool_t fbSourceEnabled; 00340 00343 Bool_t fbSourceImplemented; 00344 00348 Bool_t fbStoreEnabled; 00349 00352 Bool_t fbStoreImplemented; 00353 00359 Bool_t fbProcessEnabled; 00360 00366 Bool_t fbErrorStopEnabled; 00367 00369 Bool_t fbErrorStopped; 00370 00372 Int_t fiProcessStatus; 00373 00375 TString fcStatusMessage; 00376 00377 ClassDef(TGo4AnalysisStep,1) 00378 }; 00379 00380 #endif //TGO4ANALYSISSTEP_H