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

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

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