ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonReconstruction
MuonRecUtils
MuonLayerHough
src
MuonLayerHoughSelector.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MuonLayerHough/MuonLayerHoughSelector.h
"
6
7
#include <algorithm>
8
#include <cmath>
9
#include <iostream>
10
#include <utility>
11
12
namespace
MuonHough
{
13
14
using
valPair
= std::pair<int, float>;
15
16
MuonLayerHoughSelector::MuonLayerHoughSelector
(std::vector<std::pair<int, float>> cutValues)
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
}
24
25
MuonLayerHoughSelector::~MuonLayerHoughSelector
() =
default
;
26
27
float
MuonLayerHoughSelector::getCutValue
(
float
position)
const
{
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
}
34
35
float
MuonLayerHoughSelector::getMinCutValue
()
const
{
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
}
42
43
bool
MuonLayerHoughSelector::passesCutValue
(
float
testValue,
float
position)
const
{
return
testValue >
getCutValue
(position); }
44
45
}
// namespace MuonHough
a
static Double_t a
Definition
LArPhysWaveHECTool.cxx:38
MuonLayerHoughSelector.h
MuonHough::MuonLayerHoughSelector::getCutValue
float getCutValue(float pos) const
Getter Methods.
Definition
MuonLayerHoughSelector.cxx:27
MuonHough::MuonLayerHoughSelector::~MuonLayerHoughSelector
virtual ~MuonLayerHoughSelector()
Destructor.
MuonHough::MuonLayerHoughSelector::m_cutValues
std::vector< std::pair< int, float > > m_cutValues
Definition
MuonLayerHoughSelector.h:31
MuonHough::MuonLayerHoughSelector::getMinCutValue
float getMinCutValue() const
Definition
MuonLayerHoughSelector.cxx:35
MuonHough::MuonLayerHoughSelector::passesCutValue
bool passesCutValue(float testValue, float position) const
Definition
MuonLayerHoughSelector.cxx:43
MuonHough::MuonLayerHoughSelector::MuonLayerHoughSelector
MuonLayerHoughSelector()=default
Default constructor.
MuonHough
Definition
MuonLayerHoughTool.h:40
MuonHough::valPair
std::pair< int, float > valPair
Definition
MuonLayerHoughSelector.cxx:14
std
STL namespace.
std::sort
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
Definition
DVL_algorithms.h:554
Generated on
for ATLAS Offline Software by
1.17.0