Go to the documentation of this file.00001 #include "DetectorDescription/Core/interface/DDVector.h"
00002
00003
00004
00005
00006
00007
00008
00009 DDVector::DDVector() : DDBase<DDName,std::vector<double>*>() { }
00010
00011
00012 DDVector::DDVector(const DDName & name) : DDBase<DDName,std::vector<double>*>()
00013 {
00014 prep_ = StoreT::instance().create(name);
00015 }
00016
00017 DDVector::DDVector(const DDName & name,std::vector<double>* vals)
00018 {
00019 prep_ = StoreT::instance().create(name,vals);
00020 }
00021
00022
00023 std::ostream & operator<<(std::ostream & os, const DDVector & cons)
00024 {
00025 os << "DDVector name=" << cons.name();
00026
00027 if(cons.isDefined().second) {
00028 os << " size=" << cons.size() << " vals=( ";
00029 DDVector::value_type::const_iterator it(cons.values().begin()), ed(cons.values().end());
00030 for(; it<ed; ++it) {
00031 os << *it << ' ';
00032 }
00033 os << ')';
00034 }
00035 else {
00036 os << " constant is not yet defined, only declared.";
00037 }
00038 return os;
00039 }
00040
00041
00042
00043
00044 DDVector::operator std::vector<int>() const
00045 {
00046 std::vector<int> result(rep().size());
00047 std::vector<int>::size_type sz=0;
00048 std::vector<double>::const_iterator it(rep().begin()), ed(rep().end());
00049 for (; it != ed; ++it) {
00050 result[sz] = int(*it);
00051 ++sz;
00052 }
00053 return result;
00054 }