CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CocoaMaterialElementary.cc
Go to the documentation of this file.
1 // COCOA class implementation file
2 // Id: CocoaMaterialElementary.cc
3 // CAT: Model
4 //
5 // History: v1.0
6 // Pedro Arce
7 #include <cmath> // include floating-point std::abs functions
8 #include <fstream>
9 #include <map>
10 
12 
14  : theName(name), theDensity(density), theSymbol(symbol), theA(A), theZ(Z) {}
15 
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 }
T theZ
int ALIint
Definition: CocoaGlobals.h:15
CocoaMaterialElementary(ALIstring name, float density, ALIstring symbol, float A, ALIint Z)
bool ALIbool
Definition: CocoaGlobals.h:19
ALIbool operator==(const CocoaMaterialElementary &mate) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::string ALIstring
Definition: CocoaGlobals.h:9
Definition: APVGainStruct.h:7