ATLAS Offline Software
Loading...
Searching...
No Matches
stepInfoDistCompare Class Reference
Collaboration diagram for stepInfoDistCompare:

Public Types

enum  CompareType { RHO , R , Z }

Public Member Functions

 stepInfoDistCompare (const CompareType type)
bool operator() (const ShowerLib::StepInfo *first, const ShowerLib::StepInfo *second) const

Private Member Functions

bool sortFunction (const ShowerLib::StepInfo *first, const ShowerLib::StepInfo *second, const CompareType type) const

Private Attributes

CompareType m_type

Detailed Description

Definition at line 58 of file LArG4GenShowerLib.cxx.

Member Enumeration Documentation

◆ CompareType

Constructor & Destructor Documentation

◆ stepInfoDistCompare()

stepInfoDistCompare::stepInfoDistCompare ( const CompareType type)
inlineexplicit

Definition at line 61 of file LArG4GenShowerLib.cxx.

61: m_type(type) {}

Member Function Documentation

◆ operator()()

bool stepInfoDistCompare::operator() ( const ShowerLib::StepInfo * first,
const ShowerLib::StepInfo * second ) const
inline

Definition at line 62 of file LArG4GenShowerLib.cxx.

62 {
63 return sortFunction(first, second, m_type );
64 }
bool sortFunction(const ShowerLib::StepInfo *first, const ShowerLib::StepInfo *second, const CompareType type) const

◆ sortFunction()

bool stepInfoDistCompare::sortFunction ( const ShowerLib::StepInfo * first,
const ShowerLib::StepInfo * second,
const CompareType type ) const
inlineprivate

Definition at line 68 of file LArG4GenShowerLib.cxx.

68 {
69 if (type == RHO) {
70 if (first->position().mag2() < second->position().mag2()) return true;
71 return false;
72 } else if (type == R) {
73 if (first->position().perp2() < second->position().perp2()) return true;
74 return false;
75 } else if (type == Z) {
76 if (first->position().z() < second->position().z()) return true;
77 return false;
78 }
79 return true; //it's here just to avoid warnings
80 }
bool first
Definition DeMoScan.py:534

Member Data Documentation

◆ m_type

CompareType stepInfoDistCompare::m_type
private

Definition at line 66 of file LArG4GenShowerLib.cxx.


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