CMS 3D CMS Logo

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.

Author
T. Todorov

Definition at line 22 of file Trapezoid2RectangleMappingX.h.

Constructor & Destructor Documentation

Trapezoid2RectangleMappingX::Trapezoid2RectangleMappingX ( )
inline

Definition at line 25 of file Trapezoid2RectangleMappingX.h.

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

normal trapezoid case, a != b

Definition at line 28 of file Trapezoid2RectangleMappingX.h.

References gather_cfg::cout.

28  :
29  x0_(x0), y0_(y0), parallel_(false)
30  {
31  k_ = 2/h * (bovera-1.) / (bovera+1.);
32 
33 #ifdef DEBUG_GRID_TRM
34  std::cout << "Trapezoid2RectangleMappingX constructed with x0,y0 " << x0 << " " << y0
35  << " b/a= " << bovera << " h= " << h << std::endl;
36 #endif
37  }
Trapezoid2RectangleMappingX::Trapezoid2RectangleMappingX ( double  x0,
double  y0,
double  k 
)
inline

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

Definition at line 40 of file Trapezoid2RectangleMappingX.h.

References gather_cfg::cout.

40  :
41  x0_(x0), y0_(y0), k_(k), parallel_(true)
42  {
43 #ifdef DEBUG_GRID_TRM
44  std::cout << "Trapezoid2RectangleMappingX constructed with x0,y0 " << x0 << " " << y0
45  << " k= " << k << std::endl;
46 #endif
47  }
int k[5][pyjets_maxn]

Member Function Documentation

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

Definition at line 49 of file Trapezoid2RectangleMappingX.h.

References gather_cfg::cout.

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

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

Definition at line 61 of file Trapezoid2RectangleMappingX.h.

References gather_cfg::cout.

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

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

Member Data Documentation

double Trapezoid2RectangleMappingX::k_
private

Definition at line 75 of file Trapezoid2RectangleMappingX.h.

bool Trapezoid2RectangleMappingX::parallel_
private

Definition at line 76 of file Trapezoid2RectangleMappingX.h.

double Trapezoid2RectangleMappingX::x0_
private

Definition at line 73 of file Trapezoid2RectangleMappingX.h.

double Trapezoid2RectangleMappingX::y0_
private

Definition at line 74 of file Trapezoid2RectangleMappingX.h.