ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
Jet
JetMonitoring
Root
JetEventSelector.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 "
JetMonitoring/JetEventSelector.h
"
6
7
8
JetEventSelector::JetEventSelector
(
const
std::string &t)
9
:
asg
::
AsgTool
(t)
10
,
m_var
(this)
11
{
12
13
declareProperty
(
"CutMin"
,
m_min
);
14
declareProperty
(
"CutMax"
,
m_max
);
15
declareProperty
(
"Var"
,
m_var
);
16
}
17
18
JetEventSelector:: ~JetEventSelector
()=
default
;
19
20
StatusCode
JetEventSelector::initialize
() {
21
22
for
(
unsigned
int
it = 0; it <
m_var
.size(); it++) {
23
ATH_CHECK
(
m_var
[it].retrieve());
24
ATH_MSG_DEBUG
(
"Selecting on var ("
<<
m_var
[it]->varName() <<
") in ["
<<
m_min
.at(it) <<
" , "
<<
m_max
.at(it)<<
"]"
);
25
}
26
return
StatusCode::SUCCESS;
27
}
28
29
// This IJetEventSelector implementation uses EventHistoVarTool to
30
// retrieve EventInfo attribute.
31
// Note: xAOD:EventInfo passing not needed as EventHistoVarTool member (m_var)
32
// configured for and accesses EventInfo attribute directly.
33
int
JetEventSelector::keep
(
const
xAOD::EventInfo
&
/*not used in this implementation*/
,
const
xAOD::JetContainer
& jets)
const
{
34
35
for
(
unsigned
int
it = 0; it <
m_var
.size(); it++) {
36
float
v =
m_var
[it]->value(jets);
37
if
((
m_min
.at(it) > v) || (
m_max
.at(it) < v))
return
false
;
38
}
39
return
true
;
40
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
JetEventSelector.h
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
JetEventSelector::m_var
ToolHandleArray< IEventHistoVarTool > m_var
Definition
JetEventSelector.h:32
JetEventSelector::m_max
std::vector< float > m_max
Definition
JetEventSelector.h:30
JetEventSelector::m_min
std::vector< float > m_min
Definition
JetEventSelector.h:29
JetEventSelector::JetEventSelector
JetEventSelector(const std::string &t)
Definition
JetEventSelector.cxx:8
JetEventSelector::~JetEventSelector
virtual ~JetEventSelector()
JetEventSelector::keep
int keep(const xAOD::EventInfo &e, const xAOD::JetContainer &jets) const
Method to select.
Definition
JetEventSelector.cxx:33
JetEventSelector::initialize
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
Definition
JetEventSelector.cxx:20
asg::AsgTool::AsgTool
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition
AsgTool.cxx:58
asg
Definition
DataHandleTestTool.h:28
xAOD::EventInfo
EventInfo_v1 EventInfo
Definition of the latest event info version.
Definition
IEventInfoCnvTool.h:16
xAOD::JetContainer
JetContainer_v1 JetContainer
Definition of the current "jet container version".
Definition
JetContainer.h:17
Generated on
for ATLAS Offline Software by
1.17.0