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 120 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 121 of file GlobalTrajectoryBuilderBase.h.

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

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

b
double b
Definition: hdecay.h:118
GeomDetEnumerators::DT
Definition: GeomDetEnumerators.h:18
a
double a
Definition: hdecay.h:119
GeomDetEnumerators::RPCBarrel
Definition: GeomDetEnumerators.h:19