CMS 3D CMS Logo

DDSpecifics.cc
Go to the documentation of this file.
2 
3 #include <ostream>
4 
10 
11 using DDI::Specific;
12 
14 
16 
18  const std::vector<std::string>& partSelections,
19  const DDsvalues_type& svalues,
20  bool doRegex)
22  create(name, std::make_unique<Specific>(partSelections, svalues, doRegex));
23  std::vector<std::pair<DDLogicalPart, std::pair<const DDPartSelection*, const DDsvalues_type*>>> v;
24  rep().updateLogicalPart(v);
25  for (auto& it : v) {
26  if (it.first.isDefined().second) {
27  it.first.addSpecifics(it.second);
28  } else {
29  throw cms::Exception("DDException") << "Definition of LogicalPart missing! name=" << it.first.ddname().fullname();
30  }
31  }
32 }
33 
34 const std::vector<DDPartSelection>& DDSpecifics::selection() const { return rep().selection(); }
35 
36 const DDsvalues_type& DDSpecifics::specifics() const { return rep().specifics(); }
37 
46 std::pair<bool, DDExpandedView> DDSpecifics::node() const { return rep().node(); }
47 
48 std::ostream& operator<<(std::ostream& os, const DDSpecifics& sp) {
50  if (defined.first) {
51  os << *(defined.first) << " ";
52  if (defined.second) {
53  sp.rep().stream(os);
54  } else {
55  os << "* specific not defined * ";
56  }
57  } else {
58  os << "* specific not declared * ";
59  }
60  return os;
61 }
62 
63 std::ostream& operator<<(std::ostream& os, const std::vector<std::string>& v) {
64  for (const auto& it : v) {
65  os << it << std::endl;
66  }
67  return os;
68 }
DDSpecifics::selection
const std::vector< DDPartSelection > & selection() const
Gives a reference to the collection of part-selections.
Definition: DDSpecifics.cc:34
MessageLogger.h
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
DDBase::isDefined
def_type isDefined() const
Definition: DDBase.h:90
DDSpecifics::node
std::pair< bool, DDExpandedView > node() const
Calculates the geometrical history of a fully specified PartSelector.
Definition: DDSpecifics.cc:46
DDExpandedView.h
findQualityFiles.v
v
Definition: findQualityFiles.py:179
Specific.h
DDSpecifics::specifics
const DDsvalues_type & specifics() const
Reference to the user-data attached to all nodes selected by the selections-strings given through sel...
Definition: DDSpecifics.cc:36
operator<<
std::ostream & operator<<(std::ostream &os, const DDSpecifics &sp)
Definition: DDSpecifics.cc:48
DDBase< DDName, std::unique_ptr< DDI::Specific > >::name
const DDName & name() const
Definition: DDBase.h:59
DDBase< DDName, std::unique_ptr< DDI::Specific > >::rep
const DDI::rep_traits< DDName, std::unique_ptr< DDI::Specific > >::reference rep() const
Definition: DDBase.h:65
DDSpecifics
Interface to attach user specific data to nodes in the expanded-view.
Definition: DDSpecifics.h:41
DDSpecifics.h
DDLogicalPart.h
cms::cuda::device::unique_ptr
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
Definition: device_unique_ptr.h:33
std
Definition: JetResolutionObject.h:76
DDSpecifics::DDSpecifics
DDSpecifics()
Creates a uninitialized reference-object (see DDLogicalPart documentation for details on reference ob...
Definition: DDSpecifics.cc:13
DDBase< DDName, std::unique_ptr< DDI::Specific > >::create
void create(const DDName &name, std::unique_ptr< DDI::Specific > vals)
Definition: DDBase.h:96
Exception
Definition: hltDiff.cc:245
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
Exception.h
DDI::Specific
Definition: Specific.h:20
DDBase
Definition: DDBase.h:10
DDsvalues_type
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
Definition: DDsvalues.h:12