ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
MuonHough::MuonLayerHoughSelector Class Reference

#include <MuonLayerHoughSelector.h>

Collaboration diagram for MuonHough::MuonLayerHoughSelector:

Public Member Functions

 MuonLayerHoughSelector ()=default
 Default constructor. More...
 
 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. More...
 
float getCutValue (float pos) const
 Getter Methods. More...
 
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  }

◆ ~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  }

◆ 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); }

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:
plotting.yearwise_luminosity_vs_mu.comp
comp
Definition: yearwise_luminosity_vs_mu.py:24
MuonHough::MuonLayerHoughSelector::m_cutValues
std::vector< std::pair< int, float > > m_cutValues
Definition: MuonLayerHoughSelector.h:31
BindingsTest.cut
cut
This script demonstrates how to call a C++ class from Python Also how to use PyROOT is shown.
Definition: BindingsTest.py:13
MuonHough::MuonLayerHoughSelector::getMinCutValue
float getMinCutValue() const
Definition: MuonLayerHoughSelector.cxx:35
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
a
TList * a
Definition: liststreamerinfos.cxx:10
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
MuonHough::valPair
std::pair< int, float > valPair
Definition: MuonLayerHoughSelector.cxx:14
MuonHough::MuonLayerHoughSelector::getCutValue
float getCutValue(float pos) const
Getter Methods.
Definition: MuonLayerHoughSelector.cxx:27