ATLAS Offline Software
Loading...
Searching...
No Matches
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 }
virtual const CylinderBounds & bounds() const override final
This method returns the CylinderBounds by reference (NoBounds is not possible for cylinder)
virtual double r() const override final
This method returns the radius.

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