CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
CocoaMaterialElementary Class Reference

#include <CocoaMaterialElementary.h>

Public Member Functions

 CocoaMaterialElementary (ALIstring name, float density, ALIstring symbol, float A, ALIint Z)
 
float getA () const
 
float getDensity () const
 
ALIstring getName () const
 
ALIstring getSymbol () const
 
ALIint getZ () const
 
ALIbool operator== (const CocoaMaterialElementary &mate) const
 
 ~CocoaMaterialElementary ()
 

Private Attributes

float theA
 
float theDensity
 
ALIstring theName
 
ALIstring theSymbol
 
ALIint theZ
 

Detailed Description

Definition at line 16 of file CocoaMaterialElementary.h.

Constructor & Destructor Documentation

CocoaMaterialElementary::CocoaMaterialElementary ( ALIstring  name,
float  density,
ALIstring  symbol,
float  A,
ALIint  Z 
)

Definition at line 14 of file CocoaMaterialElementary.cc.

CocoaMaterialElementary::~CocoaMaterialElementary ( )
inline

Definition at line 22 of file CocoaMaterialElementary.h.

22 { };

Member Function Documentation

float CocoaMaterialElementary::getA ( ) const
inline

Definition at line 30 of file CocoaMaterialElementary.h.

References theA.

Referenced by operator==().

30  {
31  return theA; }
float CocoaMaterialElementary::getDensity ( ) const
inline

Definition at line 26 of file CocoaMaterialElementary.h.

References theDensity.

Referenced by operator==().

26  {
27  return theDensity; }
ALIstring CocoaMaterialElementary::getName ( ) const
inline

Definition at line 24 of file CocoaMaterialElementary.h.

References theName.

24  {
25  return theName; }
ALIstring CocoaMaterialElementary::getSymbol ( ) const
inline

Definition at line 28 of file CocoaMaterialElementary.h.

References theSymbol.

Referenced by operator==().

28  {
29  return theSymbol; }
ALIint CocoaMaterialElementary::getZ ( ) const
inline

Definition at line 32 of file CocoaMaterialElementary.h.

References theZ.

Referenced by operator==().

32  {
33  return theZ; }
ALIbool CocoaMaterialElementary::operator== ( const CocoaMaterialElementary mate) const

Definition at line 24 of file CocoaMaterialElementary.cc.

References funct::abs(), getA(), getDensity(), getSymbol(), getZ(), theA, theDensity, theSymbol, and theZ.

25 {
26  // GM: Using numeric_limits<float>::epsilon() might be better instead of a
27  // magic number 'kTolerance'. Not changing this to not break code
28  // potentially relying on this number.
29  const float kTolerance = 1.E-9;
30  return ( std::abs(mate.getDensity() - theDensity) < kTolerance
31  && mate.getSymbol() == theSymbol
32  && std::abs(mate.getA() - theA) < kTolerance
33  && mate.getZ() == theZ );
34 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

Member Data Documentation

float CocoaMaterialElementary::theA
private

Definition at line 42 of file CocoaMaterialElementary.h.

Referenced by getA(), and operator==().

float CocoaMaterialElementary::theDensity
private

Definition at line 40 of file CocoaMaterialElementary.h.

Referenced by getDensity(), and operator==().

ALIstring CocoaMaterialElementary::theName
private

Definition at line 39 of file CocoaMaterialElementary.h.

Referenced by getName().

ALIstring CocoaMaterialElementary::theSymbol
private

Definition at line 41 of file CocoaMaterialElementary.h.

Referenced by getSymbol(), and operator==().

ALIint CocoaMaterialElementary::theZ
private

Definition at line 43 of file CocoaMaterialElementary.h.

Referenced by getZ(), and operator==().