ATLAS Offline Software
Public Member Functions | List of all members
GXF::LayerSort2 Class Reference

#include <LayerSort.h>

Collaboration diagram for GXF::LayerSort2:

Public Member Functions

bool operator() (const Trk::Layer *one, const Trk::Layer *two) const
 

Detailed Description

Definition at line 18 of file LayerSort.h.

Member Function Documentation

◆ operator()()

bool GXF::LayerSort2::operator() ( const Trk::Layer one,
const Trk::Layer two 
) const

Definition at line 85 of file LayerSort.cxx.

85  {
86  auto castToCylinder = [](const Layer * pLayer) -> const CylinderSurface * {
87  if (pLayer->surfaceRepresentation().type() == Trk::SurfaceType::Cylinder)
88  return static_cast<const CylinderSurface *>(&pLayer->surfaceRepresentation());
89  return nullptr;
90  };
91  auto castToDisc = [](const Layer * pLayer) -> const DiscSurface *{
92  if (pLayer->surfaceRepresentation().type() == Trk::SurfaceType::Disc)
93  return static_cast<const DiscSurface *>(&pLayer->surfaceRepresentation());
94  return nullptr;
95  };
96  //
97  const CylinderSurface *cyl1 = castToCylinder(one);
98  const CylinderSurface *cyl2 = castToCylinder(two);
99  if (cyl1 and cyl2) {
100  return (cyl1->bounds().r() < cyl2->bounds().r());
101  }
102  const DiscSurface *disc1 = castToDisc(one);
103  const DiscSurface *disc2 = castToDisc(two);
104  if (disc1 and disc2) {
105  return (std::abs(disc1->center().z()) < std::abs(disc2->center().z()));
106  }
107 
108  return false;
109  }

The documentation for this class was generated from the following files:
Trk::one
@ one
Definition: TrkDetDescr/TrkSurfaces/TrkSurfaces/RealQuadraticEquation.h:22
python.RingerConstants.Layer
Layer
Definition: RingerConstants.py:42
Trk::two
@ two
Definition: TrkDetDescr/TrkSurfaces/TrkSurfaces/RealQuadraticEquation.h:23
Trk::SurfaceType::Disc
@ Disc
Trk::SurfaceType::Cylinder
@ Cylinder