CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Material.h
Go to the documentation of this file.
1 #ifndef DDI_Material_h
2 #define DDI_Material_h
3 
4 #include <iostream>
5 #include <vector>
6 #include <utility>
8 
9 namespace DDI {
10 
11  class Material {
12  public:
13  Material() {}
14  Material(double z, double a, double d) : z_(z), a_(a), density_(d) {}
15 
16  Material(double d) : z_(0), a_(0), density_(d) {}
17  virtual ~Material() {}
18  int noOfConsituents() const;
19 
20  double a() const { return a_; }
21  double z() const { return z_; }
22  double density() const { return density_; }
23 
24  double& a() { return a_; }
25  double& z() { return z_; }
26  double& density() { return density_; }
27 
28  int addMaterial(const DDMaterial& m, double fm) {
29  composites_.emplace_back(std::make_pair(m, fm));
30  return noOfConstituents();
31  }
32 
34 
36 
37  int noOfConstituents() const { return composites_.size(); }
38 
39  protected:
40  double z_, a_, density_;
42  };
43 
44 } // namespace DDI
45 #endif
int noOfConsituents() const
DDMaterial::FractionV composites_
Definition: Material.h:41
virtual ~Material()
Definition: Material.h:17
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
double z_
Definition: Material.h:40
int addMaterial(const DDMaterial &m, double fm)
Definition: Material.h:28
DDMaterial::FractionV::value_type & constituent(int i)
Definition: Material.h:35
tuple d
Definition: ztail.py:151
double & z()
Definition: Material.h:25
double & a()
Definition: Material.h:24
double a_
Definition: Material.h:40
const DDMaterial::FractionV::value_type & constituent(int i) const
Definition: Material.h:33
Material(double d)
Definition: Material.h:16
int noOfConstituents() const
Definition: Material.h:37
double z() const
Definition: Material.h:21
double density() const
Definition: Material.h:22
Material(double z, double a, double d)
Definition: Material.h:14
double & density()
Definition: Material.h:26
double a() const
Definition: Material.h:20
double density_
Definition: Material.h:40
std::vector< std::pair< DDMaterial, double >> FractionV
Definition: DDMaterial.h:49