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:
2010/10/22 18:24:02
Revision:
1.5
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.

{}
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, and k_.

                                                                              :
    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 40 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 49 of file Trapezoid2RectangleMappingX.h.

References gather_cfg::cout, k_, parallel_, x0_, and y0_.

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 61 of file Trapezoid2RectangleMappingX.h.

References gather_cfg::cout, k_, parallel_, x0_, and y0_.

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 75 of file Trapezoid2RectangleMappingX.h.

Referenced by rectangle(), trapezoid(), and Trapezoid2RectangleMappingX().

Definition at line 76 of file Trapezoid2RectangleMappingX.h.

Referenced by rectangle(), and trapezoid().

Definition at line 73 of file Trapezoid2RectangleMappingX.h.

Referenced by rectangle(), and trapezoid().

Definition at line 74 of file Trapezoid2RectangleMappingX.h.

Referenced by rectangle(), and trapezoid().