GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
TGo4PolyCond Class Reference

#include <TGo4PolyCond.h>

+ Inheritance diagram for TGo4PolyCond:

Public Member Functions

 TGo4PolyCond ()
 
 TGo4PolyCond (const char *name, const char *title="Go4 polygon condition")
 
virtual ~TGo4PolyCond ()
 
void SetWorkHistogram (TH1 *histo) override
 
TGo4ConditionPainterCreatePainter () override
 
void SetPainter (TGo4ConditionPainter *painter) override
 
void SetValues (Double_t *x, Double_t *y, Int_t len) override
 
void SetValues (TCutG *newcut) override
 
void SetValuesDirect (TCutG *newcut)
 
Bool_t Test (Double_t x, Double_t y) override
 
Double_t GetXLow () const override
 
Double_t GetXUp () const override
 
Double_t GetYLow () const override
 
Double_t GetYUp () const override
 
TCutG * GetCut (Bool_t changeowner) override
 
void PrintCondition (Bool_t points=kTRUE) override
 
Bool_t UpdateFrom (TGo4Condition *cond, Bool_t counts) override
 
Bool_t UpdateFromUrl (const char *rest_url_opt) override
 
Double_t GetIntegral (TH1 *histo, Option_t *opt="") override
 
Double_t GetMean (TH1 *histo, Int_t axis=1) override
 
Double_t GetRMS (TH1 *histo, Int_t axis=1) override
 
Double_t GetSkewness (TH1 *histo, Int_t axis=1) override
 
Double_t GetCurtosis (TH1 *histo, Int_t axis=1) override
 
Double_t GetXMax (TH1 *histo) override
 
Double_t GetYMax (TH1 *histo) override
 
Double_t GetCMax (TH1 *histo) override
 
Bool_t IsPolygonType () const override
 
Int_t GetMemorySize () const override
 
void SavePrimitive (std::ostream &fs, Option_t *opt="") override
 
- Public Member Functions inherited from TGo4Condition
 TGo4Condition ()
 
 TGo4Condition (const char *name, const char *title="Go4 Condition")
 
virtual ~TGo4Condition ()
 
void Paint (Option_t *opt="") override
 
void Draw (Option_t *opt="") override
 
virtual void UnDraw (Option_t *opt="")
 
void Pop () override
 
virtual Int_t Counts ()
 
virtual Int_t TrueCounts ()
 
virtual void ResetCounts ()
 
virtual void SetCounts (Int_t truecounts, Int_t counts)
 
virtual void Disable (Bool_t result)
 
virtual void Enable ()
 
Bool_t IsEnabled () const
 
virtual Bool_t Test ()
 
virtual Bool_t Test (Double_t x)
 
virtual void SetValues ()
 
virtual void SetValues (Double_t low1, Double_t up1)
 
virtual void SetValues (Double_t low1, Double_t up1, Double_t low2, Double_t up2)
 
virtual void AddCondition (TGo4Condition *next)
 
void IncCounts ()
 
void IncTrueCounts ()
 
Bool_t IsTrue () const
 
Bool_t IsFalse () const
 
Bool_t FixedResult () const
 
virtual void Invert (Bool_t on)
 
virtual void PrintBar ()
 
void Print (Option_t *opt="") const override
 
void SetLast (Bool_t value)
 
Bool_t GetLast () const
 
virtual void GetValues (Int_t &dim, Double_t &x1, Double_t &y1, Double_t &x2, Double_t &y2)
 
virtual const TGo4ConditionGetActiveCondition () const
 
virtual void MarkReset (Bool_t on)
 
void Clear (Option_t *opt="") override
 
virtual void SetFlags (Bool_t enabled, Bool_t lastresult, Bool_t markreset, Bool_t result, Bool_t truevalue, Bool_t falsevalue)
 
virtual void GetFlags (Bool_t *enabled, Bool_t *lastresult, Bool_t *markreset, Bool_t *result, Bool_t *truevalue, Bool_t *falsevalue)
 
virtual void SetVisible (Bool_t on)
 
virtual Bool_t IsVisible () const
 
void SetHistogramLink (Bool_t on)
 
Bool_t IsHistogramLink () const
 
void SetHistogram (const char *name)
 
const char * GetLinkedHistogram () const
 
TH1 * GetWorkHistogram () const
 
void SetUpdateEpsilon (Double_t val)
 
Double_t GetUpdateEpsilon () const
 
void SaveLabelStyle ()
 
void InitLabelStyle ()
 
void ResetLabel (Option_t *opt="reset")
 
virtual void SetLabelDraw (Bool_t on)
 
virtual Bool_t IsLabelDraw () const
 
virtual void SetLimitsDraw (Bool_t on)
 
virtual Bool_t IsLimitsDraw () const
 
virtual void SetIntDraw (Bool_t on)
 
virtual Bool_t IsIntDraw () const
 
virtual void SetXMeanDraw (Bool_t on)
 
virtual Bool_t IsXMeanDraw () const
 
virtual void SetXRMSDraw (Bool_t on)
 
virtual Bool_t IsXRMSDraw () const
 
virtual void SetYMeanDraw (Bool_t on)
 
virtual Bool_t IsYMeanDraw () const
 
virtual void SetYRMSDraw (Bool_t on)
 
virtual Bool_t IsYRMSDraw () const
 
virtual void SetXMaxDraw (Bool_t on)
 
virtual Bool_t IsXMaxDraw () const
 
virtual void SetYMaxDraw (Bool_t on)
 
virtual Bool_t IsYMaxDraw () const
 
virtual void SetCMaxDraw (Bool_t on)
 
virtual Bool_t IsCMaxDraw () const
 
virtual void SetLabelNumFormat (const char *fmt)
 
virtual const char * GetLabelNumFormat () const
 
virtual void SetChanged (Bool_t on=kTRUE)
 
virtual Int_t IsChanged () const
 
void SetMultiEdit (Bool_t on)
 
virtual Bool_t IsMultiEdit () const
 
void SetDimension (Int_t d)
 
Int_t GetDimension () const
 
void SetOwnedByEditor (Bool_t on)
 
Bool_t IsOwnedByEditor () const
 
virtual void SetCurrentIndex (Int_t)
 
virtual Int_t GetCurrentIndex () const
 
virtual Int_t GetNumberOfConditions () const
 
virtual Bool_t IsArrayType () const
 
void DeletePainter ()
 

Static Public Member Functions

static void CleanupSpecials ()
 
static TString NextAvailableName ()
 
- Static Public Member Functions inherited from TGo4Condition
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)
 
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)
 

Static Public Attributes

static TString fgxURL_NPOINTS ="npolygon"
 
static TString fgxURL_XPRE ="x"
 
static TString fgxURL_YPRE ="y"
 
- Static Public Attributes inherited from TGo4Condition
static const Double_t fgdUPDATEEPSILON = 0.01
 
static Bool_t fgbLABELDRAW =kTRUE
 
static Bool_t fgbLIMITSDRAW =kTRUE
 
static Bool_t fgbINTDRAW =kTRUE
 
static Bool_t fgbXMEANDRAW =kTRUE
 
static Bool_t fgbXRMSDRAW =kTRUE
 
static Bool_t fgbYMEANDRAW =kFALSE
 
static Bool_t fgbYRMSDRAW =kFALSE
 
static Bool_t fgbXMAXDRAW =kTRUE
 
static Bool_t fgbYMAXDRAW =kFALSE
 
static Bool_t fgbCMAXDRAW =kTRUE
 
static TString fgxNUMFORMAT ="%.4E"
 
static TString fgxURL_RESET ="resetcounters"
 
static TString fgxURL_RESULT ="resultmode"
 
static TString fgxURL_INVERT ="invertmode"
 
static TString fgxURL_VISIBLE ="visible"
 
static TString fgxURL_LABEL ="labeldraw"
 
static TString fgxURL_LIMITS ="limitsdraw"
 
static TString fgxURL_INTEGRAL ="intdraw"
 
static TString fgxURL_XMEAN ="xmeandraw"
 
static TString fgxURL_XRMS ="xrmsdraw"
 
static TString fgxURL_YMEAN ="ymeandraw"
 
static TString fgxURL_YRMS ="yrmsdraw"
 
static TString fgxURL_XMAX ="xmaxdraw"
 
static TString fgxURL_YMAX ="ymaxdraw"
 
static TString fgxURL_CMAX ="cmaxdraw"
 

Private Member Functions

TCutG * CloneCut (TGo4PolyCond *source)
 
void ClearCutHis ()
 
Bool_t IsCutHis (TH1 *source)
 

Private Attributes

TCutG * fxCut {nullptr}
 
TH2 * fxCutHis {nullptr}
 

Additional Inherited Members

- Protected Member Functions inherited from TGo4Condition
void BuildUrlOptionArray (const char *rest_url_opt)
 
Bool_t UrlOptionHasKey (const char *key)
 
TString GetUrlOptionAsString (const char *key, TString def_value)
 
Int_t GetUrlOptionAsInt (const char *key, Int_t def_value)
 
Double_t GetUrlOptionAsDouble (const char *key, Double_t def_value)
 
void SetPainted (Bool_t on)
 
Bool_t IsPainted () const
 
const char * MakeScript (std::ostream &out, const char *varname, Option_t *opt="", const char *arrextraargs=nullptr)
 
- Protected Attributes inherited from TGo4Condition
TGo4ConditionPainterfxPainter {nullptr}
 
TObjArray * fxUrlOptionArray {nullptr}
 

Detailed Description

Definition at line 22 of file TGo4PolyCond.h.

Constructor & Destructor Documentation

◆ TGo4PolyCond() [1/2]

TGo4PolyCond::TGo4PolyCond ( )

Definition at line 45 of file TGo4PolyCond.cxx.

References TGo4Condition::SetDimension().

◆ TGo4PolyCond() [2/2]

TGo4PolyCond::TGo4PolyCond ( const char *  name,
const char *  title = "Go4 polygon condition" 
)

Definition at line 54 of file TGo4PolyCond.cxx.

References TGo4Condition::SetDimension().

◆ ~TGo4PolyCond()

TGo4PolyCond::~TGo4PolyCond ( )
virtual

Definition at line 63 of file TGo4PolyCond.cxx.

References ClearCutHis(), and fxCut.

Member Function Documentation

◆ CleanupSpecials()

void TGo4PolyCond::CleanupSpecials ( )
static

Remove all references to any TCutGs from ROOT list of specials. To be used after loading condition from file, updating condition, or setting of cut.

Definition at line 477 of file TGo4PolyCond.cxx.

Referenced by CloneCut(), TGo4PolyCondView::CreateCut(), TGo4AnalysisObjectManager::CreateNamesList(), TGo4AnalysisObjectManager::LoadObjects(), TGo4AnalysisObjectManager::SetAnalysisCondition(), SetValues(), TGo4CondArray::TGo4CondArray(), TGo4PolyCondView::TGo4PolyCondView(), TGo4PolyCondView::UpdateCondition(), and UpdateFrom().

◆ ClearCutHis()

void TGo4PolyCond::ClearCutHis ( )
private

Set new cut histogram

Definition at line 83 of file TGo4PolyCond.cxx.

References fxCutHis.

Referenced by GetCut(), SetValues(), SetValuesDirect(), SetWorkHistogram(), UpdateFrom(), and ~TGo4PolyCond().

◆ CloneCut()

TCutG * TGo4PolyCond::CloneCut ( TGo4PolyCond source)
private

Returns pointer to a cloned cut from source. Name is set to callers name. Used internally by UpdateFrom.

Definition at line 147 of file TGo4PolyCond.cxx.

References CleanupSpecials(), and GetCut().

Referenced by UpdateFrom().

◆ CreatePainter()

TGo4ConditionPainter * TGo4PolyCond::CreatePainter ( )
overridevirtual

Factory method to generate the subclass implementation for painter

Reimplemented from TGo4Condition.

Definition at line 432 of file TGo4PolyCond.cxx.

References TGo4ConditionPainter::SetCondition().

◆ GetCMax()

Double_t TGo4PolyCond::GetCMax ( TH1 *  histo)
overridevirtual

Calculate value for histogram inside condition limits.

Reimplemented from TGo4Condition.

Definition at line 409 of file TGo4PolyCond.cxx.

References fxCutHis, and IsCutHis().

◆ GetCurtosis()

Double_t TGo4PolyCond::GetCurtosis ( TH1 *  histo,
Int_t  axis = 1 
)
overridevirtual

Calculate value for histogram inside condition limits.

Reimplemented from TGo4Condition.

Definition at line 378 of file TGo4PolyCond.cxx.

References fxCutHis, and IsCutHis().

◆ GetCut()

TCutG * TGo4PolyCond::GetCut ( Bool_t  changeowner)
overridevirtual

Used to return the cut pointer of a TGo4PolyCond. In source, pointer is set to 0, when changeowner is true. Thus source object can be deleted without deleting the cut which is now owned by the caller. When changeowner is false, the pointer can only be used to clone a new cut. The cut must not be deleted!

Reimplemented from TGo4Condition.

Definition at line 135 of file TGo4PolyCond.cxx.

References ClearCutHis(), and fxCut.

Referenced by CloneCut(), TGo4ViewPanel::CompleteMarkerEdit(), TGo4ConditionEditor::CutTable_contextMenuHandler(), TGo4ConditionEditor::CutTable_contextMenuRequested(), TGo4ConditionEditor::CutTable_valueChanged(), TGo4PolyCondView::IsCutChanged(), TGo4ConditionEditor::NPointsSpin_valueChanged(), TGo4ViewPanel::PadClickedSlot(), TGo4PolyCondPainter::PaintCondition(), TGo4ConditionPainter::PaintLabel(), TGo4ConditionEditor::RefreshWidget(), TGo4ConditionEditor::UpdateEllipse(), and UpdateFrom().

◆ GetIntegral()

Double_t TGo4PolyCond::GetIntegral ( TH1 *  histo,
Option_t *  opt = "" 
)
overridevirtual

Calculate value for histogram inside condition limits.

Reimplemented from TGo4Condition.

Definition at line 349 of file TGo4PolyCond.cxx.

References fxCut.

◆ GetMean()

Double_t TGo4PolyCond::GetMean ( TH1 *  histo,
Int_t  axis = 1 
)
overridevirtual

Calculate value for histogram inside condition limits.

Reimplemented from TGo4Condition.

Definition at line 354 of file TGo4PolyCond.cxx.

References fxCutHis, and IsCutHis().

◆ GetMemorySize()

Int_t TGo4PolyCond::GetMemorySize ( ) const
overridevirtual

Reimplemented from TGo4Condition.

Definition at line 487 of file TGo4PolyCond.cxx.

References fxCut.

◆ GetRMS()

Double_t TGo4PolyCond::GetRMS ( TH1 *  histo,
Int_t  axis = 1 
)
overridevirtual

Calculate value for histogram inside condition limits.

Reimplemented from TGo4Condition.

Definition at line 362 of file TGo4PolyCond.cxx.

References fxCutHis, and IsCutHis().

◆ GetSkewness()

Double_t TGo4PolyCond::GetSkewness ( TH1 *  histo,
Int_t  axis = 1 
)
overridevirtual

Calculate value for histogram inside condition limits.

Reimplemented from TGo4Condition.

Definition at line 370 of file TGo4PolyCond.cxx.

References fxCutHis, and IsCutHis().

◆ GetXLow()

Double_t TGo4PolyCond::GetXLow ( ) const
overridevirtual

minimum extension of polygon in x axis

Reimplemented from TGo4Condition.

Definition at line 92 of file TGo4PolyCond.cxx.

References fxCut.

Referenced by TGo4ConditionEditor::UpdateEllipse().

◆ GetXMax()

Double_t TGo4PolyCond::GetXMax ( TH1 *  histo)
overridevirtual

Calculate value for histogram inside condition limits.

Reimplemented from TGo4Condition.

Definition at line 386 of file TGo4PolyCond.cxx.

References fxCutHis, and IsCutHis().

◆ GetXUp()

Double_t TGo4PolyCond::GetXUp ( ) const
overridevirtual

maximum extension of polygon in x axis

Reimplemented from TGo4Condition.

Definition at line 102 of file TGo4PolyCond.cxx.

References fxCut.

Referenced by TGo4ConditionEditor::UpdateEllipse().

◆ GetYLow()

Double_t TGo4PolyCond::GetYLow ( ) const
overridevirtual

minimum extension of polygon in y axis

Reimplemented from TGo4Condition.

Definition at line 111 of file TGo4PolyCond.cxx.

References fxCut.

Referenced by TGo4ConditionEditor::UpdateEllipse().

◆ GetYMax()

Double_t TGo4PolyCond::GetYMax ( TH1 *  histo)
overridevirtual

Calculate value for histogram inside condition limits.

Reimplemented from TGo4Condition.

Definition at line 397 of file TGo4PolyCond.cxx.

References fxCutHis, and IsCutHis().

◆ GetYUp()

Double_t TGo4PolyCond::GetYUp ( ) const
overridevirtual

maximum extension of polygon in y axis

Reimplemented from TGo4Condition.

Definition at line 120 of file TGo4PolyCond.cxx.

References fxCut.

Referenced by TGo4ConditionEditor::UpdateEllipse().

◆ IsCutHis()

Bool_t TGo4PolyCond::IsCutHis ( TH1 *  source)
private

Returns true if fxCutHis can be used, create if possible

Definition at line 440 of file TGo4PolyCond.cxx.

References fxCut, and fxCutHis.

Referenced by GetCMax(), GetCurtosis(), GetMean(), GetRMS(), GetSkewness(), GetXMax(), and GetYMax().

◆ IsPolygonType()

Bool_t TGo4PolyCond::IsPolygonType ( ) const
overridevirtual

Reimplemented from TGo4Condition.

Definition at line 129 of file TGo4PolyCond.cxx.

◆ NextAvailableName()

TString TGo4PolyCond::NextAvailableName ( )
static

Definition at line 34 of file TGo4PolyCond.cxx.

Referenced by TGo4ViewPanel::PadClickedSlot().

◆ PrintCondition()

void TGo4PolyCond::PrintCondition ( Bool_t  points = kTRUE)
overridevirtual

Printout values. If points is true, printout polygon points.

Reimplemented from TGo4Condition.

Reimplemented in TGo4ShapedCond.

Definition at line 247 of file TGo4PolyCond.cxx.

References fxCut, and TGo4Condition::PrintCondition().

Referenced by TGo4ShapedCond::PrintCondition(), TXXXUnpackProc::TXXXUnpackProc(), TYYYUnpackProc::TYYYUnpackProc(), TXXXUnpackProc::~TXXXUnpackProc(), and TYYYUnpackProc::~TYYYUnpackProc().

◆ SavePrimitive()

void TGo4PolyCond::SavePrimitive ( std::ostream &  fs,
Option_t *  opt = "" 
)
override

Standard way to store parameter in form of macro

Definition at line 499 of file TGo4PolyCond.cxx.

References fxCut, and TGo4Condition::MakeScript().

◆ SetPainter()

void TGo4PolyCond::SetPainter ( TGo4ConditionPainter painter)
overridevirtual

Replace default painter of this condition by external one. if different views of this condition shall exist for different TPads, the painter (i.e. view) can be exchanged before pad is updated.

Reimplemented from TGo4Condition.

Definition at line 417 of file TGo4PolyCond.cxx.

References TGo4Condition::fxPainter, TGo4ConditionPainter::SetCondition(), and TGo4Log::Warn().

◆ SetValues() [1/2]

void TGo4PolyCond::SetValues ( Double_t *  x,
Double_t *  y,
Int_t  len 
)
overridevirtual

Delete old cut and create a new cut with X,Y values.

Reimplemented from TGo4Condition.

Definition at line 219 of file TGo4PolyCond.cxx.

References CleanupSpecials(), ClearCutHis(), and fxCut.

Referenced by TGo4CreateNewCondition::MakeCondition(), TGo4ConditionEditor::NPointsSpin_valueChanged(), and TGo4PolyCondView::UpdateCondition().

◆ SetValues() [2/2]

void TGo4PolyCond::SetValues ( TCutG *  newcut)
overridevirtual

Delete old cut and create new one by cloning newcut.

Reimplemented from TGo4Condition.

Definition at line 160 of file TGo4PolyCond.cxx.

References CleanupSpecials(), ClearCutHis(), and fxCut.

◆ SetValuesDirect()

void TGo4PolyCond::SetValuesDirect ( TCutG *  newcut)

Delete old cut and get ownership over newcut.

Definition at line 199 of file TGo4PolyCond.cxx.

References ClearCutHis(), and fxCut.

Referenced by TGo4ViewPanel::PadClickedSlot().

◆ SetWorkHistogram()

void TGo4PolyCond::SetWorkHistogram ( TH1 *  histo)
overridevirtual

Set reference to work histogram for statistics functions

Reimplemented from TGo4Condition.

Definition at line 76 of file TGo4PolyCond.cxx.

References ClearCutHis(), and TGo4Condition::SetWorkHistogram().

Referenced by TGo4ViewPanel::PadClickedSlot().

◆ Test()

Bool_t TGo4PolyCond::Test ( Double_t  x,
Double_t  y 
)
overridevirtual

◆ UpdateFrom()

Bool_t TGo4PolyCond::UpdateFrom ( TGo4Condition cond,
Bool_t  counts 
)
overridevirtual

Copy values from cond to this. Get a clone cut from cond by CloneCut as new cut. If counts is true, copy counters too.

Reimplemented from TGo4Condition.

Reimplemented in TGo4ShapedCond.

Definition at line 266 of file TGo4PolyCond.cxx.

References CleanupSpecials(), ClearCutHis(), CloneCut(), fxCut, GetCut(), and TGo4Condition::UpdateFrom().

Referenced by TGo4ShapedCond::UpdateFrom().

◆ UpdateFromUrl()

Bool_t TGo4PolyCond::UpdateFromUrl ( const char *  rest_url_opt)
overridevirtual

Method used by HTTP server to update some fields, specified in URL syntax

Reimplemented from TGo4Condition.

Reimplemented in TGo4ShapedCond.

Definition at line 316 of file TGo4PolyCond.cxx.

References fgxURL_NPOINTS, fgxURL_XPRE, fgxURL_YPRE, TGo4Condition::GetUrlOptionAsDouble(), TGo4Condition::GetUrlOptionAsInt(), TGo4Log::Message(), TGo4Condition::SetValues(), TGo4Condition::UpdateFromUrl(), and TGo4Condition::UrlOptionHasKey().

Referenced by TGo4ShapedCond::UpdateFromUrl().

Member Data Documentation

◆ fgxURL_NPOINTS

TString TGo4PolyCond::fgxURL_NPOINTS ="npolygon"
static

web condition editor keyword used in UpdateFromUrl.

JAM2016: this define switches between cloning when updating condition and simple copy of TCutG points

Definition at line 126 of file TGo4PolyCond.h.

Referenced by UpdateFromUrl().

◆ fgxURL_XPRE

TString TGo4PolyCond::fgxURL_XPRE ="x"
static

web condition editor keyword used in UpdateFromUrl.

Definition at line 128 of file TGo4PolyCond.h.

Referenced by UpdateFromUrl().

◆ fgxURL_YPRE

TString TGo4PolyCond::fgxURL_YPRE ="y"
static

web condition editor keyword used in UpdateFromUrl.

Definition at line 130 of file TGo4PolyCond.h.

Referenced by UpdateFromUrl().

◆ fxCut

TCutG* TGo4PolyCond::fxCut {nullptr}
private

◆ fxCutHis

TH2* TGo4PolyCond::fxCutHis {nullptr}
private

temporary histogram used to calculate statistics on polygon cuts. Will be recalculated only if boundaries have changed.

Definition at line 150 of file TGo4PolyCond.h.

Referenced by ClearCutHis(), GetCMax(), GetCurtosis(), GetMean(), GetRMS(), GetSkewness(), GetXMax(), GetYMax(), and IsCutHis().


The documentation for this class was generated from the following files: