CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
Trapezoid2RectangleMappingX Class Reference

#include <Trapezoid2RectangleMappingX.h>

Public Member Functions

void rectangle (double xtrap, double ytrap, double &xrec, double &yrec) const
 
void trapezoid (double xrec, double yrec, double &xtrap, double &ytrap) const
 
 Trapezoid2RectangleMappingX ()
 
 Trapezoid2RectangleMappingX (double x0, double y0, double bovera, double h)
 normal trapezoid case, a != b More...
 
 Trapezoid2RectangleMappingX (double x0, double y0, double k)
 special parallelogram case, a == b. The meaning of k changes. More...
 

Private Attributes

double k_
 
bool parallel_
 
double x0_
 
double y0_
 

Detailed Description

Maps a trapezoidal coordinate system into a cartesian one. It is assumed that x is the coordinate along the trapezoid bases while y is along the trapezoid height.

Date:
2011/04/16 12:47:37
Revision:
1.6
Author
T. Todorov

Definition at line 24 of file Trapezoid2RectangleMappingX.h.

Constructor & Destructor Documentation

Trapezoid2RectangleMappingX::Trapezoid2RectangleMappingX ( )
inline

Definition at line 27 of file Trapezoid2RectangleMappingX.h.

27 {}
Trapezoid2RectangleMappingX::Trapezoid2RectangleMappingX ( double  x0,
double  y0,
double  bovera,
double  h 
)
inline

normal trapezoid case, a != b

Definition at line 30 of file Trapezoid2RectangleMappingX.h.

References gather_cfg::cout.

30  :
31  x0_(x0), y0_(y0), parallel_(false)
32  {
33  k_ = 2/h * (bovera-1.) / (bovera+1.);
34 
35 #ifdef DEBUG_GRID_TRM
36  std::cout << "Trapezoid2RectangleMappingX constructed with x0,y0 " << x0 << " " << y0
37  << " b/a= " << bovera << " h= " << h << std::endl;
38 #endif
39  }
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
tuple cout
Definition: gather_cfg.py:121
Trapezoid2RectangleMappingX::Trapezoid2RectangleMappingX ( double  x0,
double  y0,
double  k 
)
inline

special parallelogram case, a == b. The meaning of k changes.

Definition at line 42 of file Trapezoid2RectangleMappingX.h.

References gather_cfg::cout.

42  :
43  x0_(x0), y0_(y0), k_(k), parallel_(true)
44  {
45 #ifdef DEBUG_GRID_TRM
46  std::cout << "Trapezoid2RectangleMappingX constructed with x0,y0 " << x0 << " " << y0
47  << " k= " << k << std::endl;
48 #endif
49  }
int k[5][pyjets_maxn]
tuple cout
Definition: gather_cfg.py:121

Member Function Documentation

void Trapezoid2RectangleMappingX::rectangle ( double  xtrap,
double  ytrap,
double &  xrec,
double &  yrec 
) const
inline

Definition at line 51 of file Trapezoid2RectangleMappingX.h.

References gather_cfg::cout.

Referenced by TrapezoidalCylindricalMFGrid::toGridFrame(), TrapezoidalCartesianMFGrid::toGridFrame(), TrapezoidalCartesianMFGrid::TrapezoidalCartesianMFGrid(), TrapezoidalCylindricalMFGrid::TrapezoidalCylindricalMFGrid(), and TrapezoidalCartesianMFGrid::uncheckedValueInTesla().

52  {
53 
54  yrec = ytrap - y0_;
55  if (!parallel_) xrec = (xtrap - x0_) / (1.+ yrec*k_);
56  else xrec = xtrap - x0_ + k_*yrec;
57 
58 #ifdef DEBUG_GRID
59  std::cout << xtrap << " " << ytrap << " transformed to rectangle " << xrec << " " << yrec << std::endl;
60 #endif
61  }
tuple cout
Definition: gather_cfg.py:121
void Trapezoid2RectangleMappingX::trapezoid ( double  xrec,
double  yrec,
double &  xtrap,
double &  ytrap 
) const
inline

Definition at line 63 of file Trapezoid2RectangleMappingX.h.

References gather_cfg::cout.

Referenced by TrapezoidalCylindricalMFGrid::fromGridFrame(), and TrapezoidalCartesianMFGrid::fromGridFrame().

64  {
65  if (!parallel_) xtrap = x0_ + xrec * (1.+ yrec*k_);
66  else xtrap = x0_ + xrec - k_*yrec;
67  ytrap = y0_ + yrec;
68 
69 #ifdef DEBUG_GRID
70  std::cout << xrec << " " << yrec << " transformed to trapezoid " << xtrap << " " << ytrap << std::endl;
71 #endif
72  }
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

double Trapezoid2RectangleMappingX::k_
private

Definition at line 77 of file Trapezoid2RectangleMappingX.h.

bool Trapezoid2RectangleMappingX::parallel_
private

Definition at line 78 of file Trapezoid2RectangleMappingX.h.

double Trapezoid2RectangleMappingX::x0_
private

Definition at line 75 of file Trapezoid2RectangleMappingX.h.

double Trapezoid2RectangleMappingX::y0_
private

Definition at line 76 of file Trapezoid2RectangleMappingX.h.