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::CocoaMaterialElementary ( ALIstring  name,
float  density,
ALIstring  symbol,
float  A,
ALIint  Z 
)

◆ ~CocoaMaterialElementary()

CocoaMaterialElementary::~CocoaMaterialElementary ( )
inline

Definition at line 20 of file CocoaMaterialElementary.h.

20 {}

Member Function Documentation

◆ getA()

float CocoaMaterialElementary::getA ( ) const
inline

Definition at line 25 of file CocoaMaterialElementary.h.

References theA.

Referenced by operator==().

◆ getDensity()

float CocoaMaterialElementary::getDensity ( ) const
inline

Definition at line 23 of file CocoaMaterialElementary.h.

References theDensity.

Referenced by operator==().

◆ getName()

ALIstring CocoaMaterialElementary::getName ( ) const
inline

Definition at line 22 of file CocoaMaterialElementary.h.

References theName.

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

22 { return theName; }

◆ getSymbol()

ALIstring CocoaMaterialElementary::getSymbol ( ) const
inline

Definition at line 24 of file CocoaMaterialElementary.h.

References theSymbol.

Referenced by operator==().

24 { return theSymbol; }

◆ getZ()

ALIint CocoaMaterialElementary::getZ ( ) const
inline

Definition at line 26 of file CocoaMaterialElementary.h.

References theZ.

Referenced by operator==().

26 { return theZ; }

◆ operator==()

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.

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

◆ theA

float CocoaMaterialElementary::theA
private

Definition at line 34 of file CocoaMaterialElementary.h.

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

◆ theDensity

float CocoaMaterialElementary::theDensity
private

Definition at line 32 of file CocoaMaterialElementary.h.

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

◆ theName

ALIstring CocoaMaterialElementary::theName
private

Definition at line 31 of file CocoaMaterialElementary.h.

Referenced by getName().

◆ theSymbol

ALIstring CocoaMaterialElementary::theSymbol
private

Definition at line 33 of file CocoaMaterialElementary.h.

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

◆ theZ

ALIint CocoaMaterialElementary::theZ
private

Definition at line 35 of file CocoaMaterialElementary.h.

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