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

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

Definition at line 121 of file GlobalTrajectoryBuilderBase.h.

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

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  }
double b
Definition: hdecay.h:118
double a
Definition: hdecay.h:119