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

Member Typedef Documentation

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

Definition at line 33 of file DDScope.h.

Constructor & Destructor Documentation

DDScope::DDScope ( void  )

empty scope

Definition at line 36 of file DDScope.cc.

37  : depth_( 0 )
38 {}
int depth_
Definition: DDScope.h:61
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:59
int depth(void) const
return the depth to wich the subtrees are restricted
Definition: DDScope.cc:108
int depth_
Definition: DDScope.h:61
DDScope::~DDScope ( void  )

Definition at line 46 of file DDScope.cc.

47 {}

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

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

51 {
52  bool result = false;
53  scope_type::iterator it = subtrees_.begin();
54  scope_type buf;
55  int supertreeCount = 0;
56  bool diffBranch = false;
57  bool subTree = false;
58 
59  for(; it != subtrees_.end(); ++it )
60  {
61  dd_scope_class classification = classify_( h, *it );
62  switch( classification )
63  {
64  case different_branch:
65  buf.push_back( *it );
66  diffBranch = true;
67  break;
68 
69  case subtree:
70  buf.push_back( *it );
71  subTree = true;
72  break;
73 
74  case supertree:
75  ++supertreeCount;
76  if( supertreeCount == 1 )
77  buf.push_back(h);
78  break;
79 
80  default:
81  break;
82  }
83  }
84 
85  if( diffBranch )
86  {
87  if( subTree == false )
88  {
89  buf.push_back(h);
90  }
91  }
92 
93  if( !subtrees_.size())
94  subtrees_.push_back( h );
95  else
96  subtrees_ = buf;
97 
98  return result;
99 }
scope_type subtrees_
Definition: DDScope.h:59
dd_scope_class
Definition: DDScope.h:9
DDScopeClassification classify_
Definition: DDScope.h:60
std::vector< DDGeoHistory > scope_type
Definition: DDScope.h:33
Definition: DDScope.h:9
int DDScope::depth ( void  ) const

return the depth to wich the subtrees are restricted

Definition at line 108 of file DDScope.cc.

References depth_.

109 {
110  return depth_;
111 }
int depth_
Definition: DDScope.h:61
const DDScope::scope_type & DDScope::scope ( void  ) const

returns the scope container

Definition at line 114 of file DDScope.cc.

References subtrees_.

115 {
116  return subtrees_;
117 }
scope_type subtrees_
Definition: DDScope.h:59
void DDScope::setDepth ( int  d)

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

Definition at line 102 of file DDScope.cc.

References edmIntegrityCheck::d, and depth_.

103 {
104  depth_ = d;
105 }
int depth_
Definition: DDScope.h:61

Friends And Related Function Documentation

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

Definition at line 119 of file DDScope.cc.

120 {
121  DDScope::scope_type::const_iterator it = scope.subtrees_.begin();
122  for(; it != scope.subtrees_.end(); ++ it )
123  {
124  os << *it << std::endl;
125  }
126  return os;
127 }
scope_type subtrees_
Definition: DDScope.h:59

Member Data Documentation

DDScopeClassification DDScope::classify_
protected

Definition at line 60 of file DDScope.h.

Referenced by addScope().

int DDScope::depth_
protected

Definition at line 61 of file DDScope.h.

Referenced by depth(), and setDepth().

scope_type DDScope::subtrees_
protected

Definition at line 59 of file DDScope.h.

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