KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVIDGrid Class Reference

Detailed Description

Abstract base class for 2D identification grids in e.g. (dE,E) maps.

Such a grid is supposed to be made up of two parts:

  • a set of lines for the identification i.e. indicating the position of the loci of points corresponding to a given nucleus
  • a set of lines used to indicate the area of the map in which identification is possible (or conversely, the limits beyond which identification is not possible).


Specific implementations of such identification grids must define the following methods :

 <h4>Bool_t IsIdentifiable(Double_t x, Double_t y) const</h4>

 - returns either kTRUE or kFALSE for each point (x,y) of the identification
   map depending on whether such a point can lead to a successful identification
   or not

 <h4>void    Identify        (Double_t x, Double_t y, KVNucleus *nuc) const</h4>

 - attribute an identification to the KVNucleus for a given point (x,y) in the map.
   This is most often based on the result of FindNearestIDLine(), which is a general
 algorithm for finding the ID line which is the closest to a given point.


Make sure to call the Initialize() method of the grid once before using it.

Get/SetParameter methods

You can associate any number of parameters with the grid (KVParameter<Double_t> objects) A parameter associates a name and a value. These parameters are used to name the grid.

Grid scaling factors

Get/SetX/YScaleFactor methods can be used to apply global linear scaling factor to grids in one or both dimensions. i.e. if we have a grid pointer

KVIDGrid* g;//pointer to a grid g->SetXScaleFactor(1.2);//we apply a 20% scaling factor to the X-coordinates g->Draw(); // X-coordinates of all points in lines are 1.2*original value

To remove the scaling factor, call SetX/YScaleFactor() or SetX/YScaleFactor(0). Note that this scaling is taken into account also in IsIdentifiable and Identify methods

Definition at line 74 of file KVIDGrid.h.

#include <KVIDGrid.h>

Inheritance diagram for KVIDGrid:

Public Member Functions

 KVIDGrid ()
 Default constructor.
 
virtual ~KVIDGrid ()
 
virtual void CalculateLineWidths ()
 
virtual TClassDefaultIDLineClass ()
 
virtual TClassDefaultOKLineClass ()
 
KVIDLineFindNearestEmbracingIDLine (Double_t x, Double_t y, const Char_t *position, const Char_t *axis, Int_t &idx, Int_t &idx_min, Int_t &idx_max, Double_t &dist, Double_t &dist_min, Double_t &dist_max) const
 
KVIDLineFindNearestIDLineFast (Double_t x, Double_t y, const Char_t *position, Int_t &idx, Int_t &idx_min, Int_t &idx_max, Double_t &dist, Double_t &dist_min, Double_t &dist_max) const
 
KVIDLineFindNextEmbracingLine (Int_t &index, Int_t inc_index, Double_t x, Double_t y, const Char_t *axis) const
 
Int_t GetIDLinesEmbracingPoint (const Char_t *direction, Double_t x, Double_t y) const
 
void Initialize ()
 
KVIDLineNewLine (const Char_t *idline_class="")
 
- Public Member Functions inherited from KVIDGraph
 KVIDGraph ()
 
 KVIDGraph (const KVIDGraph &)
 Copy constructor.
 
virtual ~KVIDGraph ()
 
virtual Bool_t AcceptIDForTest (const KVIdentificationResult &idr)
 
void Add (TString, KVIDentifier *)
 
KVIDentifierAdd (TString, TString)
 
virtual void AddCut (KVIDentifier *cut)
 
virtual void AddIdentifier (KVIDentifier *id)
 
void AddIDTelescope (KVBase *t)
 
void AddIDTelescopes (const TList *)
 Associate this graph with all ID telescopes in list.
 
virtual void AddInfo (KVIDentifier *info)
 
void AddParameter (char *Name, char *Value)
 
virtual Int_t CheckVersion (Int_t version)
 
virtual void Clear (Option_t *opt="")
 
void ClearListOfTelescopes ()
 
void ClearPad (TVirtualPad *)
 
virtual void Copy (TObject &) const
 Copy this to 'obj'.
 
virtual void Delete (Option_t *option="")
 
void Draw (Option_t *opt="")
 
virtual void DrawAndAdd (const Char_t *type="ID", const Char_t *classname="KVIDentifier")
 
virtual void DrawClass () const
 
virtual TObjectDrawClone (Option_t *option="") const
 
virtual void DrawPanel ()
 
virtual void Dump () const
 
virtual Bool_t ExistVersion (Int_t version)
 
void ExtendBeginningAllIdentLines (Double_t, Option_t *="")
 
void ExtendEndAllIdentLines (Double_t, Option_t *="")
 
void FindAxisLimits ()
 Calculate X/Y min/max of all objects in graph.
 
virtual TFitResultPtr Fit (const char *formula, Option_t *option="", Option_t *goption="", Axis_t xmin=0, Axis_t xmax=0)
 
virtual TFitResultPtr Fit (TF1 *f1, Option_t *option="", Option_t *goption="", Axis_t xmin=0, Axis_t xmax=0)
 
virtual void FitPanel ()
 virtual void SetTitle(const char *title="") {TGraph::SetTitle(title);};
 
KVIDentifierGetCut (const Char_t *name) const
 
KVListGetCuts ()
 
const KVListGetCuts () const
 
KVIDentifierGetIdentifier (const Char_t *name) const
 
KVIDentifierGetIdentifier (Int_t Z, Int_t A) const
 
KVIDentifierGetIdentifierAt (Int_t index) const
 
KVListGetIdentifiers ()
 
const KVListGetIdentifiers () const
 
const Char_tGetIDTelescopeLabel () const
 
const TListGetIDTelescopes () const
 
KVIDentifierGetInfo (const Char_t *name) const
 
KVListGetInfos ()
 
const KVListGetInfos () const
 
KVIDGraphGetLastSavedVersion () const
 
Int_t GetMassFormula () const
 
const Char_tGetName () const
 
const Char_tGetNamesOfIDTelescopes () const
 
Int_t GetNumberOfCuts () const
 
Int_t GetNumberOfIdentifiers () const
 
Int_t GetNumberOfInfos () const
 
TVirtualPadGetPad () const
 
KVNameValueListGetParameters ()
 
const KVNameValueListGetParameters () const
 
TString GetPattern (void)
 
virtual Int_t GetQualityCode () const
 
const Char_tGetRunList () const
 
const KVNumberListGetRuns () const
 
Axis_t GetXmax () const
 
Axis_t GetXmin () const
 
Double_t GetXScaleFactor ()
 
Axis_t GetYmax () const
 
Axis_t GetYmin () const
 
Double_t GetYScaleFactor ()
 
Bool_t HandlesIDTelescope (KVBase *t) const
 
virtual Bool_t HasMassIDCapability () const
 
virtual void Identify (Double_t, Double_t, KVIdentificationResult *) const =0
 
void Increment (Float_t x)
 
virtual Int_t InsertPoint ()
 
virtual void Inspect () const
 
TVirtualPadIsDrawn () const
 
virtual Bool_t IsIdentifiable (Double_t, Double_t, TString *rejected_by=nullptr) const
 
Bool_t IsSorted () const
 
void Modified ()
 
void Print (Option_t *opt="") const
 Print out all objects in graph.
 
void ReadAsciiFile (const Char_t *filename)
 
virtual void ReadAsciiFile_WP (Int_t version=-1)
 lecture des grilles avec version suivant un modele de fichier
 
virtual void ReadFromAsciiFile (std::ifstream &gridfile)
 
void RemoveCut (KVIDentifier *)
 Remove and destroy cut.
 
void RemoveIdentifier (KVIDentifier *)
 Remove and destroy identifier.
 
void RemoveIDTelescope (KVBase *t)
 
void RemoveInfo (KVIDentifier *)
 Remove and destroy cut.
 
virtual Int_t RemovePoint ()
 
virtual Int_t RemovePoint (Int_t i)
 
void ResetDraw ()
 
void ResetPad ()
 
void RevertToLastSavedVersion ()
 
virtual void SaveAs (const char *filename="", Option_t *option="") const
 
void Scale (TF1 *sx, TF1 *sy)
 
virtual void SetDrawOption (Option_t *option="")
 
virtual void SetEditable (Bool_t editable=kTRUE)
 
virtual void SetFillAttributes ()
 
virtual void SetInfos (Double_t, Double_t, KVIdentificationResult *) const
 loop over KVIDGraph::fInfoZones to set flags in KVIdentificationResult
 
virtual void SetLineAttributes ()
 
void SetLineColor (Color_t lcolor)
 
void SetLineStyle (Style_t lstyle)
 
void SetLineWidth (Width_t lwidth)
 
virtual void SetMarkerAttributes ()
 
void SetMassFormula (Int_t)
 
virtual void SetMassIDCapability (Bool_t yes=kTRUE)
 
virtual void SetMaximum (Double_t maximum=-1111)
 
virtual void SetMinimum (Double_t minimum=-1111)
 
virtual void SetName (const char *name)
 
virtual void SetOnlyZId (Bool_t yes=kTRUE)
 
void SetPattern (TString pattern)
 
void SetRunList (const char *runlist)
 
void SetRuns (const KVNumberList &nl)
 Set list of runs for which grid is valid.
 
virtual void SetVarX (const char *v)
 
virtual void SetVarY (const char *v)
 
void SetXScaleFactor (Double_t=0)
 
void SetXVariable (const char *v)
 void SetIDTelescopes();// MENU={Hierarchy="Set.../ID Telescopes"}
 
void SetYScaleFactor (Double_t=0)
 
void SetYVariable (const char *v)
 
void SortIdentifiers ()
 
virtual void TestIdentification (TH2F *data, KVHashList &histos, KVNameValueList &histo_names)
 
void UnDraw ()
 
void UpdateLastSavedVersion ()
 update last saved version. mkae copy of current state of graph.
 
void WriteAsciiFile (const Char_t *filename)
 Open, write and close ascii file containing this grid.
 
virtual void WriteAsciiFile_WP (Int_t version=-1)
 
virtual void WriteToAsciiFile (std::ofstream &gridfile)
 
- Public Member Functions inherited from TCutG
 TCutG ()
 
 TCutG (const char *name, Int_t n, const Double_t *x, const Double_t *y)
 
 TCutG (const char *name, Int_t n, const Float_t *x, const Float_t *y)
 
 TCutG (const char *name, Int_t n=0)
 
 TCutG (const TCutG &cutg)
 
 ~TCutG () override
 
virtual Double_t Area () const
 
virtual void Center (Double_t &cx, Double_t &cy) const
 
TObjectGetObjectX () const
 
TObjectGetObjectY () const
 
const char * GetVarX () const
 
const char * GetVarY () const
 
virtual Double_t IntegralHist (TH2 *h, Option_t *option="") const
 
TClassIsA () const override
 
TCutGoperator= (const TCutG &)
 
void SavePrimitive (std::ostream &out, Option_t *option="") override
 
virtual void SetObjectX (TObject *obj)
 
virtual void SetObjectY (TObject *obj)
 
void Streamer (TBuffer &) override
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
- Public Member Functions inherited from TGraph
 TGraph ()
 
 TGraph (const char *filename, const char *format="%lg %lg", Option_t *option="")
 
 TGraph (const TF1 *f, Option_t *option="")
 
 TGraph (const TGraph &gr)
 
 TGraph (const TH1 *h)
 
 TGraph (const TVectorD &vx, const TVectorD &vy)
 
 TGraph (const TVectorF &vx, const TVectorF &vy)
 
 TGraph (Int_t n)
 
 TGraph (Int_t n, const Double_t *x, const Double_t *y)
 
 TGraph (Int_t n, const Double_t *y, Double_t start=0., Double_t step=1.)
 
 TGraph (Int_t n, const Float_t *x, const Float_t *y)
 
 TGraph (Int_t n, const Int_t *x, const Int_t *y)
 
 ~TGraph () override
 
virtual void AddPoint (Double_t x, Double_t y)
 
virtual void Apply (TF1 *f)
 
void Browse (TBrowser *b) override
 
virtual Double_t Chisquare (TF1 *f1, Option_t *option="") const
 
virtual void ComputeRange (Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax) const
 
Int_t DistancetoPrimitive (Int_t px, Int_t py) override
 
void Draw (Option_t *chopt="") override
 
virtual void DrawGraph (Int_t n, const Double_t *x=nullptr, const Double_t *y=nullptr, Option_t *option="")
 
virtual void DrawGraph (Int_t n, const Float_t *x, const Float_t *y, Option_t *option="")
 
virtual void DrawGraph (Int_t n, const Int_t *x, const Int_t *y, Option_t *option="")
 
virtual Double_t Eval (Double_t x, TSpline *spline=nullptr, Option_t *option="") const
 
void ExecuteEvent (Int_t event, Int_t px, Int_t py) override
 
virtual void Expand (Int_t newsize)
 
virtual void Expand (Int_t newsize, Int_t step)
 
TObjectFindObject (const char *name) const override
 
TObjectFindObject (const TObject *obj) const override
 
virtual Double_t GetCorrelationFactor () const
 
virtual Double_t GetCovariance () const
 
Bool_t GetEditable () const
 
virtual Double_t GetErrorX (Int_t bin) const
 
virtual Double_t GetErrorXhigh (Int_t bin) const
 
virtual Double_t GetErrorXlow (Int_t bin) const
 
virtual Double_t GetErrorY (Int_t bin) const
 
virtual Double_t GetErrorYhigh (Int_t bin) const
 
virtual Double_t GetErrorYlow (Int_t bin) const
 
virtual Double_tGetEX () const
 
virtual Double_tGetEXhigh () const
 
virtual Double_tGetEXhighd () const
 
virtual Double_tGetEXlow () const
 
virtual Double_tGetEXlowd () const
 
virtual Double_tGetEY () const
 
virtual Double_tGetEYhigh () const
 
virtual Double_tGetEYhighd () const
 
virtual Double_tGetEYlow () const
 
virtual Double_tGetEYlowd () const
 
TF1GetFunction (const char *name) const
 
virtual TH1FGetHistogram () const
 
TListGetListOfFunctions () const
 
Double_t GetMaximum () const
 
Int_t GetMaxSize () const
 
virtual Double_t GetMean (Int_t axis=1) const
 
Double_t GetMinimum () const
 
Int_t GetN () const
 
char * GetObjectInfo (Int_t px, Int_t py) const override
 
virtual Int_t GetPoint (Int_t i, Double_t &x, Double_t &y) const
 
virtual Double_t GetPointX (Int_t i) const
 
virtual Double_t GetPointY (Int_t i) const
 
virtual Double_t GetRMS (Int_t axis=1) const
 
Double_tGetX () const
 
TAxisGetXaxis () const
 
Double_tGetY () const
 
TAxisGetYaxis () const
 
virtual void InitExpo (Double_t xmin=0, Double_t xmax=0)
 
virtual void InitGaus (Double_t xmin=0, Double_t xmax=0)
 
virtual void InitPolynom (Double_t xmin=0, Double_t xmax=0)
 
virtual void InsertPointBefore (Int_t ipoint, Double_t x, Double_t y)
 
virtual Double_t Integral (Int_t first=0, Int_t last=-1) const
 
TClassIsA () const override
 
virtual Bool_t IsEditable () const
 
virtual Bool_t IsHighlight () const
 
virtual Int_t IsInside (Double_t x, Double_t y) const
 
virtual void LeastSquareFit (Int_t m, Double_t *a, Double_t xmin=0, Double_t xmax=0)
 
virtual void LeastSquareLinearFit (Int_t n, Double_t &a0, Double_t &a1, Int_t &ifail, Double_t xmin=0, Double_t xmax=0)
 
virtual Int_t Merge (TCollection *list)
 
virtual void MovePoints (Double_t dx, Double_t dy, Bool_t logx=kFALSE, Bool_t logy=kFALSE)
 
TGraphoperator= (const TGraph &)
 
void Paint (Option_t *chopt="") override
 
void PaintGraph (Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt)
 
void PaintGrapHist (Int_t npoints, const Double_t *x, const Double_t *y, Option_t *chopt)
 
virtual void PaintStats (TF1 *fit)
 
void Print (Option_t *chopt="") const override
 
void RecursiveRemove (TObject *obj) override
 
void SaveAs (const char *filename, Option_t *option="") const override
 
void SavePrimitive (std::ostream &out, Option_t *option="") override
 
virtual void Scale (Double_t c1=1., Option_t *option="y")
 
virtual void Set (Int_t n)
 
virtual void SetHighlight (Bool_t set=kTRUE)
 
virtual void SetHistogram (TH1F *h)
 
void SetName (const char *name="") override
 
void SetNameTitle (const char *name="", const char *title="") override
 
virtual void SetPoint (Int_t i, Double_t x, Double_t y)
 
virtual void SetPointX (Int_t i, Double_t x)
 
virtual void SetPointY (Int_t i, Double_t y)
 
virtual void SetStats (Bool_t stats=kTRUE)
 
void SetTitle (const char *title="") override
 
virtual void Sort (Bool_t(*greater)(const TGraph *, Int_t, Int_t)=&TGraph::CompareX, Bool_t ascending=kTRUE, Int_t low=0, Int_t high=-1111)
 
void Streamer (TBuffer &) override
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
void UseCurrentStyle () override
 
void Zero (Int_t &k, Double_t AZ, Double_t BZ, Double_t E2, Double_t &X, Double_t &Y, Int_t maxiterations)
 
- Public Member Functions inherited from TNamed
 TNamed ()
 
 TNamed (const char *name, const char *title)
 
 TNamed (const TNamed &named)
 
 TNamed (const TString &name, const TString &title)
 
virtual ~TNamed ()
 
void Clear (Option_t *option="") override
 
TObjectClone (const char *newname="") const override
 
Int_t Compare (const TObject *obj) const override
 
void Copy (TObject &named) const override
 
virtual void FillBuffer (char *&buffer)
 
const char * GetName () const override
 
const char * GetTitle () const override
 
ULong_t Hash () const override
 
TClassIsA () const override
 
Bool_t IsSortable () const override
 
void ls (Option_t *option="") const override
 
TNamedoperator= (const TNamed &rhs)
 
void Print (Option_t *option="") const override
 
virtual Int_t Sizeof () const
 
void Streamer (TBuffer &) override
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
- Public Member Functions inherited from TObject
 TObject ()
 
 TObject (const TObject &object)
 
virtual ~TObject ()
 
void AbstractMethod (const char *method) const
 
virtual void AppendPad (Option_t *option="")
 
ULong_t CheckedHash ()
 
virtual const char * ClassName () const
 
virtual void Error (const char *method, const char *msgfmt,...) const
 
virtual void Execute (const char *method, const char *params, Int_t *error=nullptr)
 
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=nullptr)
 
virtual void Fatal (const char *method, const char *msgfmt,...) const
 
virtual Option_tGetDrawOption () const
 
virtual const char * GetIconName () const
 
virtual Option_tGetOption () const
 
virtual UInt_t GetUniqueID () const
 
virtual Bool_t HandleTimer (TTimer *timer)
 
Bool_t HasInconsistentHash () const
 
virtual void Info (const char *method, const char *msgfmt,...) const
 
virtual Bool_t InheritsFrom (const char *classname) const
 
virtual Bool_t InheritsFrom (const TClass *cl) const
 
void InvertBit (UInt_t f)
 
Bool_t IsDestructed () const
 
virtual Bool_t IsEqual (const TObject *obj) const
 
virtual Bool_t IsFolder () const
 
R__ALWAYS_INLINE Bool_t IsOnHeap () const
 
R__ALWAYS_INLINE Bool_t IsZombie () const
 
void MayNotUse (const char *method) const
 
virtual Bool_t Notify ()
 
void Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, void *vp)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, void *vp)
 
voidoperator new (size_t sz)
 
voidoperator new (size_t sz, void *vp)
 
voidoperator new[] (size_t sz)
 
voidoperator new[] (size_t sz, void *vp)
 
TObjectoperator= (const TObject &rhs)
 
virtual void Pop ()
 
virtual Int_t Read (const char *name)
 
void ResetBit (UInt_t f)
 
void SetBit (UInt_t f)
 
void SetBit (UInt_t f, Bool_t set)
 
virtual void SetUniqueID (UInt_t uid)
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
virtual void SysError (const char *method, const char *msgfmt,...) const
 
R__ALWAYS_INLINE Bool_t TestBit (UInt_t f) const
 
Int_t TestBits (UInt_t f) const
 
virtual void Warning (const char *method, const char *msgfmt,...) const
 
virtual Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
 
virtual Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) const
 
- Public Member Functions inherited from TAttLine
 TAttLine ()
 
 TAttLine (Color_t lcolor, Style_t lstyle, Width_t lwidth)
 
virtual ~TAttLine ()
 
void Copy (TAttLine &attline) const
 
Int_t DistancetoLine (Int_t px, Int_t py, Double_t xp1, Double_t yp1, Double_t xp2, Double_t yp2)
 
virtual Color_t GetLineColor () const
 
virtual Style_t GetLineStyle () const
 
virtual Width_t GetLineWidth () const
 
virtual void Modify ()
 
virtual void ResetAttLine (Option_t *option="")
 
virtual void SaveLineAttributes (std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
 
virtual void SetLineColorAlpha (Color_t lcolor, Float_t lalpha)
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
- Public Member Functions inherited from TAttFill
 TAttFill ()
 
 TAttFill (Color_t fcolor, Style_t fstyle)
 
virtual ~TAttFill ()
 
void Copy (TAttFill &attfill) const
 
virtual Color_t GetFillColor () const
 
virtual Style_t GetFillStyle () const
 
virtual Bool_t IsTransparent () const
 
virtual void Modify ()
 
virtual void ResetAttFill (Option_t *option="")
 
virtual void SaveFillAttributes (std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
 
virtual void SetFillColor (Color_t fcolor)
 
virtual void SetFillColorAlpha (Color_t fcolor, Float_t falpha)
 
virtual void SetFillStyle (Style_t fstyle)
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
- Public Member Functions inherited from TAttMarker
 TAttMarker ()
 
 TAttMarker (Color_t color, Style_t style, Size_t msize)
 
virtual ~TAttMarker ()
 
void Copy (TAttMarker &attmarker) const
 
virtual Color_t GetMarkerColor () const
 
virtual Size_t GetMarkerSize () const
 
virtual Style_t GetMarkerStyle () const
 
virtual void Modify ()
 
virtual void ResetAttMarker (Option_t *toption="")
 
virtual void SaveMarkerAttributes (std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t sizdef=1)
 
virtual void SetMarkerColor (Color_t mcolor=1)
 
virtual void SetMarkerColorAlpha (Color_t mcolor, Float_t malpha)
 
virtual void SetMarkerSize (Size_t msize=1)
 
virtual void SetMarkerStyle (Style_t mstyle=1)
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 

Private Member Functions

void init ()
 Initialisations, used by constructors.
 
void ReadIdentifierFromAsciiFile (TString &name, TString &type, TString &cl, std::ifstream &gridfile)
 

Private Attributes

TObjArray fEmbracingLines
 temporary array used by GetIDLinesEmbracingPoint
 

Additional Inherited Members

- Public Types inherited from TGraph
enum  EStatusBits
 
- Public Types inherited from TObject
enum  EDeprecatedStatusBits
 
enum  EStatusBits
 
- Static Public Member Functions inherited from KVIDGraph
static KVIDGraphAddGraphs (KVIDGraph *g1, Int_t id1_min, Int_t id1_max, KVIDGraph *g2, Int_t id2_min, Int_t id2_max)
 
static Bool_t GetAutoAdd ()
 
static KVIDGraphMakeIDGraph (const Char_t *)
 
static void SetAutoAdd (Bool_t yes=kTRUE)
 
- Static Public Member Functions inherited from TCutG
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
- Static Public Member Functions inherited from TGraph
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static Bool_t CompareArg (const TGraph *gr, Int_t left, Int_t right)
 
static Bool_t CompareRadius (const TGraph *gr, Int_t left, Int_t right)
 
static Bool_t CompareX (const TGraph *gr, Int_t left, Int_t right)
 
static Bool_t CompareY (const TGraph *gr, Int_t left, Int_t right)
 
static const char * DeclFileName ()
 
- Static Public Member Functions inherited from TNamed
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
- Static Public Member Functions inherited from TObject
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
static Longptr_t GetDtorOnly ()
 
static Bool_t GetObjectStat ()
 
static void SetDtorOnly (void *obj)
 
static void SetObjectStat (Bool_t stat)
 
- Static Public Member Functions inherited from TAttLine
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
- Static Public Member Functions inherited from TAttFill
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
- Static Public Member Functions inherited from TAttMarker
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
static Width_t GetMarkerLineWidth (Style_t style)
 
static Style_t GetMarkerStyleBase (Style_t style)
 
- Public Attributes inherited from TGraph
 kClipFrame
 
 kIsHighlight
 
 kIsSortedX
 
 kNoStats
 
 kNotEditable
 
 kResetHisto
 
- Public Attributes inherited from TObject
 kBitMask
 
 kCanDelete
 
 kCannotPick
 
 kHasUUID
 
 kInconsistent
 
 kInvalidObject
 
 kIsOnHeap
 
 kIsReferenced
 
 kMustCleanup
 
 kNoContextMenu
 
 kNotDeleted
 
 kObjInCanvas
 
 kOverwrite
 
 kSingleKey
 
 kWriteDelete
 
 kZombie
 
- Protected Member Functions inherited from TGraph
virtual Double_t ** Allocate (Int_t newsize)
 
Double_t ** AllocateArrays (Int_t Narrays, Int_t arraySize)
 
virtual void CopyAndRelease (Double_t **newarrays, Int_t ibegin, Int_t iend, Int_t obegin)
 
virtual Bool_t CopyPoints (Double_t **newarrays, Int_t ibegin, Int_t iend, Int_t obegin)
 
Bool_t CtorAllocate ()
 
virtual Bool_t DoMerge (const TGraph *g)
 
Double_t ** ExpandAndCopy (Int_t size, Int_t iend)
 
virtual void FillZero (Int_t begin, Int_t end, Bool_t from_ctor=kTRUE)
 
TString SaveArray (std::ostream &out, const char *suffix, Int_t frameNumber, Double_t *arr)
 
void SaveHistogramAndFunctions (std::ostream &out, const char *varname, Int_t &frameNumber, Option_t *option)
 
Double_t ** ShrinkAndCopy (Int_t size, Int_t iend)
 
virtual void SwapPoints (Int_t pos1, Int_t pos2)
 
virtual void UpdateArrays (const std::vector< Int_t > &sorting_indices, Int_t numSortedPoints, Int_t low)
 
- Protected Member Functions inherited from TObject
virtual void DoError (int level, const char *location, const char *fmt, va_list va) const
 
void MakeZombie ()
 
- Static Protected Member Functions inherited from TGraph
static void SwapValues (Double_t *arr, Int_t pos1, Int_t pos2)
 
- Protected Attributes inherited from TCutG
TObjectfObjectX
 
TObjectfObjectY
 
TString fVarX
 
TString fVarY
 
- Protected Attributes inherited from TGraph
TListfFunctions
 
TH1FfHistogram
 
Double_t fMaximum
 
Int_t fMaxSize
 
Double_t fMinimum
 
Int_t fNpoints
 
Double_tfX
 
Double_tfY
 
- Protected Attributes inherited from TNamed
TString fName
 
TString fTitle
 
- Protected Attributes inherited from TObject
 kOnlyPrepStep
 
- Protected Attributes inherited from TAttLine
Color_t fLineColor
 
Style_t fLineStyle
 
Width_t fLineWidth
 
- Protected Attributes inherited from TAttFill
Color_t fFillColor
 
Style_t fFillStyle
 
- Protected Attributes inherited from TAttMarker
Color_t fMarkerColor
 
Size_t fMarkerSize
 
Style_t fMarkerStyle
 

Constructor & Destructor Documentation

◆ KVIDGrid()

KVIDGrid::KVIDGrid ( )

Default constructor.

Definition at line 46 of file KVIDGrid.cpp.

◆ ~KVIDGrid()

KVIDGrid::~KVIDGrid ( )
virtual

Definition at line 68 of file KVIDGrid.cpp.

Member Function Documentation

◆ CalculateLineWidths()

virtual void KVIDGrid::CalculateLineWidths ( )
inlinevirtual

Reimplemented in KVIDZAGrid.

Definition at line 264 of file KVIDGrid.h.

◆ DefaultIDLineClass()

virtual TClass * KVIDGrid::DefaultIDLineClass ( )
inlinevirtual

Reimplemented in KVIDGCsI, and KVIDZAGrid.

Definition at line 266 of file KVIDGrid.h.

◆ DefaultOKLineClass()

virtual TClass * KVIDGrid::DefaultOKLineClass ( )
inlinevirtual

Definition at line 270 of file KVIDGrid.h.

◆ FindNearestEmbracingIDLine()

KVIDLine * KVIDGrid::FindNearestEmbracingIDLine ( Double_t  x,
Double_t  y,
const Char_t position,
const Char_t axis,
Int_t idx,
Int_t idx_min,
Int_t idx_max,
Double_t dist,
Double_t dist_min,
Double_t dist_max 
) const
inline

This is the same as FindNearestIDLineFast except that only lines for which KVIDLine::IsBetweenEndPoints(x,y,axis) returns kTRUE are considered. As we only consider lines between whose endpoints our point lies, this method always gives the correct answer.

increase index

decrease index

calculate distance of point to the two lines above and below

if idx_max = nlines-1, the point may be above the last line in which case we put idx_max = -1 (no line above point)

above last line

if idx_min = 0, the point may be below the first line in which case we put idx_min = -1 (no line below point)

below first line

convert indices back to index in main list

Definition at line 163 of file KVIDGrid.h.

◆ FindNearestIDLineFast()

KVIDLine * KVIDGrid::FindNearestIDLineFast ( Double_t  x,
Double_t  y,
const Char_t position,
Int_t idx,
Int_t idx_min,
Int_t idx_max,
Double_t dist,
Double_t dist_min,
Double_t dist_max 
) const
inline

Fast algorithm for finding the ID line the closest to a given point (x,y) by dichotomy.

WARNING: will not always give right result if the distance from the point to each line is not a smooth function of the line index with a single minimum. In this case you should use FindNearestIDLine. IF the grid's lines all start and end at the same abscissa, this will work fine.

IF NOT, (i.e. lines start and end at different 'x' values), it will sometimes give the wrong answer.

The returned pointer is the closest line, idx is its index in the list of identifiers, whereas idx_min and idx_max are the indices of the two closest lines between which (x,y) lies. dist, dist_min, and dist_max are the distances between the point and these lines.

The order of the indices follows the order of the sorting of the ID line list which is in turn determined by the Compare() function of the class of which the ID lines are members. For the algorithm to work, the ID lines must be sorted according to the Compare() function defined for the KVIDLine-based class of which they are members. The "position" string then corresponds to the way lines are sorted in the map (vertically or horizontally, and in which direction). For this reason it is essential to call the Initialise() method of the grid before using it (this will sort the lines).

For example: Suppose we have lines of Z identification (KVIDZALine) in a map with x=E and y=dE. The KVIDZALine::Compare() function sorts lines in order of increasing Z, i.e. in terms of increasing dE, or from bottom to top when looking at the (E,dE) map. Thus the "position" string to use is "above" : if the point (E,dE) is "above" the line currently tested, the algorithm will choose a line which is "higher up" i.e. has a larger Z, or in fact, has a larger index in the list of ID lines. The indices idx_min and idx_max would correspond to the line immediately below and above the point, respectively. This is for a case of more-or-less horizontal lines sorted from bottom to top. In a map of more-or-less vertical ID lines, with the sorting going from left to right, we would use position="right". (see KVIDLine::WhereAmI for an explanation of "above", "below", etc.).

increase index

decrease index

calculate distance of point to the two lines above and below and return pointer of the closest one

Definition at line 91 of file KVIDGrid.h.

◆ FindNextEmbracingLine()

KVIDLine * KVIDGrid::FindNextEmbracingLine ( Int_t index,
Int_t  inc_index,
Double_t  x,
Double_t  y,
const Char_t axis 
) const
inline

Starting from the line with given 'index', we search for the next line in the list of identifiers for which KVIDLine::IsBetweenEndPoints(x,y,axis) returns kTRUE. 'inc_index' is the step used to scan the list, i.e. inc_index=1 will scan index+1, index+2, ... inc_index=-1 will scan index-1, index-2, ... Returns pointer to line (or 0x0 if not found) and 'index' contains index of this line (or -1 if no line found)

no line found

Definition at line 236 of file KVIDGrid.h.

◆ GetIDLinesEmbracingPoint()

Int_t KVIDGrid::GetIDLinesEmbracingPoint ( const Char_t direction,
Double_t  x,
Double_t  y 
) const

Replaces contents of fEmbracingLines with subset of ID lines for which IsBetweenEndPoints(x,y,direction) == kTRUE. nlines = number of lines in list

Definition at line 191 of file KVIDGrid.cpp.

◆ init()

void KVIDGrid::init ( )
private

Initialisations, used by constructors.

Definition at line 58 of file KVIDGrid.cpp.

◆ Initialize()

void KVIDGrid::Initialize ( )
virtual

General initialisation method for identification grid. This method MUST be called once before using the grid for identifications. The ID lines are sorted. The natural line widths of all ID lines are calculated.

Implements KVIDGraph.

Reimplemented in KVIDZAFromZGrid, and KVIDZAGrid.

Definition at line 218 of file KVIDGrid.cpp.

◆ NewLine()

KVIDLine * KVIDGrid::NewLine ( const Char_t idline_class = "")

Create a new line compatible with this grid.

If idline_class = "id" or "ID": create default identification line object for this grid

If idline_class = "ok" or "OK": create default 'OK' line object for this grid

If idline_class = class name: create line object of given class

If idline_class = "": create KVIDLine object

Definition at line 90 of file KVIDGrid.cpp.

◆ ReadIdentifierFromAsciiFile()

void KVIDGrid::ReadIdentifierFromAsciiFile ( TString name,
TString type,
TString cl,
std::ifstream &  gridfile 
)
privatevirtual

Read in new identifier object from file Backwards-compatibility fixes

Reimplemented from KVIDGraph.

Definition at line 143 of file KVIDGrid.cpp.

Member Data Documentation

◆ fEmbracingLines

TObjArray KVIDGrid::fEmbracingLines
mutableprivate

temporary array used by GetIDLinesEmbracingPoint

Definition at line 76 of file KVIDGrid.h.