GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4EventProcessor.cxx
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#include "TGo4EventProcessor.h"
15
16#include <cstring>
17#include <stdarg.h>
18
19#include "TGo4Log.h"
20#include "TGo4EventElement.h"
22#include "TGo4AnalysisImp.h"
23
25{
26GO4TRACE((15,"TGo4EventProcessor::TGo4EventProcessor()",__LINE__, __FILE__));
27}
28
30{
31GO4TRACE((15,"TGo4EventProcessor::~TGo4EventProcessor()",__LINE__, __FILE__));
32}
33
34Bool_t TGo4EventProcessor::CheckInputEvent(const char *classname)
35{
36 GO4TRACE((12,"TGo4EventProcessor::CheckInputEvent()",__LINE__, __FILE__));
37 if(!fxInputEvent) return kFALSE;
38
39 return !strcmp(fxInputEvent->ClassName(),classname);
40}
41
42Bool_t TGo4EventProcessor::CheckCalibration(const char *classname)
43{
44 GO4TRACE((12,"TGo4EventProcessor::CheckCalibration()",__LINE__, __FILE__));
45 if(!fxCalibration) return kFALSE;
46
47 return !strcmp(fxCalibration->ClassName(),classname);
48}
49
50Bool_t TGo4EventProcessor::AddObject(TNamed *any, const char *subfolder)
51{
52 return TGo4Analysis::Instance()->AddObject(any,subfolder);
53}
54
55Bool_t TGo4EventProcessor::AddHistogram(TH1 *his, const char *subfolder, Bool_t replace)
56{
57 return TGo4Analysis::Instance()->AddHistogram(his,subfolder,replace);
58}
59
60Bool_t TGo4EventProcessor::AddParameter(TGo4Parameter *par,const char *subfolder)
61{
62 return TGo4Analysis::Instance()->AddParameter(par,subfolder);
63}
64
65Bool_t TGo4EventProcessor::AddPicture(TGo4Picture *pic,const char *subfolder)
66{
67 return TGo4Analysis::Instance()->AddPicture(pic,subfolder);
68}
69
70Bool_t TGo4EventProcessor::AddCanvas(TCanvas *can, const char *subfolder)
71{
72 return TGo4Analysis::Instance()->AddCanvas(can,subfolder);
73}
74
76{
77 return TGo4Analysis::Instance()->AddAnalysisCondition(con,subfolder);
78}
79
81{
83}
84
86{
88}
89
90Bool_t TGo4EventProcessor::RemovePicture(const char *name)
91{
93}
94
95Bool_t TGo4EventProcessor::RemoveCanvas(const char *name)
96{
98}
99
104
105TNamed *TGo4EventProcessor::GetObject(const char *name, const char *folder)
106{
107 return TGo4Analysis::Instance()->GetObject(name,folder);
108}
109
111{
112 return TGo4Analysis::Instance()->GetHistogram(name);
113}
114
115TGo4Parameter *TGo4EventProcessor::GetParameter(const char *name, const char *par_class)
116{
117 return TGo4Analysis::Instance()->GetParameter(name, par_class);
118}
119
121{
122 return TGo4Analysis::Instance()->GetPicture(name);
123}
124
125TCanvas *TGo4EventProcessor::GetCanvas(const char *name)
126{
127 return TGo4Analysis::Instance()->GetCanvas(name);
128}
129
130TGo4Condition *TGo4EventProcessor::GetAnalysisCondition(const char *name, const char *cond_cl)
131{
132 return TGo4Analysis::Instance()->GetAnalysisCondition(name, cond_cl);
133}
134
136{
137 return TGo4Analysis::Instance()->GetInputEvent(stepname);
138}
139
141{
142 return TGo4Analysis::Instance()->GetOutputEvent(stepname);
143}
144
145void TGo4EventProcessor::Message(Int_t prio, const char *text,...)
146{
147 char txtbuf[__MESSAGETEXTLENGTH__];
148 va_list args;
149 va_start(args, text);
150 vsnprintf(txtbuf, __MESSAGETEXTLENGTH__, text, args);
151 va_end(args);
152 TGo4Analysis::Instance()->Message(prio, "%s", txtbuf);
153}
154
159
161{
162 TGo4Log::Info("Default Clear of event processor %s", GetName());
163 // dummy clear, may be implemented by user
164}
165
170
172{
174}
175
176TH1 *TGo4EventProcessor::MakeTH1(char type, const char *fullname, const char *title,
177 Int_t nbinsx, Double_t xlow, Double_t xup,
178 const char *xtitle, const char *ytitle)
179{
180 return TGo4Analysis::Instance()->MakeTH1(type, fullname, title,
181 nbinsx, xlow, xup,
182 xtitle, ytitle);
183}
184
185TH2 *TGo4EventProcessor::MakeTH2(char type, const char *fullname, const char *title,
186 Int_t nbinsx, Double_t xlow, Double_t xup,
187 Int_t nbinsy, Double_t ylow, Double_t yup,
188 const char *xtitle, const char *ytitle, const char *ztitle)
189{
190 return TGo4Analysis::Instance()->MakeTH2(type, fullname, title,
191 nbinsx, xlow, xup,
192 nbinsy, ylow, yup,
193 xtitle, ytitle, ztitle);
194}
195
196TGraph *TGo4EventProcessor::MakeGraph(const char *fullname, const char *title, Int_t points, Double_t *xvalues,
197 Double_t *yvalues)
198{
199 return TGo4Analysis::Instance()->MakeGraph(fullname, title, points, xvalues, yvalues);
200}
201
202TGraph *TGo4EventProcessor::MakeGraph(const char *fullname, const char *title, TF1 *function)
203{
204 return TGo4Analysis::Instance()->MakeGraph(fullname, title, function);
205}
206
207TGo4RollingGraph *TGo4EventProcessor::MakeRollingGraph(const char *fullname, const char *title, Int_t points, Int_t average)
208{
209 return TGo4Analysis::Instance()->MakeRollingGraph(fullname, title, points, average);
210}
211
212
214 Double_t xmin, Double_t xmax,
215 const char *HistoName)
216{
217 return TGo4Analysis::Instance()->MakeWinCond(fullname, xmin, xmax, HistoName);
218}
219
221 Double_t xmin, Double_t xmax,
222 Double_t ymin, Double_t ymax,
223 const char *HistoName)
224{
225 return TGo4Analysis::Instance()->MakeWinCond(fullname,
226 xmin, xmax,
227 ymin, ymax,
228 HistoName);
229}
230
232 Int_t npoints,
233 Double_t (*points) [2],
234 const char *HistoName)
235{
236 return TGo4Analysis::Instance()->MakePolyCond(fullname, npoints, points, HistoName);
237}
238
239
240TGo4ShapedCond *TGo4EventProcessor::MakeEllipseCond(const char *fullname, Int_t npoints, Double_t cx, Double_t cy,
241 Double_t a1, Double_t a2, Double_t theta, const char *HistoName)
242{
243 return TGo4Analysis::Instance()->MakeEllipseCond(fullname, npoints, cx, cy, a1, a2, theta, HistoName);
244}
245
246TGo4ShapedCond *TGo4EventProcessor::MakeCircleCond(const char *fullname, Int_t npoints, Double_t cx, Double_t cy,
247 Double_t r, const char *HistoName)
248{
249 return TGo4Analysis::Instance()->MakeCircleCond(fullname, npoints, cx, cy, r, HistoName);
250}
251
253 Double_t cx, Double_t cy, Double_t a1, Double_t a2, Double_t theta,
254 const char *HistoName )
255{
256 return TGo4Analysis::Instance()->MakeBoxCond(fullname, cx, cy, a1, a2, theta,HistoName);
257}
258
260 Int_t npoints,
261 Double_t (*points) [2],
262 const char *HistoName)
263{
264 return TGo4Analysis::Instance()->MakeFreeShapeCond(fullname,npoints,points,HistoName);
265}
266
267
268TGo4ListCond *TGo4EventProcessor::MakeListCond(const char *fullname, const Int_t num, const Int_t * values, const char *HistoName)
269{
270 return TGo4Analysis::Instance()->MakeListCond(fullname, num, values, HistoName);
271}
272
273
274TGo4ListCond *TGo4EventProcessor::MakeListCond(const char *fullname, const Int_t start, const Int_t stop, const Int_t step, const char *HistoName)
275{
276 return TGo4Analysis::Instance()->MakeListCond(fullname, start, stop, step,HistoName);
277}
278
279
280TGo4ListCond *TGo4EventProcessor::MakeListCond(const char *fullname, const char *title, const char *HistoName)
281{
282 return TGo4Analysis::Instance()->MakeListCond(fullname, title, HistoName);
283}
284
285
287 const char *classname,
288 const char *newcmd)
289{
290 return TGo4Analysis::Instance()->MakeParameter(fullname, classname, newcmd);
291}
292
293Long64_t TGo4EventProcessor::ExecuteScript(const char *macro_name)
294{
295 return TGo4Analysis::Instance()->ExecuteScript(macro_name);
296}
297
298Long64_t TGo4EventProcessor::ExecutePython(const char *macro_name, Int_t *errcode)
299{
300 return TGo4Analysis::Instance()->ExecutePython(macro_name, errcode);
301}
302
303Long64_t TGo4EventProcessor::ExecuteLine(const char *command, Int_t *errcode)
304{
305 return TGo4Analysis::Instance()->ExecuteLine(command, errcode);
306}
#define GO4TRACE(X)
Definition TGo4Log.h:25
#define __MESSAGETEXTLENGTH__
Definition TGo4Log.h:22
TGo4ShapedCond * MakeFreeShapeCond(const char *fullname, Int_t npoints, Double_t(*points)[2], const char *HistoName=nullptr)
Create free shaped (polygon) condition.
TGo4EventElement * GetInputEvent(const char *stepname) const
Returns the input event structure of analysis step.
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...
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.
static TGo4Analysis * Instance()
return analysis instance
Bool_t IsObjMade() const
Returns kTRUE if object in last Make... call was created, kFALSE when object was retrieved from autos...
Long64_t ExecuteScript(const char *script_name)
Executes ROOT script.
void Message(Int_t prio, const char *text,...)
Display a user message.
TGraph * MakeGraph(const char *fullname, const char *title, Int_t points=0, Double_t *xvalues=nullptr, Double_t *yvalues=nullptr)
Create a TGraph with initial values as specified by points, xvalues and yvalues.
TGo4Parameter * MakeParameter(const char *fullname, const char *classname, const char *cmd=nullptr)
Create parameter of specified class,.
TCanvas * GetCanvas(const char *name)
Retrieves a TCanvas by name from the Canvases folder.
TNamed * GetObject(const char *name, const char *folder=nullptr)
Searches for object by name in all directories.
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.
TGo4WinCond * MakeWinCond(const char *fullname, Double_t xmin, Double_t xmax, const char *HistoName=nullptr)
Create 1D window condition.
Bool_t RemoveHistogram(const char *name, Bool_t del=kTRUE)
Removes histogram from histogram dir by name.
TGo4PolyCond * MakePolyCond(const char *fullname, Int_t npoints, Double_t(*points)[2], const char *HistoName=nullptr, Bool_t shapedcond=kFALSE)
Create polygon condition.
Bool_t AddAnalysisCondition(TGo4Condition *con, const char *subfolder=nullptr)
Puts a new analysis condition object in corresponding list.
void SetMakeWithAutosave(Bool_t on=kTRUE)
Set flag to use data from autosave file in Make... methods (default true)
Bool_t AddPicture(TGo4Picture *pic, const char *subfolder=nullptr)
Puts a new picture object in corresponding folder.
Bool_t AddObject(TNamed *anything, const char *subfolder=nullptr, Bool_t replace=kTRUE)
Add any external object to the user object folder.
TGo4EventElement * GetOutputEvent(const char *stepname) const
Returns the output event (detector) structure of analysis step.
Bool_t AddParameter(TGo4Parameter *par, const char *subfolder=nullptr)
Puts a new parameter object in corresponding folder.
Bool_t RemoveCanvas(const char *name)
Removes TCanvas by name.
TH1 * GetHistogram(const char *name)
Search histogram in histogram list (directory).
Bool_t RemovePicture(const char *name)
Removes picture by name.
Long64_t ExecuteLine(const char *command, Int_t *errcode=nullptr)
Process ROOT command line.
Long64_t ExecutePython(const char *script_name, Int_t *errcode=nullptr)
Executes Python script in ROOT interpreter.
Bool_t AddHistogram(TH1 *his, const char *subfolder=nullptr, Bool_t replace=kTRUE)
Add external histogram to go4 histogram directory.
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.
TGo4Picture * GetPicture(const char *name)
Retrieves a picture object by name from the object folder.
Bool_t AddCanvas(TCanvas *can, const char *subfolder=nullptr)
Puts a new TCanvas in corresponding folder.
Bool_t RemoveAnalysisCondition(const char *name)
Removes analysis condition from list by name.
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.
TGo4Condition * GetAnalysisCondition(const char *name, const char *cond_cl=nullptr)
Retrieves an analysis condition from list by name.
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.
TGo4Parameter * GetParameter(const char *name, const char *parameter_class=nullptr)
Retrieves a parameter object by name from the object folder.
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.
Bool_t RemoveParameter(const char *name)
Removes parameter by name.
void SendObjectToGUI(TObject *ob)
User May send any named object via data channel to the gui.
Go4 condition class.
Bool_t AddPicture(TGo4Picture *pic, const char *subfolder=nullptr)
Register picture to go4 framework.
Bool_t AddCanvas(TCanvas *can, const char *subfolder=nullptr)
Register TCanvas to go4 framework.
TGraph * MakeGraph(const char *fullname, const char *title, Int_t points=0, Double_t *xvalues=nullptr, Double_t *yvalues=nullptr)
Create a TGraph with initial values as specified by points, xvalues and yvalues.
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.
TGo4Picture * GetPicture(const char *name)
Get picture from go4 framework.
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.
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
Long64_t ExecutePython(const char *macro_name, Int_t *errcode=nullptr)
Executes Python script in ROOT interpreter.
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.
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.
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
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.
static void Info(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 1.
Definition TGo4Log.cxx:294
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