CMS 3D CMS Logo

List of all members | Public Member Functions
GlobalTrajectoryBuilderBase::ComparatorInOut Struct Reference

#include <GlobalTrajectoryBuilderBase.h>

Public Member Functions

bool operator() (const TransientTrackingRecHit::ConstRecHitPointer &a, const TransientTrackingRecHit::ConstRecHitPointer &b) const
 

Detailed Description

Definition at line 124 of file GlobalTrajectoryBuilderBase.h.

Member Function Documentation

◆ operator()()

bool GlobalTrajectoryBuilderBase::ComparatorInOut::operator() ( const TransientTrackingRecHit::ConstRecHitPointer a,
const TransientTrackingRecHit::ConstRecHitPointer b 
) const
inline

Definition at line 125 of file GlobalTrajectoryBuilderBase.h.

References a, b, GeomDetEnumerators::DT, and GeomDetEnumerators::RPCBarrel.

126  {
127  bool barrel_a = (a->det()->subDetector() == GeomDetEnumerators::DT ||
128  a->det()->subDetector() == GeomDetEnumerators::RPCBarrel);
129 
130  bool barrel_b = (b->det()->subDetector() == GeomDetEnumerators::DT ||
131  b->det()->subDetector() == GeomDetEnumerators::RPCBarrel);
132 
133  if (barrel_a && barrel_b)
134  return a->det()->surface().position().perp() < b->det()->surface().position().perp();
135 
136  else if (!barrel_a && !barrel_b)
137  return fabs(a->globalPosition().z()) < fabs(b->globalPosition().z());
138  else if (barrel_a && !barrel_b)
139  return true;
140  else if (!barrel_a && barrel_b)
141  return false;
142  //shouldn't really get here in any case (there's some sense to throw here )
143  return false;
144  }
double b
Definition: hdecay.h:118
double a
Definition: hdecay.h:119