GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4Condition.h
Go to the documentation of this file.
1 // $Id: TGo4Condition.h 1922 2016-06-13 10:23:16Z 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 TGO4CONDITION_H
15 #define TGO4CONDITION_H
16 
17 #include "TNamed.h"
18 #include "TAttLine.h"
19 #include "TAttFill.h"
20 #include "Riostream.h"
21 
22 class TH1;
23 class TVirtualPad;
24 class TCutG;
25 class TObjArray;
26 
27 class TGo4HistogramEntry;
28 class TGo4EventElement;
30 
31 
35 };
36 
37 class
38 
39 #ifndef __CINT__
40 #ifdef WIN32
41 #ifndef BUILDING_GO4BASE_DLL
42 __declspec(dllimport)
43 #endif
44 #endif
45 #endif
46 
47 
48 TGo4Condition : public TNamed, public TAttLine, public TAttFill {
49 
50  friend class TGo4CondArray;
51 
52  public:
53  TGo4Condition();
54 
55  TGo4Condition(const char* name, const char* title = "Go4 Condition");
56 
57  virtual ~TGo4Condition();
58 
60  virtual void Paint(Option_t* opt="");
61 
63  virtual void Draw(Option_t* opt="");
64 
66  virtual void UnDraw(Option_t* opt="");
67 
69  virtual void Pop();
70 
73 
75  virtual Int_t Counts();
76 
78  virtual Int_t TrueCounts();
79 
81  virtual void ResetCounts();
82 
84  virtual void SetCounts(Int_t truecounts, Int_t counts);
85 
88  virtual void Disable(Bool_t result);
89 
91  virtual void Enable();
92 
94  Bool_t IsEnabled() const { return fbEnabled; }
95 
99  virtual Bool_t Test();
100  virtual Bool_t Test(Double_t x, Double_t y) { return true; }
101  virtual Bool_t Test(Double_t x) { return true; }
102  virtual Bool_t Test(Bool_t result) { return true; }
103 
105  virtual void SetValues() {}
106  virtual void SetValues(Double_t low1, Double_t up1) {}
107  virtual void SetValues(Double_t low1, Double_t up1, Double_t low2, Double_t up2) {}
108  virtual void SetValues(TCutG * newcut) {}
109  virtual void SetValues(Double_t * x, Double_t * y, Int_t len) {}
110 
122  virtual void AddCondition(TGo4Condition* next);
123 
126  void IncCounts();
127 
130  void IncTrueCounts();
131 
134  Bool_t IsTrue() const { return fbTrue; }
135 
138  Bool_t IsFalse() const { return fbFalse; }
139 
141  Bool_t FixedResult() const { return fbResult; }
142 
145  virtual void Invert(Bool_t on);
146 
148  virtual void PrintCondition(Bool_t full=kTRUE);
149 
151  virtual void PrintBar();
152 
154  virtual void Print(Option_t* opt="") const;
155 
158  void SetLast(Bool_t value) { fbLastResult=value; }
159 
161  Bool_t GetLast() { return fbLastResult; }
162 
164  virtual Bool_t UpdateFrom(TGo4Condition * cond, Bool_t counts);
165 
167  virtual Bool_t UpdateFromUrl(const char* rest_url_opt);
168 
169  virtual void GetValues(Int_t & dim, Double_t & x1, Double_t & y1, Double_t & x2, Double_t & y2);
170  virtual Double_t GetXLow();
171  virtual Double_t GetXUp();
172  virtual Double_t GetYLow();
173  virtual Double_t GetYUp();
174  virtual TCutG* GetCut(Bool_t owner);
175 
178  virtual Double_t GetIntegral(TH1* histo, Option_t* opt="");
179 
181  virtual Double_t GetMean(TH1* histo, Int_t axis=1);
182 
184  virtual Double_t GetRMS(TH1* histo, Int_t axis=1);
185 
187  virtual Double_t GetSkewness(TH1* histo, Int_t axis=1);
188 
190  virtual Double_t GetCurtosis(TH1* histo, Int_t axis=1);
191 
193  virtual Double_t GetXMax(TH1* histo);
194 
196  virtual Double_t GetYMax(TH1* histo);
197 
199  virtual Double_t GetCMax(TH1* histo);
200 
203 
205  virtual void MarkReset(Bool_t on);
206 
207  virtual void Clear(Option_t* opt="");
208 
211  virtual void SetFlags(Bool_t enabled, Bool_t lastresult, Bool_t markreset,
212  Bool_t result, Bool_t truevalue, Bool_t falsevalue);
213 
216  virtual void GetFlags(Bool_t* enabled, Bool_t* lastresult, Bool_t* markreset,
217  Bool_t* result, Bool_t* truevalue, Bool_t* falsevalue);
218 
220  virtual void SetVisible(Bool_t on);
221 
223  virtual Bool_t IsVisible();
224 
226  void SetHistogramLink(Bool_t on);
227 
229  Bool_t IsHistogramLink();
230 
232  void SetHistogram(const char* name);
233 
235  const char* GetLinkedHistogram();
236 
239  void SetWorkHistogram(TH1* histo);
240 
242  TH1* GetWorkHistogram(){return fxHisto;}
243 
247  virtual void SetPainter(TGo4ConditionPainter* painter);
248 
251  void SetUpdateEpsilon(Double_t val){fdUpdateEpsilon=val;}
252 
253  Double_t GetUpdateEpsilon(){return fdUpdateEpsilon;}
254 
256  static const Double_t fgdUPDATEEPSILON;
257 
259  void SaveLabelStyle();
260 
262  void InitLabelStyle();
263 
266  void ResetLabel(Option_t* opt="reset");
267 
268  virtual void SetLabelDraw(Bool_t on);
269  virtual Bool_t IsLabelDraw();
270 
271  virtual void SetLimitsDraw(Bool_t on);
272  virtual Bool_t IsLimitsDraw();
273 
274  virtual void SetIntDraw(Bool_t on);
275  virtual Bool_t IsIntDraw();
276 
277  virtual void SetXMeanDraw(Bool_t on);
278  virtual Bool_t IsXMeanDraw();
279 
280  virtual void SetXRMSDraw(Bool_t on);
281  virtual Bool_t IsXRMSDraw();
282 
283  virtual void SetYMeanDraw(Bool_t on);
284  virtual Bool_t IsYMeanDraw();
285 
286  virtual void SetYRMSDraw(Bool_t on);
287  virtual Bool_t IsYRMSDraw();
288 
289  virtual void SetXMaxDraw(Bool_t on);
290  virtual Bool_t IsXMaxDraw();
291 
292  virtual void SetYMaxDraw(Bool_t on);
293  virtual Bool_t IsYMaxDraw();
294  virtual void SetCMaxDraw(Bool_t on);
295  virtual Bool_t IsCMaxDraw();
296 
297  virtual const char* GetLabelNumFormat();
298  virtual void SetLabelNumFormat(const char* fmt);
299 
300 
301  virtual void SetChanged(Bool_t on) { if (on) fiIsChanged++; else fiIsChanged = 0; }
302  virtual Int_t IsChanged() { return fiIsChanged; }
303 
304  void SetMultiEdit(Bool_t on){fbMultiEdit=on;}
305  virtual Bool_t IsMultiEdit(){return fbMultiEdit;}
306 
307  void SetDimension(Int_t d) { fiDim=d; }
308  Int_t GetDimension() { return fiDim; }
309 
310  void SetOwnedByEditor(Bool_t on){fbOwnedByEditor=on;}
312 
314  virtual void SetCurrentIndex(Int_t ix);
315 
317  virtual Int_t GetCurrentIndex();
318 
321  virtual Int_t GetNumberOfConditions();
322 
323  virtual Int_t GetMemorySize();
324 
325  virtual Bool_t IsPolygonType();
326  virtual Bool_t IsArrayType();
327 
328  void DeletePainter();
329 
331  static Bool_t fgbLABELDRAW;
332 
334  static Bool_t fgbLIMITSDRAW;
335 
337  static Bool_t fgbINTDRAW;
338 
340  static Bool_t fgbXMEANDRAW;
341 
343  static Bool_t fgbXRMSDRAW;
344 
346  static Bool_t fgbYMEANDRAW;
347 
349  static Bool_t fgbYRMSDRAW;
350 
352  static Bool_t fgbXMAXDRAW;
353 
355  static Bool_t fgbYMAXDRAW;
356 
358  static Bool_t fgbCMAXDRAW;
359 
361  static TString fgxNUMFORMAT;
362 
363 
365  static TString fgxURL_RESET;
367  static TString fgxURL_RESULT;
369  static TString fgxURL_INVERT;
371  static TString fgxURL_VISIBLE;
373  static TString fgxURL_LABEL;
375  static TString fgxURL_LIMITS;
377  static TString fgxURL_INTEGRAL;
379  static TString fgxURL_XMEAN;
381  static TString fgxURL_XRMS;
383  static TString fgxURL_YMEAN;
385  static TString fgxURL_YRMS;
387  static TString fgxURL_XMAX;
389  static TString fgxURL_YMAX;
391  static TString fgxURL_CMAX;
392 
393 
394  protected:
395 
400 
404  TH1* fxCutHis;
405 
406 
408  TObjArray* fxUrlOptionArray;
409 
411  void BuildUrlOptionArray(const char* rest_url_opt);
412 
414  Bool_t UrlOptionHasKey(const char* key);
415 
418  TString GetUrlOptionAsString(const char* key, TString def_value);
419 
420 
423  Int_t GetUrlOptionAsInt(const char* key, Int_t def_value);
424 
427  Double_t GetUrlOptionAsDouble(const char* key, Double_t def_value);
428 
429 
430  void SetPainted(Bool_t on) { fbIsPainted=on; }
431  Bool_t IsPainted() const { return fbIsPainted; }
432 
433  const char* MakeScript(std::ostream& out, const char* varname, Option_t* opt = "", const char* arrextraargs = 0);
434 
435  private:
436 
438  Int_t fiDim;
439 
440  Bool_t fbMarkReset;
441 
444  Bool_t fbLastResult;
445 
447  Bool_t fbTrue;
448 
450  Bool_t fbFalse;
451 
454 
456  Int_t fiCounts;
457 
462  Bool_t fbEnabled;
463 
465  Bool_t fbResult;
466 
469  Bool_t fbMultiEdit;
470 
472  Bool_t fbVisible;
473 
476 
478  TString fxHistoName;
479 
481  Double_t fdUpdateEpsilon;
482 
484  Bool_t fbLabelDraw;
485 
487  Bool_t fbLimitsDraw;
488 
490  Bool_t fbIntDraw;
491 
493  Bool_t fbXMeanDraw;
494 
496  Bool_t fbXRMSDraw;
497 
499  Bool_t fbYMeanDraw;
500 
502  Bool_t fbYRMSDraw;
503 
505  Bool_t fbXMaxDraw;
506 
508  Bool_t fbYMaxDraw;
509 
511  Bool_t fbCMaxDraw;
512 
514  TString fxNumFormat;
515 
518  TH1* fxHisto;
519 
521  Int_t fiIsChanged;
522 
525  Bool_t fbIsPainted;
526 
529 
532 
533  ClassDef(TGo4Condition,8)
534 };
535 
536 #endif //TGO4CONDITION_H
Double_t GetUpdateEpsilon()
virtual Double_t GetRMS(TH1 *histo, Int_t axis=1)
TString fxNumFormat
Bool_t IsHistogramLink()
static Bool_t fgbXRMSDRAW
virtual void Enable()
virtual void SetChanged(Bool_t on)
static TString fgxURL_CMAX
virtual Int_t TrueCounts()
virtual void MarkReset(Bool_t on)
virtual void SetIntDraw(Bool_t on)
virtual Bool_t IsVisible()
virtual Bool_t IsXMaxDraw()
static Bool_t fgbYMAXDRAW
Bool_t UrlOptionHasKey(const char *key)
static TString fgxURL_XRMS
static Bool_t fgbLIMITSDRAW
Bool_t fbLastResult
void SetUpdateEpsilon(Double_t val)
Bool_t GetLast()
static TString fgxURL_RESET
virtual Bool_t IsXRMSDraw()
virtual void SetLimitsDraw(Bool_t on)
void PrintCondition(Bool_t points)
virtual void UnDraw(Option_t *opt="")
virtual Bool_t IsXMeanDraw()
Bool_t fbMarkReset
virtual Int_t IsChanged()
Bool_t IsFalse() const
virtual void GetFlags(Bool_t *enabled, Bool_t *lastresult, Bool_t *markreset, Bool_t *result, Bool_t *truevalue, Bool_t *falsevalue)
virtual void SetValues(TCutG *newcut)
virtual void SetYRMSDraw(Bool_t on)
Int_t GetDimension()
virtual void SetLabelNumFormat(const char *fmt)
TString GetUrlOptionAsString(const char *key, TString def_value)
virtual void SetXMaxDraw(Bool_t on)
virtual Double_t GetYMax(TH1 *histo)
virtual Bool_t IsLimitsDraw()
static Bool_t fgbCMAXDRAW
virtual void SetPainter(TGo4ConditionPainter *painter)
static TString fgxURL_YMEAN
virtual Int_t Counts()
virtual Double_t GetXMax(TH1 *histo)
virtual ~TGo4Condition()
Bool_t IsEnabled() const
Definition: TGo4Condition.h:94
Bool_t fbOwnedByEditor
static Bool_t fgbLABELDRAW
Bool_t fbHistogramLink
void BuildUrlOptionArray(const char *rest_url_opt)
ConditionsKind
Definition: TGo4Condition.h:32
static TString fgxNUMFORMAT
static TString fgxURL_RESULT
virtual void SetValues()
virtual Double_t GetIntegral(TH1 *histo, Option_t *opt="")
static Bool_t fgbXMEANDRAW
Bool_t fbYMeanDraw
void SetOwnedByEditor(Bool_t on)
virtual Bool_t UpdateFrom(TGo4Condition *cond, Bool_t counts)
Bool_t fbIsPainted
virtual void SetVisible(Bool_t on)
static TString fgxURL_INTEGRAL
virtual Bool_t IsIntDraw()
Bool_t FixedResult() const
virtual Bool_t Test(Double_t x, Double_t y)
void SetPainted(Bool_t on)
virtual Double_t GetXLow()
virtual void SetCounts(Int_t truecounts, Int_t counts)
virtual void SetValues(Double_t low1, Double_t up1)
virtual Bool_t IsArrayType()
Bool_t fbMultiEdit
virtual void SetValues(Double_t low1, Double_t up1, Double_t low2, Double_t up2)
virtual void SetYMeanDraw(Bool_t on)
virtual TGo4Condition * GetActiveCondition()
virtual void PrintBar()
virtual Double_t GetMean(TH1 *histo, Int_t axis=1)
virtual Bool_t Test(Bool_t result)
virtual Double_t GetCurtosis(TH1 *histo, Int_t axis=1)
virtual Int_t GetNumberOfConditions()
virtual Bool_t UpdateFromUrl(const char *rest_url_opt)
virtual void Invert(Bool_t on)
virtual void Pop()
virtual void Disable(Bool_t result)
virtual Bool_t IsMultiEdit()
virtual void Clear(Option_t *opt="")
void SetHistogramLink(Bool_t on)
Bool_t fbXMeanDraw
virtual Bool_t IsYMaxDraw()
virtual Double_t GetYLow()
virtual void SetValues(Double_t *x, Double_t *y, Int_t len)
virtual void Print(Option_t *opt="") const
static Bool_t fgbYMEANDRAW
virtual void SetFlags(Bool_t enabled, Bool_t lastresult, Bool_t markreset, Bool_t result, Bool_t truevalue, Bool_t falsevalue)
void SetHistogram(const char *name)
virtual Bool_t IsCMaxDraw()
static TString fgxURL_VISIBLE
static TString fgxURL_INVERT
Bool_t IsPainted() const
Bool_t IsTrue() const
virtual void SetCMaxDraw(Bool_t on)
virtual void SetYMaxDraw(Bool_t on)
TH1 * GetWorkHistogram()
virtual Bool_t Test(Double_t x)
virtual const char * GetLabelNumFormat()
void ResetLabel(Option_t *opt="reset")
virtual Bool_t IsYRMSDraw()
const char * MakeScript(std::ostream &out, const char *varname, Option_t *opt="", const char *arrextraargs=0)
void SetMultiEdit(Bool_t on)
static TString fgxURL_YMAX
static Bool_t fgbXMAXDRAW
virtual Double_t GetSkewness(TH1 *histo, Int_t axis=1)
virtual Bool_t IsLabelDraw()
virtual void Draw(Option_t *opt="")
virtual void SetXMeanDraw(Bool_t on)
virtual TGo4ConditionPainter * CreatePainter()
virtual void SetXRMSDraw(Bool_t on)
virtual void Paint(Option_t *opt="")
Bool_t IsOwnedByEditor()
TGo4ConditionPainter * fxPainter
static TString fgxURL_LIMITS
void SetLast(Bool_t value)
static Bool_t fgbYRMSDRAW
void SetWorkHistogram(TH1 *histo)
TObjArray * fxUrlOptionArray
virtual void GetValues(Int_t &dim, Double_t &x1, Double_t &y1, Double_t &x2, Double_t &y2)
GO4 ConditionPainter prototype Test
Definition: condition.js:691
virtual Bool_t IsPolygonType()
Int_t GetUrlOptionAsInt(const char *key, Int_t def_value)
virtual void SetCurrentIndex(Int_t ix)
const char * GetLinkedHistogram()
virtual Bool_t IsYMeanDraw()
static TString fgxURL_XMEAN
TString fxHistoName
virtual Double_t GetXUp()
static TString fgxURL_YRMS
virtual void SetLabelDraw(Bool_t on)
virtual Double_t GetCMax(TH1 *histo)
virtual void AddCondition(TGo4Condition *next)
Bool_t fbLimitsDraw
static TString fgxURL_LABEL
virtual TCutG * GetCut(Bool_t owner)
static const Double_t fgdUPDATEEPSILON
virtual void ResetCounts()
Double_t fdUpdateEpsilon
Double_t GetUrlOptionAsDouble(const char *key, Double_t def_value)
virtual Int_t GetMemorySize()
Bool_t fbLabelDraw
static TString fgxURL_XMAX
virtual Double_t GetYUp()
void SetDimension(Int_t d)
Bool_t fbStreamedCondition
static Bool_t fgbINTDRAW
virtual Int_t GetCurrentIndex()