Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:05:24

0001 #ifndef DDI_Material_h
0002 #define DDI_Material_h
0003 
0004 #include <iostream>
0005 #include <vector>
0006 #include <utility>
0007 #include "DetectorDescription/Core/interface/DDMaterial.h"
0008 
0009 namespace DDI {
0010 
0011   class Material {
0012   public:
0013     Material() {}
0014     Material(double z, double a, double d) : z_(z), a_(a), density_(d) {}
0015 
0016     Material(double d) : z_(0), a_(0), density_(d) {}
0017     virtual ~Material() {}
0018     int noOfConsituents() const;
0019 
0020     double a() const { return a_; }
0021     double z() const { return z_; }
0022     double density() const { return density_; }
0023 
0024     double& a() { return a_; }
0025     double& z() { return z_; }
0026     double& density() { return density_; }
0027 
0028     int addMaterial(const DDMaterial& m, double fm) {
0029       composites_.emplace_back(std::make_pair(m, fm));
0030       return noOfConstituents();
0031     }
0032 
0033     const DDMaterial::FractionV::value_type& constituent(int i) const { return composites_[i]; }
0034 
0035     DDMaterial::FractionV::value_type& constituent(int i) { return composites_[i]; }
0036 
0037     int noOfConstituents() const { return composites_.size(); }
0038 
0039   protected:
0040     double z_, a_, density_;
0041     DDMaterial::FractionV composites_;
0042   };
0043 
0044 }  // namespace DDI
0045 #endif