GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4EventProcessor.h
Go to the documentation of this file.
1 // $Id: TGo4EventProcessor.h 1798 2015-11-17 13:13:45Z adamczew $
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 #ifndef TGO4EVENTPROCESSOR_H
15 #define TGO4EVENTPROCESSOR_H
16 
17 #include "TGo4EventSource.h"
18 
19 #include <math.h>
20 
21 class TH1;
22 class TH1D;
23 class TH1F;
24 class TH1S;
25 class TH1I;
26 class TH1C;
27 class TH2;
28 class TH2D;
29 class TH2C;
30 class TH2F;
31 class TH2S;
32 class TH2I;
33 class TGraph;
34 class TMultiGraph;
35 class TCanvas;
36 
37 class TGo4Condition;
38 class TGo4WinCond;
39 class TGo4PolyCond;
40 class TGo4ShapedCond;
41 
42 #ifndef TGo4EllipseCond
43 #define TGo4EllipseCond TGo4ShapedCond
44 #endif
45 
46 class TGo4CondArray;
47 class TGo4Picture;
48 class TGo4Parameter;
49 
50 class TGo4MbsEvent;
51 class TGo4EventElement;
53 
65  friend class TGo4EventElement;
66 
67  public:
68 
69  TGo4EventProcessor(const char* name);
70 
71  virtual ~TGo4EventProcessor();
72 
79 
84 
91  virtual Bool_t CheckInputEvent(const char* classname);
92 
99 
104 
111  virtual Bool_t CheckCalibration(const char* classname);
112 
113  /* implemented by subclass to assign correct event structures*/
114  virtual void InitEvent(TGo4EventElement*) {}
115 
116  /* implemented by subclass to do actual processing. For second step processors!*/
117  virtual void FinalizeEvent() {}
118 
120  Bool_t AddObject(TNamed * anything, const char* subfolder = 0);
121 
123  Bool_t AddHistogram(TH1* his, const char* subfolder = 0, Bool_t replace = kTRUE);
124 
126  Bool_t AddParameter(TGo4Parameter* par, const char* subfolder = 0);
127 
129  Bool_t AddAnalysisCondition(TGo4Condition* con, const char* subfolder = 0);
130 
132  Bool_t AddPicture(TGo4Picture* pic, const char* subfolder = 0);
133 
135  Bool_t AddCanvas(TCanvas* can, const char* subfolder = 0);
136 
138  Bool_t RemoveHistogram(const char* name);
139 
141  Bool_t RemoveParameter(const char* name);
142 
144  Bool_t RemoveAnalysisCondition(const char* name);
145 
147  Bool_t RemovePicture(const char* name);
148 
150  Bool_t RemoveCanvas(const char* name);
151 
153  TNamed * GetObject(const char* name, const char* folder = 0);
154 
156  TH1* GetHistogram(const char* name);
157 
159  TGo4Parameter* GetParameter(const char* name, const char* par_class = 0);
160 
162  TGo4Condition* GetAnalysisCondition(const char* name, const char* cond_cl = 0);
163 
165  TGo4Picture* GetPicture(const char* name);
166 
168  TCanvas* GetCanvas(const char* name);
169 
174  TGo4EventElement* GetInputEvent(const char* stepname);
175 
180  TGo4EventElement* GetOutputEvent(const char* stepname);
181 
190  void Message(Int_t prio, const char* text, ...);
191 
193  void SendObjectToGUI(TNamed* ob);
194 
195  /* We overwrite the default TNamed::Clear that would
196  * erase our name and title!
197  * Implement this method in your parameter class
198  * if you would like to reset any values with the
199  * eraser button in the gui remote browser*/
200  virtual void Clear(Option_t* opt="");
201 
203  void SetMakeWithAutosave(Bool_t on = kTRUE);
204 
207  Bool_t IsObjMade();
208 
222  TH1* MakeTH1(char type, const char* fullname, const char* title,
223  Int_t nbinsx, Double_t xlow, Double_t xup,
224  const char* xtitle = 0, const char* ytitle = 0);
225 
240  TH2* MakeTH2(char type, const char* fullname, const char* title,
241  Int_t nbinsx, Double_t xlow, Double_t xup,
242  Int_t nbinsy, Double_t ylow, Double_t yup,
243  const char* xtitle = 0, const char* ytitle = 0, const char* ztitle =0);
244 
250  TGo4WinCond* MakeWinCond(const char* fullname,
251  Double_t xmin, Double_t xmax,
252  const char* HistoName = 0);
253 
260  TGo4WinCond* MakeWinCond(const char* fullname,
261  Double_t xmin, Double_t xmax,
262  Double_t ymin, Double_t ymax,
263  const char* HistoName = 0);
264 
274  TGo4PolyCond* MakePolyCond(const char* fullname,
275  Int_t npoints,
276  Double_t (*points) [2],
277  const char* HistoName = 0);
278 
279 
288  TGo4ShapedCond* MakeEllipseCond(const char* fullname,
289  Int_t npoints,
290  Double_t cx, Double_t cy, Double_t a1, Double_t a2, Double_t theta=0,
291  const char* HistoName = 0);
292 
300  TGo4ShapedCond* MakeCircleCond(const char* fullname,
301  Int_t npoints, Double_t cx, Double_t cy, Double_t r,
302  const char* HistoName = 0);
303 
312  TGo4ShapedCond* MakeBoxCond(const char* fullname, Double_t cx, Double_t cy, Double_t a1, Double_t a2, Double_t theta,
313  const char* HistoName = 0);
314 
326  TGo4ShapedCond* MakeFreeShapeCond(const char* fullname,
327  Int_t npoints,
328  Double_t (*points) [2],
329  const char* HistoName = 0);
330 
331 
344  TGo4Parameter* MakeParameter(const char* fullname,
345  const char* classname,
346  const char* newcmd = 0);
347 
350  Long_t ExecuteScript(const char* script_name);
351 
355  Long_t ExecutePython(const char* macro_name, Int_t* errcode=0);
356 
361  Long_t ExecuteLine(const char* command, Int_t* errcode=0);
362 
363 
364 
365  /* if true, processor wants to continue with current content of input event
366  * event is not refilled from event source, and all previous analysis steps are suspended*/
368  {
369  return fbKeepInputEvent;
370  }
371 
372  /* Mark current input event for reprocessing in next cycle
373  * In this case, all previous analysis steps are skipped until this is done*/
374  void SetKeepInputEvent(Bool_t val=kTRUE)
375  {
376  fbKeepInputEvent = val;
377  }
378 
379  /* if true, processor wants to continue filling current output event
380  * Event is not stored, and all subsequent analysis steps are skipped*/
382  {
383  return fbKeepOutputEvent;
384  }
385 
386  /* Mark current input event for reprocessing in next cycle
387  * In this case, all previous analysis steps are skipped until this is done*/
388  void SetKeepOutputEvent(Bool_t val=kTRUE)
389  {
390  fbKeepOutputEvent = val;
391  }
392 
394  virtual void UserPreLoop() {}
395 
397  virtual void UserPostLoop() {}
398 
399  protected:
400 
403 
404  private:
405 
408 
411 
414 
417 
418  ClassDef(TGo4EventProcessor,3)
419 };
420 
421 #endif //TGO4EVENTPROCESSOR_H
TNamed * GetObject(const char *name, const char *folder=0)
void SetKeepOutputEvent(Bool_t val=kTRUE)
Bool_t RemoveParameter(const char *name)
TGo4Parameter * MakeParameter(const char *fullname, const char *classname, const char *newcmd=0)
TGo4ShapedCond * MakeBoxCond(const char *fullname, Double_t cx, Double_t cy, Double_t a1, Double_t a2, Double_t theta, const char *HistoName=0)
Bool_t AddHistogram(TH1 *his, const char *subfolder=0, Bool_t replace=kTRUE)
TGo4ShapedCond * MakeFreeShapeCond(const char *fullname, Int_t npoints, Double_t(*points)[2], const char *HistoName=0)
Bool_t RemovePicture(const char *name)
TGo4Picture * GetPicture(const char *name)
virtual void UserPreLoop()
TH2 * MakeTH2(char type, const char *fullname, const char *title, Int_t nbinsx, Double_t xlow, Double_t xup, Int_t nbinsy, Double_t ylow, Double_t yup, const char *xtitle=0, const char *ytitle=0, const char *ztitle=0)
virtual Bool_t CheckInputEvent(const char *classname)
TGo4WinCond * MakeWinCond(const char *fullname, Double_t xmin, Double_t xmax, const char *HistoName=0)
TGo4Condition * GetAnalysisCondition(const char *name, const char *cond_cl=0)
TGo4PolyCond * MakePolyCond(const char *fullname, Int_t npoints, Double_t(*points)[2], const char *HistoName=0)
TGo4EventCalibration * fxCalibration
Bool_t RemoveCanvas(const char *name)
virtual void UserPostLoop()
Bool_t AddParameter(TGo4Parameter *par, const char *subfolder=0)
virtual void InitEvent(TGo4EventElement *)
TGo4ShapedCond * MakeCircleCond(const char *fullname, Int_t npoints, Double_t cx, Double_t cy, Double_t r, const char *HistoName=0)
TCanvas * GetCanvas(const char *name)
Bool_t AddCanvas(TCanvas *can, const char *subfolder=0)
void SetKeepInputEvent(Bool_t val=kTRUE)
void SetInputEvent(TGo4EventElement *raw)
Long_t ExecuteScript(const char *script_name)
TGo4Parameter * GetParameter(const char *name, const char *par_class=0)
virtual Bool_t CheckCalibration(const char *classname)
TGo4EventElement * GetInputEvent()
void SetCalibration(TGo4EventCalibration *cali)
Bool_t AddAnalysisCondition(TGo4Condition *con, const char *subfolder=0)
Long_t ExecuteLine(const char *command, Int_t *errcode=0)
virtual void FinalizeEvent()
Bool_t AddPicture(TGo4Picture *pic, const char *subfolder=0)
Bool_t AddObject(TNamed *anything, const char *subfolder=0)
TH1 * MakeTH1(char type, const char *fullname, const char *title, Int_t nbinsx, Double_t xlow, Double_t xup, const char *xtitle=0, const char *ytitle=0)
void Message(Int_t prio, const char *text,...)
virtual void Clear(Option_t *opt="")
TGo4EventElement * fxInputEvent
void SendObjectToGUI(TNamed *ob)
TGo4EventElement * GetOutputEvent(const char *stepname)
Bool_t RemoveAnalysisCondition(const char *name)
TH1 * GetHistogram(const char *name)
Long_t ExecutePython(const char *macro_name, Int_t *errcode=0)
void SetMakeWithAutosave(Bool_t on=kTRUE)
TGo4EventCalibration * GetCalibration()
TGo4ShapedCond * MakeEllipseCond(const char *fullname, Int_t npoints, Double_t cx, Double_t cy, Double_t a1, Double_t a2, Double_t theta=0, const char *HistoName=0)
Bool_t RemoveHistogram(const char *name)