test
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 (void)
 empty scope More...
 
 DDScope (const DDGeoHistory &, int depth=0)
 scope with a single subtree 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 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 ( void  )

empty scope

Definition at line 34 of file DDScope.cc.

35  : depth_( 0 )
36 {}
int depth_
Definition: DDScope.h:59
DDScope::DDScope ( const DDGeoHistory h,
int  depth = 0 
)

scope with a single subtree

Definition at line 38 of file DDScope.cc.

References subtrees_.

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

Definition at line 44 of file DDScope.cc.

45 {}

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

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

49 {
50  bool result = false;
51  scope_type::iterator it = subtrees_.begin();
52  scope_type buf;
53  int supertreeCount = 0;
54  bool diffBranch = false;
55  bool subTree = false;
56 
57  for(; it != subtrees_.end(); ++it )
58  {
59  dd_scope_class classification = classify_( h, *it );
60  switch( classification )
61  {
62  case different_branch:
63  buf.push_back( *it );
64  diffBranch = true;
65  break;
66 
67  case subtree:
68  buf.push_back( *it );
69  subTree = true;
70  break;
71 
72  case supertree:
73  ++supertreeCount;
74  if( supertreeCount == 1 )
75  buf.push_back(h);
76  break;
77 
78  default:
79  break;
80  }
81  }
82 
83  if( diffBranch )
84  {
85  if( subTree == false )
86  {
87  buf.push_back(h);
88  }
89  }
90 
91  if( !subtrees_.size())
92  subtrees_.push_back( h );
93  else
94  subtrees_ = buf;
95 
96  return result;
97 }
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
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
Definition: DDScope.h:7
int DDScope::depth ( void  ) const

return the depth to wich the subtrees are restricted

Definition at line 106 of file DDScope.cc.

References depth_.

Referenced by DDQuery::exec().

107 {
108  return depth_;
109 }
int depth_
Definition: DDScope.h:59
const DDScope::scope_type & DDScope::scope ( void  ) const

returns the scope container

Definition at line 112 of file DDScope.cc.

References subtrees_.

Referenced by DDQuery::exec().

113 {
114  return subtrees_;
115 }
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 100 of file DDScope.cc.

References depth_.

101 {
102  depth_ = d;
103 }
int depth_
Definition: DDScope.h:59

Friends And Related Function Documentation

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

Definition at line 117 of file DDScope.cc.

118 {
119  DDScope::scope_type::const_iterator it = scope.subtrees_.begin();
120  for(; it != scope.subtrees_.end(); ++ it )
121  {
122  os << *it << std::endl;
123  }
124  return os;
125 }
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().