CMS 3D CMS Logo

List of all members | Public Member Functions | Friends
DDSpecifics Class Reference

Interface to attach user specific data to nodes in the expanded-view. More...

#include <DDSpecifics.h>

Inheritance diagram for DDSpecifics:
DDBase< DDName, std::unique_ptr< DDI::Specific > >

Public Member Functions

 DDSpecifics ()
 Creates a uninitialized reference-object (see DDLogicalPart documentation for details on reference objects) More...
 
 DDSpecifics (const DDName &name)
 Creates a initialized reference-object or a reference to an allready defined specifcs. More...
 
 DDSpecifics (const DDName &name, const std::vector< std::string > &partSelections, const DDsvalues_type &svalues, bool doRegex=true)
 Creates a defined reference-object or replaces a already defined reference-object named name. More...
 
std::pair< bool, DDExpandedViewnode () const
 Calculates the geometrical history of a fully specified PartSelector. More...
 
const std::vector< DDPartSelection > & selection () const
 Gives a reference to the collection of part-selections. More...
 
const DDsvalues_typespecifics () const
 Reference to the user-data attached to all nodes selected by the selections-strings given through selection. More...
 
- Public Member Functions inherited from DDBase< DDName, std::unique_ptr< DDI::Specific > >
void create (const DDName &name)
 
void create (const DDName &name, std::unique_ptr< DDI::Specific > vals)
 
 DDBase ()
 
const DDNameddname () const
 
def_type isDefined () const
 
bool isValid () const
 true, if the wrapped pointer is valid More...
 
const DDNamename () const
 
 operator bool () const
 
bool operator< (const DDBase &b) const
 
bool operator== (const DDBase &b) const
 
bool operator> (const DDBase &b) const
 
DDI::rep_traits< DDName, std::unique_ptr< DDI::Specific > >::reference rep ()
 
const DDI::rep_traits< DDName, std::unique_ptr< DDI::Specific > >::reference rep () const
 
std::string toString () const
 
const DDI::rep_traits< DDName, std::unique_ptr< DDI::Specific > >::reference val ()
 
const DDI::rep_traits< DDName, std::unique_ptr< DDI::Specific > >::reference val () const
 
virtual ~DDBase ()
 

Friends

std::ostream & operator<< (std::ostream &, const DDSpecifics &)
 

Additional Inherited Members

- Public Types inherited from DDBase< DDName, std::unique_ptr< DDI::Specific > >
using def_type = std::pair< const DDName *, bool >
 
using StoreT = DDI::Singleton< DDI::Store< DDName, std::unique_ptr< DDI::Specific > > >
 
- Static Public Member Functions inherited from DDBase< DDName, std::unique_ptr< DDI::Specific > >
static auto begin ()
 
static auto end ()
 

Detailed Description

Interface to attach user specific data to nodes in the expanded-view.

used to attach specific (user defined) data to nodes in the expanded view.

DDSpecifics are lightweighted reference-objects. For further information concerning reference-objects refere to the documentation of DDLogicalPart.

Definition at line 41 of file DDSpecifics.h.

Constructor & Destructor Documentation

◆ DDSpecifics() [1/3]

DDSpecifics::DDSpecifics ( )

Creates a uninitialized reference-object (see DDLogicalPart documentation for details on reference objects)

Definition at line 13 of file DDSpecifics.cc.

◆ DDSpecifics() [2/3]

DDSpecifics::DDSpecifics ( const DDName name)

Creates a initialized reference-object or a reference to an allready defined specifcs.

If a DDSpecifics with name was already defined, this constructor creates a lightweighted reference-object to it. Otherwise a (default) initialized reference-object is registered named name. For further details concerning the usage of reference-objects refere to the documentation of DDLogicalPart.

Definition at line 15 of file DDSpecifics.cc.

References DDBase< DDName, std::unique_ptr< DDI::Specific > >::create(), and DDBase< DDName, std::unique_ptr< DDI::Specific > >::name().

◆ DDSpecifics() [3/3]

DDSpecifics::DDSpecifics ( const DDName name,
const std::vector< std::string > &  partSelections,
const DDsvalues_type svalues,
bool  doRegex = true 
)

Creates a defined reference-object or replaces a already defined reference-object named name.

  • name unique name
  • partSelections collection of selection-strings which select expanded-nodes
  • svalues user data attached to nodes selected by partSelections

Syntax of the selection std::string

bla, bla, bla

Definition at line 17 of file DDSpecifics.cc.

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 }

References DDBase< DDName, std::unique_ptr< DDI::Specific > >::create(), Exception, DDBase< DDName, std::unique_ptr< DDI::Specific > >::name(), DDBase< DDName, std::unique_ptr< DDI::Specific > >::rep(), and findQualityFiles::v.

Member Function Documentation

◆ node()

std::pair< bool, DDExpandedView > DDSpecifics::node ( ) const

Calculates the geometrical history of a fully specified PartSelector.

node() will only work, if

  • there is only one PartSelection std::string
  • the PartSelection std::string specifies exactly one full path concatenating always direct children including their copy-number and will return (true,const DDGeoHistory&) if the std::string matches an expanded-part in the ExpandedView, else it will return (false, xxx), whereas xxx is a history which is not valid.

Definition at line 46 of file DDSpecifics.cc.

46 { return rep().node(); }

References DDBase< DDName, std::unique_ptr< DDI::Specific > >::rep().

◆ selection()

const std::vector< DDPartSelection > & DDSpecifics::selection ( ) const

Gives a reference to the collection of part-selections.

Definition at line 34 of file DDSpecifics.cc.

34 { return rep().selection(); }

References DDBase< DDName, std::unique_ptr< DDI::Specific > >::rep().

Referenced by trackingPlots.Iteration::modules(), and DDCoreToDDXMLOutput::specpar().

◆ specifics()

const DDsvalues_type & DDSpecifics::specifics ( void  ) const

Reference to the user-data attached to all nodes selected by the selections-strings given through selection.

Definition at line 36 of file DDSpecifics.cc.

36 { return rep().specifics(); }

References DDBase< DDName, std::unique_ptr< DDI::Specific > >::rep().

Referenced by DDCoreToDDXMLOutput::specpar().

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const DDSpecifics sp 
)
friend

Definition at line 48 of file DDSpecifics.cc.

48  {
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 }
DDBase< DDName, std::unique_ptr< DDI::Specific > >::def_type
std::pair< const DDName *, bool > def_type
Definition: DDBase.h:51
DDBase::isDefined
def_type isDefined() const
Definition: DDBase.h:90
findQualityFiles.v
v
Definition: findQualityFiles.py:179
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
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:246
DDBase
Definition: DDBase.h:10