KaliVeda
Toolkit for HIC analysis
KVIDZAFromZGrid.cpp
1 //Created by KVClassFactory on Tue Mar 8 10:00:16 2016
2 //Author: Diego Gruyer
3 
4 #include "KVIDZAFromZGrid.h"
5 #include "TMultiGraph.h"
6 #include "KVIDZALine.h"
7 #include "TCanvas.h"
8 
12 
13 
14 
15 
20 {
21  // Default constructor
22  // Grid is declared as a 'ZOnlyGrid' by default (this is internal mechanics)
23 
24  init();
25  fFits.SetOwner();
26  SetOnlyZId();
27  fIgnoreMassID = false;
28 }
29 
30 
31 
32 
40 
42 {
43  // This method copies the current state of 'this' object into 'obj'
44  // You should add here any member variables, for example:
45  // (supposing a member variable KVIDZAFromZGrid::fToto)
46  // CastedObj.fToto = fToto;
47  // or
48  // CastedObj.SetToto( GetToto() );
49 
50  KVIDZAGrid::Copy(obj);
52  i.fPIDRange = fPIDRange;
53  i.fPIDRangeZList = fPIDRangeZList;
54  fTables.Copy(i.fTables);
55  fFits.Copy(i.fFits);
56  i.fIgnoreMassID = fIgnoreMassID;
57 }
58 
59 
60 
61 
63 
64 void KVIDZAFromZGrid::ReadFromAsciiFile(std::ifstream& gridfile)
65 {
66  fPIDRange = kFALSE;
68 
69  if (GetParameters()->HasParameter("PIDRANGE")) {
70  fPIDRange = kTRUE;
71  LoadPIDRanges();
72  }
73 
74  // if <PARAMETER> IgnoreMassID=1 appears in file, we are only using the PID intervals to clean
75  // up a messy de-e plot, not to give mass identification. particles will only be identified in Z.
76  if (GetParameters()->HasParameter("IgnoreMassID") && GetParameters()->GetIntValue("IgnoreMassID") == 1)
77  fIgnoreMassID = true;
78  else
79  fIgnoreMassID = false;
80 
81  check_pidranges_and_massfits();
82 }
83 
84 
85 
87 
88 void KVIDZAFromZGrid::WriteToAsciiFile(std::ofstream& gridfile)
89 {
90  ExportToGrid();
92 }
93 
94 
95 
97 
99 {
100  fPIDRangeZList.Clear();
101  KVIDentifier* id = 0;
102  TIter it(GetIdentifiers());
103  while ((id = (KVIDentifier*)it())) {
104  int zz = id->GetZ();
105  if (!GetParameters()->HasParameter(Form("PIDRANGE%d", zz))) continue;
106  KVString mes = GetParameters()->GetStringValue(Form("PIDRANGE%d", zz));
107  if (mes.IsWhitespace()) continue;
108  int type = (mes.Contains(",") ? 2 : 1);
109  interval_set* itv = new interval_set(zz, type);
110  itv->SetName(GetName());
111  mes.Begin("|");
112  while (!mes.End()) {
113  KVString tmp = mes.Next();
114  tmp.Begin(":");
115  int aa = tmp.Next().Atoi();
116  KVString val = tmp.Next();
117  double pidmin, pidmax, pid;
118  if (type == 1) itv->add(aa, val.Atof());
119  else if (type == 2) {
120  val.Begin(",");
121  pidmin = val.Next().Atof();
122  pid = val.Next().Atof();
123  pidmax = val.Next().Atof();
124  itv->add(aa, pid, pidmin, pidmax);
125 // itv->add(aa, pid, pid-0.02, pid+0.02);
126  }
127  }
128  fPIDRangeZList.Add(zz);
129  fTables.Add(itv);
130  }
131  fPIDRange = kTRUE;
132  GetParameters()->SetValue("PIDRANGE", fPIDRangeZList.AsString());
133 }
134 
135 
136 
138 
140 {
141  fTables.Clear();
142  fPIDRange = kFALSE;
143  fPIDRangeZList.Clear();
144 }
145 
146 
147 
149 
151 {
152  fTables.Clear();
153  LoadPIDRanges();
154 }
155 
156 
157 
159 
161 {
162  interval_set* itv = 0;
163  TIter it(&fTables);
164  while ((itv = (interval_set*)it())) if (itv->GetZ() == zint) return itv;
165  return 0;
166 }
167 
168 
169 
172 
174 {
175  // add an interval set to the grid, updating the corresponding parameters
176  fPIDRangeZList.Add(ivs->GetZ());
177  fTables.Add(ivs);
178 }
179 
180 
181 
184 
186 {
187  // Remove interval set for given Z from grid
189 }
190 
191 
192 
195 
197 {
198  // Remove interval set from grid, update parameters related to interval sets
199  auto z_int = itvs->GetZ();
200  fPIDRangeZList.Remove(z_int); // remove Z from PIDRANGE list
201  fTables.Remove(itvs);
202  delete itvs;
203 }
204 
205 
206 
213 
215 {
216 // ((interval_set*)fTables.At(12))->fIntervals.ls();
217 
218 // for (int zz = fZminInt; zz <= fZmaxInt; zz++) {
219 // Info("PrintPIDLimits", "Z=%2d [%.4lf %.4lf]", zz, ((interval_set*)fTables.At(zz - fZminInt))->fPIDmins.at(0),
220 // ((interval_set*)fTables.At(zz - fZminInt))->fPIDmaxs.at(((interval_set*)fTables.At(zz - fZminInt))->fNPIDs - 1));
221 // }
222 }
223 
224 
225 
227 
229 {
230  fPIDRangeZList.Clear();
231  if (GetParameters()->HasParameter("PIDRANGE")) GetParameters()->RemoveParameter("PIDRANGE");
232  for (int ii = 1; ii < 50; ii++) {
233  if (GetParameters()->HasParameter(Form("PIDRANGE%d", ii))) GetParameters()->RemoveParameter(Form("PIDRANGE%d", ii));
234  }
235 }
236 
237 
238 
247 
248 int KVIDZAFromZGrid::is_inside(double pid) const
249 {
250  // Look for a set of mass-interval definitions in which the given PID
251  // falls (PID from linearisation of Z identification).
252  //
253  // In principle this should be the set corresponding to Z=nint(PID),
254  // but if not Z+/-1 are also tried.
255  //
256  // Returns the value of Z for the set found (or 0 if no set found)
257 
258  int zint = TMath::Nint(pid);
259  interval_set* it = GetIntervalSet(zint);
260  if (it) {
261  if (it->is_inside(pid)) return zint;
262  else if (it->is_above(pid)) {
263 
264  it = GetIntervalSet(zint + 1);
265  if (it && it->is_inside(pid)) return zint + 1;
266  else return 0;
267  }
268  else {
269  it = GetIntervalSet(zint - 1);
270  if (it && it->is_inside(pid)) return zint - 1;
271  else return 0;
272  }
273  }
274  else return 0;
275 }
276 
277 
278 
287 
289 {
290  // General initialisation method for identification grid.
291  //
292  // This method MUST be called once before using the grid for identifications.
293  //
294  // + The ID lines are sorted.
295  // + The natural line widths of all ID lines are calculated.
296  // + The line with the largest Z (Zmax line) is found.
297 
298  SetOnlyZId();
300 
301  // set up mass fits (if any)
302  fFits.Clear();
303  if (GetParameters()->HasStringParameter("MASSFITS")) {
304  KVNumberList zlist(GetParameters()->GetStringValue("MASSFITS"));
305  for (auto z : zlist) {
306  auto massfit = GetParameters()->GetTStringValue(Form("MASSFIT_%d", z));
307  massfit.ReplaceAll(":", "=");
308  KVNameValueList fitparams;
309  fitparams.Set(massfit);
310  fFits.Add(new KVMultiGaussIsotopeFit(z, fitparams));
311  }
312  }
313 }
314 
315 
316 
322 
323 void KVIDZAFromZGrid::check_pidranges_and_massfits()
324 {
325  // Check for inconsistencies between 'PIDRANGE' and 'MASSFIT' parameters
326  //
327  // We also check & signal the inclusion of isotopes which are only resonances:
328  // 5Li, 6Be, 8Be, 9B, etc.
329 
330  if(fPar.HasParameter("MASSFITS"))
331  {
332  KVNumberList massfits(GetParameters()->GetStringValue("MASSFITS"));
333  // check same as PIDRANGE
334  KVNumberList pidrange(GetParameters()->GetStringValue("PIDRANGE"));
335  // exclude from massfits any missing pidrange
336  auto massfits_copy = massfits;
337  massfits.Inter(pidrange);
338  if(massfits != massfits_copy)
339  {
340  KVError::Error(this, "KVIDZAFromZGrid::check_pidranges_and_massfits",
341  "Grid %s has inconsistent MASSFITS (%s) and PIDRANGE (%s) - correcting...",
342  GetName(), massfits_copy.AsString(), pidrange.AsString());
343  GetParameters()->SetValue("MASSFITS", massfits.AsString());
344  // remove any fits which do not have a corresponding pidrange
345  for(auto z : massfits)
346  {
347  if(!GetParameters()->HasParameter(Form("PIDRANGE%d",z)))
348  {
349  KVError::Warning(this, "KVIDZAFromZGrid::check_pidranges_and_massfits",
350  "Grid %s : removing fit for Z=%d...",
351  GetName(), z);
352  GetParameters()->RemoveParameter(Form("MASSFITS_%d",z));
353  }
354  }
355  }
356  // for each MASSFIT_Z, check the 'Alist' compared to the masses given in PIDRANGEZ
357  // we signal any case where the list of fitted masses is not a subset of the pidrange masses
358  massfits = GetParameters()->GetStringValue("MASSFITS");
359  for (auto z : massfits) {
360  if(pidrange.Contains(z))
361  {
362  auto massfit = GetParameters()->GetTStringValue(Form("MASSFIT_%d", z));
363  massfit.ReplaceAll(":", "=");
364  KVNameValueList fitparams;
365  fitparams.Set(massfit);
366  KVNumberList alist(fitparams.GetStringValue("Alist"));
367  for(auto A : alist)
368  {
369  if(KVNucleus(z,A).IsResonance())
370  KVError::Error(this, "check_pidranges_and_massfits",
371  "Grid %s includes resonance %s", GetName(), KVNucleus(z,A).GetSymbol() );
372  }
373  KVNumberList pidalist;
374  KVString pidr = GetParameters()->GetStringValue(Form("PIDRANGE%d", z));
375  pidr.Begin("|");
376  while(!pidr.End())
377  {
378  auto pipi = pidr.Next();
379  pipi.Begin(":");
380  pidalist.Add(pipi.Next().Atoi());
381  }
382  auto alist_orig = alist;
383  alist.Inter(pidalist);
384  if(alist != alist_orig)
385  {
386  KVError::Warning(this, "check_pidranges_and_massfits",
387  "Grid %s has inconsistent masses for Z=%d for MASSFIT (%s) and PIDRANGE (%s)",
388  GetName(), z, alist_orig.AsString(), pidalist.AsString());
389  }
390  }
391  }
392  }
393 }
394 
395 
396 
398 
400 {
401  double P;
402  auto A = fitfunc->GetA(idr->PID, P);
403  if (A) {
404  idr->A = *A;
405  idr->PID = fitfunc->GetInterpolatedA(idr->PID);
406  if (P > 0.5) idr->IDquality = KVIDZAGrid::kICODE0; // probability of A is >50%
407  else idr->IDquality = KVIDZAGrid::kICODE3;// OK, slight ambiguity of A
408  }
409  else {
410  // no A returned => background noise
412  return false;
413  }
414  return true;
415 }
416 
417 
418 
430 
432 {
433  // Fill the KVIdentificationResult object with the results of identification for point (x,y)
434  // corresponding to some physically measured quantities related to a reconstructed nucleus.
435  //
436  // If identification is successful, idr->IDOK = true.
437  // In this case, idr->Aident and idr->Zident indicate whether isotopic or only Z identification
438  // was acheived.
439  //
440  // In case of unsuccessful identification, idr->IDOK = false,
441  // BUT idr->Zident and/or idr->Aident may be true: this is to indicate which kind of
442  // identification was attempted but failed (this changes the meaning of the quality code)
443 
444  idr->Aident = idr->Zident = kFALSE;
445 
446  KVIDZAGrid::Identify(x, y, idr);
447  idr->Zident = kTRUE; // meaning Z identification was attempted, even if it failed
448  if (!idr->IDOK) return;
449 
450  bool have_pid_range_for_Z = fPIDRange && fPIDRangeZList.Contains(idr->Z);
451  auto mass_fit_for_Z = GetMultiGaussFit(idr->Z);
452  bool have_mass_fit_for_Z = (mass_fit_for_Z != nullptr);
453  bool mass_id_success = false;
454 
455  if ((have_mass_fit_for_Z || have_pid_range_for_Z)
456  && (!fHasMassIDRegion || idr->HasFlag(GetName(), "MassID"))) { // if a mass ID region is defined, we must be inside it
457  // try mass identification
458  if (have_mass_fit_for_Z)
459  mass_id_success = MassIdentificationFromMultiGaussFit(mass_fit_for_Z, idr);
460  else
461  mass_id_success = (DeduceAfromPID(idr) > 0);
462  if (mass_id_success) {
463  // mass identification was at least attempted
464  // make sure grid's quality code is consistent with KVIdentificationResult
465  const_cast<KVIDZAFromZGrid*>(this)->fICode = idr->IDquality;
466  idr->Aident = kTRUE; // meaning A identification was attempted, even if it failed
467  }
468  else {
469  // the pid falls outside of any mass ranges for a Z which has assigned isotopes
470  // therefore although the Z identification was good, we cannot consider this
471  // particle to be identified
472  const_cast<KVIDZAFromZGrid*>(this)->fICode = kICODE4;
473  idr->IDquality = fICode; // otherwise identfication result quality code is not coherent with comment (see below)
474  }
475  idr->IDOK = (fICode < kICODE4);
476  }
477 
478  // ignore isotopic successful isotopic identification if fIgnoreMassID=true
479  if (fIgnoreMassID && idr->IDOK && idr->Aident) idr->Aident = false;
480 
481  // set comments in identification result
482  switch (fICode) {
483  case kICODE0:
484  idr->SetComment("ok");
485  break;
486  case kICODE1:
487  if (mass_id_success) idr->SetComment("slight ambiguity of A, which could be larger");
488  else idr->SetComment("slight ambiguity of Z, which could be larger");
489  break;
490  case kICODE2:
491  if (mass_id_success) idr->SetComment("slight ambiguity of A, which could be smaller");
492  else idr->SetComment("slight ambiguity of Z, which could be smaller");
493  break;
494  case kICODE3:
495  if (mass_id_success) idr->SetComment("slight ambiguity of A, which could be larger or smaller");
496  else idr->SetComment("slight ambiguity of Z, which could be larger or smaller");
497  break;
498  case kICODE4:
499  if (mass_id_success) idr->SetComment("point is outside of mass identification range");
500  else idr->SetComment("Z identification correct but no mass identification");
501  break;
502  case kICODE5:
503  if (mass_id_success) idr->SetComment("point is in between two isotopes A & A+2 (e.g. 5He, 8Be, 9B)");
504  else idr->SetComment("point is in between two lines of different Z, too far from either to be considered well-identified");
505  break;
506  case kICODE6:
507  idr->SetComment("(x,y) is below first line in grid");
508  break;
509  case kICODE7:
510  idr->SetComment("(x,y) is above last line in grid");
511  break;
512  default:
513  idr->SetComment("no identification: (x,y) out of range covered by grid");
514  }
515 }
516 
517 
518 
519 
525 
527 {
528  // First look for a set of mass intervals in which the PID of the identification result falls,
529  // if there is one (see KVIDZAFromZGrid::is_inside).
530  // If an interval set is found for a Z different to the original identification, idr->Z is changed.
531  // Then call interval_set::eval for the mass interval for this Z.
532 
533  int zint = is_inside(idr->PID);
534  if (!zint) return -1;
535  if (zint != idr->Z) idr->Z = zint;
536 
537  double res = 0.;
538  interval_set* it = GetIntervalSet(zint);
539  if (it) res = it->eval(idr);
540  return res;
541 }
542 
543 
544 
545 
547 
549 {
551 
552  interval_set* itvs = 0;
553  TIter npid(GetIntervalSets());
554  while ((itvs = (interval_set*)npid())) {
555  if (!itvs->GetNPID()) continue;
556  fPIDRangeZList.Add(itvs->GetZ());
557  }
558  GetParameters()->SetValue("PIDRANGE", fPIDRangeZList.AsString());
559 
560  itvs = 0;
561  TIter next(GetIntervalSets());
562  while ((itvs = (interval_set*)next())) {
563  if (!itvs->GetNPID()) continue;
564  KVString par = Form("PIDRANGE%d", itvs->GetZ());
565  KVString val = "";
566  interval* itv = 0;
567  TIter ni(itvs->GetIntervals());
568  while ((itv = (interval*)ni())) {
569  val += Form("%d:%lf,%lf,%lf|", itv->GetA(), itv->GetPIDmin(), itv->GetPID(), itv->GetPIDmax());
570  if(KVNucleus(itvs->GetZ(),itv->GetA()).IsResonance())
571  KVError::Error(this, "ExportToGrid", "Grid %s has interval set for Z=%d including resonance %s",
572  GetName(), itvs->GetZ(), KVNucleus(itvs->GetZ(),itv->GetA()).GetSymbol());
573  }
574  val.Remove(val.Length() - 1);
575  GetParameters()->SetValue(par.Data(), val.Data());
576  }
577  // now remove any massfits which do not have a corresponding pidrange
578  if(GetParameters()->HasParameter("MASSFITS"))
579  {
580  KVNumberList massfits(GetParameters()->GetStringValue("MASSFITS"));
581  auto massfits_copy = massfits;
582  massfits.Inter(fPIDRangeZList);
583  if(massfits != massfits_copy)
584  {
585  ::Info("KVIDZAFromZGrid::ExportToGrid()",
586  "Grid %s : will correct MASSFITS(%s) to be same as PIDRANGE(%s)",
587  GetName(), massfits.AsString(), fPIDRangeZList.AsString());
588  GetParameters()->SetValue("MASSFITS", fPIDRangeZList.AsString());
589  massfits = fPIDRangeZList;
590  }
591  // remove any fit not in MASSFITS/PIDRANGE list of Z
592  for(auto z : massfits)
593  {
594  if(!GetParameters()->HasParameter(Form("PIDRANGE%d",z)))
595  {
596  ::Info("KVIDZAFromZGrid::ExportToGrid()",
597  "Grid %s : removing fit for Z=%d for which no PIDRANGE exists (%s)",
598  GetName(), z, fPIDRangeZList.AsString());
599  GetParameters()->RemoveParameter(Form("MASSFITS_%d",z));
600  }
601  }
602  }
603 }
604 
605 
606 
607 
608 
610 
612 {
613  double pid = idr->PID;
614  if (pid < 0.5) return 0.;
615  // calculate interpolated mass from PID
616  double res = fPIDs.Eval(pid);
617  int ares = 0;
618 
620 
621  // look for mass interval PID is in
622  // in case it falls between two intervals remember also the interval
623  // immediately to the left & right of the PID
624  interval* left_int(nullptr), *right_int(nullptr);
625  interval* inter;
626  TIter it(&fIntervals);
627  while ((inter = (interval*)it())) {
628  if (inter->is_inside(pid)) {
629  ares = inter->GetA();
630  break;
631  }
632  else if (inter->is_left_of(pid)) {
633  left_int = inter;
634  }
635  else if (!right_int && inter->is_right_of(pid)) {
636  right_int = inter;
637  }
638  }
639  if (ares != 0) {
640  // the PID is inside a defined mass interval
641  idr->A = ares;
642  idr->PID = res;
644  }
645  else {
646  // the PID is not inside a defined mass interval
647  //
648  // * if it is in between two consecutive masses i.e. A and A+1 then it is
649  // Z- and A-identified with a slight ambiguity of A
650  // * if it is in between two non-consecutive masses i.e. A and A+2 then it
651  // is not identified (e.g. 5He, 8Be, 9B)
652  if (!right_int || !left_int) {
653  // case where no left or right interval were found
654  // to prevent from crashes but should not appen
655  idr->A = ares;
656  idr->PID = res;
658  }
659  else {
660  int dA = right_int->GetA() - left_int->GetA();
661  if (dA == 1) {
662  // OK, slight ambiguity of A
663  ares = TMath::Nint(res);
664  idr->A = ares;
665  idr->PID = res;
667  }
668  else {
669  // in a hole where no isotopes should be (e.g. 5He, 8Be, 9B)
670  idr->A = ares;
671  idr->PID = res;
673  }
674  }
675  }
676  }
677  else {
678  ares = TMath::Nint(res);
679  idr->A = ares;
680  idr->PID = res;
681  if (ares > fPIDs.GetX()[0] && ares < fPIDs.GetX()[fNPIDs - 1]) {
683  }
684  else {
686  }
687  }
688  return res;
689 }
690 
691 
692 
694 
695 bool interval_set::is_inside(double pid)
696 {
697  if (fType != KVIDZAFromZGrid::kIntType) return kTRUE;
698 
699 // Info("is_inside","min: %d max:%d npids:%d", ((interval*)fIntervals.At(0))->GetA(), ((interval*)fIntervals.At(fNPIDs-1))->GetA(), fNPIDs);
700 
701  if (pid > ((interval*)fIntervals.At(0))->GetPIDmin() && pid < ((interval*)fIntervals.At(fNPIDs - 1))->GetPIDmax()) return kTRUE;
702  else return kFALSE;
703 }
704 
705 
706 
708 
709 bool interval_set::is_above(double pid)
710 {
711  if (fType != KVIDZAFromZGrid::kIntType) return kTRUE;
712 
713  if (pid > ((interval*)fIntervals.At(fNPIDs - 1))->GetPIDmax()) return kTRUE;
714  else return kFALSE;
715 }
716 
717 
718 
719 
721 
723 {
724  if (!GetNPID()) return "-";
725  KVNumberList alist;
726  for (int ii = 0; ii < GetNPID(); ii++) alist.Add(((interval*)fIntervals.At(ii))->GetA());
727  return alist.AsString();
728 }
729 
730 
731 
733 
734 interval_set::interval_set(int zz, int type)
735 {
736  fType = type;
737  fZ = zz;
738  fNPIDs = 0;
739 }
740 
741 
742 
744 
745 void interval_set::add(int aa, double pid, double pidmin, double pidmax)
746 {
747  if (fType == KVIDZAFromZGrid::kIntType && !(pid > pidmin && pid < pidmax))
748  {
749  // sort into correct order: pidmin, pid, pidmax
750  std::map<double,int> toto;
751  ++toto[pidmin];
752  ++toto[pid];
753  ++toto[pidmax];
754  auto it = std::begin(toto);
755  pidmin = it->first;
756  ++it;
757  pid = it->first;
758  ++it;
759  pidmax = it->first;
760  }
761 
762  fPIDs.SetPoint(fNPIDs, pid, aa);
764  if (pid) fIntervals.AddLast(new interval(fZ, aa, pid, pidmin, pidmax));
765  }
766  fNPIDs++;
767 }
768 
769 
770 
771 
772 
constexpr Bool_t kFALSE
double Double_t
constexpr Bool_t kTRUE
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 Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
char * Form(const char *fmt,...)
virtual void WriteToAsciiFile(std::ofstream &gridfile)
Definition: KVIDGraph.cpp:444
const Char_t * GetName() const override
Definition: KVIDGraph.cpp:1414
const KVNameValueList * GetParameters() const
Definition: KVIDGraph.h:357
const KVList * GetIdentifiers() const
Definition: KVIDGraph.h:367
Hybrid charge & mass identification grid.
const KVList * GetIntervalSets() const
bool MassIdentificationFromMultiGaussFit(KVMultiGaussIsotopeFit *, KVIdentificationResult *) const
void Initialize() override
interval_set * GetIntervalSet(int zint) const
void WriteToAsciiFile(std::ofstream &gridfile) override
void Identify(Double_t x, Double_t y, KVIdentificationResult *) const override
virtual double DeduceAfromPID(KVIdentificationResult *idr) const
void AddIntervalSet(interval_set *)
add an interval set to the grid, updating the corresponding parameters
KVMultiGaussIsotopeFit * GetMultiGaussFit(int z) const
void SetOnlyZId(Bool_t=kTRUE) override
void RemoveIntervalSet(int zint)
Remove interval set for given Z from grid.
void ReadFromAsciiFile(std::ifstream &gridfile) override
void Copy(TObject &obj) const override
void ReadFromAsciiFile(std::ifstream &gridfile) override
void Copy(TObject &) const override
Copy this to 'obj'.
Definition: KVIDZAGrid.cpp:66
void Initialize() override
void Identify(Double_t x, Double_t y, KVIdentificationResult *) const override
Base class for graphical cuts used in particle identification.
Definition: KVIDentifier.h:28
Full result of one attempted particle identification.
Bool_t IDOK
general quality of identification, =kTRUE if acceptable identification made
void SetComment(const Char_t *c)
Bool_t Aident
= kTRUE if A of particle established
Double_t PID
= "real" Z if Zident==kTRUE and Aident==kFALSE, "real" A if Zident==Aident==kTRUE
Int_t A
A of particle found (if Aident==kTRUE)
Int_t Z
Z of particle found (if Zident==kTRUE)
Int_t IDquality
specific quality code returned by identification procedure
Bool_t HasFlag(std::string grid_name, TString flag)
Bool_t Zident
=kTRUE if Z of particle established
Function for fitting PID mass spectra.
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
void SetValue(const Char_t *name, value_type value)
void RemoveParameter(const Char_t *name)
const Char_t * GetStringValue(const Char_t *name) const
bool Set(const KVString &)
TString GetTStringValue(const Char_t *name) const
Description of properties and kinematics of atomic nuclei.
Definition: KVNucleus.h:123
const Char_t * GetSymbol(Option_t *opt="") const
Definition: KVNucleus.cpp:71
Bool_t IsResonance() const
Definition: KVNucleus.cpp:2007
Strings used to represent a set of ranges of values.
Definition: KVNumberList.h:85
void Inter(const KVNumberList &list)
Bool_t Contains(Int_t val) const
returns kTRUE if the value 'val' is contained in the ranges defined by the number list
void Clear(Option_t *="") override
Empty number list, reset it to initial state.
const Char_t * AsString(Int_t maxchars=0) const
void Remove(Int_t)
Remove value 'n' from the list.
void Add(Int_t)
Add value 'n' to the list.
void Copy(TObject &obj) const override
TObject * Remove(TObject *obj) override
Remove object from list.
void Add(TObject *obj) override
void AddLast(TObject *obj) override
void Clear(Option_t *option="") override
TObject * At(Int_t idx) const override
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:73
void Begin(TString delim) const
Definition: KVString.cpp:565
Bool_t End() const
Definition: KVString.cpp:634
KVString Next(Bool_t strip_whitespace=kFALSE) const
Definition: KVString.cpp:695
void Add(TObject *obj) override
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Double_t * GetX() const
virtual Double_t Eval(Double_t x, TSpline *spline=nullptr, Option_t *option="") const
virtual void SetName(const char *name)
virtual void Info(const char *method, const char *msgfmt,...) const
Ssiz_t Length() const
Int_t Atoi() const
Double_t Atof() const
const char * Data() const
Bool_t IsWhitespace() const
TString & Remove(EStripType s, char c)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
TString & ReplaceAll(const char *s1, const char *s2)
TString GetListOfMasses()
bool is_inside(double pid)
bool is_above(double pid)
void add(int aa, double pid, double pidmin=-1., double pidmax=-1.)
double eval(KVIdentificationResult *idr)
interval_set(int zz, int type)
KVList * GetIntervals()
bool is_right_of(double pid)
double GetPID()
bool is_left_of(double pid)
double GetPIDmin()
double GetPIDmax()
bool is_inside(double pid)
Double_t y[n]
Double_t x[n]
void Error(UserClass p, const char *location, const char *va_(fmt),...)
Definition: KVError.h:116
void Warning(UserClass p, const char *location, const char *va_(fmt),...)
Definition: KVError.h:125
void init()
Int_t Nint(T x)
ClassImp(TPyArg)