CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 64 of file DDExpandedNode.h.

Member Function Documentation

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

Definition at line 67 of file DDExpandedNode.h.

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

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