KaliVeda
Toolkit for HIC analysis
KVIDentifier Class Reference

Detailed Description

Base class for graphical cuts used in particle identification.

Definition at line 28 of file KVIDentifier.h.

#include <KVIDentifier.h>

Inheritance diagram for KVIDentifier:

Public Member Functions

 KVIDentifier ()
 Default constructor. More...
 
 KVIDentifier (const KVIDentifier &)
 
 KVIDentifier (const TCutG &)
 copy a TCutG More...
 
 KVIDentifier (const TGraph &)
 copy a TGraph More...
 
virtual ~KVIDentifier ()
 Destructor. More...
 
virtual Int_t AddPointAtTheEnd ()
 
virtual void ChechHierarchy (KVIDentifier *gr)
 
virtual void CloneScaleStore (Int_t newzt, Int_t newat, Double_t dy=0., Double_t sx=1., Double_t sy=1.)
 
Int_t Compare (const TObject *) const override
 
virtual Int_t ContinueDrawing ()
 Continue to draw an existing the line. More...
 
void Copy (TObject &obj) const override
 Copy attributes of this identifier into 'obj'. More...
 
void CopyGraph (const TGraph &)
 Copy coordinates of points from the TGraph. More...
 
void CopyGraph (TGraph *)
 Copy coordinates of points from the TGraph. More...
 
virtual Int_t DecreaseNumberOfPoints ()
 
void Delete (Option_t *option="") override
 
void DrawClass () const override
 
TObject * DrawClone (Option_t *option="") const override
 
void DrawPanel () override
 
void Dump () const override
 
void ExtendLine (bool fromBeginning, Double_t Limit, Option_t *Direction)
 
void ExtendLine (Double_t, Option_t *Direction="")
 
TFitResultPtr Fit (const char *formula, Option_t *option="", Option_t *goption="", Axis_t xmin=0, Axis_t xmax=0) override
 
TFitResultPtr Fit (TF1 *f1, Option_t *option="", Option_t *goption="", Axis_t xmin=0, Axis_t xmax=0) override
 
void FitPanel () override
 
virtual Int_t GetA () const
 
virtual Int_t GetID () const
 
virtual Int_t GetMassFormula () const
 
KVIDGraph * GetParent () const
 Get pointer to parent ID graph. More...
 
virtual Double_t GetPID () const
 
virtual const Char_t * GetSelectionType () const
 
const Char_t * GetType () const
 
virtual Int_t GetZ () const
 
virtual Bool_t HasMassFits () const
 
virtual Int_t IncreaseNumberOfPoints ()
 
Int_t InsertPoint () override
 Insert a new point at the mouse position. More...
 
virtual Int_t InsertSmoothPoint ()
 Insert a new point at the mouse X position using a smooth evaluation of the Y. More...
 
void Inspect () const override
 
void NotifyParentOfModification ()
 If identifier belongs to a graph/grid, send signal to say it has been modified. More...
 
virtual Bool_t OnlyZId () const
 
void Print (Option_t *opt) const override
 
virtual void ReadAsciiFile (std::ifstream &)
 
virtual Int_t RemoveFirstPoint ()
 
virtual Int_t RemoveLastPoint ()
 
virtual Int_t RemovePoint () override
 
virtual Int_t RemovePoint (Int_t i) override
 
void SaveAs (const char *filename="", Option_t *option="") const override
 
void Scale (TF1 *sx, TF1 *sy)
 
void ScaleXY (Double_t sx=-1, Double_t sy=-1)
 
virtual void SetA (Int_t atnum)
 
virtual void SetAandZ (Int_t atnum, Int_t ztnum)
 
void SetDrawOption (Option_t *option="") override
 
void SetFillAttributes () override
 
void SetLineAttributes () override
 
void SetMarkerAttributes () override
 
virtual void SetMassFormula (Int_t mf)
 
void SetMaximum (Double_t maximum=-1111) override
 
void SetMinimum (Double_t minimum=-1111) override
 
void SetName (const char *name) override
 
virtual void SetOnlyZId (Bool_t onlyz=kTRUE)
 
void SetParent (KVIDGraph *)
 Set pointer to parent ID graph. More...
 
void SetTitle (const char *title="") override
 
virtual void SetZ (Int_t ztnum)
 
virtual Int_t SortPoints (Bool_t ascending=kTRUE)
 
virtual Bool_t TestPoint (Double_t, Double_t)
 
virtual void WaitForPrimitive ()
 
virtual void WriteAsciiFile (std::ofstream &, const Char_t *name_prefix="")
 

Friends

class KVIDGraph
 

Constructor & Destructor Documentation

◆ KVIDentifier() [1/4]

KVIDentifier::KVIDentifier ( )

Default constructor.

Definition at line 51 of file KVIDentifier.cpp.

◆ KVIDentifier() [2/4]

KVIDentifier::KVIDentifier ( const KVIDentifier &  gr)

copy constructor we do not copy the fParent pointer to parent grid, it is left NULL.

Definition at line 100 of file KVIDentifier.cpp.

◆ KVIDentifier() [3/4]

KVIDentifier::KVIDentifier ( const TCutG &  gr)

copy a TCutG

Definition at line 73 of file KVIDentifier.cpp.

◆ KVIDentifier() [4/4]

KVIDentifier::KVIDentifier ( const TGraph &  gr)

copy a TGraph

Definition at line 85 of file KVIDentifier.cpp.

◆ ~KVIDentifier()

KVIDentifier::~KVIDentifier ( )
virtual

Destructor.

Definition at line 63 of file KVIDentifier.cpp.

Member Function Documentation

◆ AddPointAtTheEnd()

Int_t KVIDentifier::AddPointAtTheEnd ( )
virtual

Insert a new point at the end its position is extrapolated from the two last points assuming linear evolution (yy = a*xx + bb) The KVIDentifier has to have at least 2 points

Definition at line 818 of file KVIDentifier.cpp.

◆ ChechHierarchy()

void KVIDentifier::ChechHierarchy ( KVIDentifier *  gr)
virtual

Check if the line has been draw from left to right or right to left In this last case, we invert the filling order

Definition at line 749 of file KVIDentifier.cpp.

◆ CloneScaleStore()

void KVIDentifier::CloneScaleStore ( Int_t  newzt,
Int_t  newar,
Double_t  dy = 0.,
Double_t  sx = 1.,
Double_t  sy = 1. 
)
virtual

Create a new line from the selected one with a new Z and A (optional) this new line is scale from the selected one with a vertical sy and horizontal sx (optional) factor you need to undraw and draw the grid to see its implementation

Definition at line 535 of file KVIDentifier.cpp.

◆ Compare()

Int_t KVIDentifier::Compare ( const TObject *  ) const
override

Dummy method used for sorting, can be redefined in more specific implementations. A priori we don't know how to "order" the identification cuts.

Definition at line 287 of file KVIDentifier.cpp.

◆ ContinueDrawing()

Int_t KVIDentifier::ContinueDrawing ( )
virtual

Continue to draw an existing the line.

Definition at line 685 of file KVIDentifier.cpp.

◆ Copy()

void KVIDentifier::Copy ( TObject &  obj) const
override

Copy attributes of this identifier into 'obj'.

Definition at line 115 of file KVIDentifier.cpp.

◆ CopyGraph() [1/2]

void KVIDentifier::CopyGraph ( const TGraph &  graph)

Copy coordinates of points from the TGraph.

Definition at line 189 of file KVIDentifier.cpp.

◆ CopyGraph() [2/2]

void KVIDentifier::CopyGraph ( TGraph *  graph)

Copy coordinates of points from the TGraph.

Definition at line 170 of file KVIDentifier.cpp.

◆ DecreaseNumberOfPoints()

Int_t KVIDentifier::DecreaseNumberOfPoints ( )
virtual

Definition at line 917 of file KVIDentifier.cpp.

◆ Delete()

void KVIDentifier::Delete ( Option_t *  option = "")
inlineoverride

-— The following redeclarations are here just to remove the MENU tag which -— is present in TObject.h, to stop these methods appearing in the ID line context menus

Definition at line 183 of file KVIDentifier.h.

◆ DrawClass()

void KVIDentifier::DrawClass ( ) const
inlineoverride

Definition at line 187 of file KVIDentifier.h.

◆ DrawClone()

TObject* KVIDentifier::DrawClone ( Option_t *  option = "") const
inlineoverride

Definition at line 191 of file KVIDentifier.h.

◆ DrawPanel()

void KVIDentifier::DrawPanel ( )
inlineoverride

Definition at line 162 of file KVIDentifier.h.

◆ Dump()

void KVIDentifier::Dump ( ) const
inlineoverride

Definition at line 196 of file KVIDentifier.h.

◆ ExtendLine() [1/2]

void KVIDentifier::ExtendLine ( bool  fromBeginning,
Double_t  Limit,
Option_t *  Direction 
)

Add a straight-line segment at the end or the beginning of the line depending on fromBeginning.

  • Direction = "" (default) - continue in the direction of first/last segment
  • Direction = "H", "h", "hori", "HORI" etc. - add horizontal segment
  • Direction = "v", "V", "vert", "VERT" etc. - add vertical segment

Definition at line 465 of file KVIDentifier.cpp.

◆ ExtendLine() [2/2]

void KVIDentifier::ExtendLine ( Double_t  Limit,
Option_t *  Direction = "" 
)

Right-clicking an identifier and selecting this method from the context menu allows to add a straight-line segment at the end or the beginning of the line (whichever is closest to the mouse).

  • Direction = "" (default) - continue in the direction of first/last segment
  • Direction = "H", "h", "hori", "HORI" etc. - add horizontal segment
  • Direction = "v", "V", "vert", "VERT" etc. - add vertical segment

Definition at line 428 of file KVIDentifier.cpp.

◆ Fit() [1/2]

TFitResultPtr KVIDentifier::Fit ( const char *  formula,
Option_t *  option = "",
Option_t *  goption = "",
Axis_t  xmin = 0,
Axis_t  xmax = 0 
)
inlineoverride

Definition at line 166 of file KVIDentifier.h.

◆ Fit() [2/2]

TFitResultPtr KVIDentifier::Fit ( TF1 *  f1,
Option_t *  option = "",
Option_t *  goption = "",
Axis_t  xmin = 0,
Axis_t  xmax = 0 
)
inlineoverride

Definition at line 170 of file KVIDentifier.h.

◆ FitPanel()

void KVIDentifier::FitPanel ( )
inlineoverride

Definition at line 158 of file KVIDentifier.h.

◆ GetA()

virtual Int_t KVIDentifier::GetA ( ) const
inlinevirtual

Reimplemented in KVIDCutLine, and KVIDCutContour.

Definition at line 76 of file KVIDentifier.h.

◆ GetID()

virtual Int_t KVIDentifier::GetID ( ) const
inlinevirtual

Definition at line 72 of file KVIDentifier.h.

◆ GetMassFormula()

virtual Int_t KVIDentifier::GetMassFormula ( ) const
inlinevirtual

Reimplemented in KVIDCutLine, and KVIDCutContour.

Definition at line 116 of file KVIDentifier.h.

◆ GetParent()

KVIDGraph * KVIDentifier::GetParent ( ) const

Get pointer to parent ID graph.

Definition at line 136 of file KVIDentifier.cpp.

◆ GetPID()

Double_t KVIDentifier::GetPID ( ) const
virtual

Definition at line 965 of file KVIDentifier.cpp.

◆ GetSelectionType()

virtual const Char_t* KVIDentifier::GetSelectionType ( ) const
inlinevirtual

Reimplemented in KVIDCutLine, and KVIDCutContour.

Definition at line 250 of file KVIDentifier.h.

◆ GetType()

const Char_t* KVIDentifier::GetType ( ) const
inline

Definition at line 246 of file KVIDentifier.h.

◆ GetZ()

virtual Int_t KVIDentifier::GetZ ( ) const
inlinevirtual

Reimplemented in KVIDCutLine, and KVIDCutContour.

Definition at line 80 of file KVIDentifier.h.

◆ HasMassFits()

virtual Bool_t KVIDentifier::HasMassFits ( ) const
inlinevirtual

Reimplemented in KVIDZALine.

Definition at line 254 of file KVIDentifier.h.

◆ IncreaseNumberOfPoints()

Int_t KVIDentifier::IncreaseNumberOfPoints ( )
virtual

Definition at line 881 of file KVIDentifier.cpp.

◆ InsertPoint()

Int_t KVIDentifier::InsertPoint ( )
override

Insert a new point at the mouse position.

Definition at line 577 of file KVIDentifier.cpp.

◆ InsertSmoothPoint()

Int_t KVIDentifier::InsertSmoothPoint ( )
virtual

Insert a new point at the mouse X position using a smooth evaluation of the Y.

Definition at line 646 of file KVIDentifier.cpp.

◆ Inspect()

void KVIDentifier::Inspect ( ) const
inlineoverride

Definition at line 200 of file KVIDentifier.h.

◆ NotifyParentOfModification()

void KVIDentifier::NotifyParentOfModification ( )

If identifier belongs to a graph/grid, send signal to say it has been modified.

Definition at line 158 of file KVIDentifier.cpp.

◆ OnlyZId()

virtual Bool_t KVIDentifier::OnlyZId ( ) const
inlinevirtual

Definition at line 104 of file KVIDentifier.h.

◆ Print()

void KVIDentifier::Print ( Option_t *  opt) const
override

Print out for identification cut The optional "opt" string, if given, is printed in parentheses after the line's name This is used by KVIDGraph in order to show which are "ID" cuts and which are "OK" cuts (i.e. used to define an identifiable area in a data map).

Definition at line 304 of file KVIDentifier.cpp.

◆ ReadAsciiFile()

void KVIDentifier::ReadAsciiFile ( std::ifstream &  )
virtual

Read coordinates of identifier in file buffer stream Format is :

number_of_points x1 y1 x2 y2 ... etc. etc.

Definition at line 259 of file KVIDentifier.cpp.

◆ RemoveFirstPoint()

Int_t KVIDentifier::RemoveFirstPoint ( )
virtual

Remove the first point The KVIDentifier has to have at least 2 points

Definition at line 846 of file KVIDentifier.cpp.

◆ RemoveLastPoint()

Int_t KVIDentifier::RemoveLastPoint ( )
virtual

Remove the first point The KVIDentifier has to have at least 2 points

Definition at line 865 of file KVIDentifier.cpp.

◆ RemovePoint() [1/2]

Int_t KVIDentifier::RemovePoint ( )
overridevirtual

Definition at line 781 of file KVIDentifier.cpp.

◆ RemovePoint() [2/2]

virtual Int_t KVIDentifier::RemovePoint ( Int_t  i)
inlineoverridevirtual

Definition at line 235 of file KVIDentifier.h.

◆ SaveAs()

void KVIDentifier::SaveAs ( const char *  filename = "",
Option_t *  option = "" 
) const
inlineoverride

Definition at line 204 of file KVIDentifier.h.

◆ Scale()

void KVIDentifier::Scale ( TF1 *  sx,
TF1 *  sy 
)

Apply to the coordinates of every point the transformation X_0 —> sx(X_0,Y_0) Y_0 —> sy(X_0,Y_0) if sx & sy are two-dimensional functions (inherits from TF2), otherwise we apply the transformation X_0 —> sx(X_0) Y_0 —> sy(Y_0) for sx & sy one-dimensionsal (TF1) functions.

Definition at line 353 of file KVIDentifier.cpp.

◆ ScaleXY()

void KVIDentifier::ScaleXY ( Double_t  sx = -1,
Double_t  sy = -1 
)

Scale the coordinates of every point of the cut according to X_0 —> sx*X_0 Y_0 —> sy*Y_0 Default argument value '-1' means leave coordinate unchanged

Definition at line 324 of file KVIDentifier.cpp.

◆ SetA()

virtual void KVIDentifier::SetA ( Int_t  atnum)
inlinevirtual

Definition at line 89 of file KVIDentifier.h.

◆ SetAandZ()

virtual void KVIDentifier::SetAandZ ( Int_t  atnum,
Int_t  ztnum 
)
inlinevirtual

Definition at line 94 of file KVIDentifier.h.

◆ SetDrawOption()

void KVIDentifier::SetDrawOption ( Option_t *  option = "")
inlineoverride

Definition at line 208 of file KVIDentifier.h.

◆ SetFillAttributes()

void KVIDentifier::SetFillAttributes ( )
inlineoverride

Definition at line 216 of file KVIDentifier.h.

◆ SetLineAttributes()

void KVIDentifier::SetLineAttributes ( )
inlineoverride

Definition at line 212 of file KVIDentifier.h.

◆ SetMarkerAttributes()

void KVIDentifier::SetMarkerAttributes ( )
inlineoverride

Definition at line 220 of file KVIDentifier.h.

◆ SetMassFormula()

virtual void KVIDentifier::SetMassFormula ( Int_t  mf)
inlinevirtual

Definition at line 108 of file KVIDentifier.h.

◆ SetMaximum()

void KVIDentifier::SetMaximum ( Double_t  maximum = -1111)
inlineoverride

-— The following redeclarations are here just to remove the MENU tag which -— is present in TGraph.h, to stop these methods appearing in the ID line context menus

Definition at line 146 of file KVIDentifier.h.

◆ SetMinimum()

void KVIDentifier::SetMinimum ( Double_t  minimum = -1111)
inlineoverride

Definition at line 150 of file KVIDentifier.h.

◆ SetName()

void KVIDentifier::SetName ( const char *  name)
inlineoverride

-— The following redeclarations are here just to remove the MENU tag which -— is present in TNamed.h, to stop these methods appearing in the ID line context menus

Definition at line 176 of file KVIDentifier.h.

◆ SetOnlyZId()

virtual void KVIDentifier::SetOnlyZId ( Bool_t  onlyz = kTRUE)
inlinevirtual

Definition at line 100 of file KVIDentifier.h.

◆ SetParent()

void KVIDentifier::SetParent ( KVIDGraph *  p)

Set pointer to parent ID graph.

Definition at line 147 of file KVIDentifier.cpp.

◆ SetTitle()

void KVIDentifier::SetTitle ( const char *  title = "")
inlineoverride

Definition at line 154 of file KVIDentifier.h.

◆ SetZ()

virtual void KVIDentifier::SetZ ( Int_t  ztnum)
inlinevirtual

Definition at line 84 of file KVIDentifier.h.

◆ SortPoints()

Int_t KVIDentifier::SortPoints ( Bool_t  ascending = kTRUE)
virtual

Definition at line 953 of file KVIDentifier.cpp.

◆ TestPoint()

virtual Bool_t KVIDentifier::TestPoint ( Double_t  ,
Double_t   
)
inlinevirtual

Abstract method, should be overridden in child classes. Used to test whether a point (x,y) in the ID map is identifiable.

Reimplemented in KVIDCutLine, and KVIDCutContour.

Definition at line 121 of file KVIDentifier.h.

◆ WaitForPrimitive()

void KVIDentifier::WaitForPrimitive ( )
virtual

Method used to draw a new identifier in the active pad Override in child classes so that gPad->WaitPrimitive has correct arguments

Reimplemented in KVIDLine.

Definition at line 401 of file KVIDentifier.cpp.

◆ WriteAsciiFile()

void KVIDentifier::WriteAsciiFile ( std::ofstream &  ,
const Char_t *  name_prefix = "" 
)
virtual

Write name and coordinates of identifier in file buffer stream Optional string name_prefix will be written just in front of the name of the object. Format is :

+classname name_prefix:name_of_object number_of_points x1 y1 x2 y2 ... etc. etc.

Definition at line 218 of file KVIDentifier.cpp.

Friends And Related Function Documentation

◆ KVIDGraph

friend class KVIDGraph
friend

Definition at line 29 of file KVIDentifier.h.