GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4EventProcessor.h
Go to the documentation of this file.
1 // $Id: TGo4EventProcessor.h 2748 2020-04-16 09:50:56Z 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 #ifndef TGO4EVENTPROCESSOR_H
15 #define TGO4EVENTPROCESSOR_H
16 
17 #include "TGo4EventSource.h"
18 
19 #include <cmath>
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 TF1;
36 class TCanvas;
37 
38 class TGo4Condition;
39 class TGo4WinCond;
40 class TGo4PolyCond;
41 class TGo4ShapedCond;
42 class TGo4ListCond;
43 class TGo4RollingGraph;
44 
45 #ifndef TGo4EllipseCond
46 #define TGo4EllipseCond TGo4ShapedCond
47 #endif
48 
49 class TGo4CondArray;
50 class TGo4Picture;
51 class TGo4Parameter;
52 
53 class TGo4MbsEvent;
54 class TGo4EventElement;
56 
68  friend class TGo4EventElement;
69 
70  public:
71 
72  TGo4EventProcessor(const char* name);
73 
74  virtual ~TGo4EventProcessor();
75 
82 
87 
94  virtual Bool_t CheckInputEvent(const char* classname);
95 
102 
107 
114  virtual Bool_t CheckCalibration(const char* classname);
115 
116  /* implemented by subclass to assign correct event structures*/
117  virtual void InitEvent(TGo4EventElement*) {}
118 
119  /* implemented by subclass to do actual processing. For second step processors!*/
120  virtual void FinalizeEvent() {}
121 
123  Bool_t AddObject(TNamed * anything, const char* subfolder = 0);
124 
126  Bool_t AddHistogram(TH1* his, const char* subfolder = 0, Bool_t replace = kTRUE);
127 
129  Bool_t AddParameter(TGo4Parameter* par, const char* subfolder = 0);
130 
132  Bool_t AddAnalysisCondition(TGo4Condition* con, const char* subfolder = 0);
133 
135  Bool_t AddPicture(TGo4Picture* pic, const char* subfolder = 0);
136 
138  Bool_t AddCanvas(TCanvas* can, const char* subfolder = 0);
139 
141  Bool_t RemoveHistogram(const char* name);
142 
144  Bool_t RemoveParameter(const char* name);
145 
147  Bool_t RemoveAnalysisCondition(const char* name);
148 
150  Bool_t RemovePicture(const char* name);
151 
153  Bool_t RemoveCanvas(const char* name);
154 
156  TNamed * GetObject(const char* name, const char* folder = 0);
157 
159  TH1* GetHistogram(const char* name);
160 
162  TGo4Parameter* GetParameter(const char* name, const char* par_class = 0);
163 
165  TGo4Condition* GetAnalysisCondition(const char* name, const char* cond_cl = 0);
166 
168  TGo4Picture* GetPicture(const char* name);
169 
171  TCanvas* GetCanvas(const char* name);
172 
177  TGo4EventElement* GetInputEvent(const char* stepname);
178 
183  TGo4EventElement* GetOutputEvent(const char* stepname);
184 
193  void Message(Int_t prio, const char* text, ...);
194 
196  void SendObjectToGUI(TNamed* ob);
197 
198  /* We overwrite the default TNamed::Clear that would
199  * erase our name and title!
200  * Implement this method in your parameter class
201  * if you would like to reset any values with the
202  * eraser button in the gui remote browser*/
203  virtual void Clear(Option_t* opt="");
204 
206  void SetMakeWithAutosave(Bool_t on = kTRUE);
207 
210  Bool_t IsObjMade();
211 
225  TH1* MakeTH1(char type, const char* fullname, const char* title,
226  Int_t nbinsx, Double_t xlow, Double_t xup,
227  const char* xtitle = 0, const char* ytitle = 0);
228 
243  TH2* MakeTH2(char type, const char* fullname, const char* title,
244  Int_t nbinsx, Double_t xlow, Double_t xup,
245  Int_t nbinsy, Double_t ylow, Double_t yup,
246  const char* xtitle = 0, const char* ytitle = 0, const char* ztitle =0);
247 
252  TGraph* MakeGraph(const char* fullname, const char* title, Int_t points = 0, Double_t* xvalues = 0,
253  Double_t* yvalues = 0);
254 
258  TGraph* MakeGraph(const char* fullname, const char* title, TF1* function);
259 
264  TGo4RollingGraph* MakeRollingGraph(const char* fullname, const char* title, Int_t points = 0, Int_t average = 1);
265 
266 
267 
273  TGo4WinCond* MakeWinCond(const char* fullname,
274  Double_t xmin, Double_t xmax,
275  const char* HistoName = 0);
276 
283  TGo4WinCond* MakeWinCond(const char* fullname,
284  Double_t xmin, Double_t xmax,
285  Double_t ymin, Double_t ymax,
286  const char* HistoName = 0);
287 
297  TGo4PolyCond* MakePolyCond(const char* fullname,
298  Int_t npoints,
299  Double_t (*points) [2],
300  const char* HistoName = 0);
301 
302 
311  TGo4ShapedCond* MakeEllipseCond(const char* fullname,
312  Int_t npoints,
313  Double_t cx, Double_t cy, Double_t a1, Double_t a2, Double_t theta=0,
314  const char* HistoName = 0);
315 
323  TGo4ShapedCond* MakeCircleCond(const char* fullname,
324  Int_t npoints, Double_t cx, Double_t cy, Double_t r,
325  const char* HistoName = 0);
326 
335  TGo4ShapedCond* MakeBoxCond(const char* fullname, Double_t cx, Double_t cy, Double_t a1, Double_t a2, Double_t theta,
336  const char* HistoName = 0);
337 
349  TGo4ShapedCond* MakeFreeShapeCond(const char* fullname,
350  Int_t npoints,
351  Double_t (*points) [2],
352  const char* HistoName = 0);
353 
354 
362  TGo4ListCond* MakeListCond(const char* fullname, const Int_t num, const Int_t * values, const char* HistoName = 0);
363 
364 
365 
374  TGo4ListCond* MakeListCond(const char* fullname, const Int_t start, const Int_t stop, const Int_t step = 1, const char* HistoName = 0);
375 
376 
381  TGo4ListCond* MakeListCond(const char* fullname, const char* title, const char* HistoName = 0);
382 
383 
384 
385 
398  TGo4Parameter* MakeParameter(const char* fullname,
399  const char* classname,
400  const char* newcmd = 0);
401 
404  Long_t ExecuteScript(const char* script_name);
405 
409  Long_t ExecutePython(const char* macro_name, Int_t* errcode=0);
410 
415  Long_t ExecuteLine(const char* command, Int_t* errcode=0);
416 
417 
418 
419  /* if true, processor wants to continue with current content of input event
420  * event is not refilled from event source, and all previous analysis steps are suspended*/
422  {
423  return fbKeepInputEvent;
424  }
425 
426  /* Mark current input event for reprocessing in next cycle
427  * In this case, all previous analysis steps are skipped until this is done*/
428  void SetKeepInputEvent(Bool_t val=kTRUE)
429  {
430  fbKeepInputEvent = val;
431  }
432 
433  /* if true, processor wants to continue filling current output event
434  * Event is not stored, and all subsequent analysis steps are skipped*/
436  {
437  return fbKeepOutputEvent;
438  }
439 
440  /* Mark current input event for reprocessing in next cycle
441  * In this case, all previous analysis steps are skipped until this is done*/
442  void SetKeepOutputEvent(Bool_t val=kTRUE)
443  {
444  fbKeepOutputEvent = val;
445  }
446 
448  virtual void UserPreLoop() {}
449 
451  virtual void UserPostLoop() {}
452 
453  protected:
454 
457 
458  private:
459 
462 
465 
468 
471 
472  ClassDef(TGo4EventProcessor,3)
473 };
474 
475 #endif //TGO4EVENTPROCESSOR_H
TNamed * GetObject(const char *name, const char *folder=0)
void SetKeepOutputEvent(Bool_t val=kTRUE)
Graphs that renew themselves iteratively to monitor a value.
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)
TGo4RollingGraph * MakeRollingGraph(const char *fullname, const char *title, Int_t points=0, Int_t average=1)
virtual Bool_t CheckInputEvent(const char *classname)
TGo4WinCond * MakeWinCond(const char *fullname, Double_t xmin, Double_t xmax, const char *HistoName=0)
TGo4ListCond * MakeListCond(const char *fullname, const Int_t num, const Int_t *values, 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)
TGraph * MakeGraph(const char *fullname, const char *title, Int_t points=0, Double_t *xvalues=0, Double_t *yvalues=0)
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)