ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
JetGeom::line_t Class Reference

#include <cyl_geom.h>

Collaboration diagram for JetGeom::line_t:

Public Member Functions

 line_t (float cx, float cy, float cc, bool to_r)
 constructor by giving the coeff of equation of the line ( More...
 
 line_t (point_t p1, point_t p2)
 Constructor by giving 2 points. More...
 
bool is_above (point_t &p)
 
bool is_below (point_t &p)
 
bool is_left (point_t &p)
 
bool is_right (point_t &p)
 
void phi_shift (float dphi)
 
point_t intercept_y (float y)
 
point_t intercept_x (float x)
 

Public Attributes

float m_cx
 
float m_cy
 
float m_cc
 
bool m_oriented_r
 

Detailed Description

oriented segment/line in a simplistic way

Definition at line 37 of file cyl_geom.h.

Constructor & Destructor Documentation

◆ line_t() [1/2]

JetGeom::line_t::line_t ( float  cx,
float  cy,
float  cc,
bool  to_r 
)
inline

constructor by giving the coeff of equation of the line (

Parameters
cxx +
cyy +
cc= 0). If
to_ris true the line is oriented toward positive x

Definition at line 43 of file cyl_geom.h.

43 : m_cx(cx),m_cy(cy),m_cc(cc), m_oriented_r(to_r) {};

◆ line_t() [2/2]

JetGeom::line_t::line_t ( point_t  p1,
point_t  p2 
)
inline

Constructor by giving 2 points.

This also sets orientation

Definition at line 287 of file cyl_geom.h.

287  {
288  m_cy = p1.first - p2.first;
289  m_cx = p2.second - p1.second;
290  m_cc = -(m_cx*p1.first+m_cy*p1.second);
291  m_oriented_r = (p1.first < p2.first);
292 }

Member Function Documentation

◆ intercept_x()

point_t JetGeom::line_t::intercept_x ( float  x)
inline

Definition at line 307 of file cyl_geom.h.

307  {
308  if(m_cy==0) return point_t(x,-99999);
309  return point_t( x, (-m_cc - m_cx*x)/m_cy );
310 }

◆ intercept_y()

point_t JetGeom::line_t::intercept_y ( float  y)
inline

Definition at line 302 of file cyl_geom.h.

302  {
303  if(m_cx==0) return point_t(-99999,y);
304  return point_t( (-m_cc - m_cy*y)/m_cx , y);
305 }

◆ is_above()

bool JetGeom::line_t::is_above ( point_t p)
inline

Definition at line 294 of file cyl_geom.h.

294  {
295  return ( (m_cy!=0) && ( p.second >= - (m_cx*p.first+m_cc)/m_cy) );
296 }

◆ is_below()

bool JetGeom::line_t::is_below ( point_t p)
inline

Definition at line 298 of file cyl_geom.h.

298  {
299  return ( (m_cy!=0) && ( p.second <= - (m_cx*p.first+m_cc)/m_cy) ) ;
300 }

◆ is_left()

bool JetGeom::line_t::is_left ( point_t p)
inline

Definition at line 54 of file cyl_geom.h.

54 {return m_oriented_r ? is_above(p) : is_below(p);};

◆ is_right()

bool JetGeom::line_t::is_right ( point_t p)
inline

Definition at line 55 of file cyl_geom.h.

55 {return m_oriented_r ? is_below(p) : is_above(p);};

◆ phi_shift()

void JetGeom::line_t::phi_shift ( float  dphi)
inline

Definition at line 57 of file cyl_geom.h.

57 {m_cc = m_cc - m_cy*dphi;}

Member Data Documentation

◆ m_cc

float JetGeom::line_t::m_cc

Definition at line 47 of file cyl_geom.h.

◆ m_cx

float JetGeom::line_t::m_cx

Definition at line 47 of file cyl_geom.h.

◆ m_cy

float JetGeom::line_t::m_cy

Definition at line 47 of file cyl_geom.h.

◆ m_oriented_r

bool JetGeom::line_t::m_oriented_r

Definition at line 48 of file cyl_geom.h.


The documentation for this class was generated from the following file:
JetGeom::line_t::m_oriented_r
bool m_oriented_r
Definition: cyl_geom.h:48
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
JetGeom::line_t::is_above
bool is_above(point_t &p)
Definition: cyl_geom.h:294
x
#define x
PlotCalibFromCool.cx
cx
Definition: PlotCalibFromCool.py:666
JetGeom::line_t::m_cx
float m_cx
Definition: cyl_geom.h:47
JetGeom::line_t::m_cy
float m_cy
Definition: cyl_geom.h:47
JetGeom::line_t::is_below
bool is_below(point_t &p)
Definition: cyl_geom.h:298
y
#define y
PlotCalibFromCool.cy
cy
Definition: PlotCalibFromCool.py:667
JetGeom::line_t::m_cc
float m_cc
Definition: cyl_geom.h:47
python.handimod.cc
int cc
Definition: handimod.py:523