CMS 3D CMS Logo

List of all members | Public Member Functions
DDScopeClassification Struct Reference

Classification of scope describe by A towards B. More...

#include <DDScope.h>

Public Member Functions

dd_scope_class operator() (const DDGeoHistory &, const DDGeoHistory &) const
 

Detailed Description

Classification of scope describe by A towards B.

The leaf-node of A defines the root of a subtree in the DDExpandedView, so does the leaf-node of B.

Definition at line 19 of file DDScope.h.

Member Function Documentation

dd_scope_class DDScopeClassification::operator() ( const DDGeoHistory left,
const DDGeoHistory right 
) const

Definition at line 6 of file DDScope.cc.

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

8 {
10  DDGeoHistory::const_iterator lit = left.begin(); // left-iterator
11  DDGeoHistory::const_iterator rit = right.begin(); // right-iterator
12 
13  while( lit != left.end() && rit != right.end())
14  {
15  if( lit->siblingno() != rit->siblingno())
16  {
17  result = different_branch;
18  break;
19  }
20  ++lit;
21  ++rit;
22  }
23 
24  if( result != different_branch )
25  {
26  if( lit == left.end()) { // left history leaf node marks the root of a subtree which contains
27  result = supertree; // the leaf node of the right history or both roots are the same ...
28  }
29  else
30  {
31  result = subtree;
32  }
33  }
34  return result;
35 }
dd_scope_class
Definition: DDScope.h:9
Definition: DDScope.h:9