ATLAS Offline Software
Loading...
Searching...
No Matches
CP::SelectionAccessorExprOr Class Reference

Implements a SelectionAccessor that performs a binary logical OR. More...

#include <SelectionAccessorExprOr.h>

Inheritance diagram for CP::SelectionAccessorExprOr:
Collaboration diagram for CP::SelectionAccessorExprOr:

Public Member Functions

 SelectionAccessorExprOr (std::unique_ptr< ISelectionReadAccessor > left, std::unique_ptr< ISelectionReadAccessor > right)
virtual bool getBool (const SG::AuxElement &element, const CP::SystematicSet *sys) const override
virtual std::string label () const override
virtual CP::SystematicSet getInputAffecting (const ISystematicsSvc &svc, const std::string &objectName) const override
 get the systematics when reading from the decoration
virtual StatusCode fillSystematics (const ISystematicsSvc &svc, const std::vector< CP::SystematicSet > &sysList, const std::string &objectName) override
 fill the systematic variations
virtual SelectionType getBits (const SG::AuxElement &element, const CP::SystematicSet *sys) const override
 get the selection decoration
virtual bool isBool () const override
 whether this accessor returns a simple boolean

Private Attributes

std::unique_ptr< ISelectionReadAccessorm_left
std::unique_ptr< ISelectionReadAccessorm_right

Detailed Description

Implements a SelectionAccessor that performs a binary logical OR.

Definition at line 15 of file SelectionAccessorExprOr.h.

Constructor & Destructor Documentation

◆ SelectionAccessorExprOr()

CP::SelectionAccessorExprOr::SelectionAccessorExprOr ( std::unique_ptr< ISelectionReadAccessor > left,
std::unique_ptr< ISelectionReadAccessor > right )
Parameters
leftLeft argument to the OR expression
RightRight argument to the OR expression

Definition at line 11 of file SelectionAccessorExprOr.cxx.

14 : m_left(std::move(left)), m_right(std::move(right)) {}
std::unique_ptr< ISelectionReadAccessor > m_left
std::unique_ptr< ISelectionReadAccessor > m_right

Member Function Documentation

◆ fillSystematics()

StatusCode CP::SelectionAccessorExprOr::fillSystematics ( const ISystematicsSvc & svc,
const std::vector< CP::SystematicSet > & sysList,
const std::string & objectName )
overridevirtual

fill the systematic variations

Implements CP::ISelectionReadAccessor.

Definition at line 34 of file SelectionAccessorExprOr.cxx.

38{
39 using namespace msgSelectionHelpers;
40
41 ANA_CHECK (m_left->fillSystematics (svc, sysList, objectName));
42 ANA_CHECK (m_right->fillSystematics (svc, sysList, objectName));
43 return StatusCode::SUCCESS;
44}
#define ANA_CHECK(EXP)
check whether the given expression was successful

◆ getBits()

SelectionType CP::SelectionAccessorExprBase::getBits ( const SG::AuxElement & element,
const CP::SystematicSet * sys ) const
overridevirtualinherited

get the selection decoration

Implements CP::ISelectionReadAccessor.

Definition at line 9 of file SelectionAccessorExprBase.cxx.

11 {
12 return getBool(element,sys) ? selectionAccept() : selectionReject();
13}
virtual bool getBool(const SG::AuxElement &element, const CP::SystematicSet *sys=nullptr) const =0
get the selection decoration
constexpr SelectionType selectionReject()
the selection decoration to apply for objects that are rejected
constexpr SelectionType selectionAccept()
the selection decoration to apply for objects that are selected

◆ getBool()

bool CP::SelectionAccessorExprOr::getBool ( const SG::AuxElement & element,
const CP::SystematicSet * sys ) const
overridevirtual
Parameters
elementAuxElement to evaluate the selection on
Returns
The result of the expression left OR right

Implements CP::ISelectionReadAccessor.

Definition at line 16 of file SelectionAccessorExprOr.cxx.

17 {
18 return m_left->getBool(element,sys) || m_right->getBool(element,sys);
19}

◆ getInputAffecting()

CP::SystematicSet CP::SelectionAccessorExprOr::getInputAffecting ( const ISystematicsSvc & svc,
const std::string & objectName ) const
overridevirtual

get the systematics when reading from the decoration

Implements CP::ISelectionReadAccessor.

Definition at line 25 of file SelectionAccessorExprOr.cxx.

28{
29 CP::SystematicSet result = m_left->getInputAffecting (svc, objectName);
30 result.insert (m_right->getInputAffecting (svc, objectName));
31 return result;
32}

◆ isBool()

bool CP::SelectionAccessorExprBase::isBool ( ) const
overridevirtualinherited

whether this accessor returns a simple boolean

Implements CP::ISelectionReadAccessor.

Definition at line 17 of file SelectionAccessorExprBase.cxx.

19{
20 return true;
21}

◆ label()

std::string CP::SelectionAccessorExprOr::label ( ) const
overridevirtual
Returns
Returns a readable and parseable representation

Implements CP::ISelectionReadAccessor.

Definition at line 21 of file SelectionAccessorExprOr.cxx.

21 {
22 return "( " + m_left->label() + " || " + m_right->label() + " )";
23}

Member Data Documentation

◆ m_left

std::unique_ptr<ISelectionReadAccessor> CP::SelectionAccessorExprOr::m_left
private

Definition at line 40 of file SelectionAccessorExprOr.h.

◆ m_right

std::unique_ptr<ISelectionReadAccessor> CP::SelectionAccessorExprOr::m_right
private

Definition at line 41 of file SelectionAccessorExprOr.h.


The documentation for this class was generated from the following files: