4#include "KVIDZAFromZGrid.h"
25 fTables.SetOwner(
kTRUE);
28 fIgnoreMassID =
false;
147 double pidmin, pidmax, pid;
149 else if (
type == 2) {
154 itv->
add(aa, pid, pidmin, pidmax);
224 for (
int ii = 1; ii < 30; ii++) {
253 if (it && it->
is_inside(pid))
return zint + 1;
258 if (it && it->
is_inside(pid))
return zint - 1;
291 if (!
id->InheritsFrom(
"KVIDZALine"))
continue;
303 for (
auto z : zlist) {
307 fitparams.
Set(massfit);
320 auto A = fitfunc->GetA(idr->
PID, P);
323 idr->
PID = fitfunc->GetInterpolatedA(idr->
PID);
366 if (!idr->
IDOK)
return;
370 bool have_mass_fit_for_Z = (mass_fit_for_Z !=
nullptr);
371 bool mass_id_success =
false;
373 if ((have_mass_fit_for_Z || have_pid_range_for_Z)
376 if (have_mass_fit_for_Z)
380 if (mass_id_success) {
405 if (mass_id_success) idr->
SetComment(
"slight ambiguity of A, which could be larger");
406 else idr->
SetComment(
"slight ambiguity of Z, which could be larger");
409 if (mass_id_success) idr->
SetComment(
"slight ambiguity of A, which could be smaller");
410 else idr->
SetComment(
"slight ambiguity of Z, which could be smaller");
413 if (mass_id_success) idr->
SetComment(
"slight ambiguity of A, which could be larger or smaller");
414 else idr->
SetComment(
"slight ambiguity of Z, which could be larger or smaller");
417 if (mass_id_success) idr->
SetComment(
"point is outside of mass identification range");
418 else idr->
SetComment(
"point is in between two lines of different Z, too far from either to be considered well-identified");
421 if (mass_id_success) idr->
SetComment(
"point is in between two isotopes A & A+2 (e.g. 5He, 8Be, 9B)");
422 else idr->
SetComment(
"point is in between two lines of different Z, too far from either to be considered well-identified");
425 idr->
SetComment(
"(x,y) is below first line in grid");
428 idr->
SetComment(
"(x,y) is above last line in grid");
431 idr->
SetComment(
"no identification: (x,y) out of range covered by grid");
452 if (!zint)
return -1;
453 if (zint != idr->
Z) idr->
Z = zint;
457 if (it) res = it->
eval(idr);
473 if (!itvs->
GetNPID())
continue;
481 if (!itvs->
GetNPID())
continue;
502 double pid = idr->
PID;
503 if (pid < 0.5)
return 0.;
513 interval* left_int(
nullptr), *right_int(
nullptr);
518 ares = inter->
GetA();
541 if (!right_int || !left_int) {
549 int dA = right_int->
GetA() - left_int->GetA();
646 Error(
"add",
"Wrong interval for Z=%d and A=%d: [%.4lf %.4lf %.4lf] (%s)",
fZ, aa, pidmin, pid, pidmax,
GetName());
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
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,...)
const KVNameValueList * GetParameters() const
virtual void WriteToAsciiFile(std::ofstream &gridfile)
virtual void ReadFromAsciiFile(std::ifstream &gridfile)
const KVList * GetIdentifiers() const
const Char_t * GetName() const
const KVList * GetInfos() const
Hybrid charge & mass identification grid.
Bool_t fHasMassIDRegion
set to true if grid has a limited region for mass identification, indicated by an info "MassID"
KVList * GetIntervalSets()
bool MassIdentificationFromMultiGaussFit(KVMultiGaussIsotopeFit *, KVIdentificationResult *) const
KVList fTables
intervals for mass id
KVMultiGaussIsotopeFit * GetMultiGaussFit(int z) const
interval_set * GetIntervalSet(int zint) const
virtual void WriteToAsciiFile(std::ofstream &gridfile)
void SetOnlyZId(Bool_t=kTRUE)
void Copy(TObject &obj) const
virtual double DeduceAfromPID(KVIdentificationResult *idr) const
KVUniqueNameList fFits
multi-gaussian fits for mass id
virtual void ReadFromAsciiFile(std::ifstream &gridfile)
int is_inside(double pid) const
virtual void Identify(Double_t x, Double_t y, KVIdentificationResult *) const
virtual void Copy(TObject &) const
Copy this to 'obj'.
virtual void Identify(Double_t x, Double_t y, KVIdentificationResult *) const
UShort_t fZMax
largest Z of lines in grid
Int_t fICode
code de retour
Base class for identification ridge lines corresponding to different nuclear species.
Base class for graphical cuts used in particle identification.
virtual Int_t GetZ() const
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)
Bool_t HasStringParameter(const Char_t *name) const
const Char_t * GetStringValue(const Char_t *name) const
bool Set(const KVString &)
TString GetTStringValue(const Char_t *name) const
Strings used to represent a set of ranges of values.
const Char_t * AsString(Int_t maxchars=0) const
void Add(Int_t)
Add value 'n' to the list.
virtual TObject * FindObject(const char *name) const
virtual void Copy(TObject &obj) const
virtual void AddLast(TObject *obj)
virtual void SetOwner(Bool_t enable=kTRUE)
virtual void Clear(Option_t *option="")
virtual TObject * At(Int_t idx) const
virtual void Add(TObject *obj)
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
void Begin(TString delim) const
KVString Next(Bool_t strip_whitespace=kFALSE) const
virtual void Add(TObject *obj)
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
virtual Double_t Eval(Double_t x, TSpline *spline=nullptr, Option_t *option="") const
const char * GetName() const override
virtual void SetName(const char *name)
virtual void Error(const char *method, const char *msgfmt,...) 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)
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
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)
bool is_right_of(double pid)
bool is_left_of(double pid)
bool is_inside(double pid)
double min(double x, double y)