CMS 3D CMS Logo

DDVector.cc
Go to the documentation of this file.
2 
3 #include <utility>
4 
6 
8 
9 DDVector::DDVector(const DDName& name, std::unique_ptr<std::vector<double>> vals) { create(name, std::move(vals)); }
10 
11 std::ostream& operator<<(std::ostream& os, const DDVector& cons) {
12  os << "DDVector name=" << cons.name();
13 
14  if (cons.isDefined().second) {
15  os << " size=" << cons.size() << " vals=( ";
16  DDVector::value_type::const_iterator it(cons.values().begin()), ed(cons.values().end());
17  for (; it < ed; ++it) {
18  os << *it << ' ';
19  }
20  os << ')';
21  } else {
22  os << " constant is not yet defined, only declared.";
23  }
24  return os;
25 }
26 
27 DDVector::operator std::vector<int>() const {
28  std::vector<int> result(rep().size());
30  std::vector<double>::const_iterator it(rep().begin()), ed(rep().end());
31  for (; it != ed; ++it) {
32  result[sz] = int(*it);
33  ++sz;
34  }
35  return result;
36 }
operator<<
std::ostream & operator<<(std::ostream &os, const DDVector &cons)
output operator for printing ...
Definition: DDVector.cc:11
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
DDVector
a named constant corresponding to the DDL-XML tag <Constant> and <ConstantsVector>
Definition: DDVector.h:18
DDBase::isDefined
def_type isDefined() const
Definition: DDBase.h:90
DDVector::values
const value_type & values() const
the stored values
Definition: DDVector.h:39
Utilities.operator
operator
Definition: Utilities.py:24
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
mps_fire.end
end
Definition: mps_fire.py:242
DDBase< DDName, std::unique_ptr< std::vector< double > > >::name
const DDName & name() const
Definition: DDBase.h:59
createfilelist.int
int
Definition: createfilelist.py:10
DDVector::DDVector
DDVector()
an uninitialized constant; one can assign an initialized constant to make it valid
Definition: DDVector.cc:5
cuy.rep
rep
Definition: cuy.py:1189
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
cms::cuda::device::unique_ptr
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
Definition: device_unique_ptr.h:33
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
DDBase< DDName, std::unique_ptr< std::vector< double > > >::create
void create(const DDName &name, std::unique_ptr< std::vector< double > > vals)
Definition: DDBase.h:96
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
DDVector.h
mps_fire.result
result
Definition: mps_fire.py:311
DDBase
Definition: DDBase.h:10
DDVector::size
size_t size() const
the size of the array of values
Definition: DDVector.h:36
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443