KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVIDentifier.cpp
Go to the documentation of this file.
1 /*
2 $Id: KVIDentifier.cpp,v 1.8 2009/04/20 12:16:50 ebonnet Exp $
3 $Revision: 1.8 $
4 $Date: 2009/04/20 12:16:50 $
5 */
6 
7 //Created by KVClassFactory on Mon Apr 14 14:25:38 2008
8 //Author: franklan
9 
10 #include "KVIDentifier.h"
11 #include "KVIDGraph.h"
12 #include "TF1.h"
13 #include "TPad.h"
14 #include "TClass.h"
15 
16 using namespace std;
17 
19 
20 
21 
23 void KVIDentifier::SetName(const char* name)
24 {
25  TGraph::SetName(name);
26  if (GetParent()) GetParent()->Modified();
27 }
28 
29 
30 
36 
38 {
39  // Default initialisations
40  // We set marker size and style for the underlying TGraph,
41  // this way a small circle is drawn at each point.
42  // Also SetEditable(kFALSE) is used to stop it being modified using the mouse.
43 
45  SetMarkerSize(0.8);
46  SetLineWidth(2);
47  SetEditable(kFALSE);
48  fParent = 0;
49  fGridOnlyZId = kFALSE;
50 }
51 
52 
53 
56 
58  : TCutG(), fIon(1, 1)
59 {
60  // Default constructor
61  init();
62 }
63 
64 
65 
68 
70 {
71  // Destructor
72 }
73 
74 
75 
78 
80  : TCutG(gr), fIon(1, 1)
81 {
82  //copy a TCutG
83  init();
84 }
85 
86 
87 
90 
92  : TCutG(), fIon(1, 1)
93 {
94  //copy a TGraph
95  init();
96  CopyGraph(gr);
97 }
98 
99 
100 
105 
107  : TCutG(), fIon(1, 1)
108 {
109  // copy constructor
110  // we do not copy the fParent pointer to parent grid,
111  // it is left NULL.
112  init();
113  gr.Copy(*this);
114 }
115 
116 
117 
120 
121 void KVIDentifier::Copy(TObject& obj) const
122 {
123  // Copy attributes of this identifier into 'obj'
124  TNamed::Copy(obj);
125  TAttLine::Copy((TAttLine&)obj);
126  TAttFill::Copy((TAttFill&)obj);
128  ((KVIDentifier&)obj).CopyGraph((TGraph*)this);
129  ((TCutG&)obj).SetVarX(GetVarX());
130  ((TCutG&)obj).SetVarY(GetVarY());
131  ((KVIDentifier&)obj).SetZ(GetZ());
132  ((KVIDentifier&)obj).SetA(GetA());
133  ((KVIDentifier&)obj).SetOnlyZId(OnlyZId());
134  ((KVIDentifier&)obj).SetMassFormula(GetMassFormula());
135 }
136 
137 
138 
141 
143 {
144  // Get pointer to parent ID graph
145  return fParent;
146 }
147 
148 
149 
152 
154 {
155  // Set pointer to parent ID graph
156  fParent = p;
157 }
158 
159 
160 
161 
164 
166 {
167  // Copy coordinates of points from the TGraph
168 
169  Double_t x, y;
170  //change number of points
171  Set(graph->GetN());
172  for (int i = 0; i < GetN(); i++) {
173  graph->GetPoint(i, x, y);
174  SetPoint(i, x, y);
175  }
176 }
177 
178 
179 
180 
183 
185 {
186  // Copy coordinates of points from the TGraph
187 
188  Double_t x, y;
189  //change number of points
190  Set(graph.GetN());
191  for (int i = 0; i < GetN(); i++) {
192  graph.GetPoint(i, x, y);
193  SetPoint(i, x, y);
194  }
195 }
196 
197 
198 
199 
212 
213 void KVIDentifier::WriteAsciiFile(ofstream& file, const Char_t* name_prefix)
214 {
215  //Write name and coordinates of identifier in file buffer stream
216  //Optional string name_prefix will be written just in front of the name of the object.
217  //Format is :
218  //
219  //+classname
220  //name_prefix:name_of_object
221  //number_of_points
222  //x1 y1
223  //x2 y2
224  //...
225  //etc. etc.
226 
227  file << '+' << ClassName() << endl;
228  if (name_prefix)
229  file << name_prefix << ":";
230  file << GetName() << endl;
231  //any extra stuff defined in child class ?
232  WriteAsciiFile_extras(file, name_prefix);
233  file << GetN() << endl;
234  for (Int_t i = 0; i < GetN(); i++) {
235  Double_t x, y;
236  GetPoint(i, x, y);
237  file << x << " " << y << endl;
238  }
239 }
240 
241 
242 
243 
253 
255 {
256  //Read coordinates of identifier in file buffer stream
257  //Format is :
258  //
259  //number_of_points
260  //x1 y1
261  //x2 y2
262  //...
263  //etc. etc.
264 
265  ReadAsciiFile_extras(file);//any extra stuff defined in child class ?
266  Int_t N;
267  file >> N;
268  for (Int_t i = 0; i < N; i++) {
269  Double_t x, y;
270  file >> x >> y;
271  SetPoint(i, x, y);
272  }
273 }
274 
275 
276 
277 
281 
283 {
284  //Dummy method used for sorting, can be redefined in more specific implementations.
285  //A priori we don't know how to "order" the identification cuts.
286 
287  return 0;
288 }
289 
290 
291 
292 
298 
300 {
301  // Print out for identification cut
302  // The optional "opt" string, if given, is printed in parentheses after the line's name
303  // This is used by KVIDGraph in order to show which are "ID" cuts and which are
304  // "OK" cuts (i.e. used to define an identifiable area in a data map).
305 
306  cout << ClassName() << " : " << GetName() << "(" << opt << ")" << endl;
307  TCutG::Print();
308 }
309 
310 
311 
312 
318 
320 {
321  //Scale the coordinates of every point of the cut according to
322  // X_0 ---> sx*X_0
323  // Y_0 ---> sy*Y_0
324  //Default argument value '-1' means leave coordinate unchanged
325  if (TMath::Abs(sx) == 1 && TMath::Abs(sy) == 1)
326  return;
327  for (int i = 0; i < fNpoints; i++) {
328  if (sx > 0.)
329  fX[i] *= sx;
330  if (sy > 0.)
331  fY[i] *= sy;
332  }
333 }
334 
335 
336 
337 
347 
349 {
350  // Apply to the coordinates of every point the transformation
351  // X_0 ---> sx(X_0,Y_0)
352  // Y_0 ---> sy(X_0,Y_0)
353  // if sx & sy are two-dimensional functions (inherits from TF2),
354  // otherwise we apply the transformation
355  // X_0 ---> sx(X_0)
356  // Y_0 ---> sy(Y_0)
357  // for sx & sy one-dimensionsal (TF1) functions.
358 
359  if (!sx && !sy) return; // if the two functions are NULL we leave coordinate unchanged
360  Bool_t sx_2d, sy_2d;
361  sx_2d = (sx && sx->InheritsFrom("TF2"));
362  sy_2d = (sy && sy->InheritsFrom("TF2"));
363  if (sx && sy) {
364  for (Int_t ii = 0; ii < fNpoints; ii++) {
365  Double_t fXp = 0.; // valeur intermediaire pour calculer X' et Y'
366  Double_t fYp = 0.; //a partir des coordonnees initiales
367  if (sx_2d) fXp = sx->Eval(fX[ii], fY[ii]);
368  else fXp = sx->Eval(fX[ii]);
369  if (sy_2d) fYp = sy->Eval(fX[ii], fY[ii]);
370  else fYp = sy->Eval(fY[ii]);
371  fX[ii] = fXp;
372  fY[ii] = fYp;
373  }
374  }
375  else if (sx) {
376  for (Int_t ii = 0; ii < fNpoints; ii++) {
377  if (sx_2d) fX[ii] = sx->Eval(fX[ii], fY[ii]);
378  else fX[ii] = sx->Eval(fX[ii]);
379  }
380  }
381  else {
382  for (Int_t ii = 0; ii < fNpoints; ii++) {
383  if (sy_2d) fY[ii] = sy->Eval(fX[ii], fY[ii]);
384  else fY[ii] = sy->Eval(fY[ii]);
385  }
386  }
387 }
388 
389 
390 
391 
395 
397 {
398  // Method used to draw a new identifier in the active pad
399  // Override in child classes so that gPad->WaitPrimitive has correct arguments
400 
401  if (!gPad) return;
402  TGraph* gr = (TGraph*) gPad->WaitPrimitive("CUTG", "CutG");
403  //copy coordinates of user's line
404  CopyGraph(gr);
405  //remove TGraph and draw the KVIDentifier in its place
406  gPad->GetListOfPrimitives()->Remove(gr);
407  delete gr;
408  Draw("PL");
409 }
410 
411 
412 
413 
422 
424 {
425  // Right-clicking an identifier and selecting this method from the context
426  // menu allows to add a straight-line segment at the end or the beginning
427  // of the line (whichever is closest to the mouse).
428  //
429  // Direction = "" (default) - continue in the direction of first/last segment
430  // Direction = "H", "h", "hori", "HORI" etc. - add horizontal segment
431  // Direction = "v", "V", "vert", "VERT" etc. - add vertical segment
432 
433  if (!GetEditable()) return;
434 
435  // find closest point
436  Int_t px = gPad->GetEventX(); // mouse position
437  Int_t py = gPad->GetEventY(); // mouse position
438  Int_t dpx = px - gPad->XtoAbsPixel(gPad->XtoPad(fX[0])); // first point
439  Int_t dpy = py - gPad->YtoAbsPixel(gPad->XtoPad(fY[0])); // first point
440  Int_t dist_1 = dpx * dpx + dpy * dpy;
441  dpx = px - gPad->XtoAbsPixel(gPad->XtoPad(fX[fNpoints - 1])); // last point
442  dpy = py - gPad->YtoAbsPixel(gPad->XtoPad(fY[fNpoints - 1])); // last point
443  Int_t dist_N = dpx * dpx + dpy * dpy;
444  Int_t ipoint = (dist_N < dist_1 ? fNpoints - 1 : 0);
445 
446  // coordinates of new point
447  TString opt(Direction);
448  opt.ToUpper();
449  Double_t newX = fX[ipoint];
450  Double_t newY = fY[ipoint];
451  if (opt.BeginsWith("H")) newX = Limit;
452  else if (opt.BeginsWith("V")) newY = Limit;
453  else {
454  if (fNpoints < 2) {
455  Error("ExtendLine", "Cannot extend line, need at least one segment!");
456  return;
457  }
458  // trouver equation de la droite du dernier/premier segment
459  Double_t u, v, uu, vv;
460  Int_t iipoint = (ipoint == 0 ? 1 : fNpoints - 2);
461  u = fX[ipoint];
462  uu = fX[iipoint];
463  v = fY[ipoint];
464  vv = fY[iipoint];
465  Double_t a = vv - v;
466  Double_t b = u - uu;
467  Double_t c = -(b * v + a * u);
468  //
469  // Check that 'Limit' the x-coordinate of the new point is larger than the x-coordinate of the last existing point, in order to avoid issues
470  if (Limit < u) {
471  Error("ExtendLine", "Cannot extend line, with x-coordinate wanted smaller than the one of the existing last point!");
472  return;
473  }
474  //
475  // use 'Limit' as x-coordinate of new point
476  newX = Limit;
477  newY = -(a * newX + c) / b;
478  }
479 
480  // add point
481  Int_t iend = (ipoint > 0 ? fNpoints : 0);
482  Double_t** ps = ExpandAndCopy(fNpoints + 1, iend);
483  CopyAndRelease(ps, ipoint, fNpoints++, ipoint + 1);
484 
485  // To avoid redefinitions in descendant classes
486  FillZero(iend, iend + 1);
487 
488  if (ipoint > 0) ipoint = fNpoints - 1;
489  fX[ipoint] = newX;
490  fY[ipoint] = newY;
491  gPad->Modified();
492 }
493 
494 
495 
502 
504 {
505  // Create a new line from the selected one
506  // with a new Z and A (optional)
507  // this new line is scale from the selected one with a vertical sy
508  // and horizontal sx (optional) factor
509  // you need to undraw and draw the grid to see its implementation
510 
511  if (!gPad) {
512  Error("CloneScaleStore", "This method should be called using the interactive menu.");
513  return;
514  }
515 
516  TClass* cl = new TClass(this->IsA()->GetName());
517  KVIDentifier* idbis = (KVIDentifier*)cl->New();
518  Double_t xx, yy;
519  for (Int_t nn = 0; nn < this->GetN(); nn += 1) {
520  this->GetPoint(nn, xx, yy);
521  idbis->SetPoint(nn, xx, yy + dy);
522  }
523  idbis->SetOnlyZId(OnlyZId());
524  idbis->SetZ(newzt);
525  idbis->SetMassFormula(GetMassFormula());
526  idbis->SetEditable(IsEditable());
527  if (newar != -1) {
528  idbis->SetA(newar);
529  }
530  if ((sx > 0.) && (sy > 0.)) idbis->Scale(sx, sy);
531  this->GetParent()->AddIdentifier(idbis);
532 
533  this->GetParent()->UnDraw();
534  this->GetParent()->Draw();
535 
536 
537  delete cl;
538 }
539 
540 
541 
544 
546 {
547  // Insert a new point at the mouse position
548  if (!GetEditable()) return -2;
549  if (!gPad) {
550  Error("InsertPoint", "This method should be called using the interactive menu.");
551  return -1;
552  }
553 
554  Int_t px = gPad->GetEventX();
555  //Int_t py = gPad->GetEventY();
556 
557 // Info("InsertPoint", "x=%d y=%d", px, py);
558  Int_t ifound = -1;
559  //while ( gPad->XtoAbsPixel(gPad->XtoPad(fX[ii]))>px && ii<fNpoints-1) ii+=1;
560  //Recherche en pixel absolu
561  //pour trouver le point a partir duquel le TGraph
562  //doit bouger
563 // Print("");
564  for (Int_t ii = 0; ii < fNpoints; ii += 1) {
565 // Info("InsertPoint", "np=%d ii=%d %lf %lf %d\n",
566 // fNpoints,
567 // ii,
568 // fX[ii],
569 // gPad->XtoPad(fX[ii]),
570 // gPad->XtoAbsPixel(gPad->XtoPad(fX[ii]))
571 // );
572  if (gPad->XtoAbsPixel(gPad->XtoPad(fX[ii])) > px) {
573  ifound = ii;
574  break;
575  }
576  }
577 
578 // Info("InsertPoint", "point ifound=%d", ifound);
579 
580  Double_t deltaX = fX[ifound] - fX[ifound - 1];
581  Double_t aa = (fY[ifound] - fY[ifound - 1]) / (deltaX);
582  Double_t bb = fY[ifound] - fX[ifound] * aa;
583  //Conversion du px pour le TGraph et extrapole le new Y
584  Double_t newX = gPad->PadtoX(gPad->AbsPixeltoX(px));
585  Double_t newY = aa * newX + bb;
586 // Info("InsertPoint", "nouveau point %lf %lf", newX, newY);
587 
588  //Dernier point du graph
589  Double_t lastX = fX[fNpoints - 1];
590  Double_t lastY = fY[fNpoints - 1];
591  //Le dernier point est ajoute en fin de graph
592  //fNpoint -> fNpoint+1
593  SetPoint(fNpoints, lastX, lastY);
594  //On deplace les autres points
595  for (Int_t ii = fNpoints - 2; ii >= ifound; ii -= 1)
596  SetPoint(ii, fX[ii - 1], fY[ii - 1]);
597  //Ajout du nouveau point
598  SetPoint(ifound, newX, newY);
599 
600 // Print("");
601 
602  if (gPad) gPad->Modified();
603 
604  return ifound;
605 }
606 
607 
608 
611 
613 {
614  // Insert a new point at the mouse X position using a smooth evaluation of the Y
615  if (!GetEditable()) return -2;
616  if (!gPad) {
617  Error("InsertSmoothPoint", "This method should be called using the interactive menu.");
618  return -1;
619  }
620 
621  Int_t px = gPad->GetEventX();
622 
623  Int_t ifound = -1;
624  for (Int_t ii = 0; ii < fNpoints; ii += 1) {
625  if (gPad->XtoAbsPixel(gPad->XtoPad(fX[ii])) > px) {
626  ifound = ii;
627  break;
628  }
629  }
630 
631  Double_t newX = gPad->PadtoX(gPad->AbsPixeltoX(px));
632  Double_t newY = Eval(newX, 0, "S");
633 
634  Double_t lastX = fX[fNpoints - 1];
635  Double_t lastY = fY[fNpoints - 1];
636  SetPoint(fNpoints, lastX, lastY);
637  for (Int_t ii = fNpoints - 2; ii >= ifound; ii -= 1) SetPoint(ii, fX[ii - 1], fY[ii - 1]);
638 
639  SetPoint(ifound, newX, newY);
640  if (gPad) gPad->Modified();
641 
642  return ifound;
643 }
644 
645 
646 
649 
651 {
652  // Continue to draw an existing the line
653  if (!GetEditable()) return -2;
654  if (!gPad) {
655  Error("ContinueDrawing", "This method should be called using the interactive menu.");
656  return -1;
657  }
658 
659  KVIDentifier* gr = (KVIDentifier*)this->IsA()->New();
660  gr->WaitForPrimitive();
662 
663  Int_t np = gr->GetN();
664 
665  Double_t last, first, yy;
666  gr->GetPoint(np - 1, last, yy);
667  gr->GetPoint(0, first, yy);
668 
669  Double_t xmax = fX[fNpoints - 1];
670  Double_t xmin = fX[0];
671 
672  Info("ContinueDrawing", "Existing Line %lf %lf, Added line %lf %lf", xmin, xmax, last, first);
673 
674  if (first > xmax) {
675  //A rajouter apres (a droite) de la ligne existante
676  Double_t xx;
677  for (Int_t ii = 0; ii < np; ii += 1) {
678  gr->GetPoint(ii, xx, yy);
679  this->SetPoint(fNpoints, xx, yy);
680  }
681  }
682  else if (last < xmin) {
683  //A rajouter avant (a gauche) la ligne existante
684  Double_t xx;
685  for (Int_t ii = 0; ii < fNpoints; ii += 1) {
686  this->GetPoint(ii, xx, yy);
687  gr->SetPoint(gr->GetN(), xx, yy);
688  }
689 
690  for (Int_t ii = 0; ii < gr->GetN(); ii += 1) {
691  gr->GetPoint(ii, xx, yy);
692  this->SetPoint(ii, xx, yy);
693  }
694  }
695  else {
696  Info("ContinueDrawing", "Faire une extension a droite ou a gauche\nsans recouvrement avec la ligne existante");
697  }
698 
699  delete gr;
700  gPad->Modified();
701 
702  return np;
703 }
704 
705 
706 
711 
713 {
714  //Check if the line has been draw from left to right
715  //or right to left
716  //In this last case, we invert the filling order
717 
718  Int_t np = gr->GetN();
719  Double_t* xx = gr->GetX();
720  Double_t* yy = gr->GetY();
721  Double_t Delta = xx[np - 1] - xx[0];
722  if (Delta > 0) return;
723 
724  Info("ChechHierarchy", "Invert filling order");
725  Double_t* xp = new Double_t[np];
726  Double_t* yp = new Double_t[np];
727  for (Int_t nn = 0; nn < np; nn += 1) {
728  xp[nn] = xx[nn];
729  yp[nn] = yy[nn];
730  }
731 
732  for (Int_t ii = 1; ii <= np; ii += 1) {
733  gr->SetPoint(ii - 1, xp[np - ii], yp[np - ii]);
734  }
735  delete [] xp;
736  delete [] yp;
737 
738 }
739 
740 
741 
747 
749 {
750  // Insert a new point at the end
751  // its position is extrapolated from the two last points
752  // assuming linear evolution (yy = a*xx + bb)
753  // The KVIDentifier has to have at least 2 points
754  if (!GetEditable()) return -2;
755  if (fNpoints < 2) return -3;
756 
757  Int_t np = fNpoints;
758  Double_t deltaX = fX[np - 1] - fX[np - 2];
759  Double_t aa = (fY[np - 1] - fY[np - 2]) / (deltaX);
760  Double_t bb = fY[np - 1] - fX[np - 1] * aa;
761  //yy = aa*xx+bb -> bb = yy-aa*xx
762  Double_t newX = fX[np - 1] + deltaX;
763  Double_t newY = aa * newX + bb;
764  SetPoint(np, newX, newY);
765  if (gPad) gPad->Modified();
766  return np + 1;
767 
768 }
769 
770 
774 
776 {
777  // Remove the first point
778  // The KVIDentifier has to have at least 2 points
779  if (!GetEditable()) return -2;
780  if (fNpoints < 2) return -3;
781 
782  RemovePoint(0);
783  if (gPad) gPad->Modified();
784  return fNpoints - 1;
785 
786 }
787 
788 
789 
793 
795 {
796  // Remove the first point
797  // The KVIDentifier has to have at least 2 points
798  if (!GetEditable()) return -2;
799  if (fNpoints < 2) return -3;
800 
801  RemovePoint(GetN() - 1);
802  if (gPad) gPad->Modified();
803  return fNpoints - 1;
804 }
805 
806 
807 
809 
811 {
812  if (!GetEditable()) return -2;
813  if (fNpoints < 2) return -1;
814 
815  Int_t nNpoints = (fNpoints - 1) * 2 + 1;
816  Double_t* nX = new Double_t[nNpoints];
817  Double_t* nY = new Double_t[nNpoints];
818 
819  for (int ii = 0; ii < nNpoints; ii++) {
820  if (!(ii % 2)) {
821  nX[ii] = fX[ii / 2];
822  nY[ii] = fY[ii / 2];
823  }
824  else {
825  nX[ii] = 0.5 * (fX[(ii - 1) / 2] + fX[(ii + 1) / 2]);
826  nY[ii] = Eval(nX[ii], 0, "S");
827  }
828  }
829 
830  Set(0);
831  for (int ii = 0; ii < nNpoints; ii++) SetPoint(ii, nX[ii], nY[ii]);
832 
833  delete[] nX;
834  delete[] nY;
835 
836  if (gPad) gPad->Modified();
837 
838  return fNpoints;
839 }
840 
841 
842 
844 
846 {
847  if (!GetEditable()) return -2;
848  if (fNpoints < 2) return -1;
849 
850  Int_t nNpoints = fNpoints / 2 + 1; //(fNpoints%2)?(fNpoints/2):((fNpoints+1)/2);
851  Double_t* nX = new Double_t[nNpoints];
852  Double_t* nY = new Double_t[nNpoints];
853 
854  nX[0] = fX[0];
855  nY[0] = fY[0];
856 
857  for (int ii = 1; ii < nNpoints - 1; ii++) {
858  nX[ii] = fX[ii * 2];
859  nY[ii] = fY[ii * 2];
860  }
861 
862  nX[nNpoints - 1] = fX[fNpoints - 1];
863  nY[nNpoints - 1] = fY[fNpoints - 1];
864 
865  Set(0);
866  for (int ii = 0; ii < nNpoints; ii++) SetPoint(ii, nX[ii], nY[ii]);
867 
868  delete[] nX;
869  delete[] nY;
870 
871  if (gPad) gPad->Modified();
872 
873  return fNpoints;
874 }
875 
876 
877 
879 
881 {
882  Sort(&TGraph::CompareX, ascending);
883  if (gPad) gPad->Modified();
884  return 0;
885 }
886 
887 
888 
890 
892 {
893  if (OnlyZId()) return (Double_t)GetZ();
894  return (GetZ() + 0.1 * (GetA() - 2.*GetZ()));
895 }
896 
897 
int Int_t
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
#define b(i)
#define c(i)
char Char_t
const Bool_t kFALSE
bool Bool_t
double Double_t
const char Option_t
kCircle
#define N
float xmin
float xmax
#define gPad
Base class for particle identification in a 2D map.
Definition: KVIDGraph.h:31
void Draw(Option_t *opt="")
Definition: KVIDGraph.cpp:903
void UnDraw()
Definition: KVIDGraph.cpp:981
virtual void AddIdentifier(KVIDentifier *id)
Definition: KVIDGraph.h:312
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 Int_t RemoveFirstPoint()
virtual void Scale(Double_t sx=-1, Double_t sy=-1)
virtual Int_t DecreaseNumberOfPoints()
virtual Int_t RemovePoint()
Definition: KVIDentifier.h:237
virtual Double_t GetPID() const
virtual Int_t AddPointAtTheEnd()
KVIDGraph * fParent
parent identification map or grid
Definition: KVIDentifier.h:31
virtual Int_t GetA() const
Definition: KVIDentifier.h:74
virtual void WriteAsciiFile_extras(std::ofstream &, const Char_t *="")
Definition: KVIDentifier.h:41
virtual Int_t RemoveLastPoint()
virtual Int_t InsertSmoothPoint()
Insert a new point at the mouse X position using a smooth evaluation of the Y.
virtual Int_t IncreaseNumberOfPoints()
virtual void ExtendLine(Double_t, Option_t *Direction="")
virtual Int_t InsertPoint()
Insert a new point at the mouse position.
virtual void WaitForPrimitive()
void Copy(TObject &obj) const
Copy attributes of this identifier into 'obj'.
virtual Int_t GetZ() const
Definition: KVIDentifier.h:78
void SetParent(KVIDGraph *)
Set pointer to parent ID graph.
virtual void ChechHierarchy(KVIDentifier *gr)
virtual ~KVIDentifier()
Destructor.
void CopyGraph(TGraph *)
Copy coordinates of points from the TGraph.
virtual Bool_t OnlyZId() const
Definition: KVIDentifier.h:102
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="")
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 SetZ(Int_t ztnum)
Definition: KVIDentifier.h:82
virtual Int_t ContinueDrawing()
Continue to draw an existing the line.
void Copy(TAttFill &attfill) const
void Copy(TAttLine &attline) const
void Copy(TAttMarker &attmarker) const
const char * GetVarY() const
const char * GetVarX() const
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
Int_t fNpoints
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
virtual Bool_t IsEditable() const
virtual void SetName(const char *name="")
virtual void CopyAndRelease(Double_t **newarrays, Int_t ibegin, Int_t iend, Int_t obegin)
static Bool_t CompareX(const TGraph *gr, Int_t left, Int_t right)
Int_t GetN() const
Double_t * fY
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)
Double_t * GetX() const
virtual void Print(Option_t *chopt="") const
virtual void Draw(Option_t *chopt="")
virtual Double_t Eval(Double_t x, TSpline *spline=nullptr, Option_t *option="") const
Bool_t GetEditable() const
virtual void FillZero(Int_t begin, Int_t end, Bool_t from_ctor=kTRUE)
Double_t ** ExpandAndCopy(Int_t size, Int_t iend)
Double_t * fX
Double_t * GetY() const
virtual void Set(Int_t n)
virtual Int_t GetPoint(Int_t i, Double_t &x, Double_t &y) const
virtual void SetEditable(Bool_t editable=kTRUE)
virtual const char * GetName() const
virtual void Copy(TObject &named) const
virtual const char * ClassName() const
virtual Bool_t InheritsFrom(const char *classname) const
virtual void Error(const char *method, const char *msgfmt,...) const
virtual void Info(const char *method, const char *msgfmt,...) const
void ToUpper()
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Double_t y[n]
Double_t x[n]
gr SetMarkerSize(1.3)
TGraphErrors * gr
gr SetLineWidth(2)
const long double cl
Definition: KVUnits.h:85
Double_t Abs(Double_t d)
v
m SetMarkerStyle(20)
auto * a