CMS 3D CMS Logo

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
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
const DDMaterial::FractionV::value_type & constituent(int i) const
Definition: Material.h:33
double & z()
Definition: Material.h:25
double & a()
Definition: Material.h:24
int noOfConstituents() const
Definition: Material.h:37
double a_
Definition: Material.h:40
std::vector< std::pair< DDMaterial, double > > FractionV
Definition: DDMaterial.h:49
d
Definition: ztail.py:151
Material(double d)
Definition: Material.h:16
int noOfConsituents() const
Definition: Assembly.h:7
Material(double z, double a, double d)
Definition: Material.h:14
double & density()
Definition: Material.h:26
double density() const
Definition: Material.h:22
double density_
Definition: Material.h:40
double z() const
Definition: Material.h:21
double a() const
Definition: Material.h:20