KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
KVIDentifier.h
Go to the documentation of this file.
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 
27 class KVIDentifier : public TCutG {
28  friend class KVIDGraph;
29 
30 protected:
34 
38 
41  virtual void WriteAsciiFile_extras(std::ofstream&, const Char_t* /*name_prefix*/ = "") {}
42 
45  virtual void ReadAsciiFile_extras(std::ifstream&) {}
46  virtual void SetNameFromNucleus()
47  {
48  SetName(Form("Z=%d A=%d", GetZ(), GetA()));
49  }
50 
51 private:
52  void init();
53 
54 public:
55  KVIDentifier();
56  KVIDentifier(const KVIDentifier&);
57  KVIDentifier(const TCutG&);
58  KVIDentifier(const TGraph&);
59  virtual ~KVIDentifier();
60 
61  KVIDGraph* GetParent() const;
62  void SetParent(KVIDGraph*);
63 
64  Int_t Compare(const TObject*) const;
65  void Copy(TObject& obj) const;
66 
67  virtual void WriteAsciiFile(std::ofstream&, const Char_t* name_prefix = "");
68  virtual void ReadAsciiFile(std::ifstream&);
69 
70  virtual Int_t GetID() const
71  {
72  return 0;
73  };
74  virtual Int_t GetA() const
75  {
76  return fIon.GetA();
77  };
78  virtual Int_t GetZ() const
79  {
80  return fIon.GetZ();
81  };
82  virtual void SetZ(Int_t ztnum)
83  {
84  fIon.SetZ(ztnum);
86  }; // *MENU={Hierarchy="SetNucleus.../Z"}*
87  virtual void SetA(Int_t atnum)
88  {
89  fIon.SetA(atnum);
91  }; // *MENU={Hierarchy="SetNucleus.../A"}*
92  virtual void SetAandZ(Int_t atnum, Int_t ztnum)
93  {
94  fIon.SetZ(ztnum);
95  fIon.SetA(atnum);
97  }; // *MENU={Hierarchy="SetNucleus.../A and Z"}* *ARGS={atnum=>fA,ztnum=>fZ}
98  virtual void SetOnlyZId(Bool_t onlyz = kTRUE)
99  {
100  fGridOnlyZId = onlyz;
101  };
102  virtual Bool_t OnlyZId()const
103  {
104  return fGridOnlyZId;
105  }
106  virtual void SetMassFormula(Int_t mf)
107  {
108  if (OnlyZId()) {
109  fIon.SetMassFormula(mf);
110  fMassFormula = mf;
112  }
113  }; // *SUBMENU={Hierarchy="SetNucleus.../Mass Formula"}*
114  virtual Int_t GetMassFormula()const
115  {
116  return fIon.GetMassFormula();
117  }
118 
119  virtual Bool_t TestPoint(Double_t /*x*/, Double_t /*y*/)
120  {
123 
124  AbstractMethod("TestMethod(Double_t x, Double_t y");
125  return kFALSE;
126  }
127 
128  void CopyGraph(TGraph*);
129  void CopyGraph(const TGraph&);
130 
131  virtual void Scale(Double_t sx = -1, Double_t sy = -1);
132  virtual void Scale(TF1* sx, TF1* sy);
133 
134  virtual void Print(Option_t* opt) const;
135 
136  virtual void WaitForPrimitive();
137 
138  void ExtendLine(Double_t, Option_t* Direction = ""); // *MENU={Hierarchy="Modify Line.../ExtendLine"}*
139  void ExtendLine(bool fromBeginning, Double_t Limit, Option_t* Direction);
140 
143  virtual void SetMaximum(Double_t maximum = -1111)
144  {
145  TGraph::SetMaximum(maximum);
146  };
147  virtual void SetMinimum(Double_t minimum = -1111)
148  {
149  TGraph::SetMinimum(minimum);
150  };
151  virtual void SetTitle(const char* title = "")
152  {
153  TGraph::SetTitle(title);
154  };
155  virtual void FitPanel()
156  {
158  };
159  virtual void DrawPanel()
160  {
162  };
163 #if ROOT_VERSION_CODE > ROOT_VERSION(5,25,4)
164  virtual TFitResultPtr Fit(const char* formula, Option_t* option = "", Option_t* goption = "", Axis_t xmin = 0, Axis_t xmax = 0)
165  {
166  return TGraph::Fit(formula, option, goption, xmin, xmax);
167  };
168  virtual TFitResultPtr Fit(TF1* f1, Option_t* option = "", Option_t* goption = "", Axis_t xmin = 0, Axis_t xmax = 0)
169  {
170  return TGraph::Fit(f1, option, goption, xmin, xmax);
171  };
172 #else
173  virtual Int_t Fit(const char* formula, Option_t* option = "", Option_t* goption = "", Axis_t xmin = 0, Axis_t xmax = 0)
174  {
175  return TGraph::Fit(formula, option, goption, xmin, xmax);
176  };
177  virtual Int_t Fit(TF1* f1, Option_t* option = "", Option_t* goption = "", Axis_t xmin = 0, Axis_t xmax = 0)
178  {
179  return TGraph::Fit(f1, option, goption, xmin, xmax);
180  };
181 #endif
184  virtual void SetName(const char* name);
187  virtual void Delete(Option_t* option = "")
188  {
189  TGraph::Delete(option);
190  };
191  virtual void DrawClass() const
192  {
194  };
195  virtual TObject* DrawClone(Option_t* option = "") const
196  {
197  return TGraph::DrawClone(option);
198  };
199  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}
200  virtual void Dump() const
201  {
202  TGraph::Dump();
203  };
204  virtual void Inspect() const
205  {
206  TGraph::Inspect();
207  };
208  virtual void SaveAs(const char* filename = "", Option_t* option = "") const
209  {
210  TGraph::SaveAs(filename, option);
211  };
212  virtual void SetDrawOption(Option_t* option = "")
213  {
214  TGraph::SetDrawOption(option);
215  };
216  virtual void SetLineAttributes()
217  {
219  };
220  virtual void SetFillAttributes()
221  {
223  };
224  virtual void SetMarkerAttributes()
225  {
227  };
228 
229  virtual Int_t InsertPoint(); // *MENU={Hierarchy="Modify Line.../InsertPoint"}*
230  virtual Int_t AddPointAtTheEnd(); // *MENU={Hierarchy="Modify Line.../AddPointAtTheEnd"}*
231  virtual Int_t RemoveFirstPoint(); // *MENU={Hierarchy="Modify Line.../RemoveFirstPoint"}*
232  virtual Int_t RemoveLastPoint(); // *MENU={Hierarchy="Modify Line.../RemoveLastPoint"}*
233  virtual Int_t IncreaseNumberOfPoints(); // *MENU*
234  virtual Int_t DecreaseNumberOfPoints(); // *MENU*
235  virtual Int_t SortPoints(Bool_t ascending = kTRUE); // *MENU*
236  virtual Int_t ContinueDrawing(); // *MENU={Hierarchy="Modify Line.../ContinueDrawing"}*
237  virtual void ChechHierarchy(KVIDentifier* gr);
238  virtual Int_t RemovePoint()
239  {
240  if (GetEditable()) {
241  return TCutG::RemovePoint();
242  }
243  else {
244  return -1;
245  }
246  }; // *MENU={Hierarchy="Modify Line.../RemovePoint"}*
248  {
249  return TCutG::RemovePoint(i);
250  };
251 
252  virtual Int_t InsertSmoothPoint(); // *MENU*
253 
254 
255  virtual Double_t GetPID() const;
256 
257  ClassDef(KVIDentifier, 2) //Base class for graphical cuts used in particle identification
258 };
259 
260 #endif
int Int_t
char Char_t
const Bool_t kFALSE
bool Bool_t
double Axis_t
double Double_t
const char Option_t
#define ClassDef(name, id)
float xmin
float xmax
char * Form(const char *fmt,...)
Base class for particle identification in a 2D map.
Definition: KVIDGraph.h:31
Base class for graphical cuts used in particle identification.
Definition: KVIDentifier.h:27
virtual void SetOnlyZId(Bool_t onlyz=kTRUE)
Definition: KVIDentifier.h:98
virtual void ReadAsciiFile_extras(std::ifstream &)
Definition: KVIDentifier.h:45
virtual void SetMassFormula(Int_t mf)
Definition: KVIDentifier.h:106
virtual void SetAandZ(Int_t atnum, Int_t ztnum)
Definition: KVIDentifier.h:92
virtual Int_t RemoveFirstPoint()
virtual void SetMarkerAttributes()
Definition: KVIDentifier.h:224
virtual void SetFillAttributes()
Definition: KVIDentifier.h:220
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:164
virtual Int_t DecreaseNumberOfPoints()
virtual Int_t RemovePoint()
Definition: KVIDentifier.h:238
virtual void SetName(const char *name)
virtual Double_t GetPID() const
virtual Int_t AddPointAtTheEnd()
virtual void SetDrawOption(Option_t *option="")
Definition: KVIDentifier.h:212
virtual void SaveAs(const char *filename="", Option_t *option="") const
Definition: KVIDentifier.h:208
KVIDGraph * fParent
parent identification map or grid
Definition: KVIDentifier.h:31
KVNucleus fIon
ion/nucleus corresponding to this identifier
Definition: KVIDentifier.h:32
virtual Int_t GetA() const
Definition: KVIDentifier.h:74
virtual void WriteAsciiFile_extras(std::ofstream &, const Char_t *="")
Definition: KVIDentifier.h:41
virtual void Inspect() const
Definition: KVIDentifier.h:204
virtual Int_t RemoveLastPoint()
Int_t fA
dummy variables used by context menu dialog boxes
Definition: KVIDentifier.h:36
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:35
virtual void SetMaximum(Double_t maximum=-1111)
Definition: KVIDentifier.h:143
virtual void WaitForPrimitive()
void Copy(TObject &obj) const
Copy attributes of this identifier into 'obj'.
virtual void SetTitle(const char *title="")
Definition: KVIDentifier.h:151
virtual Int_t GetZ() const
Definition: KVIDentifier.h:78
virtual void Delete(Option_t *option="")
Definition: KVIDentifier.h:187
void SetParent(KVIDGraph *)
Set pointer to parent ID graph.
virtual Int_t GetID() const
Definition: KVIDentifier.h:70
virtual void ChechHierarchy(KVIDentifier *gr)
virtual void SetMinimum(Double_t minimum=-1111)
Definition: KVIDentifier.h:147
virtual void FitPanel()
Definition: KVIDentifier.h:155
virtual ~KVIDentifier()
Destructor.
virtual void SetLineAttributes()
Definition: KVIDentifier.h:216
void CopyGraph(TGraph *)
Copy coordinates of points from the TGraph.
virtual Int_t RemovePoint(Int_t i)
Definition: KVIDentifier.h:247
virtual void DrawPanel()
Definition: KVIDentifier.h:159
Int_t fMassFormula
OPTION={GetMethod="GetMassFormula";SetMethod="SetMassFormula";Items=(0="Beta-stability",...
Definition: KVIDentifier.h:37
virtual Bool_t OnlyZId() const
Definition: KVIDentifier.h:102
virtual TObject * DrawClone(Option_t *option="") const
Definition: KVIDentifier.h:195
virtual Int_t GetMassFormula() const
Definition: KVIDentifier.h:114
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:33
virtual TFitResultPtr Fit(TF1 *f1, Option_t *option="", Option_t *goption="", Axis_t xmin=0, Axis_t xmax=0)
Definition: KVIDentifier.h:168
virtual Int_t SortPoints(Bool_t ascending=kTRUE)
Int_t Compare(const TObject *) const
virtual void SetA(Int_t atnum)
Definition: KVIDentifier.h:87
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:191
virtual Bool_t TestPoint(Double_t, Double_t)
Definition: KVIDentifier.h:119
virtual void SetZ(Int_t ztnum)
Definition: KVIDentifier.h:82
virtual Int_t ContinueDrawing()
Continue to draw an existing the line.
virtual void SetNameFromNucleus()
Definition: KVIDentifier.h:46
virtual void Dump() const
Definition: KVIDentifier.h:200
Description of properties and kinematics of atomic nuclei.
Definition: KVNucleus.h:125
Int_t GetA() const
Definition: KVNucleus.cpp:799
void SetA(Int_t a)
Definition: KVNucleus.cpp:655
void SetZ(Int_t z, Char_t mt=-1)
Definition: KVNucleus.cpp:704
void SetMassFormula(UChar_t mt)
Definition: KVNucleus.h:344
Int_t GetZ() const
Return the number of proton / atomic number.
Definition: KVNucleus.cpp:770
Int_t GetMassFormula() const
Definition: KVNucleus.h:176
virtual void SetFillAttributes()
virtual void SetLineAttributes()
virtual void SetMarkerAttributes()
virtual void SetMaximum(Double_t maximum=-1111)
virtual void SetTitle(const char *title="")
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()
Bool_t GetEditable() const
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 SaveAs(const char *filename="", Option_t *option="") const
virtual void Delete(Option_t *option="")
virtual void SetDrawOption(Option_t *option="")
virtual void DrawClass() const
TF1 * f1