ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
xAOD::MissingETAssociationHelper Class Reference

#include <MissingETAssociationHelper.h>

Collaboration diagram for xAOD::MissingETAssociationHelper:

Public Member Functions

 MissingETAssociationHelper ()
 Default constructor. More...
 
 MissingETAssociationHelper (const MissingETAssociationMap_v1 *map)
 Construct with a map. More...
 
virtual ~MissingETAssociationHelper ()
 Base class destructor. More...
 
bool objSelected (const MissingETAssociation_v1 *assoc, size_t objIdx) const
 Test if object is selected for MET calculation. More...
 
bool objSelected (const MissingETAssociation_v1 *assoc, const IParticle *pPart) const
 Test if object is selected for MET calculation. More...
 
MissingETBase::Types::bitmask_t getObjSelectionFlags (const MissingETAssociation_v1 *assoc) const
 Return object selection bitmask for the given association. More...
 
void setObjSelectionFlag (const MissingETAssociation_v1 *assoc, size_t objIdx, bool status)
 Flag object as selected for MET calculation. More...
 
void setObjSelectionFlag (const MissingETAssociation_v1 *assoc, const IParticle *pPart, bool status)
 Flag object as selected for MET calculation. More...
 
void resetObjSelectionFlags ()
 
const MissingETAssociationMap_v1map () const
 

Private Attributes

const MissingETAssociationMap_v1m_map
 
std::vector< MissingETBase::Types::bitmask_tm_useObjectFlags
 

Detailed Description

Definition at line 25 of file MissingETAssociationHelper.h.

Constructor & Destructor Documentation

◆ MissingETAssociationHelper() [1/2]

MissingETAssociationHelper::MissingETAssociationHelper ( )

Default constructor.

Definition at line 23 of file MissingETAssociationHelper.cxx.

24  : m_map(nullptr)
25 { }

◆ MissingETAssociationHelper() [2/2]

MissingETAssociationHelper::MissingETAssociationHelper ( const MissingETAssociationMap_v1 map)

Construct with a map.

Definition at line 27 of file MissingETAssociationHelper.cxx.

28  : m_map(map)
29 { }

◆ ~MissingETAssociationHelper()

MissingETAssociationHelper::~MissingETAssociationHelper ( )
virtual

Base class destructor.

Definition at line 31 of file MissingETAssociationHelper.cxx.

32 { }

Member Function Documentation

◆ getObjSelectionFlags()

MissingETBase::Types::bitmask_t MissingETAssociationHelper::getObjSelectionFlags ( const MissingETAssociation_v1 assoc) const

Return object selection bitmask for the given association.

Definition at line 64 of file MissingETAssociationHelper.cxx.

65 {
66  if(!assoc) throw std::runtime_error("MissingETAssociationHelper::getObjSelectionFlags received a null pointer");
67  if(assoc->index() >= m_useObjectFlags.size()) return 0; // No flag for this association has been set to 1 yet
68  return m_useObjectFlags.at(assoc->index());
69 }

◆ map()

const MissingETAssociationMap_v1* xAOD::MissingETAssociationHelper::map ( ) const
inline

Definition at line 45 of file MissingETAssociationHelper.h.

45 { return m_map; }

◆ objSelected() [1/2]

bool MissingETAssociationHelper::objSelected ( const MissingETAssociation_v1 assoc,
const IParticle pPart 
) const

Test if object is selected for MET calculation.

Definition at line 58 of file MissingETAssociationHelper.cxx.

59 {
60  if(!assoc) throw std::runtime_error("MissingETAssociationHelper::objSelected received a null pointer");
61  return this->objSelected(assoc, assoc->findIndex(pPart));
62 }

◆ objSelected() [2/2]

bool MissingETAssociationHelper::objSelected ( const MissingETAssociation_v1 assoc,
size_t  objIdx 
) const

Test if object is selected for MET calculation.

Definition at line 49 of file MissingETAssociationHelper.cxx.

50 {
51  if(!assoc) throw std::runtime_error("MissingETAssociationHelper::objSelected received a null pointer");
52  size_t index = assoc->index();
53  if(index >= m_useObjectFlags.size()) return false; // No flag for this association has been set to 1 yet
54  if (objIdx >= sizeof(MissingETBase::Types::bitmask_t)*CHAR_BIT) return false;
55  return bool(m_useObjectFlags.at(index) & (static_cast<MissingETBase::Types::bitmask_t>(1)<<objIdx));
56 }

◆ resetObjSelectionFlags()

void xAOD::MissingETAssociationHelper::resetObjSelectionFlags ( )
inline

Definition at line 44 of file MissingETAssociationHelper.h.

44 { m_useObjectFlags.clear(); }

◆ setObjSelectionFlag() [1/2]

void MissingETAssociationHelper::setObjSelectionFlag ( const MissingETAssociation_v1 assoc,
const IParticle pPart,
bool  status 
)

Flag object as selected for MET calculation.

Definition at line 43 of file MissingETAssociationHelper.cxx.

44 {
45  if(!assoc) throw std::runtime_error("MissingETAssociationHelper::setObjSelectionFlag received a null pointer");
46  this->setObjSelectionFlag(assoc,assoc->findIndex(pPart),status);
47 }

◆ setObjSelectionFlag() [2/2]

void MissingETAssociationHelper::setObjSelectionFlag ( const MissingETAssociation_v1 assoc,
size_t  objIdx,
bool  status 
)

Flag object as selected for MET calculation.

Definition at line 34 of file MissingETAssociationHelper.cxx.

35 {
36  if(!assoc) throw std::runtime_error("MissingETAssociationHelper::setObjSelectionFlag received a null pointer");
37  size_t index = assoc->index();
38  if(index >= m_useObjectFlags.size()) m_useObjectFlags.resize(index+1, 0);
39  if(status) m_useObjectFlags.at(index) |= (1<<objIdx);
40  else m_useObjectFlags.at(index) &= ~(1<<objIdx);
41 }

Member Data Documentation

◆ m_map

const MissingETAssociationMap_v1* xAOD::MissingETAssociationHelper::m_map
private

Definition at line 49 of file MissingETAssociationHelper.h.

◆ m_useObjectFlags

std::vector<MissingETBase::Types::bitmask_t> xAOD::MissingETAssociationHelper::m_useObjectFlags
private

Definition at line 51 of file MissingETAssociationHelper.h.


The documentation for this class was generated from the following files:
index
Definition: index.py:1
xAOD::MissingETAssociationHelper::m_map
const MissingETAssociationMap_v1 * m_map
Definition: MissingETAssociationHelper.h:49
xAOD::MissingETAssociationHelper::setObjSelectionFlag
void setObjSelectionFlag(const MissingETAssociation_v1 *assoc, size_t objIdx, bool status)
Flag object as selected for MET calculation.
Definition: MissingETAssociationHelper.cxx:34
xAOD::MissingETAssociationHelper::map
const MissingETAssociationMap_v1 * map() const
Definition: MissingETAssociationHelper.h:45
MissingETBase::Types::bitmask_t
uint64_t bitmask_t
Type for status word bit mask.
Definition: MissingETBase.h:39
xAOD::MissingETAssociation_v1::findIndex
size_t findIndex(const IParticle *pPart) const
Find index of given object in contributing object store.
Definition: MissingETAssociation_v1.cxx:268
xAOD::MissingETAssociationHelper::m_useObjectFlags
std::vector< MissingETBase::Types::bitmask_t > m_useObjectFlags
Definition: MissingETAssociationHelper.h:51
SG::AuxElement::index
size_t index() const
Return the index of this element within its container.
xAOD::MissingETAssociationHelper::objSelected
bool objSelected(const MissingETAssociation_v1 *assoc, size_t objIdx) const
Test if object is selected for MET calculation.
Definition: MissingETAssociationHelper.cxx:49
merge.status
status
Definition: merge.py:17
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60