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

38  : depth_( 0 )
39 {}
int depth_
Definition: DDScope.h:61
DDScope::DDScope ( const DDGeoHistory h,
int  depth = 0 
)

scope with a single subtree

Definition at line 41 of file DDScope.cc.

References subtrees_.

42  : depth_( depth )
43 {
44  subtrees_.emplace_back( h );
45 }
scope_type subtrees_
Definition: DDScope.h:59
int depth(void) const
return the depth to wich the subtrees are restricted
Definition: DDScope.cc:109
int depth_
Definition: DDScope.h:61
DDScope::~DDScope ( void  )

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, mps_fire::result, subtree, subtrees_, and supertree.

52 {
53  bool result = false;
54  scope_type::iterator it = subtrees_.begin();
55  scope_type buf;
56  int supertreeCount = 0;
57  bool diffBranch = false;
58  bool subTree = false;
59 
60  for(; it != subtrees_.end(); ++it )
61  {
62  dd_scope_class classification = classify_( h, *it );
63  switch( classification )
64  {
65  case different_branch:
66  buf.emplace_back( *it );
67  diffBranch = true;
68  break;
69 
70  case subtree:
71  buf.emplace_back( *it );
72  subTree = true;
73  break;
74 
75  case supertree:
76  ++supertreeCount;
77  if( supertreeCount == 1 )
78  buf.emplace_back(h);
79  break;
80 
81  default:
82  break;
83  }
84  }
85 
86  if( diffBranch )
87  {
88  if( subTree == false )
89  {
90  buf.emplace_back(h);
91  }
92  }
93 
94  if( subtrees_.empty())
95  subtrees_.emplace_back( h );
96  else
97  subtrees_ = buf;
98 
99  return result;
100 }
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 109 of file DDScope.cc.

References depth_.

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

returns the scope container

Definition at line 115 of file DDScope.cc.

References subtrees_.

116 {
117  return subtrees_;
118 }
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 103 of file DDScope.cc.

References edmIntegrityCheck::d, and depth_.

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

Friends And Related Function Documentation

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

Definition at line 120 of file DDScope.cc.

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