125 idx_max = nlines - 1;
127 dist = dist_min = dist_max = -1.;
129 while (idx_max > idx_min + 1) {
132 Bool_t point_above_line =
line->WhereAmI(
x,
y, position);
134 if (point_above_line) {
137 idx += (
Int_t)((idx_max - idx) / 2 + 0.5);
142 idx -= (
Int_t)((idx - idx_min) / 2 + 0.5);
152 if (dist_max < dist_min) {
171 if (!nlines)
return 0;
173 idx_max = nlines - 1;
175 dist = dist_min = dist_max = -1.;
177 while (idx_max > idx_min + 1) {
180 Bool_t point_above_line =
line->WhereAmI(
x,
y, position);
182 if (point_above_line) {
185 idx += (
Int_t)((idx_max - idx) / 2 + 0.5);
190 idx -= (
Int_t)((idx - idx_min) / 2 + 0.5);
199 if (idx_max == nlines - 1) {
225 if (dist_max < dist_min) {
243 Int_t ii = index + inc_index;
246 while ((ii > -1 && ii < nlines)) {
248 if (
l->IsBetweenEndPoints(
x,
y, axis))
break;
251 if (ii < 0 || ii >= nlines) {
#define ClassDef(name, id)
Base class for particle identification in a 2D map.
Int_t GetNumberOfIdentifiers() const
KVList * fIdentifiers
list of identification objects
KVIDentifier * GetIdentifierAt(Int_t index) const
Abstract base class for 2D identification grids in e.g. (dE,E) maps.
virtual TClass * DefaultIDLineClass()
virtual void CalculateLineWidths()
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
KVIDGrid()
Default constructor.
KVIDLine * FindNextEmbracingLine(Int_t &index, Int_t inc_index, Double_t x, Double_t y, const Char_t *axis) const
virtual TClass * DefaultOKLineClass()
KVIDLine * FindNearestIDLineFast(Double_t x, Double_t y, const Char_t *position, Int_t &idx, Int_t &idx_min, Int_t &idx_max, Double_t &dist, Double_t &dist_min, Double_t &dist_max) const
void init()
Initialisations, used by constructors.
KVIDLine * NewLine(const Char_t *idline_class="")
Int_t GetIDLinesEmbracingPoint(const Char_t *direction, Double_t x, Double_t y) const
TObjArray fEmbracingLines
temporary array used by GetIDLinesEmbracingPoint
void ReadIdentifierFromAsciiFile(TString &name, TString &type, TString &cl, std::ifstream &gridfile)
Base class for lines/cuts used for particle identification in 2D data maps.
Double_t DistanceToLine(Double_t px, Double_t py, Int_t &)
Bool_t WhereAmI(Double_t px, Double_t py, Option_t *opt)
static TClass * GetClass(Bool_t load=kTRUE, Bool_t silent=kFALSE)
TObject * UncheckedAt(Int_t i) const
virtual Int_t IndexOf(const TObject *obj) const
double dist(AxisAngle const &r1, AxisAngle const &r2)