ATLAS Offline Software
Loading...
Searching...
No Matches
MissingETAssociationHelper.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
9#include <stdexcept>
10
11using namespace xAOD;
12
14// Constructors and destructor //
16
20
24
27
29{
30 if(!assoc) throw std::runtime_error("MissingETAssociationHelper::setObjSelectionFlag received a null pointer");
31 size_t index = assoc->index();
32 if(index >= m_useObjectFlags.size()) m_useObjectFlags.resize(index+1, 0);
33 if(status) m_useObjectFlags.at(index) |= (1<<objIdx);
34 else m_useObjectFlags.at(index) &= ~(1<<objIdx);
35}
36
38{
39 if(!assoc) throw std::runtime_error("MissingETAssociationHelper::setObjSelectionFlag received a null pointer");
40 this->setObjSelectionFlag(assoc,assoc->findIndex(pPart),status);
41}
42
44{
45 if(!assoc) throw std::runtime_error("MissingETAssociationHelper::objSelected received a null pointer");
46 size_t index = assoc->index();
47 if(index >= m_useObjectFlags.size()) return false; // No flag for this association has been set to 1 yet
48 if (objIdx >= sizeof(MissingETBase::Types::bitmask_t)*CHAR_BIT) return false;
49 return bool(m_useObjectFlags.at(index) & (static_cast<MissingETBase::Types::bitmask_t>(1)<<objIdx));
50}
51
53{
54 if(!assoc) throw std::runtime_error("MissingETAssociationHelper::objSelected received a null pointer");
55 return this->objSelected(assoc, assoc->findIndex(pPart));
56}
57
59{
60 if(!assoc) throw std::runtime_error("MissingETAssociationHelper::getObjSelectionFlags received a null pointer");
61 if(assoc->index() >= m_useObjectFlags.size()) return 0; // No flag for this association has been set to 1 yet
62 return m_useObjectFlags.at(assoc->index());
63}
64
65
size_t index() const
Return the index of this element within its container.
Class providing the definition of the 4-vector interface.
MissingETBase::Types::bitmask_t getObjSelectionFlags(const MissingETAssociation_v1 *assoc) const
Return object selection bitmask for the given association.
std::vector< MissingETBase::Types::bitmask_t > m_useObjectFlags
const MissingETAssociationMap_v1 * m_map
bool objSelected(const MissingETAssociation_v1 *assoc, size_t objIdx) const
Test if object is selected for MET calculation.
void setObjSelectionFlag(const MissingETAssociation_v1 *assoc, const IParticle *pPart, bool status)
Flag object as selected for MET calculation.
virtual ~MissingETAssociationHelper()
Base class destructor.
const MissingETAssociationMap_v1 * map() const
void setObjSelectionFlag(const MissingETAssociation_v1 *assoc, size_t objIdx, bool status)
Flag object as selected for MET calculation.
MET association descriptor contains object links and corresponding parameters.
size_t findIndex(const IParticle *pPart) const
Find index of given object in contributing object store.
uint64_t bitmask_t
Type for status word bit mask.
Definition index.py:1
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
setBGCode setTAP setLVL2ErrorBits bool