00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef TGO4EVENTPROCESSOR_H
00015 #define TGO4EVENTPROCESSOR_H
00016
00017 #include "TGo4EventSource.h"
00018
00019 #include <math.h>
00020
00021 class TH1;
00022 class TH1D;
00023 class TH1F;
00024 class TH1S;
00025 class TH1I;
00026 class TH1C;
00027 class TH2;
00028 class TH2D;
00029 class TH2C;
00030 class TH2F;
00031 class TH2S;
00032 class TH2I;
00033 class TGraph;
00034 class TMultiGraph;
00035 class TCanvas;
00036
00037 class TGo4Condition;
00038 class TGo4WinCond;
00039 class TGo4PolyCond;
00040 class TGo4CondArray;
00041 class TGo4Picture;
00042 class TGo4Parameter;
00043
00044 class TGo4MbsEvent;
00045 class TGo4EventElement;
00046 class TGo4EventCalibration;
00047
00058 class TGo4EventProcessor: public TGo4EventSource {
00059 friend class TGo4EventElement;
00060
00061 public:
00062
00063 TGo4EventProcessor(const char* name);
00064
00065 virtual ~TGo4EventProcessor();
00066
00072 void SetInputEvent(TGo4EventElement * raw) { fxInputEvent = raw; }
00073
00077 inline TGo4EventElement * GetInputEvent() { return fxInputEvent; }
00078
00085 virtual Bool_t CheckInputEvent(const char* classname);
00086
00092 void SetCalibration(TGo4EventCalibration * cali) { fxCalibration = cali; }
00093
00097 TGo4EventCalibration * GetCalibration() { return fxCalibration; }
00098
00105 virtual Bool_t CheckCalibration(const char* classname);
00106
00107
00108 virtual void InitEvent(TGo4EventElement*) {}
00109
00110
00111 virtual void FinalizeEvent() {}
00112
00114 Bool_t AddObject(TNamed * anything, const char* subfolder = 0);
00115
00117 Bool_t AddHistogram(TH1* his, const char* subfolder = 0, Bool_t replace = kTRUE);
00118
00120 Bool_t AddParameter(TGo4Parameter* par, const char* subfolder = 0);
00121
00123 Bool_t AddAnalysisCondition(TGo4Condition* con, const char* subfolder = 0);
00124
00126 Bool_t AddPicture(TGo4Picture* pic, const char* subfolder = 0);
00127
00129 Bool_t AddCanvas(TCanvas* can, const char* subfolder = 0);
00130
00132 Bool_t RemoveHistogram(const char* name);
00133
00135 Bool_t RemoveParameter(const char* name);
00136
00138 Bool_t RemoveAnalysisCondition(const char* name);
00139
00141 Bool_t RemovePicture(const char* name);
00142
00144 Bool_t RemoveCanvas(const char* name);
00145
00147 TNamed * GetObject(const char* name, const char* folder = 0);
00148
00150 TH1* GetHistogram(const char* name);
00151
00153 TGo4Parameter* GetParameter(const char* name, const char* par_class = 0);
00154
00156 TGo4Condition* GetAnalysisCondition(const char* name, const char* cond_cl = 0);
00157
00159 TGo4Picture* GetPicture(const char* name);
00160
00162 TCanvas* GetCanvas(const char* name);
00163
00168 TGo4EventElement* GetInputEvent(const char* stepname);
00169
00174 TGo4EventElement* GetOutputEvent(const char* stepname);
00175
00184 void Message(Int_t prio, const char* text, ...);
00185
00187 void SendObjectToGUI(TNamed* ob);
00188
00189
00190
00191
00192
00193
00194 virtual void Clear(Option_t* opt="");
00195
00197 void SetMakeWithAutosave(Bool_t on = kTRUE);
00198
00201 Bool_t IsObjMade();
00202
00216 TH1* MakeTH1(char type, const char* fullname, const char* title,
00217 Int_t nbinsx, Double_t xlow, Double_t xup,
00218 const char* xtitle = 0, const char* ytitle = 0);
00219
00234 TH2* MakeTH2(char type, const char* fullname, const char* title,
00235 Int_t nbinsx, Double_t xlow, Double_t xup,
00236 Int_t nbinsy, Double_t ylow, Double_t yup,
00237 const char* xtitle = 0, const char* ytitle = 0, const char* ztitle =0);
00238
00244 TGo4WinCond* MakeWinCond(const char* fullname,
00245 Double_t xmin, Double_t xmax,
00246 const char* HistoName = 0);
00247
00254 TGo4WinCond* MakeWinCond(const char* fullname,
00255 Double_t xmin, Double_t xmax,
00256 Double_t ymin, Double_t ymax,
00257 const char* HistoName = 0);
00258
00268 TGo4PolyCond* MakePolyCond(const char* fullname,
00269 Int_t npoints,
00270 Double_t (*points) [2],
00271 const char* HistoName = 0);
00272
00285 TGo4Parameter* MakeParameter(const char* fullname,
00286 const char* classname,
00287 const char* newcmd = 0);
00288
00291 Long_t ExecuteScript(const char* script_name);
00292
00293
00294
00295 Bool_t IsKeepInputEvent()
00296 {
00297 return fbKeepInputEvent;
00298 }
00299
00300
00301
00302 void SetKeepInputEvent(Bool_t val=kTRUE)
00303 {
00304 fbKeepInputEvent = val;
00305 }
00306
00307
00308
00309 Bool_t IsKeepOutputEvent()
00310 {
00311 return fbKeepOutputEvent;
00312 }
00313
00314
00315
00316 void SetKeepOutputEvent(Bool_t val=kTRUE)
00317 {
00318 fbKeepOutputEvent = val;
00319 }
00320
00322 virtual void UserPreLoop() {}
00323
00325 virtual void UserPostLoop() {}
00326
00327 protected:
00328
00330 TGo4EventProcessor() : fxInputEvent(0), fxCalibration(0), fbKeepInputEvent(kFALSE), fbKeepOutputEvent(kFALSE) {}
00331
00332 private:
00333
00335 TGo4EventElement * fxInputEvent;
00336
00338 TGo4EventCalibration * fxCalibration;
00339
00341 Bool_t fbKeepInputEvent;
00342
00344 Bool_t fbKeepOutputEvent;
00345
00346 ClassDef(TGo4EventProcessor,3)
00347 };
00348
00349 #endif //TGO4EVENTPROCESSOR_H