CMS 3D CMS Logo

List of all members | Public Member Functions
DDExpandedNodeLess Struct Reference

function object to compare to ExpandedNodes More...

#include <DDExpandedNode.h>

Public Member Functions

bool operator() (const DDExpandedNode &n1, const DDExpandedNode &n2)
 

Detailed Description

function object to compare to ExpandedNodes

compares (for STL usage) two DDExpandedNodes for

Definition at line 66 of file DDExpandedNode.h.

Member Function Documentation

bool DDExpandedNodeLess::operator() ( const DDExpandedNode n1,
const DDExpandedNode n2 
)
inline

Definition at line 69 of file DDExpandedNode.h.

References DDExpandedNode::absTranslation(), DDBase< N, C >::ddname(), DDExpandedNode::logicalPart(), mps_fire::result, and DDExpandedNode::siblingno().

70  {
71  const DDTranslation & t1 = n1.absTranslation();
72  const DDTranslation & t2 = n2.absTranslation();
73 
74  bool result = false;
75 
76  // 'alphabetical ordering' according to absolute position
77 
78  if (t1.z() < t2.z())
79  {
80  result=true;
81  }
82  else if ( (t1.z()==t2.z()) && (t1.y() < t2.y()))
83  {
84  result=true;
85  }
86  else if ( (t1.z()==t2.z()) && (t1.y()==t2.y()) && (t1.x()<t2.x()))
87  {
88  result=true;
89  }
90  else if (n1.siblingno() < n2.siblingno())
91  {
92  result=true;
93  }
94  else if (n1.logicalPart().ddname() < n2.logicalPart().ddname())
95  {
96  result=true;
97  }
98 
99  return result;
100  }
const DDTranslation & absTranslation() const
absolute translation of this node
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
int siblingno() const
sibling number of this node
const DDLogicalPart & logicalPart() const
the LogicalPart describing this node
const N & ddname() const
Definition: DDBase.h:76