GeoModel - GeoModelCore
GeoElement.h
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef GEOMODELKERNEL_GEOELEMENT_H
6 #define GEOMODELKERNEL_GEOELEMENT_H
7 
16 #include "GeoModelKernel/RCBase.h"
17 #include "GeoModelKernel/Units.h"
18 #include <string>
19 
20 class GeoElement : public RCBase
21 {
22  public:
23  GeoElement (const std::string &Name, const std::string &Symbol, double Z, double A);
24 
25  int operator==(const GeoElement &right) const;
26  int operator!=(const GeoElement &right) const;
27 
28  // Returns the effective number of nucleons in the element.
29  double getN () const;
30 
31  // The name of the element, e.g. "Carbon".
32  const std::string& getName () const;
33 
34  // The chemical symbol for the element, e.g. C, O, S, Na....
35  const std::string& getSymbol () const;
36 
37  // The atomic number Z for the material.
38  const double& getZ () const;
39 
40  // The average atomic mass for the element.
41  const double& getA () const;
42 
43  // Tsai formula for the radiation length
44  double getRadTsai () const;
45 
46  protected:
47  virtual ~GeoElement();
48 
49  private:
50  GeoElement(const GeoElement &right);
51  GeoElement & operator=(const GeoElement &right);
52 
53  std::string m_name;
54  std::string m_symbol;
55 
56  double m_z;
57  double m_a;
58 };
59 
60 inline int GeoElement::operator==(const GeoElement &right) const
61 {
62  return
63  m_name ==
64  right.m_name && m_symbol == right.m_symbol && m_z == right.m_z && m_a == right.m_a;
65 }
66 
67 inline int GeoElement::operator!=(const GeoElement &right) const
68 {
69  return m_name != right.m_name ||
70  m_symbol != right.m_symbol || m_z != right.m_z || m_a != right.m_a;
71 }
72 
73 inline double GeoElement::getN () const
74 {
75  return m_a * (GeoModelKernelUnits::mole / GeoModelKernelUnits::gram);
76 }
77 
78 inline const std::string& GeoElement::getName () const
79 {
80  return m_name;
81 }
82 
83 inline const std::string& GeoElement::getSymbol () const
84 {
85  return m_symbol;
86 }
87 
88 inline const double& GeoElement::getZ () const
89 {
90  return m_z;
91 }
92 
93 inline const double& GeoElement::getA () const
94 {
95  return m_a;
96 }
97 
98 #endif
This class represents chemical elements. Elements are allocated on the heap and deleted automatically...
Definition: GeoElement.h:20
This is a base class for objects whose memory is managed through reference counting. Reference-counted objects can only be created using operator new, the cannot be created on the stack.
Definition: RCBase.h:24