4 #ifndef __KVPIDINTERVALPAINTER_H
5 #define __KVPIDINTERVALPAINTER_H
16 #include "KVIDZAFromZGrid.h"
34 bool fDrawLabel{
false};
35 bool fHighlight{
false};
45 void SetDrawLabel(
bool yes =
true)
49 bool GetDrawLabel()
const
54 void Update(
int z,
int a,
double pid);
55 bool CheckPosition(
double x)
60 return (!parent->active_intervals)
64 class pid_line :
public TLine {
66 enum class limit_t {lower, upper};
76 SetLineColor(def_color);
80 limit_t GetLimitType()
const
84 bool IsUpperLimit()
const
86 return GetLimitType() == limit_t::upper;
88 bool IsLowerLimit()
const
90 return GetLimitType() == limit_t::lower;
101 if (
type == limit_t::lower)
102 parent->GetInterval()->SetPIDmin(pid);
104 parent->GetInterval()->SetPIDmax(pid);
118 assert(GetX1() == GetX2());
122 bool CheckPosition(
double x);
127 bool fHighlight{
false};
134 TH1* fLinearHisto =
nullptr;
136 TAxis* fXaxis{
nullptr}, *fYaxis{
nullptr};
138 double pid, min, max;
150 Bool_t active_intervals =
true;
163 return right_interval;
167 return left_interval;
173 fXaxis{fLinearHisto->GetXaxis()},
174 fYaxis{fLinearHisto->GetYaxis()},
175 pid{fInterval->GetPID()},
176 min{fInterval->GetPIDmin()},
177 max{fInterval->GetPIDmax()},
178 fA{fInterval->
GetA()},
179 fZ{fInterval->
GetZ()},
180 fMarker{this, itv_color},
181 fLine1{this,
min, 0, 200, pid_line::limit_t::lower, itv_color},
182 fLine2{this,
max, 0, 200, pid_line::limit_t::upper, itv_color},
183 left_interval{last_interval}
196 active_intervals =
false;
206 active_intervals =
true;
232 fMarker.SetDrawLabel(dis);
236 return fMarker.GetDrawLabel();
262 return fLine1.GetX();
266 return fLine2.GetX();
270 return fMarker.GetX();
#define RQ_OBJECT(sender_class)
#define ClassDefOverride(name, id)
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
char * Form(const char *fmt,...)
Graphical representation of a PID interval in the KVIDZAFromZGrid mass assignation GUI.
void SetCanvas(TCanvas *cc)
KVPIDIntervalPainter * get_right_interval() const
Double_t GetHistoXAxisLowerLimit() const
KVPIDIntervalPainter(const char *name, const char *title)
KVPIDIntervalPainter(const TString &name, const TString &title)
double GetPIDIntervalUpperLimit() const
void DeactivateIntervals()
double GetPIDIntervalLowerLimit() const
TCanvas * GetCanvas() const
interval * GetInterval() const
void Draw(Option_t *option="") override
void SetDisplayLabel(bool dis=true)
void HighLight(bool hi=true)
bool GetDisplayLabel() const
KVPIDIntervalPainter * get_left_interval() const
void set_right_interval(KVPIDIntervalPainter *i)
Double_t GetHistoXAxisUpperLimit() const
KVPIDIntervalPainter(interval *itv, TH1 *hh, Color_t itv_color, KVPIDIntervalPainter *last_interval)
double GetPIDPosition() const
void set_left_interval(KVPIDIntervalPainter *i)
virtual Double_t GetBinCenter(Int_t bin) const
TObject * Remove(const TObjLinkPtr_t &lnk)
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual void Paint(Option_t *option="")
TList * GetListOfPrimitives() const override
void Modified(Bool_t flag=1) override
double min(double x, double y)
double max(double x, double y)