GeoModel - GeoModelCore
GeoMaterial.h
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef GEOMODELKERNEL_GEOMATERIAL_H
6 #define GEOMODELKERNEL_GEOMATERIAL_H
7 
29 #include "GeoModelKernel/RCBase.h"
30 #include "GeoModelKernel/GeoElement.h"
31 #include <vector>
32 
33 class GeoMaterial : public RCBase
34 {
35  public:
36  GeoMaterial (const std::string &Name, double Density);
37 
38  // Add an element to the material.
39  void add (const GeoElement* element, double fraction = 1.0);
40 
41  // Add another material to the material (this copies all of
42  // the element from the other material into this one).
43  // Fraction is by mass.
44  void add (const GeoMaterial* material, double fraction);
45 
46  // Lock the material against the addition of other
47  // materials or elements.
48  void lock ();
49 
50  // Constant dEdx term.
51  double getDeDxConstant () const;
52 
53  // I0 term (ionization potential). From tables. Units: eV.
54  double getDeDxI0 () const;
55 
56  // Get dEdx_min. dEdxConstant*11.528 Paul Avery, CBX-92-39.
57  double getDeDxMin () const;
58 
59  // Returns the radiation length, computed from the density
60  // and the list of constituents, and their properties.
61  double getRadLength () const;
62 
63  // Return the nuclear interaction length, computed from the
64  // density, the list of constituents, and their properties.
65  double getIntLength () const;
66 
67  unsigned int getNumElements () const;
68 
69  // Gets the ith element.
70  const GeoElement* getElement (unsigned int i) const;
71 
72  // Gets the fraction by weight of the ith element
73  double getFraction (int i) const;
74 
75  // The name of the material.
76  const std::string& getName () const;
77 
78  // The density of the material.
79  const double& getDensity () const;
80 
81  // Gives an integral identifier for the material. For
82  // convenience.
83  const unsigned int& getID () const;
84 
85  protected:
86  virtual ~GeoMaterial();
87 
88  private:
89  GeoMaterial(const GeoMaterial &right);
90  GeoMaterial & operator=(const GeoMaterial &right);
91 
92  std::string m_name;
93  double m_density;
94  unsigned int m_iD;
95 
96  // A list of the fractional composition of each material.
97  // Fraction is by mass.
98  std::vector<double> m_fraction;
99 
100  // The radiation length of the material.
101  double m_radLength;
102 
103  // The interaction length of the material.
104  double m_intLength;
105 
106  // A static used to assign unique identifiers to new
107  // materials.
108  static unsigned int s_lastID;
109 
110  // The constant term in the formula governing dE/dx.
111  double m_dedDxConst;
112 
113  // The ionization potential in the formula governing dE/dx.
114  double m_deDxI0;
115 
116  // A flag used to lock the material from further addition
117  // of elements or other constituents.
118  bool m_locked;
119 
120  static const double s_ionizationPotential[93];
121 
122  private:
123  // The list of GeoElements composing a GeoMaterial.
124  std::vector<const GeoElement *> m_element;
125 };
126 
127 inline const std::string& GeoMaterial::getName () const
128 {
129  return m_name;
130 }
131 
132 inline const double& GeoMaterial::getDensity () const
133 {
134  return m_density;
135 }
136 
137 inline const unsigned int& GeoMaterial::getID () const
138 {
139  return m_iD;
140 }
141 
142 #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
This class represents materials. A material is a collection of elements. In addition it has a density...
Definition: GeoMaterial.h:33