ATLAS Offline Software
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
asg::AcceptData Class Referencefinal

#include <AcceptData.h>

Collaboration diagram for asg::AcceptData:

Public Member Functions

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

Static Public Attributes

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

Private Attributes

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

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  {}

Member Function Documentation

◆ clear()

void asg::AcceptData::clear ( )
inline

Clear all bits.

Definition at line 54 of file AcceptData.h.

54 { m_accept.reset(); }

◆ clearPositive()

void asg::AcceptData::clearPositive ( )
inline

Set all bits to true.

Definition at line 57 of file AcceptData.h.

58  {
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  }

◆ 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  }

◆ 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  }

◆ 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:
asg::AcceptData::getCutResultInvertedBitSet
std::bitset< NBITS > getCutResultInvertedBitSet() const
Get an inverted bitset of the cut result.
Definition: AcceptData.h:119
asg::AcceptData::m_accept
std::bitset< NBITS > m_accept
The cut bits.
Definition: AcceptData.h:160
asg::AcceptInfo::getCutPosition
unsigned int getCutPosition(const std::string &cutName) const
Get the bit position of a cut.
Definition: AcceptInfo.h:73
asg::AcceptData::getCutPosition
unsigned int getCutPosition(const std::string &cutName) const
Get the bit position of a cut.
Definition: AcceptData.h:71
asg::AcceptInfo::getCutName
const std::string & getCutName(unsigned int cutPosition) const
Get the name of a cut, based on the cut position (slow, avoid usage)
Definition: AcceptInfo.cxx:36
asg::AcceptInfo::getNCuts
unsigned int getNCuts() const
Get the number of cuts defined.
Definition: AcceptInfo.h:46
asg::AcceptData::m_info
const AcceptInfo * m_info
the info structure describing us
Definition: AcceptData.h:157
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
asg::AcceptData::setCutResult
void setCutResult(const std::string &cutName, bool cutResult)
Set the result of a cut, based on the cut name (safer)
Definition: AcceptData.h:134
asg::AcceptData::getCutResult
bool getCutResult(const std::string &cutName) const
Get the result of a cut, based on the cut name (safer)
Definition: AcceptData.h:98
asg::AcceptInfo::getName
const char * getName() const
Get the name of the class instance.
Definition: AcceptInfo.h:43
asg::AcceptInfo::getCutDescription
const std::string & getCutDescription(const std::string &cutName) const
Get the description of a cut, based on the cut name.
Definition: AcceptInfo.cxx:119
asg::AcceptInfo::getCutMask
const std::bitset< NBITS > & getCutMask() const
Get a bitmask for all cuts defined.
Definition: AcceptInfo.h:49