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 (const std::string &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 (const std::string &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 29 of file AcceptData.h.

Constructor & Destructor Documentation

◆ AcceptData()

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

Standard constructor.

Definition at line 37 of file AcceptData.h.

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

Member Function Documentation

◆ clear()

void asg::AcceptData::clear ( )
inline

Clear all bits.

Definition at line 54 of file AcceptData.h.

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

◆ clearPositive()

void asg::AcceptData::clearPositive ( )
inline

Set all bits to true.

Definition at line 57 of file AcceptData.h.

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

◆ 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 85 of file AcceptData.h.

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

◆ 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 91 of file AcceptData.h.

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

◆ getCutMask()

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

Get a bitmask for all cuts defined.

Definition at line 67 of file AcceptData.h.

67{ 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 78 of file AcceptData.h.

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

◆ getCutPosition()

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

Get the bit position of a cut.

Definition at line 71 of file AcceptData.h.

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

◆ getCutResult() [1/2]

bool asg::AcceptData::getCutResult ( const std::string & cutName) const
inline

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

Definition at line 98 of file AcceptData.h.

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

◆ 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 105 of file AcceptData.h.

106 {
107 return m_accept[cutPosition];
108 }

◆ getCutResultBitSet()

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

Get the cut result bitset.

Definition at line 112 of file AcceptData.h.

113 {
114 return m_accept;
115 }

◆ 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 126 of file AcceptData.h.

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

◆ 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 119 of file AcceptData.h.

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

◆ getName()

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

Get the name of the class instance.

Definition at line 50 of file AcceptData.h.

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

◆ getNCuts()

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

Get the number of cuts defined.

Definition at line 64 of file AcceptData.h.

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

◆ operator bool()

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

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

Definition at line 43 of file AcceptData.h.

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

◆ operator|=()

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

Definition at line 146 of file AcceptData.h.

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

◆ 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 134 of file AcceptData.h.

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

◆ 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 141 of file AcceptData.h.

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

Member Data Documentation

◆ m_accept

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

The cut bits.

Definition at line 160 of file AcceptData.h.

◆ m_info

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

the info structure describing us

Definition at line 157 of file AcceptData.h.

◆ NBITS

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

The number of bits for cuts.

Definition at line 34 of file AcceptData.h.


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