ATLAS Offline Software
Loading...
Searching...
No Matches
asg::AcceptData Class Referencefinal

#include <AcceptData.h>

Collaboration diagram for asg::AcceptData:

Public Member Functions

 AcceptData (const AcceptInfo *val_info)
 Standard constructor.
 operator bool () const
 Overload the boolean cast; allows for: if(myAcceptData).
const char * getName () const
 Get the name of the class instance.
void clear ()
 Clear all bits.
void clearPositive ()
 Set all bits to true.
unsigned int getNCuts () const
 Get the number of cuts defined.
std::bitset< NBITSgetCutMask () const
 Get a bitmask for all cuts defined.
unsigned int getCutPosition (std::string_view cutName) const
 Get the bit position of a cut.
const std::string & getCutName (unsigned int cutPosition) const
 Get the name of a cut, based on the cut position (slow, avoid usage).
const std::string & getCutDescription (const std::string &cutName) const
 Get the description of a cut, based on the cut name.
const std::string & getCutDescription (unsigned int cutPosition) const
 Get the description of a cut, based on the cut position.
bool getCutResult (std::string_view cutName) const
 Get the result of a cut, based on the cut name (safer).
bool getCutResult (unsigned int cutPosition) const
 Get the result of a cut, based on the cut position (faster).
const std::bitset< NBITS > & getCutResultBitSet () const
 Get the cut result bitset.
std::bitset< NBITSgetCutResultInvertedBitSet () const
 Get an inverted bitset of the cut result.
unsigned int getCutResultInverted () const
 Get an inverted bitset as an unsigned integer of the cut result.
void setCutResult (const std::string &cutName, bool cutResult)
 Set the result of a cut, based on the cut name (safer).
void setCutResult (unsigned int cutPosition, bool cutResult)
 Get the result of a cut, based on the cut position (faster).
AcceptDataoperator|= (const AcceptData &other)

Static Public Attributes

static const unsigned int NBITS =AcceptInfo::NBITS
 The number of bits for cuts.

Private Attributes

const AcceptInfom_info = nullptr
 the info structure describing us
std::bitset< NBITSm_accept
 The cut bits.

Detailed Description

Definition at line 30 of file AcceptData.h.

Constructor & Destructor Documentation

◆ AcceptData()

asg::AcceptData::AcceptData ( const AcceptInfo * val_info)
inlineexplicit

Standard constructor.

Definition at line 38 of file AcceptData.h.

39 : m_info (val_info)
40 {}
const AcceptInfo * m_info
the info structure describing us
Definition AcceptData.h:158

Member Function Documentation

◆ clear()

void asg::AcceptData::clear ( )
inline

Clear all bits.

Definition at line 55 of file AcceptData.h.

55{ m_accept.reset(); }
std::bitset< NBITS > m_accept
The cut bits.
Definition AcceptData.h:161

◆ clearPositive()

void asg::AcceptData::clearPositive ( )
inline

Set all bits to true.

Definition at line 58 of file AcceptData.h.

59 {
60 m_accept = m_info->getCutMask();
61 }

◆ getCutDescription() [1/2]

const std::string & asg::AcceptData::getCutDescription ( const std::string & cutName) const
inline

Get the description of a cut, based on the cut name.

Definition at line 86 of file AcceptData.h.

87 {
88 return m_info->getCutDescription (cutName);
89 }

◆ getCutDescription() [2/2]

const std::string & asg::AcceptData::getCutDescription ( unsigned int cutPosition) const
inline

Get the description of a cut, based on the cut position.

Definition at line 92 of file AcceptData.h.

93 {
94 return m_info->getCutDescription (cutPosition);
95 }

◆ getCutMask()

std::bitset< NBITS > asg::AcceptData::getCutMask ( ) const
inline

Get a bitmask for all cuts defined.

Definition at line 68 of file AcceptData.h.

68{ return m_info->getCutMask(); };

◆ getCutName()

const std::string & asg::AcceptData::getCutName ( unsigned int cutPosition) const
inline

Get the name of a cut, based on the cut position (slow, avoid usage).

Definition at line 79 of file AcceptData.h.

80 {
81 return m_info->getCutName (cutPosition);
82 };

◆ getCutPosition()

unsigned int asg::AcceptData::getCutPosition ( std::string_view cutName) const
inline

Get the bit position of a cut.

Definition at line 72 of file AcceptData.h.

73 {
74 return m_info->getCutPosition(cutName);
75 }

◆ getCutResult() [1/2]

bool asg::AcceptData::getCutResult ( std::string_view cutName) const
inline

Get the result of a cut, based on the cut name (safer).

Definition at line 99 of file AcceptData.h.

100 {
101 unsigned int cutPosition = getCutPosition(cutName);
102 return getCutResult(cutPosition);
103 }
unsigned int getCutPosition(std::string_view cutName) const
Get the bit position of a cut.
Definition AcceptData.h:72
bool getCutResult(std::string_view cutName) const
Get the result of a cut, based on the cut name (safer).
Definition AcceptData.h:99

◆ getCutResult() [2/2]

bool asg::AcceptData::getCutResult ( unsigned int cutPosition) const
inline

Get the result of a cut, based on the cut position (faster).

Definition at line 106 of file AcceptData.h.

107 {
108 return m_accept[cutPosition];
109 }

◆ getCutResultBitSet()

const std::bitset< NBITS > & asg::AcceptData::getCutResultBitSet ( ) const
inline

Get the cut result bitset.

Definition at line 113 of file AcceptData.h.

114 {
115 return m_accept;
116 }

◆ getCutResultInverted()

unsigned int asg::AcceptData::getCutResultInverted ( ) const
inline

Get an inverted bitset as an unsigned integer of the cut result.

This is IsEM-style, i.e, 0 means that all cuts are passed

Definition at line 127 of file AcceptData.h.

128 {
129 return getCutResultInvertedBitSet().to_ulong();
130 }
std::bitset< NBITS > getCutResultInvertedBitSet() const
Get an inverted bitset of the cut result.
Definition AcceptData.h:120

◆ getCutResultInvertedBitSet()

std::bitset< NBITS > asg::AcceptData::getCutResultInvertedBitSet ( ) const
inline

Get an inverted bitset of the cut result.

This is IsEM-style, i.e, 0 means the cut is passed

Definition at line 120 of file AcceptData.h.

121 {
122 return m_accept ^ m_info->getCutMask();
123 }

◆ getName()

const char * asg::AcceptData::getName ( ) const
inline

Get the name of the class instance.

Definition at line 51 of file AcceptData.h.

51{ return m_info->getName(); };

◆ getNCuts()

unsigned int asg::AcceptData::getNCuts ( ) const
inline

Get the number of cuts defined.

Definition at line 65 of file AcceptData.h.

65{ return m_info->getNCuts(); };

◆ operator bool()

asg::AcceptData::operator bool ( ) const
inlineexplicit

Overload the boolean cast; allows for: if(myAcceptData).

Definition at line 44 of file AcceptData.h.

45 {
46 return m_accept == m_info->getCutMask();
47 };

◆ operator|=()

AcceptData & asg::AcceptData::operator|= ( const AcceptData & other)
inline

Definition at line 147 of file AcceptData.h.

148 {
149 assert (m_info == other.m_info);
150 m_accept |= other.m_accept;
151 return *this;
152 }

◆ setCutResult() [1/2]

void asg::AcceptData::setCutResult ( const std::string & cutName,
bool cutResult )
inline

Set the result of a cut, based on the cut name (safer).

Definition at line 135 of file AcceptData.h.

136 {
137 unsigned int cutPosition = getCutPosition(cutName);
138 return setCutResult( cutPosition, cutResult );
139 }
void setCutResult(const std::string &cutName, bool cutResult)
Set the result of a cut, based on the cut name (safer).
Definition AcceptData.h:135

◆ setCutResult() [2/2]

void asg::AcceptData::setCutResult ( unsigned int cutPosition,
bool cutResult )
inline

Get the result of a cut, based on the cut position (faster).

Definition at line 142 of file AcceptData.h.

143 {
144 m_accept[cutPosition] = cutResult;
145 }

Member Data Documentation

◆ m_accept

std::bitset<NBITS> asg::AcceptData::m_accept
private

The cut bits.

Definition at line 161 of file AcceptData.h.

◆ m_info

const AcceptInfo* asg::AcceptData::m_info = nullptr
private

the info structure describing us

Definition at line 158 of file AcceptData.h.

◆ NBITS

const unsigned int asg::AcceptData::NBITS =AcceptInfo::NBITS
static

The number of bits for cuts.

Definition at line 35 of file AcceptData.h.


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