MINT2
Public Member Functions | List of all members
moreByAbsID_stillUnique Class Reference

#include <DecayTreeComparisons.h>

Public Member Functions

bool operator() (MINT::const_counted_ptr< DecayTree > a, MINT::const_counted_ptr< DecayTree > b) const
 

Detailed Description

Definition at line 44 of file DecayTreeComparisons.h.

Member Function Documentation

◆ operator()()

bool moreByAbsID_stillUnique::operator() ( MINT::const_counted_ptr< DecayTree a,
MINT::const_counted_ptr< DecayTree b 
) const

Definition at line 98 of file DecayTreeComparisons.cpp.

99  {
100 
101  // sorts by abs ID but is still unique. When two
102  // particles have same abs ID, the one with
103  // the positive id comes first
104 
105  // first handle bad pointers
106  if(0 == a && 0==b) return false;
107  if(0 == a && 0!=b) return true;
108  if(0 !=a && 0==b) return false;
109 
110  int abs_a = abs(a->getVal().pdg());
111  int abs_b = abs(b->getVal().pdg());
112 
113  if(abs_a == abs_b) {
114  return a->getVal().pdg() > b->getVal().pdg();
115  }else{
116  return abs_a > abs_b;
117  }
118 }
const ValueType & getVal() const
Definition: DDTree.h:102
int pdg() const

The documentation for this class was generated from the following files: