ATLAS Offline Software
Loading...
Searching...
No Matches
MuonHough::MuonLayerHoughSelector Class Reference

#include <MuonLayerHoughSelector.h>

Collaboration diagram for MuonHough::MuonLayerHoughSelector:

Public Member Functions

 MuonLayerHoughSelector ()=default
 Default constructor.
 MuonLayerHoughSelector (const MuonLayerHoughSelector &)=default
 MuonLayerHoughSelector (MuonLayerHoughSelector &&)=default
MuonLayerHoughSelectoroperator= (MuonLayerHoughSelector &&)=default
MuonLayerHoughSelectoroperator= (const MuonLayerHoughSelector &)=default
 MuonLayerHoughSelector (std::vector< std::pair< int, float > > cutValues)
virtual ~MuonLayerHoughSelector ()
 Destructor.
float getCutValue (float pos) const
 Getter Methods.
float getMinCutValue () const
bool passesCutValue (float testValue, float position) const

Private Attributes

std::vector< std::pair< int, float > > m_cutValues

Detailed Description

Definition at line 12 of file MuonLayerHoughSelector.h.

Constructor & Destructor Documentation

◆ MuonLayerHoughSelector() [1/4]

MuonHough::MuonLayerHoughSelector::MuonLayerHoughSelector ( )
default

Default constructor.

◆ MuonLayerHoughSelector() [2/4]

MuonHough::MuonLayerHoughSelector::MuonLayerHoughSelector ( const MuonLayerHoughSelector & )
default

◆ MuonLayerHoughSelector() [3/4]

MuonHough::MuonLayerHoughSelector::MuonLayerHoughSelector ( MuonLayerHoughSelector && )
default

◆ MuonLayerHoughSelector() [4/4]

MuonHough::MuonLayerHoughSelector::MuonLayerHoughSelector ( std::vector< std::pair< int, float > > cutValues)

Definition at line 16 of file MuonLayerHoughSelector.cxx.

17 : m_cutValues (std::move (cutValues))
18 {
19 auto comp = [](const valPair& a, const valPair& b) -> bool { return a.first < b.first; };
20 std::sort(m_cutValues.begin(), m_cutValues.end(), comp);
21
22 if (getMinCutValue() < 0) std::cout << std::endl << "MuonLayerHoughSelector: Negative cuts found!!!" << std::endl;
23 }
static Double_t a
std::vector< std::pair< int, float > > m_cutValues
std::pair< int, float > valPair
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.

◆ ~MuonLayerHoughSelector()

MuonHough::MuonLayerHoughSelector::~MuonLayerHoughSelector ( )
virtualdefault

Destructor.

Member Function Documentation

◆ getCutValue()

float MuonHough::MuonLayerHoughSelector::getCutValue ( float pos) const

Getter Methods.

Definition at line 27 of file MuonLayerHoughSelector.cxx.

27 {
28 const float pos = std::abs(position);
29 for (const auto& cut : m_cutValues) {
30 if (cut.first < pos) return cut.second; // notice the array is already sorted
31 }
32 return m_cutValues.back().second;
33 }
cut
This script demonstrates how to call a C++ class from Python Also how to use PyROOT is shown.

◆ getMinCutValue()

float MuonHough::MuonLayerHoughSelector::getMinCutValue ( ) const

Definition at line 35 of file MuonLayerHoughSelector.cxx.

35 {
36 if (m_cutValues.empty()) {
37 std::cout << "MuonLayerHoughSelector: cutValues not available, returning invalid value";
38 return -999;
39 }
40 return m_cutValues[0].second;
41 }

◆ operator=() [1/2]

MuonLayerHoughSelector & MuonHough::MuonLayerHoughSelector::operator= ( const MuonLayerHoughSelector & )
default

◆ operator=() [2/2]

MuonLayerHoughSelector & MuonHough::MuonLayerHoughSelector::operator= ( MuonLayerHoughSelector && )
default

◆ passesCutValue()

bool MuonHough::MuonLayerHoughSelector::passesCutValue ( float testValue,
float position ) const

Definition at line 43 of file MuonLayerHoughSelector.cxx.

43{ return testValue > getCutValue(position); }
float getCutValue(float pos) const
Getter Methods.

Member Data Documentation

◆ m_cutValues

std::vector<std::pair<int, float> > MuonHough::MuonLayerHoughSelector::m_cutValues
private

Definition at line 31 of file MuonLayerHoughSelector.h.


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