Belle II Software  release-06-00-14
Const::RestrictedDetectorSet< ASetType > Class Template Reference

A class for sets of detector IDs whose content is limited to restricted set of valid detector IDs. More...

#include <Const.h>

Inheritance diagram for Const::RestrictedDetectorSet< ASetType >:
Collaboration diagram for Const::RestrictedDetectorSet< ASetType >:

Public Member Functions

 RestrictedDetectorSet ()
 Exception that is thrown if there is the attempt to add an invalid detector ID to a restricted set. More...
 
 RestrictedDetectorSet (const DetectorSet &set)
 (Copy) constructor. More...
 
 RestrictedDetectorSet (EDetector det)
 Constructor for a set containg one detector ID. More...
 
RestrictedDetectorSetoperator+= (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...
 
int getIndex (EDetector det) const
 Getter for the index of a given detector in this set. More...
 
EDetector operator[] (int index) const
 Accessor for a detector ID in this set. More...
 
size_t size () const
 Getter for number of detector IDs in this set.
 
std::string __repr__ () const
 String for printing in python.
 

Static Public Member Functions

static DetectorSet set ()
 Accessor for the set of valid detector IDs. More...
 

Private Member Functions

void checkSet () const
 Check of set validity. More...
 

Static Private Member Functions

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

Private Attributes

unsigned short m_bits
 The internal representation of the set as bit pattern.
 

Detailed Description

template<class ASetType>
class Belle2::Const::RestrictedDetectorSet< ASetType >

A class for sets of detector IDs whose content is limited to restricted set of valid detector IDs.

Definition at line 177 of file Const.h.

Constructor & Destructor Documentation

◆ RestrictedDetectorSet() [1/3]

Exception that is thrown if there is the attempt to add an invalid detector ID to a restricted set.

Default constructor.

Definition at line 188 of file Const.h.

◆ RestrictedDetectorSet() [2/3]

RestrictedDetectorSet ( const DetectorSet set)
inline

(Copy) constructor.

Parameters
setThe copied set of detector IDs.

Definition at line 195 of file Const.h.

◆ RestrictedDetectorSet() [3/3]

Constructor for a set containg one detector ID.

Parameters
detThe detector ID.

Definition at line 202 of file Const.h.

Member Function Documentation

◆ checkSet()

void checkSet ( ) const
inlineprivate

Check of set validity.

If an invalid detector ID is found an exception is thrown.

Definition at line 221 of file Const.h.

◆ contains()

bool contains ( const DetectorSet set) const
inlineinherited

Check whether this set contains another set.

Parameters
setThe other set of detector IDs.

Definition at line 121 of file Const.h.

◆ getBit()

unsigned short getBit ( Const::EDetector  det)
staticprivateinherited

Conversion of detector ID to bit pattern.

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

Definition at line 203 of file UnitConst.cc.

◆ getDetector()

Const::EDetector getDetector ( unsigned short  bit)
staticprivateinherited

Conversion of bit pattern to detector ID.

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

Definition at line 216 of file UnitConst.cc.

◆ getIndex()

int getIndex ( EDetector  det) const
inherited

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 235 of file UnitConst.cc.

◆ operator!=()

bool operator!= ( const DetectorSet set) const
inlineinherited

Inequality operator.

Parameters
setThe other set of detector IDs.

Definition at line 115 of file Const.h.

◆ operator+=()

RestrictedDetectorSet& operator+= ( const DetectorSet set)
inline

Addition of another set to this one.

Parameters
setThe other set of detector IDs.

Definition at line 208 of file Const.h.

◆ operator-=()

DetectorSet& operator-= ( const DetectorSet set)
inlineinherited

Subtraction of another set from this one.

Parameters
setThe other set of detector IDs.

Definition at line 103 of file Const.h.

◆ operator==()

bool operator== ( const DetectorSet set) const
inlineinherited

Equality operator.

Parameters
setThe other set of detector IDs.

Definition at line 109 of file Const.h.

◆ operator[]()

Const::EDetector operator[] ( int  index) const
inherited

Accessor for a detector ID in this set.

Parameters
indexThe index in the set.
Returns
The detector ID at the given index, or Const::invalidDetector if the index is out of range.

Definition at line 246 of file UnitConst.cc.

◆ set()

static DetectorSet set ( )
inlinestatic

Accessor for the set of valid detector IDs.

Returns
The set of valid detector IDs.

Definition at line 214 of file Const.h.


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