GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4EventProcessor.h
Go to the documentation of this file.
1// $Id$
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
21class TH1;
22class TH1D;
23class TH1F;
24class TH1S;
25class TH1I;
26class TH1C;
27class TH2;
28class TH2D;
29class TH2C;
30class TH2F;
31class TH2S;
32class TH2I;
33class TGraph;
34class TMultiGraph;
35class TF1;
36class TCanvas;
37
38class TGo4Condition;
39class TGo4WinCond;
40class TGo4PolyCond;
41class TGo4ShapedCond;
42class TGo4ListCond;
44
45#ifndef TGo4EllipseCond
46#define TGo4EllipseCond TGo4ShapedCond
47#endif
48
49class TGo4CondArray;
50class TGo4Picture;
51class TGo4Parameter;
52
53class TGo4MbsEvent;
56
63
65 friend class TGo4EventElement;
66
67 public:
68
69 TGo4EventProcessor(const char *name);
70
71 virtual ~TGo4EventProcessor();
72
79
84
92 virtual Bool_t CheckInputEvent(const char *classname);
93
100
105
113 virtual Bool_t CheckCalibration(const char *classname);
114
116 virtual void InitEvent(TGo4EventElement *) {}
117
119 virtual void FinalizeEvent() {}
120
123 Bool_t AddObject(TNamed *anything, const char *subfolder = nullptr);
124
127 Bool_t AddHistogram(TH1 *his, const char *subfolder = nullptr, Bool_t replace = kTRUE);
128
131 Bool_t AddParameter(TGo4Parameter *par, const char *subfolder = nullptr);
132
135 Bool_t AddAnalysisCondition(TGo4Condition *con, const char *subfolder = nullptr);
136
139 Bool_t AddPicture(TGo4Picture *pic, const char *subfolder = nullptr);
140
143 Bool_t AddCanvas(TCanvas *can, const char *subfolder = nullptr);
144
147 Bool_t RemoveHistogram(const char *name);
148
151 Bool_t RemoveParameter(const char *name);
152
155 Bool_t RemoveAnalysisCondition(const char *name);
156
159 Bool_t RemovePicture(const char *name);
160
163 Bool_t RemoveCanvas(const char *name);
164
167 TNamed *GetObject(const char *name, const char *folder = nullptr);
168
171 TH1 *GetHistogram(const char *name);
172
175 TGo4Parameter *GetParameter(const char *name, const char *par_class = nullptr);
176
179 TGo4Condition *GetAnalysisCondition(const char *name, const char *cond_cl = nullptr);
180
183 TGo4Picture *GetPicture(const char *name);
184
187 TCanvas *GetCanvas(const char *name);
188
194 TGo4EventElement *GetInputEvent(const char *stepname);
195
201 TGo4EventElement *GetOutputEvent(const char *stepname);
202
213 void Message(Int_t prio, const char *text, ...)
214 #if defined(__GNUC__) && !defined(__CLING__)
215 __attribute__((format(printf, 3, 4)))
216 #endif
217 ;
218
220 void SendObjectToGUI(TNamed *ob);
221
222 /* We overwrite the default TNamed::Clear that would
223 * erase our name and title!
224 * Implement this method in your parameter class
225 * if you would like to reset any values with the
226 * eraser button in the gui remote browser*/
227 void Clear(Option_t *opt = "") override;
228
230 void SetMakeWithAutosave(Bool_t on = kTRUE);
231
234 Bool_t IsObjMade() const;
235
253 TH1 *MakeTH1(char type, const char *fullname, const char *title,
254 Int_t nbinsx, Double_t xlow, Double_t xup,
255 const char *xtitle = nullptr, const char *ytitle = nullptr);
256
278 TH2 *MakeTH2(char type, const char *fullname, const char *title,
279 Int_t nbinsx, Double_t xlow, Double_t xup,
280 Int_t nbinsy, Double_t ylow, Double_t yup,
281 const char *xtitle = nullptr, const char *ytitle = nullptr, const char *ztitle = nullptr);
282
287 TGraph *MakeGraph(const char *fullname, const char *title, Int_t points = 0, Double_t *xvalues = nullptr,
288 Double_t *yvalues = nullptr);
289
293 TGraph *MakeGraph(const char *fullname, const char *title, TF1 *function);
294
299 TGo4RollingGraph *MakeRollingGraph(const char *fullname, const char *title, Int_t points = 0, Int_t average = 1);
300
306 TGo4WinCond *MakeWinCond(const char *fullname,
307 Double_t xmin, Double_t xmax,
308 const char *HistoName = nullptr);
309
317 TGo4WinCond *MakeWinCond(const char *fullname,
318 Double_t xmin, Double_t xmax,
319 Double_t ymin, Double_t ymax,
320 const char *HistoName = nullptr);
321
330 TGo4PolyCond *MakePolyCond(const char *fullname,
331 Int_t npoints,
332 Double_t (*points) [2],
333 const char *HistoName = nullptr);
334
344 TGo4ShapedCond *MakeEllipseCond(const char *fullname,
345 Int_t npoints,
346 Double_t cx, Double_t cy, Double_t a1, Double_t a2, Double_t theta = 0,
347 const char *HistoName = nullptr);
348
356 TGo4ShapedCond *MakeCircleCond(const char *fullname,
357 Int_t npoints, Double_t cx, Double_t cy, Double_t r,
358 const char *HistoName = nullptr);
359
368 TGo4ShapedCond *MakeBoxCond(const char *fullname, Double_t cx, Double_t cy, Double_t a1, Double_t a2, Double_t theta,
369 const char *HistoName = nullptr);
370
383 TGo4ShapedCond *MakeFreeShapeCond(const char *fullname,
384 Int_t npoints,
385 Double_t (*points) [2],
386 const char *HistoName = nullptr);
387
395 TGo4ListCond *MakeListCond(const char *fullname, const Int_t num, const Int_t * values, const char *HistoName = nullptr);
396
404 TGo4ListCond *MakeListCond(const char *fullname, const Int_t start, const Int_t stop, const Int_t step = 1, const char *HistoName = nullptr);
405
410 TGo4ListCond *MakeListCond(const char *fullname, const char *title, const char *HistoName = nullptr);
411
424 TGo4Parameter *MakeParameter(const char *fullname,
425 const char *classname,
426 const char *newcmd = nullptr);
427
430 Long64_t ExecuteScript(const char *script_name);
431
435 Long64_t ExecutePython(const char *macro_name, Int_t *errcode = nullptr);
436
442 Long64_t ExecuteLine(const char *command, Int_t *errcode = nullptr);
443
447 Bool_t IsKeepInputEvent() const { return fbKeepInputEvent; }
448
451 void SetKeepInputEvent(Bool_t val = kTRUE) { fbKeepInputEvent = val; }
452
456 Bool_t IsKeepOutputEvent() const { return fbKeepOutputEvent; }
457
460 void SetKeepOutputEvent(Bool_t val = kTRUE) { fbKeepOutputEvent = val; }
461
463 virtual void UserPreLoop() {}
464
466 virtual void UserPostLoop() {}
467
468 protected:
469
471
472 private:
473
476
479
481 Bool_t fbKeepInputEvent{kFALSE};
482
484 Bool_t fbKeepOutputEvent{kFALSE};
485
486 ClassDefOverride(TGo4EventProcessor,3)
487};
488
489#endif //TGO4EVENTPROCESSOR_H
TGraph * MakeGraph()
Definition Example12.cxx:45
Array of conditions.
Go4 condition class.
Data object for calibration of the input event.
The abstract base class for the data elements of which the unpacked events (or detector structure dat...
Abstract event processor.
virtual void UserPreLoop()
Method called when analysis is created.
Bool_t AddPicture(TGo4Picture *pic, const char *subfolder=nullptr)
Register picture to go4 framework.
void SetKeepInputEvent(Bool_t val=kTRUE)
Mark current input event for reprocessing in next cycle.
Bool_t AddCanvas(TCanvas *can, const char *subfolder=nullptr)
Register TCanvas to go4 framework.
TH1 * MakeTH1(char type, const char *fullname, const char *title, Int_t nbinsx, Double_t xlow, Double_t xup, const char *xtitle=nullptr, const char *ytitle=nullptr)
Create one dimensional histogram of specified type.
Bool_t IsKeepOutputEvent() const
Is marked to keep output event.
TGo4Picture * GetPicture(const char *name)
Get picture from go4 framework.
void SetCalibration(TGo4EventCalibration *cali)
Sets reference to external raw event which is used by the concrete processor to unpack the interestin...
Bool_t fbKeepOutputEvent
flag to steer continue filling of same output event
TGo4RollingGraph * MakeRollingGraph(const char *fullname, const char *title, Int_t points=0, Int_t average=1)
Create a go4 rolling graph (generic trending plot) with properties points and average.
TGo4Parameter * GetParameter(const char *name, const char *par_class=nullptr)
Get parameter from go4 framework.
void SendObjectToGUI(TNamed *ob)
Send any object as copy to gui.
virtual Bool_t CheckCalibration(const char *classname)
Check if calibration class is valid.
TNamed * GetObject(const char *name, const char *folder=nullptr)
Get any object from go4 framework.
Bool_t fbKeepInputEvent
flag to steer re-processing of same input event
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=nullptr, const char *ytitle=nullptr, const char *ztitle=nullptr)
Create two dimensional histogram of specified type.
TGo4ShapedCond * MakeCircleCond(const char *fullname, Int_t npoints, Double_t cx, Double_t cy, Double_t r, const char *HistoName=nullptr)
Create circular shaped polygon condition.
void Clear(Option_t *opt="") override
TGo4EventCalibration * GetCalibration() const
Access to external calibration object.
virtual void InitEvent(TGo4EventElement *)
implemented by subclass to assign correct event structures
Long64_t ExecutePython(const char *macro_name, Int_t *errcode=nullptr)
Executes Python script in ROOT interpreter.
void SetKeepOutputEvent(Bool_t val=kTRUE)
Mark current input event for reprocessing in next cycle.
virtual Bool_t CheckInputEvent(const char *classname)
Check if input event is valid.
TGo4Parameter * MakeParameter(const char *fullname, const char *classname, const char *newcmd=nullptr)
Create parameter of specified class,.
TGo4WinCond * MakeWinCond(const char *fullname, Double_t xmin, Double_t xmax, const char *HistoName=nullptr)
Create 1D window condition.
Bool_t AddAnalysisCondition(TGo4Condition *con, const char *subfolder=nullptr)
Register condition to go4 framework.
TCanvas * GetCanvas(const char *name)
Get TCanvas from go4 framework.
Bool_t AddHistogram(TH1 *his, const char *subfolder=nullptr, Bool_t replace=kTRUE)
Register histogram to go4 framework.
TGo4EventElement * fxInputEvent
1
void Message(Int_t prio, const char *text,...)
Display a user message.
void SetInputEvent(TGo4EventElement *raw)
Sets reference to external raw event which is used by the concrete processor to unpack the interestin...
Bool_t AddObject(TNamed *anything, const char *subfolder=nullptr)
Register user object to go4 framework.
TGo4ListCond * MakeListCond(const char *fullname, const Int_t num, const Int_t *values, const char *HistoName=nullptr)
Create "whitlelist" condition with separate values to test against condition is true if any of the va...
Bool_t RemovePicture(const char *name)
UnRegister picture from go4 framework and delete it.
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=nullptr)
Create ellipse shaped polygon condition.
virtual void UserPostLoop()
Method called when analysis is stopping.
TGo4EventProcessor(const char *name)
Bool_t IsKeepInputEvent() const
Is marked to keep input event.
Long64_t ExecuteScript(const char *script_name)
Executes ROOT script.
Long64_t ExecuteLine(const char *command, Int_t *errcode=nullptr)
Process ROOT command line.
TGo4EventCalibration * fxCalibration
aggregation
virtual void FinalizeEvent()
implemented by subclass to do actual processing.
Bool_t RemoveParameter(const char *name)
UnRegister parameter from go4 framework and delete it.
void SetMakeWithAutosave(Bool_t on=kTRUE)
Set flag to use data from autosave file in Make... methods (default true)
TGo4EventElement * GetOutputEvent(const char *stepname)
Returns the output event structure of analysis step.
Bool_t IsObjMade() const
Returns kTRUE if object in last Make... call was created, kFALSE when object was retrieved from autos...
TGo4ShapedCond * MakeFreeShapeCond(const char *fullname, Int_t npoints, Double_t(*points)[2], const char *HistoName=nullptr)
Create free shaped (polygon) condition.
Bool_t RemoveAnalysisCondition(const char *name)
UnRegister condition from go4 framework and delete it.
Bool_t RemoveCanvas(const char *name)
UnRegister canvas from go4 framework and delete it.
TGo4EventElement * GetInputEvent()
Access to external raw event which is set as association member.
TGo4PolyCond * MakePolyCond(const char *fullname, Int_t npoints, Double_t(*points)[2], const char *HistoName=nullptr)
Create polygon condition.
TGo4ShapedCond * MakeBoxCond(const char *fullname, Double_t cx, Double_t cy, Double_t a1, Double_t a2, Double_t theta, const char *HistoName=nullptr)
Create tilted rectangular box shaped polygon condition.
Bool_t RemoveHistogram(const char *name)
UnRegister histogram from go4 framework and delete it.
TH1 * GetHistogram(const char *name)
Get histogram from go4 framework.
Bool_t AddParameter(TGo4Parameter *par, const char *subfolder=nullptr)
Register parameter to go4 framework.
friend class TGo4EventElement
TGo4Condition * GetAnalysisCondition(const char *name, const char *cond_cl=nullptr)
Get condition from go4 framework.
Condition that checks a value against a list of "good" (or bad) values.
Wrapper for the standard gsi event structure as delivered from mbs.
Base class for all parameter aggregations, e.g.
Picture cconfiguration in Go4.
Definition TGo4Picture.h:40
Polygon condition.
Graphs that renew themselves iteratively to monitor a value.
Shaped condition.
Window condition.
Definition TGo4WinCond.h:26