CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 empty scope More...
 
 DDScope (const DDGeoHistory &, int depth=0)
 scope with a single subtree More...
 
int depth () const
 return the depth to wich the subtrees are restricted More...
 
const scope_typescope () const
 returns the scope container More...
 
void setDepth (int)
 subtrees of the scope are only transversed down to the given level More...
 
 ~DDScope ()
 

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 26 of file DDScope.h.

Member Typedef Documentation

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

Definition at line 31 of file DDScope.h.

Constructor & Destructor Documentation

DDScope::DDScope ( )

empty scope

Definition at line 37 of file DDScope.cc.

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

scope with a single subtree

Definition at line 40 of file DDScope.cc.

References subtrees_.

41  : depth_(depth)
42 {
43  subtrees_.push_back(h);
44 }
scope_type subtrees_
Definition: DDScope.h:57
int depth() const
return the depth to wich the subtrees are restricted
Definition: DDScope.cc:114
int depth_
Definition: DDScope.h:59
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
DDScope::~DDScope ( )

Definition at line 47 of file DDScope.cc.

48 { }

Member Function Documentation

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 51 of file DDScope.cc.

References classify_, different_branch, query::result, subtree, subtrees_, and supertree.

52 {
53  bool result = false;
54  //DCOUT('S',"DDScope::addScope()" << h);
55  scope_type::iterator it = subtrees_.begin();
56  scope_type buf;
57  int supertreeCount = 0;
58  bool diffBranch = false;
59  bool subTree = false;
60  //DDGeoHistory::size_type pos = subtree_.size();
61 
62  for(; it != subtrees_.end(); ++it) {
63  dd_scope_class classification = classify_(h,*it);
64  switch (classification) {
65 
66  case different_branch:
67  buf.push_back(*it);
68  diffBranch=true;
69  //buf.push_back(h);
70  //DCOUT('S'," ->different_branch");
71  break;
72 
73  case subtree:
74  buf.push_back(*it);
75  subTree = true;
76  //DCOUT('S'," ->subtree");
77  break;
78 
79  case supertree:
80  //buf.push_back(h);
81  ++supertreeCount;
82  if (supertreeCount==1)
83  buf.push_back(h);
84  //DCOUT('S'," ->supertree");
85  break;
86 
87  default:
88  ;
89  }
90  }
91 
92  if (diffBranch) {
93  if (subTree==false) {
94  buf.push_back(h);
95  }
96  }
97 
98  if (!subtrees_.size())
99  subtrees_.push_back(h);
100  else
101  subtrees_ = buf;
102 
103  //DCOUT('S',"DDScope.size()=" << subtrees_.size() );
104  return result;
105 }
scope_type subtrees_
Definition: DDScope.h:57
dd_scope_class
Definition: DDScope.h:7
DDScopeClassification classify_
Definition: DDScope.h:58
std::vector< DDGeoHistory > scope_type
Definition: DDScope.h:31
tuple result
Definition: query.py:137
Definition: DDScope.h:7
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
int DDScope::depth ( ) const

return the depth to wich the subtrees are restricted

Definition at line 114 of file DDScope.cc.

References depth_.

Referenced by DDQuery::exec().

115 {
116  return depth_;
117 }
int depth_
Definition: DDScope.h:59
const DDScope::scope_type & DDScope::scope ( ) const

returns the scope container

Definition at line 120 of file DDScope.cc.

References subtrees_.

Referenced by DDQuery::exec().

121 {
122  return subtrees_;
123 }
scope_type subtrees_
Definition: DDScope.h:57
void DDScope::setDepth ( int  d)

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

Definition at line 108 of file DDScope.cc.

References depth_.

109 {
110  depth_ = d;
111 }
int depth_
Definition: DDScope.h:59

Friends And Related Function Documentation

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

Definition at line 125 of file DDScope.cc.

126 {
127  DDScope::scope_type::const_iterator it = scope.subtrees_.begin();
128  for (; it!=scope.subtrees_.end(); ++ it) {
129  os << *it << std::endl;
130  }
131  return os;
132 }
scope_type subtrees_
Definition: DDScope.h:57

Member Data Documentation

DDScopeClassification DDScope::classify_
protected

Definition at line 58 of file DDScope.h.

Referenced by addScope().

int DDScope::depth_
protected

Definition at line 59 of file DDScope.h.

Referenced by depth(), and setDepth().

scope_type DDScope::subtrees_
protected

Definition at line 57 of file DDScope.h.

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