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 56 of file DDExpandedNode.h.

Member Function Documentation

◆ operator()()

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

Definition at line 57 of file DDExpandedNode.h.

57  {
58  const DDTranslation &t1 = n1.absTranslation();
59  const DDTranslation &t2 = n2.absTranslation();
60 
61  bool result = false;
62 
63  // 'alphabetical ordering' according to absolute position
64 
65  if (t1.z() < t2.z()) {
66  result = true;
67  } else if ((t1.z() == t2.z()) && (t1.y() < t2.y())) {
68  result = true;
69  } else if ((t1.z() == t2.z()) && (t1.y() == t2.y()) && (t1.x() < t2.x())) {
70  result = true;
71  } else if (n1.siblingno() < n2.siblingno()) {
72  result = true;
73  } else if (n1.logicalPart().ddname() < n2.logicalPart().ddname()) {
74  result = true;
75  }
76 
77  return result;
78  }

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

RandomServiceHelper.t2
t2
Definition: RandomServiceHelper.py:257
RandomServiceHelper.t1
t1
Definition: RandomServiceHelper.py:256
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
DDExpandedNode::siblingno
int siblingno() const
sibling number of this node
Definition: DDExpandedNode.h:40
DDBase::ddname
const N & ddname() const
Definition: DDBase.h:61
DDExpandedNode::logicalPart
const DDLogicalPart & logicalPart() const
the LogicalPart describing this node
Definition: DDExpandedNode.h:28
DDExpandedNode::absTranslation
const DDTranslation & absTranslation() const
absolute translation of this node
Definition: DDExpandedNode.h:31
mps_fire.result
result
Definition: mps_fire.py:303