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;
54  fTables.Copy(i.fTables);
55  fFits.Copy(i.fFits);
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 
82 }
83 
84 
85 
87 
88 void KVIDZAFromZGrid::WriteToAsciiFile(std::ofstream& gridfile)
89 {
90  ExportToGrid();
92 }
93 
94 
95 
97 
99 {
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;
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 {
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 
319 
321 {
322  // Check for inconsistencies between 'PIDRANGE' and 'MASSFIT' parameters
323 
324  if(fPar.HasParameter("MASSFITS"))
325  {
326  KVNumberList massfits(GetParameters()->GetStringValue("MASSFITS"));
327  // check same as PIDRANGE
328  KVNumberList pidrange(GetParameters()->GetStringValue("PIDRANGE"));
329  // exclude from massfits any missing pidrange
330  auto massfits_copy = massfits;
331  massfits.Inter(pidrange);
332  if(massfits != massfits_copy)
333  {
334  KVError::Error(this, "KVIDZAFromZGrid::check_pidranges_and_massfits",
335  "Grid %s has inconsistent MASSFITS (%s) and PIDRANGE (%s) - correcting...",
336  GetName(), massfits_copy.AsString(), pidrange.AsString());
337  GetParameters()->SetValue("MASSFITS", massfits.AsString());
338  // remove any fits which do not have a corresponding pidrange
339  for(auto z : massfits)
340  {
341  if(!GetParameters()->HasParameter(Form("PIDRANGE%d",z)))
342  {
343  KVError::Warning(this, "KVIDZAFromZGrid::check_pidranges_and_massfits",
344  "Grid %s : removing fit for Z=%d...",
345  GetName(), z);
346  GetParameters()->RemoveParameter(Form("MASSFITS_%d",z));
347  }
348  }
349  }
350  // for each MASSFIT_Z, check the 'Alist' compared to the masses given in PIDRANGEZ
351  // we signal any case where the list of fitted masses is not a subset of the pidrange masses
352  massfits = GetParameters()->GetStringValue("MASSFITS");
353  for (auto z : massfits) {
354  if(pidrange.Contains(z))
355  {
356  auto massfit = GetParameters()->GetTStringValue(Form("MASSFIT_%d", z));
357  massfit.ReplaceAll(":", "=");
358  KVNameValueList fitparams;
359  fitparams.Set(massfit);
360  KVNumberList alist(fitparams.GetStringValue("Alist"));
361  KVNumberList pidalist;
362  KVString pidr = GetParameters()->GetStringValue(Form("PIDRANGE%d", z));
363  pidr.Begin("|");
364  while(!pidr.End())
365  {
366  auto pipi = pidr.Next();
367  pipi.Begin(":");
368  pidalist.Add(pipi.Next().Atoi());
369  }
370  auto alist_orig = alist;
371  alist.Inter(pidalist);
372  if(alist != alist_orig)
373  {
374  KVError::Warning(this, "KVIDZAFromZGrid::check_pidranges_and_massfits",
375  "Grid %s has inconsistent masses for Z=%d for MASSFIT (%s) and PIDRANGE (%s)",
376  GetName(), z, alist_orig.AsString(), pidalist.AsString());
377  }
378  }
379  }
380  }
381 }
382 
383 
384 
386 
388 {
389  double P;
390  auto A = fitfunc->GetA(idr->PID, P);
391  if (A) {
392  idr->A = *A;
393  idr->PID = fitfunc->GetInterpolatedA(idr->PID);
394  if (P > 0.5) idr->IDquality = KVIDZAGrid::kICODE0; // probability of A is >50%
395  else idr->IDquality = KVIDZAGrid::kICODE3;// OK, slight ambiguity of A
396  }
397  else {
398  // no A returned => background noise
400  return false;
401  }
402  return true;
403 }
404 
405 
406 
418 
420 {
421  // Fill the KVIdentificationResult object with the results of identification for point (x,y)
422  // corresponding to some physically measured quantities related to a reconstructed nucleus.
423  //
424  // If identification is successful, idr->IDOK = true.
425  // In this case, idr->Aident and idr->Zident indicate whether isotopic or only Z identification
426  // was acheived.
427  //
428  // In case of unsuccessful identification, idr->IDOK = false,
429  // BUT idr->Zident and/or idr->Aident may be true: this is to indicate which kind of
430  // identification was attempted but failed (this changes the meaning of the quality code)
431 
432  idr->Aident = idr->Zident = kFALSE;
433 
434  KVIDZAGrid::Identify(x, y, idr);
435  idr->Zident = kTRUE; // meaning Z identification was attempted, even if it failed
436  if (!idr->IDOK) return;
437 
438  bool have_pid_range_for_Z = fPIDRange && fPIDRangeZList.Contains(idr->Z);
439  auto mass_fit_for_Z = GetMultiGaussFit(idr->Z);
440  bool have_mass_fit_for_Z = (mass_fit_for_Z != nullptr);
441  bool mass_id_success = false;
442 
443  if ((have_mass_fit_for_Z || have_pid_range_for_Z)
444  && (!fHasMassIDRegion || idr->HasFlag(GetName(), "MassID"))) { // if a mass ID region is defined, we must be inside it
445  // try mass identification
446  if (have_mass_fit_for_Z)
447  mass_id_success = MassIdentificationFromMultiGaussFit(mass_fit_for_Z, idr);
448  else
449  mass_id_success = (DeduceAfromPID(idr) > 0);
450  if (mass_id_success) {
451  // mass identification was at least attempted
452  // make sure grid's quality code is consistent with KVIdentificationResult
453  const_cast<KVIDZAFromZGrid*>(this)->fICode = idr->IDquality;
454  idr->Aident = kTRUE; // meaning A identification was attempted, even if it failed
455  }
456  else {
457  // the pid falls outside of any mass ranges for a Z which has assigned isotopes
458  // therefore although the Z identification was good, we cannot consider this
459  // particle to be identified
460  const_cast<KVIDZAFromZGrid*>(this)->fICode = kICODE4;
461  idr->IDquality = fICode; // otherwise identfication result quality code is not coherent with comment (see below)
462  }
463  idr->IDOK = (fICode < kICODE4);
464  }
465 
466  // ignore isotopic successful isotopic identification if fIgnoreMassID=true
467  if (fIgnoreMassID && idr->IDOK && idr->Aident) idr->Aident = false;
468 
469  // set comments in identification result
470  switch (fICode) {
471  case kICODE0:
472  idr->SetComment("ok");
473  break;
474  case kICODE1:
475  if (mass_id_success) idr->SetComment("slight ambiguity of A, which could be larger");
476  else idr->SetComment("slight ambiguity of Z, which could be larger");
477  break;
478  case kICODE2:
479  if (mass_id_success) idr->SetComment("slight ambiguity of A, which could be smaller");
480  else idr->SetComment("slight ambiguity of Z, which could be smaller");
481  break;
482  case kICODE3:
483  if (mass_id_success) idr->SetComment("slight ambiguity of A, which could be larger or smaller");
484  else idr->SetComment("slight ambiguity of Z, which could be larger or smaller");
485  break;
486  case kICODE4:
487  if (mass_id_success) idr->SetComment("point is outside of mass identification range");
488  else idr->SetComment("Z identification correct but no mass identification");
489  break;
490  case kICODE5:
491  if (mass_id_success) idr->SetComment("point is in between two isotopes A & A+2 (e.g. 5He, 8Be, 9B)");
492  else idr->SetComment("point is in between two lines of different Z, too far from either to be considered well-identified");
493  break;
494  case kICODE6:
495  idr->SetComment("(x,y) is below first line in grid");
496  break;
497  case kICODE7:
498  idr->SetComment("(x,y) is above last line in grid");
499  break;
500  default:
501  idr->SetComment("no identification: (x,y) out of range covered by grid");
502  }
503 }
504 
505 
506 
507 
513 
515 {
516  // First look for a set of mass intervals in which the PID of the identification result falls,
517  // if there is one (see KVIDZAFromZGrid::is_inside).
518  // If an interval set is found for a Z different to the original identification, idr->Z is changed.
519  // Then call interval_set::eval for the mass interval for this Z.
520 
521  int zint = is_inside(idr->PID);
522  if (!zint) return -1;
523  if (zint != idr->Z) idr->Z = zint;
524 
525  double res = 0.;
526  interval_set* it = GetIntervalSet(zint);
527  if (it) res = it->eval(idr);
528  return res;
529 }
530 
531 
532 
533 
535 
537 {
539 
540  interval_set* itvs = 0;
541  TIter npid(GetIntervalSets());
542  while ((itvs = (interval_set*)npid())) {
543  if (!itvs->GetNPID()) continue;
544  fPIDRangeZList.Add(itvs->GetZ());
545  }
546  GetParameters()->SetValue("PIDRANGE", fPIDRangeZList.AsString());
547 
548  itvs = 0;
549  TIter next(GetIntervalSets());
550  while ((itvs = (interval_set*)next())) {
551  if (!itvs->GetNPID()) continue;
552  KVString par = Form("PIDRANGE%d", itvs->GetZ());
553  KVString val = "";
554  interval* itv = 0;
555  TIter ni(itvs->GetIntervals());
556  while ((itv = (interval*)ni())) {
557  val += Form("%d:%lf,%lf,%lf|", itv->GetA(), itv->GetPIDmin(), itv->GetPID(), itv->GetPIDmax());
558  }
559  val.Remove(val.Length() - 1);
560  GetParameters()->SetValue(par.Data(), val.Data());
561  }
562  // now remove any massfits which do not have a corresponding pidrange
563  if(GetParameters()->HasParameter("MASSFITS"))
564  {
565  KVNumberList massfits(GetParameters()->GetStringValue("MASSFITS"));
566  auto massfits_copy = massfits;
567  massfits.Inter(fPIDRangeZList);
568  if(massfits != massfits_copy)
569  {
570  ::Info("KVIDZAFromZGrid::ExportToGrid()",
571  "Grid %s : will correct MASSFITS(%s) to be same as PIDRANGE(%s)",
572  GetName(), massfits.AsString(), fPIDRangeZList.AsString());
573  GetParameters()->SetValue("MASSFITS", fPIDRangeZList.AsString());
574  massfits = fPIDRangeZList;
575  }
576  // remove any fit not in MASSFITS/PIDRANGE list of Z
577  for(auto z : massfits)
578  {
579  if(!GetParameters()->HasParameter(Form("PIDRANGE%d",z)))
580  {
581  ::Info("KVIDZAFromZGrid::ExportToGrid()",
582  "Grid %s : removing fit for Z=%d for which no PIDRANGE exists (%s)",
584  GetParameters()->RemoveParameter(Form("MASSFITS_%d",z));
585  }
586  }
587  }
588 }
589 
590 
591 
592 
593 
595 
597 {
598  double pid = idr->PID;
599  if (pid < 0.5) return 0.;
600  // calculate interpolated mass from PID
601  double res = fPIDs.Eval(pid);
602  int ares = 0;
603 
605 
606  // look for mass interval PID is in
607  // in case it falls between two intervals remember also the interval
608  // immediately to the left & right of the PID
609  interval* left_int(nullptr), *right_int(nullptr);
610  interval* inter;
611  TIter it(&fIntervals);
612  while ((inter = (interval*)it())) {
613  if (inter->is_inside(pid)) {
614  ares = inter->GetA();
615  break;
616  }
617  else if (inter->is_left_of(pid)) {
618  left_int = inter;
619  }
620  else if (!right_int && inter->is_right_of(pid)) {
621  right_int = inter;
622  }
623  }
624  if (ares != 0) {
625  // the PID is inside a defined mass interval
626  idr->A = ares;
627  idr->PID = res;
629  }
630  else {
631  // the PID is not inside a defined mass interval
632  //
633  // * if it is in between two consecutive masses i.e. A and A+1 then it is
634  // Z- and A-identified with a slight ambiguity of A
635  // * if it is in between two non-consecutive masses i.e. A and A+2 then it
636  // is not identified (e.g. 5He, 8Be, 9B)
637  if (!right_int || !left_int) {
638  // case where no left or right interval were found
639  // to prevent from crashes but should not appen
640  idr->A = ares;
641  idr->PID = res;
643  }
644  else {
645  int dA = right_int->GetA() - left_int->GetA();
646  if (dA == 1) {
647  // OK, slight ambiguity of A
648  ares = TMath::Nint(res);
649  idr->A = ares;
650  idr->PID = res;
652  }
653  else {
654  // in a hole where no isotopes should be (e.g. 5He, 8Be, 9B)
655  idr->A = ares;
656  idr->PID = res;
658  }
659  }
660  }
661  }
662  else {
663  ares = TMath::Nint(res);
664  idr->A = ares;
665  idr->PID = res;
666  if (ares > fPIDs.GetX()[0] && ares < fPIDs.GetX()[fNPIDs - 1]) {
668  }
669  else {
671  }
672  }
673  return res;
674 }
675 
676 
677 
679 
680 bool interval_set::is_inside(double pid)
681 {
682  if (fType != KVIDZAFromZGrid::kIntType) return kTRUE;
683 
684 // Info("is_inside","min: %d max:%d npids:%d", ((interval*)fIntervals.At(0))->GetA(), ((interval*)fIntervals.At(fNPIDs-1))->GetA(), fNPIDs);
685 
686  if (pid > ((interval*)fIntervals.At(0))->GetPIDmin() && pid < ((interval*)fIntervals.At(fNPIDs - 1))->GetPIDmax()) return kTRUE;
687  else return kFALSE;
688 }
689 
690 
691 
693 
694 bool interval_set::is_above(double pid)
695 {
696  if (fType != KVIDZAFromZGrid::kIntType) return kTRUE;
697 
698  if (pid > ((interval*)fIntervals.At(fNPIDs - 1))->GetPIDmax()) return kTRUE;
699  else return kFALSE;
700 }
701 
702 
703 
704 
706 
708 {
709  if (!GetNPID()) return "-";
710  KVNumberList alist;
711  for (int ii = 0; ii < GetNPID(); ii++) alist.Add(((interval*)fIntervals.At(ii))->GetA());
712  return alist.AsString();
713 }
714 
715 
716 
718 
719 interval_set::interval_set(int zz, int type)
720 {
721  fType = type;
722  fZ = zz;
723  fNPIDs = 0;
724 }
725 
726 
727 
729 
730 void interval_set::add(int aa, double pid, double pidmin, double pidmax)
731 {
732  if (fType == KVIDZAFromZGrid::kIntType && !(pid > pidmin && pid < pidmax))
733  {
734  // sort into correct order: pidmin, pid, pidmax
735  std::map<double,int> toto;
736  ++toto[pidmin];
737  ++toto[pid];
738  ++toto[pidmax];
739  auto it = std::begin(toto);
740  pidmin = it->first;
741  ++it;
742  pid = it->first;
743  ++it;
744  pidmax = it->first;
745  }
746 
747  fPIDs.SetPoint(fNPIDs, pid, aa);
749  if (pid) fIntervals.AddLast(new interval(fZ, aa, pid, pidmin, pidmax));
750  }
751  fNPIDs++;
752 }
753 
754 
755 
756 
757 
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,...)
KVNameValueList fPar
parameters associated to grid
Definition: KVIDGraph.h:44
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.
void check_pidranges_and_massfits()
Check for inconsistencies between 'PIDRANGE' and 'MASSFIT' parameters.
const KVList * GetIntervalSets() const
bool MassIdentificationFromMultiGaussFit(KVMultiGaussIsotopeFit *, KVIdentificationResult *) const
void Initialize() override
KVList fTables
intervals for mass id
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
KVUniqueNameList fFits
multi-gaussian fits for mass id
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
KVNumberList fPIDRangeZList
void Copy(TObject &obj) const override
int is_inside(double pid) const
void ReadFromAsciiFile(std::ifstream &gridfile) override
void Copy(TObject &) const override
Copy this to 'obj'.
Definition: KVIDZAGrid.cpp:66
Bool_t fHasMassIDRegion
Definition: KVIDZAGrid.h:100
Int_t fICode
code de retour
Definition: KVIDZAGrid.h:90
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 &)
Bool_t HasParameter(const Char_t *name) const
TString GetTStringValue(const Char_t *name) const
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)