14#ifndef TGO4CONDITION_H
15#define TGO4CONDITION_H
44 TGo4Condition(
const char *name,
const char *title =
"Go4 Condition");
49 void Paint(Option_t *opt =
"")
override;
52 void Draw(Option_t *opt =
"")
override;
55 virtual void UnDraw(Option_t *opt =
"");
73 virtual void SetCounts(Int_t truecounts, Int_t counts);
77 virtual void Disable(Bool_t result);
88 virtual Bool_t
Test();
89 virtual Bool_t
Test(Double_t x, Double_t y) {
return true; }
90 virtual Bool_t
Test(Double_t x) {
return true; }
95 virtual void SetValues(Double_t low1, Double_t up1) {}
96 virtual void SetValues(Double_t low1, Double_t up1, Double_t low2, Double_t up2) {}
98 virtual void SetValues(Double_t * x, Double_t * y, Int_t len) {}
134 virtual void Invert(Bool_t on);
143 void Print(Option_t *opt =
"")
const override;
158 virtual void GetValues(Int_t &dim, Double_t &x1, Double_t &y1, Double_t &x2, Double_t &y2);
159 virtual Double_t
GetXLow()
const {
return 0.; }
160 virtual Double_t
GetXUp()
const {
return 0.; }
161 virtual Double_t
GetYLow()
const {
return 0.; }
162 virtual Double_t
GetYUp()
const {
return 0.; }
163 virtual TCutG *
GetCut(Bool_t owner) {
return nullptr; }
167 virtual Double_t
GetIntegral(TH1 *, Option_t * =
"") {
return 0.; }
170 virtual Double_t
GetMean(TH1 *, Int_t = 1) {
return 0.; }
173 virtual Double_t
GetRMS(TH1 *, Int_t = 1) {
return 0.; }
182 virtual Double_t
GetXMax(TH1 *) {
return 0.; }
185 virtual Double_t
GetYMax(TH1 *) {
return 0.; }
188 virtual Double_t
GetCMax(TH1 *) {
return 0.; }
196 void Clear(Option_t *opt =
"")
override;
200 virtual void SetFlags(Bool_t enabled, Bool_t lastresult, Bool_t markreset,
201 Bool_t result, Bool_t truevalue, Bool_t falsevalue);
205 virtual void GetFlags(Bool_t *enabled, Bool_t *lastresult, Bool_t *markreset,
206 Bool_t *result, Bool_t *truevalue, Bool_t *falsevalue);
386 static void SetGlobalStyle(Bool_t LABELDRAW, Bool_t LIMITSDRAW, Bool_t INTDRAW,
387 Bool_t XMEANDRAW, Bool_t YMEANDRAW, Bool_t XRMSDRAW, Bool_t YRMSDRAW,
388 Bool_t XMAXDRAW, Bool_t YMAXDRAW, Bool_t CMAXDRAW,
const char *NUMFORMAT);
390 static void GetGlobalStyle(Bool_t &LABELDRAW, Bool_t &LIMITSDRAW, Bool_t &INTDRAW,
391 Bool_t &XMEANDRAW, Bool_t &YMEANDRAW, Bool_t &XRMSDRAW, Bool_t &YRMSDRAW,
392 Bool_t &XMAXDRAW, Bool_t &YMAXDRAW, Bool_t &CMAXDRAW, TString &NUMFORMAT);
425 const char *
MakeScript(std::ostream &out,
const char *varname, Option_t *opt =
"",
const char *arrextraargs =
nullptr);
virtual Int_t TrueCounts()
Return number of true results of the Test method call.
virtual void SetCurrentIndex(Int_t)
set index for array type subclasses
virtual TCutG * GetCut(Bool_t owner)
virtual Bool_t Test(Double_t x)
Bool_t fbTrue
These are inverted by Invert(true), and restored by Invert(false)
virtual Bool_t IsYMaxDraw() const
static Bool_t fgbCMAXDRAW
default setting for all conditions for label draw cmax flag.
virtual void SetValues(Double_t *x, Double_t *y, Int_t len)
virtual Double_t GetXUp() const
virtual Int_t GetNumberOfConditions() const
for condition aggregates: return total number of conditions, i.e.size of condition array
virtual Bool_t Test(Double_t x, Double_t y)
Bool_t fbHistogramLink
is true if this condition has link to a histogram name
Bool_t fbCMaxDraw
If true, draw corresponding value as label on working pad.
Double_t GetUpdateEpsilon() const
void Clear(Option_t *opt="") override
Bool_t fbIsPainted
Flag to prevent Paint() method to redraw condition views after UnDraw.
virtual void SetYMeanDraw(Bool_t on)
TH1 * fxHisto
Reference to currently used histogram (for statistics boxes).
static TString fgxURL_RESULT
web condition editor keyword used in UpdateFromUrl.
virtual TGo4ConditionPainter * CreatePainter()
Factory method to generate the subclass implementation for painter.
void SetPainted(Bool_t on)
static TString fgxURL_YMAX
web condition editor keyword used in UpdateFromUrl.
virtual void SetValues(Double_t low1, Double_t up1, Double_t low2, Double_t up2)
virtual Bool_t IsXMaxDraw() const
void SetUpdateEpsilon(Double_t val)
Configure graphical update tolerance for this condition individually.
Int_t fiCounts
Counts the number of calls of the Test method.
Bool_t fbFalse
These are inverted by Invert(true), and restored by Invert(false).
virtual Double_t GetCurtosis(TH1 *, Int_t=1)
Calculate value for histogram inside condition limits.
static void SetGlobalStyle(Bool_t LABELDRAW, Bool_t LIMITSDRAW, Bool_t INTDRAW, Bool_t XMEANDRAW, Bool_t YMEANDRAW, Bool_t XRMSDRAW, Bool_t YRMSDRAW, Bool_t XMAXDRAW, Bool_t YMAXDRAW, Bool_t CMAXDRAW, const char *NUMFORMAT)
Bool_t fbXMeanDraw
If true, draw corresponding value as label on working pad.
static TString fgxURL_XRMS
web condition editor keyword used in UpdateFromUrl.
friend class TGo4CondArray
virtual Bool_t IsYMeanDraw() const
Bool_t fbXRMSDraw
If true, draw corresponding value as label on working pad.
static TString fgxURL_VISIBLE
web condition editor keyword used in UpdateFromUrl.
static TString fgxNUMFORMAT
default setting for all conditions with format string for numbers.
virtual Bool_t UpdateFrom(TGo4Condition *cond, Bool_t counts)
Copy values from cond to this.
void SetHistogramLink(Bool_t on)
Define if this condition has association with an analysis histogram.
void InitLabelStyle()
Initialize label setup from static default variables.
TString GetUrlOptionAsString(const char *key, TString def_value)
Scan list of url options for key.
Double_t GetUrlOptionAsDouble(const char *key, Double_t def_value)
Scan list of url options for key.
Bool_t fbXMaxDraw
If true, draw corresponding value as label on working pad.
static TString fgxURL_LIMITS
web condition editor keyword used in UpdateFromUrl.
Int_t fiIsChanged
Counter indicate how many times condition was changed from graphical view.
TString fxNumFormat
format string for all label numbers.
virtual void SetLabelDraw(Bool_t on)
virtual const TGo4Condition * GetActiveCondition() const
To be overwritten for condition array.
static TString fgxURL_YMEAN
web condition editor keyword used in UpdateFromUrl.
virtual void SetVisible(Bool_t on)
Set/Unset visibility.
static TString fgxURL_YRMS
web condition editor keyword used in UpdateFromUrl.
virtual void GetFlags(Bool_t *enabled, Bool_t *lastresult, Bool_t *markreset, Bool_t *result, Bool_t *truevalue, Bool_t *falsevalue)
Sets values of internal boolean flags to external variables.
virtual void Enable()
Enable (unfreeze) Test execution.
virtual Bool_t UpdateFromUrl(const char *rest_url_opt)
Method used by HTTP server to update some fields, specified in URL syntax.
Bool_t fbYMeanDraw
If true, draw corresponding value as label on working pad.
virtual void SetCounts(Int_t truecounts, Int_t counts)
Set counters.
void SetOwnedByEditor(Bool_t on)
Int_t fiDim
Dimension (1 or 2).
virtual void SetPainter(TGo4ConditionPainter *painter)
Replace default painter of this condition by external one.
virtual void SetLimitsDraw(Bool_t on)
Int_t GetUrlOptionAsInt(const char *key, Int_t def_value)
Scan list of url options for key.
virtual void SetValues()
Set values needed, i.e.
TH1 * GetWorkHistogram() const
access work histogram reference
static TString fgxURL_LABEL
web condition editor keyword used in UpdateFromUrl.
virtual void GetValues(Int_t &dim, Double_t &x1, Double_t &y1, Double_t &x2, Double_t &y2)
virtual void AddCondition(TGo4Condition *next)
Add another condition to this one.
virtual Double_t GetMean(TH1 *, Int_t=1)
Calculate value for histogram inside condition limits.
virtual Bool_t IsPolygonType() const
virtual Int_t GetMemorySize() const
Int_t GetDimension() const
const char * GetLinkedHistogram() const
Access name of the associated histogram.
virtual Bool_t IsYRMSDraw() const
static Bool_t fgbLABELDRAW
default setting for all conditions for label draw on/off flag.
virtual Bool_t IsXMeanDraw() const
Bool_t fbLastResult
This can be used to store the last result by SetLast(bool).
void SetHistogram(const char *name)
Define the name of the associated histogram.
virtual void ResetCounts()
Clear counters.
virtual Double_t GetSkewness(TH1 *, Int_t=1)
Calculate value for histogram inside condition limits.
virtual void SetValues(Double_t low1, Double_t up1)
Bool_t fbYMaxDraw
If true, draw corresponding value as label on working pad.
static Bool_t fgbYMAXDRAW
default setting for all conditions for label draw ymax flag.
void IncCounts()
Increment the test counter.
Bool_t fbLabelDraw
If true, draw corresponding value as label on working pad.
virtual void SetIntDraw(Bool_t on)
virtual Bool_t IsArrayType() const
void Pop() override
Re-implement TObject method to pop all our views to front.
virtual Int_t Counts()
Return number of calls of the Test method.
TGo4ConditionPainter * fxPainter
Painter instance to display the condition in root pad.
TObjArray * fxUrlOptionArray
array with TObjStrings evaluated by UpdateFromUrl
Bool_t fbOwnedByEditor
Flag to suppress interactive deletion of condition.
void ResetLabel(Option_t *opt="reset")
Will reset label position to defaults with other option than reset, just pop label to front.
Bool_t fbIntDraw
If true, draw corresponding value as label on working pad.
static Bool_t fgbXRMSDRAW
default setting for all conditions for label draw xrms flag.
Bool_t IsHistogramLink() const
True if the histogram of given name is linked to this.
Bool_t fbStreamedCondition
This allows to treat conditions streamed into pad.
Double_t fdUpdateEpsilon
Precision for the check if graphical representation change requires update.
virtual void SetYRMSDraw(Bool_t on)
Bool_t FixedResult() const
Returns the value set by Disable(value).
static TString fgxURL_INTEGRAL
web condition editor keyword used in UpdateFromUrl.
static TString fgxURL_XMAX
web condition editor keyword used in UpdateFromUrl.
void Draw(Option_t *opt="") override
Draw this condition on current pad.
static Bool_t fgbXMAXDRAW
default setting for all conditions for label draw xmax flag.
void BuildUrlOptionArray(const char *rest_url_opt)
re-build the list of url options from string
virtual Bool_t Test()
Test if condition is true.
virtual Bool_t IsLimitsDraw() const
virtual Int_t IsChanged() const
static const Double_t fgdUPDATEEPSILON
default value for graphical update tolerance.
void SetDimension(Int_t d)
Bool_t fbResult
If fbEnabled is false, return this as result.
virtual void SetYMaxDraw(Bool_t on)
TString fxHistoName
contains associated histogram name
virtual Double_t GetYMax(TH1 *)
Calculate value for histogram inside condition limits.
virtual Bool_t IsXRMSDraw() const
Bool_t fbVisible
Property to store visibility of condition on display.
virtual Bool_t IsVisible() const
Visibility property for gui display in editor.
Bool_t fbEnabled
Flag to enable/disable this condition.
virtual Bool_t IsCMaxDraw() const
virtual Double_t GetXLow() const
virtual Bool_t IsIntDraw() const
void SetMultiEdit(Bool_t on)
void IncTrueCounts()
Increment the "test was true" counter.
Bool_t IsTrue() const
Use this as return, if test was true.
void Print(Option_t *opt="") const override
Default printout for root object lists.
virtual void SetXRMSDraw(Bool_t on)
virtual Bool_t IsLabelDraw() const
static TString fgxURL_CMAX
web condition editor keyword used in UpdateFromUrl.
Bool_t UrlOptionHasKey(const char *key)
returns true if key is present in list of url options.
virtual void SetXMeanDraw(Bool_t on)
virtual void SetChanged(Bool_t on=kTRUE)
virtual void PrintCondition(Bool_t full=kTRUE)
Prints counters and boolean members.
Bool_t IsFalse() const
Use this as return, if test was false.
static void GetGlobalStyle(Bool_t &LABELDRAW, Bool_t &LIMITSDRAW, Bool_t &INTDRAW, Bool_t &XMEANDRAW, Bool_t &YMEANDRAW, Bool_t &XRMSDRAW, Bool_t &YRMSDRAW, Bool_t &XMAXDRAW, Bool_t &YMAXDRAW, Bool_t &CMAXDRAW, TString &NUMFORMAT)
virtual void Disable(Bool_t result)
Freeze condition, on Test() return result.
virtual Double_t GetCMax(TH1 *)
Calculate value for histogram inside condition limits.
Bool_t GetLast() const
Returns result of last Test.
virtual void PrintBar()
Prints counters and bar.
virtual void SetFlags(Bool_t enabled, Bool_t lastresult, Bool_t markreset, Bool_t result, Bool_t truevalue, Bool_t falsevalue)
Sets values of external boolean flags to internal variables.
Bool_t IsOwnedByEditor() const
virtual Double_t GetIntegral(TH1 *, Option_t *="")
Calculate value for histogram inside condition limits.
virtual Int_t GetCurrentIndex() const
get index for array type subclasses
virtual void Invert(Bool_t on)
Inverts return values, when on is true, i.e.
Int_t fiTrueCounts
Counts the number of calls of the Test method with true result.
static Bool_t fgbYMEANDRAW
default setting for all conditions for label draw ymean flag.
virtual void MarkReset(Bool_t on)
defines if condition counters shall be reset in UpdateFrom method
virtual const char * GetLabelNumFormat() const
virtual Double_t GetXMax(TH1 *)
Calculate value for histogram inside condition limits.
static Bool_t fgbLIMITSDRAW
default setting for all conditions for label draw limits flag.
static TString fgxURL_INVERT
web condition editor keyword used in UpdateFromUrl.
static Bool_t fgbINTDRAW
default setting for all conditions for label draw integral flag.
virtual Double_t GetYUp() const
static TString fgxURL_XMEAN
web condition editor keyword used in UpdateFromUrl.
const char * MakeScript(std::ostream &out, const char *varname, Option_t *opt="", const char *arrextraargs=nullptr)
virtual void SetCMaxDraw(Bool_t on)
Bool_t fbMultiEdit
Flag to indicate that properties of all conditions in array are edited/used.
Bool_t fbYRMSDraw
If true, draw corresponding value as label on working pad.
static TString fgxURL_RESET
web condition editor keyword used in UpdateFromUrl.
virtual Double_t GetYLow() const
void SetLast(Bool_t value)
Can be used in Test to store the result.
virtual void SetLabelNumFormat(const char *fmt)
static Bool_t fgbYRMSDRAW
default setting for all conditions for label draw yrms flag.
virtual void SetValues(TCutG *newcut)
virtual void UnDraw(Option_t *opt="")
Erase view of this condition from the pad.
virtual void SetXMaxDraw(Bool_t on)
virtual void SetWorkHistogram(TH1 *histo)
Set reference to work histogram for statistics functions.
Bool_t fbLimitsDraw
If true, draw corresponding value as label on working pad.
Bool_t IsEnabled() const
Returns true if condition is enabled.
virtual Double_t GetRMS(TH1 *, Int_t=1)
Calculate value for histogram inside condition limits.
void Paint(Option_t *opt="") override
Display condition with plain root canvas and in go4 viewpanel.
static Bool_t fgbXMEANDRAW
default setting for all conditions for label draw xmean flag.
void SaveLabelStyle()
This will save draw flags into static default setup.
virtual Bool_t IsMultiEdit() const
The abstract base class for the data elements of which the unpacked events (or detector structure dat...
Entry for the dynamic list, specialized for histogram like objects.