ATLAS Offline Software
Loading...
Searching...
No Matches
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
6
7
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
19
21
22 for (unsigned int it = 0; it < m_var.size(); it++) {
23 ATH_CHECK(m_var[it].retrieve());
24 ATH_MSG_INFO( "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.
33int 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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ToolHandleArray< IEventHistoVarTool > m_var
std::vector< float > m_max
std::vector< float > m_min
JetEventSelector(const std::string &t)
virtual ~JetEventSelector()
int keep(const xAOD::EventInfo &e, const xAOD::JetContainer &jets) const
Method to select.
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
EventInfo_v1 EventInfo
Definition of the latest event info version.
JetContainer_v1 JetContainer
Definition of the current "jet container version".