ATLAS Offline Software
Loading...
Searching...
No Matches
VariableDependency.icc
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5// $Id: VariableDependency.icc 689837 2015-08-17 17:22:12Z wsfreund $
6#ifndef RINGERSELECTORTOOLS_TOOLS_VARIABLEDEPENDENCY_ICC
7#define RINGERSELECTORTOOLS_TOOLS_VARIABLEDEPENDENCY_ICC
8
9// Local includes:
10#include "RingerSelectorTools/tools/VariableDependency.h"
11
12namespace Ringer {
13
14// =============================================================================
15inline
16bool VariableDependency::isWithinRange(const DepVarStruct &depVar) const
17{
18 return isWithinEtaRange(depVar.eta) && isWithinEtRange(depVar.et);
19}
20
21// =============================================================================
22inline
23bool VariableDependency::isWithinEtaRange(const float eta) const
24{
25 if ( static_cast<bool>(m_etaDependency) ){
26 const float eta_abs = std::abs(eta);
27 return ( (eta_abs >= m_etaMin) && (eta_abs < m_etaMax) );
28 } else {
29 return true;
30 }
31}
32
33// =============================================================================
34inline
35EtaDependency VariableDependency::etaDep() const {
36 return m_etaDependency;
37}
38
39// =============================================================================
40inline
41float VariableDependency::etaMin() const
42{
43 return m_etaMin;
44}
45
46// =============================================================================
47inline
48float VariableDependency::etaMax() const
49{
50 return m_etaMax;
51}
52
53// =============================================================================
54inline
55void VariableDependency::setEtaDep(const float etaMin, const float etaMax)
56{
57 m_etaDependency = EtaDependency::EtaDependent;
58 m_etaMin = etaMin;
59 m_etaMax = etaMax;
60}
61
62// =============================================================================
63inline
64bool VariableDependency::isWithinEtRange(const float et) const
65{
66 if ( static_cast<bool>(m_etDependency) ) {
67 return ( (et >= m_etMin) && (et < m_etMax) );
68 } else {
69 return true;
70 }
71}
72
73// =============================================================================
74inline
75EtDependency VariableDependency::etDep() const {
76 return m_etDependency;
77}
78
79// =============================================================================
80inline
81float VariableDependency::etMin() const
82{
83 return m_etMin;
84}
85
86// =============================================================================
87inline
88float VariableDependency::etMax() const
89{
90 return m_etMax;
91}
92
93// =============================================================================
94inline
95void VariableDependency::setEtDep(const float etMin, const float etMax)
96{
97 m_etDependency = EtDependency::EtDependent;
98 m_etMin = etMin;
99 m_etMax = etMax;
100}
101
102// =============================================================================
103inline
104void VariableDependency::setEtaEtDep(const float etaMin, const float etaMax,
105 const float etMin, const float etMax)
106{
107 setEtaDep(etaMin,etaMax);
108 setEtDep(etMin,etMax);
109}
110
111} // namespace Ringer
112
113#endif // RINGERSELECTORTOOLS_TOOLS_VARIABLEDEPENDENCY_ICC