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
DDI
Definition: DDCompactView.h:25
DDMaterial::FractionV
std::vector< std::pair< DDMaterial, double > > FractionV
Definition: DDMaterial.h:49
DDI::Material::constituent
DDMaterial::FractionV::value_type & constituent(int i)
Definition: Material.h:35
mps_fire.i
i
Definition: mps_fire.py:428
DDI::Material::z
double z() const
Definition: Material.h:21
DDI::Material::a
double a() const
Definition: Material.h:20
DDI::Material::z
double & z()
Definition: Material.h:25
DDI::Material::noOfConstituents
int noOfConstituents() const
Definition: Material.h:37
DDI::Material::~Material
virtual ~Material()
Definition: Material.h:17
DDI::Material
Definition: Material.h:11
DDI::Material::Material
Material()
Definition: Material.h:13
DDMaterial
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
DDI::Material::constituent
const DDMaterial::FractionV::value_type & constituent(int i) const
Definition: Material.h:33
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:79
DDI::Material::density_
double density_
Definition: Material.h:40
DDI::Material::a
double & a()
Definition: Material.h:24
DDMaterial.h
DDI::Material::composites_
DDMaterial::FractionV composites_
Definition: Material.h:41
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
DDI::Material::Material
Material(double z, double a, double d)
Definition: Material.h:14
DDI::Material::Material
Material(double d)
Definition: Material.h:16
DDI::Material::density
double & density()
Definition: Material.h:26
DDI::Material::density
double density() const
Definition: Material.h:22
ztail.d
d
Definition: ztail.py:151
DDI::Material::noOfConsituents
int noOfConsituents() const
DDI::Material::z_
double z_
Definition: Material.h:40
DDI::Material::a_
double a_
Definition: Material.h:40
DDI::Material::addMaterial
int addMaterial(const DDMaterial &m, double fm)
Definition: Material.h:28