21#include "KVIDZAGrid.h"
22#include "KVIDZALine.h"
23#include "KVIDCutLine.h"
26#include "KVIdentificationResult.h"
105 gROOT->ProcessLine(
"if(gROOT->FindObject(\"gIDGridEditorCanvas\")) gIDGridEditor->Clear()");
115 TIter next_id(tmplist);
161 UInt_t idx_max = nlines - 1;
166 while (idx_max > idx_min + 1) {
180 idx += (
Int_t)((idx_max - idx) / 2 + 0.5);
185 idx -= (
Int_t)((idx - idx_min) / 2 + 0.5);
190 if (
line->GetZ() == z) {
195 if (
line->GetZ() == z) {
226 if (
line->GetA() ==
a) {
231 if (
a >
line->GetA()) {
234 if (
line->GetZ() != z)
236 if (
line->GetA() ==
a) {
244 else if (a < line->GetA()) {
245 for (
int i = idx; i > 0; i--) {
247 if (
line->GetZ() != z)
249 if (
line->GetA() ==
a) {
339 i_other = (Zhi > -1 ? i + 1 : (Zlo > -1 ? i - 1 : -1));
343 i_other = (Zhi == Z ? i + 1 : (Zlo == Z ? i - 1 : -1));
346 i_other = (Zhi > -1 ? i + 1 : (Zlo > -1 ? i - 1 : -1));
470 if (!
gPad->GetListOfPrimitives()->GetSize()) {
479 line->GetLineWithWidth()->
Draw(
"3PL");
597 Error(
"FindFourEmbracingLines",
598 "I do not understand the result of FindNearestEmbracingIDLine!!!");
852 else if (
kinf > -1) {
922 else if (ix2 == -ix1 * 2) {
924 if (tmp > 0 &&
dist != 0) {
925 dt = -(
y1 + 2. *
y2 -
933 else if (ix1 == -ix2 * 2) {
935 if (tmp > 0 &&
dist != 0) {
936 dt = -(
y2 + 2. *
y1 +
948 deltaA = yy * ix2 /
y2 / 2.;
954 if (
dist > -1. && dt * yy > -1.)
973 if (nextline->
GetZ() == Z
974 && !((
KVIDLine*)nextline)->IsBetweenEndPoints(
x,
y,
"x")) {
986 if (idx > -1 && --idx >= 0) {
988 if (nextline->
GetZ() == Z
989 && !((
KVIDLine*)nextline)->IsBetweenEndPoints(
x,
y,
"x")) {
1193 else if (
kinf > -1) {
1261 else if (ix2 == -ix1 * 2) {
1263 if (tmp > 0. &&
dist != 0) {
1264 dt = -(
y1 + 2. *
y2 -
1272 else if (ix1 == -ix2 * 2) {
1274 if (tmp > 0. &&
dist != 0) {
1275 dt = -(
y2 + 2. *
y1 +
1287 deltaZ = yy * ix2 /
y2 / 2.;
1293 if (
dist > -1. && dt * yy > -1.)
1326 if (idx > -1 && --idx >= 0) {
1403 idr->
SetComment(
"no identification: (x,y) out of range covered by grid");
1425 idr->
SetComment(
"slight ambiguity of Z, which could be larger");
1428 idr->
SetComment(
"slight ambiguity of Z, which could be smaller");
1431 idr->
SetComment(
"slight ambiguity of Z, which could be larger or smaller");
1434 idr->
SetComment(
"point is in between two lines of different Z, too far from either to be considered well-identified");
1437 idr->
SetComment(
"point is in between two lines of different Z, too far from either to be considered well-identified");
1440 idr->
SetComment(
"(x,y) is below first line in grid");
1443 idr->
SetComment(
"(x,y) is above last line in grid");
1446 idr->
SetComment(
"no identification: (x,y) out of range covered by grid");
1471 idr->
SetComment(
"slight ambiguity of A, which could be larger");
1474 idr->
SetComment(
"slight ambiguity of A, which could be smaller");
1477 idr->
SetComment(
"slight ambiguity of A, which could be larger or smaller");
1480 idr->
SetComment(
"point is in between two isotopes of different Z, too far from either to be considered well-identified");
1483 idr->
SetComment(
"point is in between two isotopes of different Z, too far from either to be considered well-identified");
1486 idr->
SetComment(
"(x,y) is below first line in grid");
1489 idr->
SetComment(
"(x,y) is above last line in grid");
1492 idr->
SetComment(
"no identification: (x,y) out of range covered by grid");
1539 Warning(
"Streamer",
"Reading KVIDZGrid with version=%d", R__v);
1680 if (!graph_class) graph_class =
IsA();
1682 Error(
"MakeSubsetGraph",
"Called with graph class %s, does not derive from KVIDGraph",
1728 if (
l->GetZ() >= Zmin &&
l->GetZ() <= Zmax) lines->
Add(
l);
1731 if (strcmp(graph_class,
"")) cl = TClass::GetClass(graph_class);
1760 Warning(
"Streamer",
"Reading KVIDZGrid with version=%d", R__v);
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
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 x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char y1
char * Form(const char *fmt,...)
Base class for particle identification in a 2D map.
const KVNameValueList * GetParameters() const
virtual void SetVarX(const char *v)
void RemoveIdentifier(KVIDentifier *)
Remove and destroy identifier.
KVList fIdentifiers
list of identification objects
void Draw(Option_t *opt="")
Int_t GetNumberOfIdentifiers() const
Int_t GetMassFormula() const
const KVNumberList & GetRuns() const
void FindAxisLimits()
Calculate X/Y min/max of all objects in graph.
const KVList * GetIdentifiers() const
virtual void SetVarY(const char *v)
void SetMassFormula(Int_t)
const Char_t * GetName() const
TList fTelescopes
ID telescopes for which grid is valid.
void AddIDTelescopes(const TList *)
Associate this graph with all ID telescopes in list.
virtual void AddIdentifier(KVIDentifier *id)
virtual void SetInfos(Double_t, Double_t, KVIdentificationResult *) const
loop over KVIDGraph::fInfoZones to set flags in KVIdentificationResult
const KVList * GetCuts() const
void SetRuns(const KVNumberList &nl)
Set list of runs for which grid is valid.
virtual void SetOnlyZId(Bool_t yes=kTRUE)
KVIDentifier * GetIdentifierAt(Int_t index) const
KVIDLine * FindNearestEmbracingIDLine(Double_t x, Double_t y, const Char_t *position, const Char_t *axis, Int_t &idx, Int_t &idx_min, Int_t &idx_max, Double_t &dist, Double_t &dist_min, Double_t &dist_max) const
KVIDLine * FindNextEmbracingLine(Int_t &index, Int_t inc_index, Double_t x, Double_t y, const Char_t *axis) const
Base class for lines/cuts used for particle identification in 2D data maps.
Double_t DistanceToLine(Double_t px, Double_t py, Int_t &)
void GetStartPoint(Double_t &x, Double_t &y) const
Bool_t IsBetweenEndPoints(Double_t x, Double_t y, const Char_t *axis="") const
void GetEndPoint(Double_t &x, Double_t &y) const
Identification grid with lines corresponding to different nuclear isotopes (KVIDZALine)
Double_t fDistanceClosest
distance from point to closest line
virtual void CalculateLineWidths()
void init()
initialisation
KVIDLine * fClosest
closest line to last-identified point
void ReCheckQuality(Int_t &Z, Double_t &A)
virtual KVIDZALine * GetZLine(Int_t z, Int_t &) const
virtual void Copy(TObject &) const
Copy this to 'obj'.
void DrawLinesWithWidth()
void RemoveZLines(const Char_t *ZList)
Remove and destroy identifiers.
virtual void IdentZ(Double_t x, Double_t y, Double_t &Z)
virtual void Identify(Double_t x, Double_t y, KVIdentificationResult *) const
KVIDZALine * fZMaxLine
line with biggest Z and A
Int_t ksups
used by IdentZA and IdentZ
virtual void Initialize()
UShort_t fZMax
largest Z of lines in grid
KVIDZAGrid()
default ctor.
virtual void IdentZA(Double_t x, Double_t y, Int_t &Z, Double_t &A)
Int_t fIdxClosest
index of closest line in main list fIdentifiers
Int_t fICode
code de retour
Int_t Zint
Z of line used to identify particle.
void SetManualWidth(Double_t manual_width=.3, Double_t manual_width_scaling=0.05)
KVIDGraph * MakeSubsetGraph(Int_t Zmin, Int_t Zmax, const Char_t *="")
virtual void MakeEDeltaEZGrid(Int_t Zmin, Int_t Zmax, Int_t npoints=20, Double_t gamma = 2);//*MENU*
virtual Bool_t FindFourEmbracingLines(Double_t x, Double_t y, const Char_t *position)
Int_t Aint
mass of line used to identify particle
void RemoveLine(Int_t Z, Int_t A=-1)
Remove and destroy identifier.
virtual ~KVIDZAGrid()
default dtor.
virtual KVIDZALine * GetZALine(Int_t z, Int_t a, Int_t &) const
Base class for identification ridge lines corresponding to different nuclear species.
virtual void SetAsymWidth(Double_t d_l, Double_t d_r)
void SetWidth(Double_t w)
Base class for graphical cuts used in particle identification.
virtual Int_t GetA() const
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 Zident
=kTRUE if Z of particle established
Extended TList class which owns its objects by default.
Double_t GetDoubleValue(const Char_t *name) const
void SetValue(const Char_t *name, value_type value)
Description of properties and kinematics of atomic nuclei.
Double_t GetLifeTime(Int_t z=-1, Int_t a=-1) const
Strings used to represent a set of ranges of values.
KVSeqCollection * GetSubListWithMethod(const Char_t *retvalue, const Char_t *method) const
virtual TObject * Last() const
virtual void Streamer(TBuffer &)
void Copy(TAttFill &attfill) const
virtual Version_t ReadVersion(UInt_t *start=nullptr, UInt_t *bcnt=nullptr, const TClass *cl=nullptr)=0
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=nullptr)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Bool_t InheritsFrom(const char *cl) const override
const char * GetVarX() const
TClass * IsA() const override
const char * GetVarY() const
void Clear(Option_t *option="") override
void Add(TObject *obj) override
const char * GetName() const override
virtual Bool_t InheritsFrom(const char *classname) const
virtual void Error(const char *method, const char *msgfmt,...) const
virtual void Draw(Option_t *option="")
double dist(AxisAngle const &r1, AxisAngle const &r2)
Double_t Min(Double_t a, Double_t b)
Double_t Sqrt(Double_t x)
Double_t Max(Double_t a, Double_t b)