CMS 3D CMS Logo

Public Member Functions | Private Attributes

MaterialAccountingGroup::BoundingBox Class Reference

List of all members.

Public Member Functions

 BoundingBox (double min_r, double max_r, double min_z, double max_z)
 BoundingBox ()
void grow (double skin)
void grow (double r, double z)
bool inside (double r, double z) const
std::pair< double, double > range_r () const
std::pair< double, double > range_z () const

Private Attributes

double r_max
double r_min
double z_max
double z_min

Detailed Description

Definition at line 22 of file MaterialAccountingGroup.h.


Constructor & Destructor Documentation

MaterialAccountingGroup::BoundingBox::BoundingBox ( double  min_r,
double  max_r,
double  min_z,
double  max_z 
) [inline]

Definition at line 25 of file MaterialAccountingGroup.h.

                                                                        :
      r_min(min_r),
      r_max(max_r),
      z_min(min_z),
      z_max(max_z)
    { }
MaterialAccountingGroup::BoundingBox::BoundingBox ( ) [inline]

Definition at line 32 of file MaterialAccountingGroup.h.

                  :
      r_min(0.),
      r_max(0.),
      z_min(0.),
      z_max(0.)
    { }

Member Function Documentation

void MaterialAccountingGroup::BoundingBox::grow ( double  r,
double  z 
) [inline]

Definition at line 39 of file MaterialAccountingGroup.h.

References alignCSCRings::r, r_max, r_min, z, z_max, and z_min.

Referenced by MaterialAccountingGroup::MaterialAccountingGroup().

                                  {
      if (r < r_min) r_min = r;
      if (r > r_max) r_max = r;
      if (z < z_min) z_min = z;
      if (z > z_max) z_max = z;
    }
void MaterialAccountingGroup::BoundingBox::grow ( double  skin) [inline]

Definition at line 46 of file MaterialAccountingGroup.h.

References r_max, r_min, z_max, and z_min.

                           {
      r_min -= skin;    // yes, we allow r_min to go negative
      r_max += skin;
      z_min -= skin;
      z_max += skin;
    }
bool MaterialAccountingGroup::BoundingBox::inside ( double  r,
double  z 
) const [inline]

Definition at line 53 of file MaterialAccountingGroup.h.

References r_min, z_max, and z_min.

Referenced by MaterialAccountingGroup::inside().

                                          {
      return (r >= r_min and r <= r_max and z >= z_min and z <= z_max);
    }
std::pair<double, double> MaterialAccountingGroup::BoundingBox::range_r ( ) const [inline]

Definition at line 57 of file MaterialAccountingGroup.h.

References r_max, and r_min.

Referenced by MaterialAccountingGroup::info().

                                            {
      return std::make_pair(r_min, r_max);
    }
std::pair<double, double> MaterialAccountingGroup::BoundingBox::range_z ( ) const [inline]

Definition at line 61 of file MaterialAccountingGroup.h.

References z_max, and z_min.

Referenced by MaterialAccountingGroup::info().

                                            {
      return std::make_pair(z_min, z_max);
    }

Member Data Documentation

Definition at line 67 of file MaterialAccountingGroup.h.

Referenced by grow(), and range_r().

Definition at line 66 of file MaterialAccountingGroup.h.

Referenced by grow(), inside(), and range_r().

Definition at line 69 of file MaterialAccountingGroup.h.

Referenced by grow(), inside(), and range_z().

Definition at line 68 of file MaterialAccountingGroup.h.

Referenced by grow(), inside(), and range_z().