FEDRA emulsion software from the OPERA Collaboration
EdbAttachPath Class Reference

#include <EdbAttachPath.h>

Inheritance diagram for EdbAttachPath:
Collaboration diagram for EdbAttachPath:

Public Member Functions

Float_t Dist (const int i) const
 
 EdbAttachPath (int n)
 
int GetAlignedNeighbours (const int i0, TArrayI &list) const
 
float GetMax (TArrayF &a)
 
float GetMin (TArrayF &a)
 
int I (const int i) const
 
int ID (const int i) const
 
int N () const
 
int N0 () const
 
int OK (const int i) const
 
void OrderPointsRadial ()
 
void RiseOK (const int i)
 
void SetPoint (const int i, const float x, const float y, const int id)
 
void SetRange (const float r)
 
void SetStartingAtCenter ()
 
void SetStartingPosition (const float x, const float y)
 
void SetStartingPosition (const int i)
 
float Xmax ()
 
float Xmin ()
 
float Ymax ()
 
float Ymin ()
 
virtual ~EdbAttachPath ()
 

Private Attributes

TArrayF eDist
 
TArrayI eID
 
TArrayI eInd
 
Int_t eN
 
Int_t eN0
 
TArrayI eOK
 
Float_t eR
 
TArrayF eX
 
Float_t eX0
 
TArrayF eY
 
Float_t eY0
 

Constructor & Destructor Documentation

◆ EdbAttachPath()

EdbAttachPath::EdbAttachPath ( int  n)
inline
29 : eX(n),eY(n),eID(n),eOK(n),eDist(n),eInd(n) {eN0=n; eN=0;}
TArrayI eOK
Definition: EdbAttachPath.h:18
Int_t eN0
Definition: EdbAttachPath.h:14
TArrayI eInd
Definition: EdbAttachPath.h:24
TArrayI eID
Definition: EdbAttachPath.h:17
TArrayF eDist
Definition: EdbAttachPath.h:23
Int_t eN
Definition: EdbAttachPath.h:25
TArrayF eX
Definition: EdbAttachPath.h:15
TArrayF eY
Definition: EdbAttachPath.h:16

◆ ~EdbAttachPath()

virtual EdbAttachPath::~EdbAttachPath ( )
inlinevirtual
30 {}

Member Function Documentation

◆ Dist()

Float_t EdbAttachPath::Dist ( const int  i) const
inline
45 { return eDist[i]; }

◆ GetAlignedNeighbours()

int EdbAttachPath::GetAlignedNeighbours ( const int  i0,
TArrayI &  list 
) const
82 {
83  // for a given view return list of already aligned neighbours
84  int n=0;
85  for(int i=0; i<eN0; i++)
86  {
87  if(eOK[i]) {
88  float dx = eX[i] - eX[i0];
89  float dy = eY[i] - eY[i0];
90  float d = Sqrt(dx*dx+dy*dy);
91  if( d<eR && d>0.001 )
92  {
93  list[n] = i; n++;
94  printf("i = %d d = %f \n",i,d);
95  }
96  }
97  }
98  return n;
99 }
void d()
Definition: RecDispEX.C:381

◆ GetMax()

float EdbAttachPath::GetMax ( TArrayF &  a)
52 {
53  int n = a.GetSize();
54  float a0 = a[0];
55  for(int i=1; i<n; i++) if(a[i]>a0) a0=a[i];
56  return a0;
57 }
void a()
Definition: check_aligned.C:59

◆ GetMin()

float EdbAttachPath::GetMin ( TArrayF &  a)
43 {
44  int n = a.GetSize();
45  float a0 = a[0];
46  for(int i=1; i<n; i++) if(a[i]<a0) a0=a[i];
47  return a0;
48 }

◆ I()

int EdbAttachPath::I ( const int  i) const
inline
40 { return eInd[i]; }

◆ ID()

int EdbAttachPath::ID ( const int  i) const
inline
44 { return eID[i]; }

◆ N()

int EdbAttachPath::N ( ) const
inline
42 { return eN; }

◆ N0()

int EdbAttachPath::N0 ( ) const
inline
41 { return eN0; }

◆ OK()

int EdbAttachPath::OK ( const int  i) const
inline
43 { return eOK[i]; }

◆ OrderPointsRadial()

void EdbAttachPath::OrderPointsRadial ( )
69 {
70  for(int i=0; i<eN0; i++)
71  {
72  float dx = eX[i]-eX0;
73  float dy = eY[i]-eY0;
74  eDist[i] = Sqrt(dx*dx+dy*dy);
75  }
76  TMath::Sort(eN0,eDist.GetArray(),eInd.GetArray(),0);
77  eN=eN0;
78 }
Float_t eX0
Definition: EdbAttachPath.h:20
Float_t eY0
Definition: EdbAttachPath.h:20

◆ RiseOK()

void EdbAttachPath::RiseOK ( const int  i)
inline
38 { eOK[i]++; }

◆ SetPoint()

void EdbAttachPath::SetPoint ( const int  i,
const float  x,
const float  y,
const int  id 
)
18 {
19  eX[i]=x;
20  eY[i]=y;
21  eID[i]=id;
22 }
UInt_t id
Definition: tlg2pattern.C:118

◆ SetRange()

void EdbAttachPath::SetRange ( const float  r)
inline
35 {eR=r;}
Float_t eR
Definition: EdbAttachPath.h:21
void r(int rid=2)
Definition: test.C:201

◆ SetStartingAtCenter()

void EdbAttachPath::SetStartingAtCenter ( )
61 {
62  float x = (Xmax()+Xmin())/2.;
63  float y = (Ymax()+Ymin())/2.;
65 }
void SetStartingPosition(const int i)
Definition: EdbAttachPath.h:32
float Xmax()
Definition: EdbAttachPath.h:50
float Ymin()
Definition: EdbAttachPath.h:51
float Ymax()
Definition: EdbAttachPath.h:52
float Xmin()
Definition: EdbAttachPath.h:49

◆ SetStartingPosition() [1/2]

void EdbAttachPath::SetStartingPosition ( const float  x,
const float  y 
)
26 {
27  int i0 = -1;
28  float d0=1000000000;
29  for(int i=0; i<eN0; i++)
30  {
31  float dx = eX[i]-x;
32  float dy = eY[i]-y;
33  float d = Sqrt(dx*dx+dy*dy);
34  if(d<d0) {d0=d; i0=i;}
35  }
36  eX0=eX[i0];
37  eY0=eY[i0];
38  Log(2,"EdbAttachPath::SetStartingPosition","%f %f",eX0,eY0);
39 }
bool Log(int level, const char *location, const char *fmt,...)
Definition: EdbLog.cxx:75

◆ SetStartingPosition() [2/2]

void EdbAttachPath::SetStartingPosition ( const int  i)
inline
32 {eX0=eX[i]; eY0=eY[i];}

◆ Xmax()

float EdbAttachPath::Xmax ( )
inline
50 {return GetMax( eX ); }
float GetMax(TArrayF &a)
Definition: EdbAttachPath.cxx:51

◆ Xmin()

float EdbAttachPath::Xmin ( )
inline
49 {return GetMin( eX ); }
float GetMin(TArrayF &a)
Definition: EdbAttachPath.cxx:42

◆ Ymax()

float EdbAttachPath::Ymax ( )
inline
52 {return GetMax( eY ); }

◆ Ymin()

float EdbAttachPath::Ymin ( )
inline
51 {return GetMin( eY ); }

Member Data Documentation

◆ eDist

TArrayF EdbAttachPath::eDist
private

◆ eID

TArrayI EdbAttachPath::eID
private

◆ eInd

TArrayI EdbAttachPath::eInd
private

◆ eN

Int_t EdbAttachPath::eN
private

◆ eN0

Int_t EdbAttachPath::eN0
private

◆ eOK

TArrayI EdbAttachPath::eOK
private

◆ eR

Float_t EdbAttachPath::eR
private

◆ eX

TArrayF EdbAttachPath::eX
private

◆ eX0

Float_t EdbAttachPath::eX0
private

◆ eY

TArrayF EdbAttachPath::eY
private

◆ eY0

Float_t EdbAttachPath::eY0
private

The documentation for this class was generated from the following files: