KaliVeda
Toolkit for HIC analysis
KVIDentifier.h
1 /*
2 $Id: KVIDentifier.h,v 1.7 2009/04/20 10:01:58 ebonnet Exp $
3 $Revision: 1.7 $
4 $Date: 2009/04/20 10:01:58 $
5 */
6 
9 
10 #ifndef __KVIDENTIFIER_H
11 #define __KVIDENTIFIER_H
12 
13 #include "Riostream.h"
14 #include "TCutG.h"
15 #include "KVNucleus.h"
16 #include "RVersion.h"
17 
18 class TF1;
19 class KVIDGraph;
20 
28 class KVIDentifier : public TCutG {
29  friend class KVIDGraph;
30 
31 protected:
35 
39 
42  virtual void WriteAsciiFile_extras(std::ofstream&, const Char_t* /*name_prefix*/ = "") {}
43 
46  virtual void ReadAsciiFile_extras(std::ifstream&) {}
47  virtual void SetNameFromNucleus()
48  {
49  SetName(Form("Z=%d A=%d", GetZ(), GetA()));
50  }
51 
52 private:
53  void init();
54 
55 public:
56  KVIDentifier();
57  KVIDentifier(const KVIDentifier&);
58  KVIDentifier(const TCutG&);
59  KVIDentifier(const TGraph&);
60  virtual ~KVIDentifier();
61 
62  KVIDGraph* GetParent() const;
63  void SetParent(KVIDGraph*);
64 
65  Int_t Compare(const TObject*) const;
66  void Copy(TObject& obj) const;
67 
68  virtual void WriteAsciiFile(std::ofstream&, const Char_t* name_prefix = "");
69  virtual void ReadAsciiFile(std::ifstream&);
70 
71  virtual Int_t GetID() const
72  {
73  return 0;
74  };
75  virtual Int_t GetA() const
76  {
77  return fIon.GetA();
78  };
79  virtual Int_t GetZ() const
80  {
81  return fIon.GetZ();
82  };
83  virtual void SetZ(Int_t ztnum)
84  {
85  fIon.SetZ(ztnum);
87  }; // *MENU={Hierarchy="SetNucleus.../Z"}*
88  virtual void SetA(Int_t atnum)
89  {
90  fIon.SetA(atnum);
92  }; // *MENU={Hierarchy="SetNucleus.../A"}*
93  virtual void SetAandZ(Int_t atnum, Int_t ztnum)
94  {
95  fIon.SetZ(ztnum);
96  fIon.SetA(atnum);
98  }; // *MENU={Hierarchy="SetNucleus.../A and Z"}* *ARGS={atnum=>fA,ztnum=>fZ}
99  virtual void SetOnlyZId(Bool_t onlyz = kTRUE)
100  {
101  fGridOnlyZId = onlyz;
102  };
103  virtual Bool_t OnlyZId()const
104  {
105  return fGridOnlyZId;
106  }
107  virtual void SetMassFormula(Int_t mf)
108  {
109  if (OnlyZId()) {
110  fIon.SetMassFormula(mf);
111  fMassFormula = mf;
113  }
114  }; // *SUBMENU={Hierarchy="SetNucleus.../Mass Formula"}*
115  virtual Int_t GetMassFormula()const
116  {
117  return fIon.GetMassFormula();
118  }
119 
120  virtual Bool_t TestPoint(Double_t /*x*/, Double_t /*y*/)
121  {
124 
125  AbstractMethod("TestMethod(Double_t x, Double_t y");
126  return kFALSE;
127  }
128 
129  void CopyGraph(TGraph*);
130  void CopyGraph(const TGraph&);
131 
132  virtual void Scale(Double_t sx = -1, Double_t sy = -1);
133  virtual void Scale(TF1* sx, TF1* sy);
134 
135  virtual void Print(Option_t* opt) const;
136 
137  virtual void WaitForPrimitive();
138 
139  void ExtendLine(Double_t, Option_t* Direction = ""); // *MENU={Hierarchy="Modify Line.../ExtendLine"}*
140  void ExtendLine(bool fromBeginning, Double_t Limit, Option_t* Direction);
141 
144  virtual void SetMaximum(Double_t maximum = -1111)
145  {
146  TGraph::SetMaximum(maximum);
147  };
148  virtual void SetMinimum(Double_t minimum = -1111)
149  {
150  TGraph::SetMinimum(minimum);
151  };
152  virtual void SetTitle(const char* title = "")
153  {
154  TGraph::SetTitle(title);
155  };
156  virtual void FitPanel()
157  {
159  };
160  virtual void DrawPanel()
161  {
163  };
164 #if ROOT_VERSION_CODE > ROOT_VERSION(5,25,4)
165  virtual TFitResultPtr Fit(const char* formula, Option_t* option = "", Option_t* goption = "", Axis_t xmin = 0, Axis_t xmax = 0)
166  {
167  return TGraph::Fit(formula, option, goption, xmin, xmax);
168  };
169  virtual TFitResultPtr Fit(TF1* f1, Option_t* option = "", Option_t* goption = "", Axis_t xmin = 0, Axis_t xmax = 0)
170  {
171  return TGraph::Fit(f1, option, goption, xmin, xmax);
172  };
173 #else
174  virtual Int_t Fit(const char* formula, Option_t* option = "", Option_t* goption = "", Axis_t xmin = 0, Axis_t xmax = 0)
175  {
176  return TGraph::Fit(formula, option, goption, xmin, xmax);
177  };
178  virtual Int_t Fit(TF1* f1, Option_t* option = "", Option_t* goption = "", Axis_t xmin = 0, Axis_t xmax = 0)
179  {
180  return TGraph::Fit(f1, option, goption, xmin, xmax);
181  };
182 #endif
185  virtual void SetName(const char* name);
188  virtual void Delete(Option_t* option = "")
189  {
191  };
192  virtual void DrawClass() const
193  {
195  };
196  virtual TObject* DrawClone(Option_t* option = "") const
197  {
198  return TGraph::DrawClone(option);
199  };
200  virtual void CloneScaleStore(Int_t newzt, Int_t newat, Double_t dy = 0., Double_t sx = 1., Double_t sy = 1.); // *MENU* *ARGS={newat=>fA,newzt=>fZ}
201  virtual void Dump() const
202  {
203  TGraph::Dump();
204  };
205  virtual void Inspect() const
206  {
207  TGraph::Inspect();
208  };
209  virtual void SaveAs(const char* filename = "", Option_t* option = "") const
210  {
212  };
213  virtual void SetDrawOption(Option_t* option = "")
214  {
216  };
217  virtual void SetLineAttributes()
218  {
220  };
221  virtual void SetFillAttributes()
222  {
224  };
225  virtual void SetMarkerAttributes()
226  {
228  };
229 
230  virtual Int_t InsertPoint(); // *MENU={Hierarchy="Modify Line.../InsertPoint"}*
231  virtual Int_t AddPointAtTheEnd(); // *MENU={Hierarchy="Modify Line.../AddPointAtTheEnd"}*
232  virtual Int_t RemoveFirstPoint(); // *MENU={Hierarchy="Modify Line.../RemoveFirstPoint"}*
233  virtual Int_t RemoveLastPoint(); // *MENU={Hierarchy="Modify Line.../RemoveLastPoint"}*
234  virtual Int_t IncreaseNumberOfPoints(); // *MENU*
235  virtual Int_t DecreaseNumberOfPoints(); // *MENU*
236  virtual Int_t SortPoints(Bool_t ascending = kTRUE); // *MENU*
237  virtual Int_t ContinueDrawing(); // *MENU={Hierarchy="Modify Line.../ContinueDrawing"}*
238  virtual void ChechHierarchy(KVIDentifier* gr);
239  virtual Int_t RemovePoint(); // *MENU={Hierarchy="Modify Line.../RemovePoint"}*
241  {
242  return TCutG::RemovePoint(i);
243  }
244 
245  virtual Int_t InsertSmoothPoint(); // *MENU*
246 
247 
248  virtual Double_t GetPID() const;
249 
250  ClassDef(KVIDentifier, 2) //Base class for graphical cuts used in particle identification
251 };
252 
253 #endif
int Int_t
bool Bool_t
char Char_t
double Axis_t
constexpr Bool_t kFALSE
double Double_t
const char Option_t
#define ClassDef(name, id)
Option_t Option_t option
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 filename
float xmin
float xmax
char * Form(const char *fmt,...)
Base class for particle identification in a 2D map.
Definition: KVIDGraph.h:32
Base class for graphical cuts used in particle identification.
Definition: KVIDentifier.h:28
virtual void SetOnlyZId(Bool_t onlyz=kTRUE)
Definition: KVIDentifier.h:99
virtual void ReadAsciiFile_extras(std::ifstream &)
Definition: KVIDentifier.h:46
virtual void SetMassFormula(Int_t mf)
Definition: KVIDentifier.h:107
virtual void SetAandZ(Int_t atnum, Int_t ztnum)
Definition: KVIDentifier.h:93
virtual Int_t RemoveFirstPoint()
virtual void SetMarkerAttributes()
Definition: KVIDentifier.h:225
virtual void SetFillAttributes()
Definition: KVIDentifier.h:221
virtual void Scale(Double_t sx=-1, Double_t sy=-1)
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Axis_t xmin=0, Axis_t xmax=0)
Definition: KVIDentifier.h:165
virtual Int_t DecreaseNumberOfPoints()
virtual void SetName(const char *name)
virtual Double_t GetPID() const
virtual Int_t AddPointAtTheEnd()
virtual void SetDrawOption(Option_t *option="")
Definition: KVIDentifier.h:213
virtual void SaveAs(const char *filename="", Option_t *option="") const
Definition: KVIDentifier.h:209
KVIDGraph * fParent
parent identification map or grid
Definition: KVIDentifier.h:32
KVNucleus fIon
ion/nucleus corresponding to this identifier
Definition: KVIDentifier.h:33
virtual Int_t GetA() const
Definition: KVIDentifier.h:75
virtual void WriteAsciiFile_extras(std::ofstream &, const Char_t *="")
Definition: KVIDentifier.h:42
virtual void Inspect() const
Definition: KVIDentifier.h:205
virtual Int_t RemoveLastPoint()
Int_t fA
dummy variables used by context menu dialog boxes
Definition: KVIDentifier.h:37
virtual Int_t InsertSmoothPoint()
Insert a new point at the mouse X position using a smooth evaluation of the Y.
virtual Int_t IncreaseNumberOfPoints()
void ExtendLine(Double_t, Option_t *Direction="")
virtual Int_t InsertPoint()
Insert a new point at the mouse position.
Int_t fZ
dummy variables used by context menu dialog boxes
Definition: KVIDentifier.h:36
virtual void SetMaximum(Double_t maximum=-1111)
Definition: KVIDentifier.h:144
virtual void WaitForPrimitive()
void Copy(TObject &obj) const
Copy attributes of this identifier into 'obj'.
virtual void SetTitle(const char *title="")
Definition: KVIDentifier.h:152
virtual Int_t GetZ() const
Definition: KVIDentifier.h:79
virtual void Delete(Option_t *option="")
Definition: KVIDentifier.h:188
void SetParent(KVIDGraph *)
Set pointer to parent ID graph.
virtual Int_t GetID() const
Definition: KVIDentifier.h:71
virtual void ChechHierarchy(KVIDentifier *gr)
virtual void SetMinimum(Double_t minimum=-1111)
Definition: KVIDentifier.h:148
virtual void FitPanel()
Definition: KVIDentifier.h:156
virtual ~KVIDentifier()
Destructor.
virtual void SetLineAttributes()
Definition: KVIDentifier.h:217
void CopyGraph(TGraph *)
Copy coordinates of points from the TGraph.
virtual Int_t RemovePoint(Int_t i)
Definition: KVIDentifier.h:240
virtual void DrawPanel()
Definition: KVIDentifier.h:160
Int_t fMassFormula
OPTION={GetMethod="GetMassFormula";SetMethod="SetMassFormula";Items=(0="Beta-stability",...
Definition: KVIDentifier.h:38
virtual Bool_t OnlyZId() const
Definition: KVIDentifier.h:103
virtual TObject * DrawClone(Option_t *option="") const
Definition: KVIDentifier.h:196
virtual Int_t GetMassFormula() const
Definition: KVIDentifier.h:115
virtual void CloneScaleStore(Int_t newzt, Int_t newat, Double_t dy=0., Double_t sx=1., Double_t sy=1.)
virtual void WriteAsciiFile(std::ofstream &, const Char_t *name_prefix="")
Bool_t fGridOnlyZId
=kTRUE if parent grid has OnlyZId set
Definition: KVIDentifier.h:34
virtual TFitResultPtr Fit(TF1 *f1, Option_t *option="", Option_t *goption="", Axis_t xmin=0, Axis_t xmax=0)
Definition: KVIDentifier.h:169
virtual Int_t SortPoints(Bool_t ascending=kTRUE)
Int_t Compare(const TObject *) const
virtual void SetA(Int_t atnum)
Definition: KVIDentifier.h:88
KVIDGraph * GetParent() const
Get pointer to parent ID graph.
KVIDentifier()
Default constructor.
virtual void ReadAsciiFile(std::ifstream &)
virtual void Print(Option_t *opt) const
virtual void DrawClass() const
Definition: KVIDentifier.h:192
virtual Bool_t TestPoint(Double_t, Double_t)
Definition: KVIDentifier.h:120
virtual void SetZ(Int_t ztnum)
Definition: KVIDentifier.h:83
virtual Int_t ContinueDrawing()
Continue to draw an existing the line.
virtual void SetNameFromNucleus()
Definition: KVIDentifier.h:47
virtual Int_t RemovePoint()
virtual void Dump() const
Definition: KVIDentifier.h:201
Description of properties and kinematics of atomic nuclei.
Definition: KVNucleus.h:126
Int_t GetA() const
Definition: KVNucleus.cpp:802
void SetA(Int_t a)
Definition: KVNucleus.cpp:658
void SetZ(Int_t z, Char_t mt=-1)
Definition: KVNucleus.cpp:707
void SetMassFormula(UChar_t mt)
Definition: KVNucleus.h:345
Int_t GetZ() const
Return the number of proton / atomic number.
Definition: KVNucleus.cpp:773
Int_t GetMassFormula() const
Definition: KVNucleus.h:177
virtual void SetFillAttributes()
virtual void SetLineAttributes()
virtual void SetMarkerAttributes()
virtual void SetMaximum(Double_t maximum=-1111)
void SaveAs(const char *filename, Option_t *option="") const override
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Axis_t xmin=0, Axis_t xmax=0)
virtual void FitPanel()
virtual Int_t RemovePoint()
void SetTitle(const char *title="") override
virtual void DrawPanel()
virtual void SetMinimum(Double_t minimum=-1111)
void AbstractMethod(const char *method) const
virtual void Inspect() const
virtual void Dump() const
virtual TObject * DrawClone(Option_t *option="") const
virtual void Delete(Option_t *option="")
virtual void SetDrawOption(Option_t *option="")
virtual void DrawClass() const
TF1 * f1