CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Attributes | Friends
DDScope Class Reference

defines subtrees in the expanded-view More...

#include <DDScope.h>

Public Types

typedef std::vector< DDGeoHistoryscope_type
 

Public Member Functions

bool addScope (const DDGeoHistory &s)
 Adds a scope. No new scope will be added if s is already contained in one of the subtrees. More...
 
 DDScope (const DDGeoHistory &, int depth=0)
 scope with a single subtree More...
 
 DDScope (void)
 empty scope More...
 
int depth (void) const
 return the depth to wich the subtrees are restricted More...
 
const scope_typescope (void) const
 returns the scope container More...
 
void setDepth (int)
 subtrees of the scope are only transversed down to the given level More...
 
 ~DDScope (void)
 

Protected Attributes

DDScopeClassification classify_
 
int depth_
 
scope_type subtrees_
 

Friends

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

Detailed Description

defines subtrees in the expanded-view

One scope is defined by a set of DDGeoHistory.

Definition at line 27 of file DDScope.h.

Member Typedef Documentation

◆ scope_type

typedef std::vector<DDGeoHistory> DDScope::scope_type

Definition at line 31 of file DDScope.h.

Constructor & Destructor Documentation

◆ DDScope() [1/2]

DDScope::DDScope ( void  )

empty scope

Definition at line 29 of file DDScope.cc.

29 : depth_(0) {}

◆ DDScope() [2/2]

DDScope::DDScope ( const DDGeoHistory h,
int  depth = 0 
)

scope with a single subtree

Definition at line 31 of file DDScope.cc.

31 : depth_(depth) { subtrees_.emplace_back(h); }

References subtrees_.

◆ ~DDScope()

DDScope::~DDScope ( void  )

Definition at line 33 of file DDScope.cc.

33 {}

Member Function Documentation

◆ addScope()

bool DDScope::addScope ( const DDGeoHistory s)

Adds a scope. No new scope will be added if s is already contained in one of the subtrees.

returns true, if scope has changed, else false.

Definition at line 35 of file DDScope.cc.

35  {
36  bool result = false;
37  scope_type::iterator it = subtrees_.begin();
39  int supertreeCount = 0;
40  bool diffBranch = false;
41  bool subTree = false;
42 
43  for (; it != subtrees_.end(); ++it) {
44  dd_scope_class classification = classify_(h, *it);
45  switch (classification) {
46  case different_branch:
47  buf.emplace_back(*it);
48  diffBranch = true;
49  break;
50 
51  case subtree:
52  buf.emplace_back(*it);
53  subTree = true;
54  break;
55 
56  case supertree:
57  ++supertreeCount;
58  if (supertreeCount == 1)
59  buf.emplace_back(h);
60  break;
61 
62  default:
63  break;
64  }
65  }
66 
67  if (diffBranch) {
68  if (subTree == false) {
69  buf.emplace_back(h);
70  }
71  }
72 
73  if (subtrees_.empty())
74  subtrees_.emplace_back(h);
75  else
76  subtrees_ = buf;
77 
78  return result;
79 }

References visDQMUpload::buf, classify_, different_branch, mps_fire::result, subtree, subtrees_, and supertree.

◆ depth()

int DDScope::depth ( void  ) const

return the depth to wich the subtrees are restricted

Definition at line 83 of file DDScope.cc.

83 { return depth_; }

References depth_.

◆ scope()

const DDScope::scope_type & DDScope::scope ( void  ) const

returns the scope container

Definition at line 85 of file DDScope.cc.

85 { return subtrees_; }

References subtrees_.

◆ setDepth()

void DDScope::setDepth ( int  d)

subtrees of the scope are only transversed down to the given level

Definition at line 81 of file DDScope.cc.

81 { depth_ = d; }

References ztail::d, and depth_.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const DDScope scope 
)
friend

Definition at line 87 of file DDScope.cc.

87  {
88  DDScope::scope_type::const_iterator it = scope.subtrees_.begin();
89  for (; it != scope.subtrees_.end(); ++it) {
90  os << *it << std::endl;
91  }
92  return os;
93 }

Member Data Documentation

◆ classify_

DDScopeClassification DDScope::classify_
protected

Definition at line 58 of file DDScope.h.

Referenced by addScope().

◆ depth_

int DDScope::depth_
protected

Definition at line 59 of file DDScope.h.

Referenced by depth(), and setDepth().

◆ subtrees_

scope_type DDScope::subtrees_
protected

Definition at line 57 of file DDScope.h.

Referenced by addScope(), DDScope(), operator<<(), and scope().

supertree
Definition: DDScope.h:9
DDScope::scope_type
std::vector< DDGeoHistory > scope_type
Definition: DDScope.h:31
dd_scope_class
dd_scope_class
Definition: DDScope.h:9
DDScope::scope
const scope_type & scope(void) const
returns the scope container
Definition: DDScope.cc:85
h
DDScope::depth_
int depth_
Definition: DDScope.h:59
DDScope::subtrees_
scope_type subtrees_
Definition: DDScope.h:57
different_branch
Definition: DDScope.h:9
DDScope::classify_
DDScopeClassification classify_
Definition: DDScope.h:58
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
subtree
Definition: DDScope.h:9
ztail.d
d
Definition: ztail.py:151
mps_fire.result
result
Definition: mps_fire.py:311
DDScope::depth
int depth(void) const
return the depth to wich the subtrees are restricted
Definition: DDScope.cc:83