UTIL::BitSet32 Class Reference

Convenient helper class for setting single bits in a 32bit-field, such as collection flags or hit types - extends std::bitset<32>. More...

#include <UTIL/BitSet32.h>

List of all members.

Public Member Functions

 BitSet32 (int val)
 Allow to construct this from an int.
BitSet32operator= (int val)
 Allow assignment from an int.
 operator int ()
 Direct conversion to int.

Detailed Description

Convenient helper class for setting single bits in a 32bit-field, such as collection flags or hit types - extends std::bitset<32>.

Use convenient methods make_bitset32(...) to create a bit set with some bits set.
Examples:

    // set collection flags :
    LCCollectionVec* calVec = new LCCollectionVec( LCIO::SIMCALORIMETERHIT )  ;
	calVec->setFlag( UTIL::make_bitset32(  LCIO::CHBIT_LONG, LCIO::CHBIT_STEP ) );
    // check TrackerHit type:
    BitSet32 type( hit->getType() ) ;
    bool isComposite = type.test( ILDTrkHitTypeBit::COMPOSITE_SPACEPOINT ) ; // test w/ range check
    // or shorter:
    if( BitSet32( hit->getType() )[ ILDTrkHitTypeBit::COMPOSITE_SPACEPOINT ] ) {...}
  

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Friends

Generated on 6 Mar 2020 for LCIO by  doxygen 1.6.1