ATLAS Offline Software
Public Member Functions | List of all members
ActsTrk::SurfaceBoundSet< BoundType >::BoundComparer Struct Reference

: Comparison struct to construct sets of Acts::Surface bounds with unique elements. More...

Collaboration diagram for ActsTrk::SurfaceBoundSet< BoundType >::BoundComparer:

Public Member Functions

bool operator() (const std::shared_ptr< BoundType > &a, const std::shared_ptr< BoundType > &b) const
 

Detailed Description

template<class BoundType>
struct ActsTrk::SurfaceBoundSet< BoundType >::BoundComparer

: Comparison struct to construct sets of Acts::Surface bounds with unique elements.

Two elements are considered to be identical if all of their parameters match within epsilon. Combined with the native insert mechanism of the set, one can easily propagate the same bound object to multiple surfaces.

Definition at line 30 of file SurfaceBoundSet.h.

Member Function Documentation

◆ operator()()

template<class BoundType >
bool ActsTrk::SurfaceBoundSet< BoundType >::BoundComparer::operator() ( const std::shared_ptr< BoundType > &  a,
const std::shared_ptr< BoundType > &  b 
) const
inline

Definition at line 31 of file SurfaceBoundSet.h.

32  {
33  if (a->type() != b->type()) {
34  return static_cast<int>(a->type()) < static_cast<int>(b->type());
35  }
36  const std::vector<double> avalues{a->values()};
37  const std::vector<double> bvalues{b->values()};
38  std::size_t size = avalues.size();
39  for(std::size_t i=0; i<size-1; ++i) {
40  if(std::abs(avalues[i]- bvalues[i]) > std::numeric_limits<double>::epsilon()){
41  return avalues[i] < bvalues[i];
42  }
43  }
44  return avalues[size-1] < bvalues[size-1];
45  }

The documentation for this struct was generated from the following file:
lumiFormat.i
int i
Definition: lumiFormat.py:92
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
a
TList * a
Definition: liststreamerinfos.cxx:10
ActsTrk::SurfaceBoundSet::size
size_t size() const
Definition: SurfaceBoundSet.h:23