Belle II Software  release-08-01-10
Const::DetectorSet Class Reference

The DetectorSet class for sets of detector IDs in the form of EDetector values. More...

#include <Const.h>

Inheritance diagram for Const::DetectorSet:

Classes

class  Iterator
 Iterator. More...
 

Public Member Functions

 DetectorSet ()
 Default constructor.
 
 DetectorSet (const DetectorSet &)=default
 Copy constructor.
 
DetectorSetoperator= (const DetectorSet &)=default
 Assignment operator.
 
 DetectorSet (EDetector det)
 Constructor for a set containig one detector ID. More...
 
virtual ~DetectorSet ()
 Destructor.
 
Iterator begin () const
 Beginning iterator.
 
Iterator end () const
 Ending iterator.
 
DetectorSetoperator+= (const DetectorSet &set)
 Addition of another set to this one. More...
 
DetectorSetoperator-= (const DetectorSet &set)
 Subtraction of another set from this one. More...
 
bool operator== (const DetectorSet &set) const
 Equality operator. More...
 
bool operator!= (const DetectorSet &set) const
 Inequality operator. More...
 
bool contains (const DetectorSet &set) const
 Check whether this set contains another set. More...
 
bool contains (const Iterator &it) const
 Check whether this set contains detector specified by iterator. More...
 
int getIndex (EDetector det) const
 Getter for the index of a given detector in this set. More...
 
size_t size () const
 Getter for number of detector IDs in this set.
 
std::string __str__ () const
 String for printing in python.
 

Private Member Functions

 DetectorSet (uint16_t bits)
 Constructor. More...
 
 ClassDef (DetectorSet, 1)
 Class version.
 

Static Private Member Functions

static uint16_t getBit (EDetector det)
 Conversion of detector ID to bit pattern. More...
 
static EDetector getDetector (uint16_t bit)
 Conversion of bit pattern to detector ID. More...
 

Private Attributes

uint16_t m_bits
 The internal representation of the set as bit pattern.
 

Detailed Description

The DetectorSet class for sets of detector IDs in the form of EDetector values.

Only detectors may be included, not subdetectors.

Definition at line 71 of file Const.h.

Constructor & Destructor Documentation

◆ DetectorSet() [1/2]

DetectorSet ( EDetector  det)
inline

Constructor for a set containig one detector ID.

Parameters
detThe ID of the detector.

Definition at line 181 of file Const.h.

◆ DetectorSet() [2/2]

DetectorSet ( uint16_t  bits)
inlineexplicitprivate

Constructor.

Parameters
bitsThe internal representation of the set as bit pattern.

Definition at line 260 of file Const.h.

Member Function Documentation

◆ contains() [1/2]

bool contains ( const DetectorSet set) const
inline

Check whether this set contains another set.

Parameters
setThe other set of detector IDs.

Definition at line 226 of file Const.h.

◆ contains() [2/2]

bool contains ( const Iterator it) const
inline

Check whether this set contains detector specified by iterator.

Parameters
[in]itIterator.

Definition at line 232 of file Const.h.

◆ getBit()

unsigned short getBit ( Const::EDetector  det)
staticprivate

Conversion of detector ID to bit pattern.

Parameters
detThe detector ID.
Returns
The bit pattern representing the given detector ID.

Definition at line 246 of file UnitConst.cc.

◆ getDetector()

Const::EDetector getDetector ( uint16_t  bit)
staticprivate

Conversion of bit pattern to detector ID.

Parameters
bitThe bit pattern.
Returns
The detector ID corresponding to the given bit pattern.

Definition at line 259 of file UnitConst.cc.

◆ getIndex()

int getIndex ( EDetector  det) const

Getter for the index of a given detector in this set.

Parameters
detThe detector ID.
Returns
Index of the detector ID in this set, or -1 if the detector ID is not in this set.

Definition at line 278 of file UnitConst.cc.

◆ operator!=()

bool operator!= ( const DetectorSet set) const
inline

Inequality operator.

Parameters
setThe other set of detector IDs.

Definition at line 220 of file Const.h.

◆ operator+=()

DetectorSet& operator+= ( const DetectorSet set)
inline

Addition of another set to this one.

Parameters
setThe other set of detector IDs.

Definition at line 202 of file Const.h.

◆ operator-=()

DetectorSet& operator-= ( const DetectorSet set)
inline

Subtraction of another set from this one.

Parameters
setThe other set of detector IDs.

Definition at line 208 of file Const.h.

◆ operator==()

bool operator== ( const DetectorSet set) const
inline

Equality operator.

Parameters
setThe other set of detector IDs.

Definition at line 214 of file Const.h.


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