CMS 3D CMS Logo

Public Member Functions | Private Attributes

Trapezoid2RectangleMappingX Class Reference

#include <Trapezoid2RectangleMappingX.h>

List of all members.

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 (double x0, double y0, double bovera, double h)
 normal trapezoid case, a != b
 Trapezoid2RectangleMappingX (double x0, double y0, double k)
 special parallelogram case, a == b. The meaning of k changes.
 Trapezoid2RectangleMappingX ()

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.

{}
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.

                                                                              :
    x0_(x0), y0_(y0), parallel_(false)
  {
    k_ = 2/h * (bovera-1.) / (bovera+1.);

#ifdef DEBUG_GRID_TRM
    std::cout << "Trapezoid2RectangleMappingX constructed with x0,y0 " << x0 << " " << y0 
         << " b/a= " << bovera << " h= " << h << std::endl;
#endif
  }
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.

                                                               :
    x0_(x0), y0_(y0), k_(k), parallel_(true)
  {
#ifdef DEBUG_GRID_TRM
    std::cout << "Trapezoid2RectangleMappingX constructed with x0,y0 " << x0 << " " << y0 
         << " k= " << k << std::endl;
#endif
  }

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 TrapezoidalCartesianMFGrid::toGridFrame(), TrapezoidalCylindricalMFGrid::toGridFrame(), TrapezoidalCartesianMFGrid::TrapezoidalCartesianMFGrid(), TrapezoidalCylindricalMFGrid::TrapezoidalCylindricalMFGrid(), and TrapezoidalCartesianMFGrid::uncheckedValueInTesla().

                                                    {

    yrec = ytrap - y0_;
    if (!parallel_) xrec = (xtrap - x0_) / (1.+ yrec*k_);
    else            xrec = xtrap - x0_ + k_*yrec;

#ifdef DEBUG_GRID
    std::cout << xtrap << " " << ytrap << " transformed to rectangle " << xrec << " " << yrec << std::endl;
#endif
  }
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 TrapezoidalCartesianMFGrid::fromGridFrame(), and TrapezoidalCylindricalMFGrid::fromGridFrame().

                                                      {
    if (!parallel_) xtrap = x0_ + xrec * (1.+ yrec*k_);
    else            xtrap = x0_ + xrec - k_*yrec;
    ytrap = y0_ + yrec;

#ifdef DEBUG_GRID
    std::cout << xrec << " " << yrec << " transformed to trapezoid " << xtrap << " " << ytrap << std::endl;
#endif
  }

Member Data Documentation

Definition at line 77 of file Trapezoid2RectangleMappingX.h.

Definition at line 78 of file Trapezoid2RectangleMappingX.h.

Definition at line 75 of file Trapezoid2RectangleMappingX.h.

Definition at line 76 of file Trapezoid2RectangleMappingX.h.