Belle II Software  release-08-01-10
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...
 
Iterator begin () const
 Beginning iterator.
 
Iterator end () const
 Ending iterator.
 
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.
 

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...
 
 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

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 287 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 298 of file Const.h.

◆ RestrictedDetectorSet() [2/3]

RestrictedDetectorSet ( const DetectorSet set)
inline

(Copy) constructor.

Parameters
setThe copied set of detector IDs.

Definition at line 305 of file Const.h.

◆ RestrictedDetectorSet() [3/3]

Constructor for a set containg one detector ID.

Parameters
detThe detector ID.

Definition at line 312 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 331 of file Const.h.

◆ contains() [1/2]

bool contains ( const DetectorSet set) const
inlineinherited

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
inlineinherited

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)
staticprivateinherited

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)
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 259 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 278 of file UnitConst.cc.

◆ operator!=()

bool operator!= ( const DetectorSet set) const
inlineinherited

Inequality operator.

Parameters
setThe other set of detector IDs.

Definition at line 220 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 318 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 208 of file Const.h.

◆ operator==()

bool operator== ( const DetectorSet set) const
inlineinherited

Equality operator.

Parameters
setThe other set of detector IDs.

Definition at line 214 of file Const.h.

◆ set()

static DetectorSet set ( )
inlinestatic

Accessor for the set of valid detector IDs.

Returns
The set of valid detector IDs.

Definition at line 324 of file Const.h.


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