CMS 3D CMS Logo

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 
)
CocoaMaterialElementary::~CocoaMaterialElementary ( )
inline

Definition at line 20 of file CocoaMaterialElementary.h.

20 {};

Member Function Documentation

float CocoaMaterialElementary::getA ( ) const
inline

Definition at line 25 of file CocoaMaterialElementary.h.

References theA.

Referenced by CocoaToDDLMgr::ma(), and operator==().

float CocoaMaterialElementary::getDensity ( ) const
inline

Definition at line 23 of file CocoaMaterialElementary.h.

References theDensity.

Referenced by CocoaToDDLMgr::ma(), and operator==().

ALIstring CocoaMaterialElementary::getName ( ) const
inline

Definition at line 22 of file CocoaMaterialElementary.h.

References theName.

Referenced by plotting.Plot::draw(), CocoaToDDLMgr::lv(), and CocoaToDDLMgr::ma().

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

Definition at line 24 of file CocoaMaterialElementary.h.

References theSymbol.

Referenced by CocoaToDDLMgr::ma(), and operator==().

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

Definition at line 26 of file CocoaMaterialElementary.h.

References operator==(), and theZ.

Referenced by CocoaToDDLMgr::ma(), and operator==().

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

Definition at line 16 of file CocoaMaterialElementary.cc.

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

Referenced by getZ().

16  {
17  // GM: Using numeric_limits<float>::epsilon() might be better instead of a
18  // magic number 'kTolerance'. Not changing this to not break code
19  // potentially relying on this number.
20  const float kTolerance = 1.E-9;
21  return (std::abs(mate.getDensity() - theDensity) < kTolerance && mate.getSymbol() == theSymbol &&
22  std::abs(mate.getA() - theA) < kTolerance && mate.getZ() == theZ);
23 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

Member Data Documentation

float CocoaMaterialElementary::theA
private

Definition at line 34 of file CocoaMaterialElementary.h.

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

float CocoaMaterialElementary::theDensity
private

Definition at line 32 of file CocoaMaterialElementary.h.

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

ALIstring CocoaMaterialElementary::theName
private
ALIstring CocoaMaterialElementary::theSymbol
private

Definition at line 33 of file CocoaMaterialElementary.h.

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

ALIint CocoaMaterialElementary::theZ
private

Definition at line 35 of file CocoaMaterialElementary.h.

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