ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigHypothesis
TrigHLTJetHypo
src
TrigJetConditionConfig_phi.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrigJetConditionConfig_phi.h
"
6
7
#include "GaudiKernel/StatusCode.h"
8
#include "
./PhiCondition.h
"
9
#include <cmath>
10
11
TrigJetConditionConfig_phi::TrigJetConditionConfig_phi
(
const
std::string&
type
,
12
const
std::string& name,
13
const
IInterface* parent) :
14
base_class(
type
, name, parent){
15
16
}
17
18
StatusCode
TrigJetConditionConfig_phi::initialize
() {
19
20
auto
convert = [](
const
std::string& s) {
21
22
if
(s ==
"PI"
){
23
return
M_PI
;
24
}
else
if
(s ==
"-PI"
) {
25
return
-
M_PI
;
26
}
27
return
std::stod(s);
28
};
29
30
try
{
31
m_min
= convert(
m_strmin
);
32
}
catch
(...) {
33
ATH_MSG_ERROR
(
"Cannot convert "
+
m_strmin
+
" to double"
);
34
return
StatusCode::FAILURE;
35
}
36
37
try
{
38
m_max
= convert(
m_strmax
);
39
}
catch
(...) {
40
ATH_MSG_ERROR
(
"Cannot convert "
+
m_strmax
+
" to double"
);
41
return
StatusCode::FAILURE;
42
}
43
44
CHECK
(
checkVals
());
45
return
StatusCode::SUCCESS;
46
}
47
48
49
Condition
TrigJetConditionConfig_phi::getCondition
()
const
{
50
return
std::make_unique<PhiCondition>(
m_min
,
m_max
);
51
}
52
53
54
StatusCode
TrigJetConditionConfig_phi::checkVals
()
const
{
55
56
if
(
m_min
>
m_max
){
57
ATH_MSG_ERROR
(
" min phi > max phi"
);
58
return
StatusCode::FAILURE;
59
}
60
61
if
(
m_min
< -
M_PI
) {
62
ATH_MSG_ERROR
(
" min phi "
<<
m_min
<<
" out of range"
);
63
return
StatusCode::FAILURE;
64
}
65
66
if
(
m_max
>
M_PI
) {
67
ATH_MSG_ERROR
(
" max phi "
<<
m_max
<<
" out of range"
);
68
return
StatusCode::FAILURE;
69
}
70
71
return
StatusCode::SUCCESS;
72
}
M_PI
#define M_PI
Definition
ActiveFraction.h:14
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
Condition
std::unique_ptr< ICondition > Condition
Definition
ConditionsDefs.h:19
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
PhiCondition.h
TrigJetConditionConfig_phi.h
TrigJetConditionConfig_phi::m_min
double m_min
Definition
TrigJetConditionConfig_phi.h:37
TrigJetConditionConfig_phi::m_max
double m_max
Definition
TrigJetConditionConfig_phi.h:38
TrigJetConditionConfig_phi::getCondition
virtual Condition getCondition() const override
Definition
TrigJetConditionConfig_phi.cxx:49
TrigJetConditionConfig_phi::checkVals
StatusCode checkVals() const
Definition
TrigJetConditionConfig_phi.cxx:54
TrigJetConditionConfig_phi::initialize
virtual StatusCode initialize() override
Definition
TrigJetConditionConfig_phi.cxx:18
TrigJetConditionConfig_phi::TrigJetConditionConfig_phi
TrigJetConditionConfig_phi(const std::string &type, const std::string &name, const IInterface *parent)
Definition
TrigJetConditionConfig_phi.cxx:11
TrigJetConditionConfig_phi::m_strmax
Gaudi::Property< std::string > m_strmax
Definition
TrigJetConditionConfig_phi.h:35
TrigJetConditionConfig_phi::m_strmin
Gaudi::Property< std::string > m_strmin
Definition
TrigJetConditionConfig_phi.h:32
type
Generated on
for ATLAS Offline Software by
1.17.0