CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
MaterialAccountingGroup::BoundingBox Class Reference

Public Member Functions

 BoundingBox ()
 
 BoundingBox (double min_r, double max_r, double min_z, double max_z)
 
void grow (double r, double z)
 
void grow (double skin)
 
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

◆ BoundingBox() [1/2]

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

Definition at line 24 of file MaterialAccountingGroup.h.

25  : r_min(min_r), r_max(max_r), z_min(min_z), z_max(max_z) {}

◆ BoundingBox() [2/2]

MaterialAccountingGroup::BoundingBox::BoundingBox ( )
inline

Definition at line 27 of file MaterialAccountingGroup.h.

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

Member Function Documentation

◆ grow() [1/2]

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

Definition at line 29 of file MaterialAccountingGroup.h.

29  {
30  if (r < r_min)
31  r_min = r;
32  if (r > r_max)
33  r_max = r;
34  if (z < z_min)
35  z_min = z;
36  if (z > z_max)
37  z_max = z;
38  }

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

Referenced by MaterialAccountingGroup::MaterialAccountingGroup().

◆ grow() [2/2]

void MaterialAccountingGroup::BoundingBox::grow ( double  skin)
inline

Definition at line 40 of file MaterialAccountingGroup.h.

40  {
41  r_min -= skin; // yes, we allow r_min to go negative
42  r_max += skin;
43  z_min -= skin;
44  z_max += skin;
45  }

References r_max, r_min, z_max, and z_min.

◆ inside()

bool MaterialAccountingGroup::BoundingBox::inside ( double  r,
double  z 
) const
inline

Definition at line 47 of file MaterialAccountingGroup.h.

47 { return (r >= r_min and r <= r_max and z >= z_min and z <= z_max); }

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

Referenced by MaterialAccountingGroup::inside().

◆ range_r()

std::pair<double, double> MaterialAccountingGroup::BoundingBox::range_r ( ) const
inline

◆ range_z()

std::pair<double, double> MaterialAccountingGroup::BoundingBox::range_z ( ) const
inline

Member Data Documentation

◆ r_max

double MaterialAccountingGroup::BoundingBox::r_max
private

Definition at line 55 of file MaterialAccountingGroup.h.

Referenced by grow(), and range_r().

◆ r_min

double MaterialAccountingGroup::BoundingBox::r_min
private

Definition at line 54 of file MaterialAccountingGroup.h.

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

◆ z_max

double MaterialAccountingGroup::BoundingBox::z_max
private

Definition at line 57 of file MaterialAccountingGroup.h.

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

◆ z_min

double MaterialAccountingGroup::BoundingBox::z_min
private

Definition at line 56 of file MaterialAccountingGroup.h.

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

MaterialAccountingGroup::BoundingBox::z_max
double z_max
Definition: MaterialAccountingGroup.h:57
MaterialAccountingGroup::BoundingBox::r_max
double r_max
Definition: MaterialAccountingGroup.h:55
MaterialAccountingGroup::BoundingBox::r_min
double r_min
Definition: MaterialAccountingGroup.h:54
DDAxes::z
MaterialAccountingGroup::BoundingBox::z_min
double z_min
Definition: MaterialAccountingGroup.h:56
alignCSCRings.r
r
Definition: alignCSCRings.py:93