PandaRoot
MvdOfflineTBAnalysis_Topix4/mrftools.h
Go to the documentation of this file.
1 /*============================================================*/
2 /* mrftools.h */
3 /* Toolbox */
4 /* M.C. Mertens */
5 /*============================================================*/
6 
7 #ifndef __MRFTOOLS_H__
8 #define __MRFTOOLS_H__
9 
10 //#include <sys/types.h>
11 #include <map>
12 #include <string>
13 #include "mrf_confitem.h"
14 
16 namespace mrftools {
17 
19 
24 bool getIntBit(const UInt_t &position, const UInt_t &value);
25 
27 
32 void setIntBit(const UInt_t &position, UInt_t &value, const bool &state);
33 
35 
40 UInt_t shiftBy(const int &positions, const UInt_t &value);
41 
42 unsigned int getIteratorItemCount(const std::map<std::string, TConfItem>::const_iterator &start, const std::map<std::string, TConfItem>::const_iterator &stop);
43 unsigned int getIteratorItemCount(const std::map<std::string, std::map<std::string, TConfItem>>::const_iterator &start,
44  const std::map<std::string, std::map<std::string, TConfItem>>::const_iterator &stop);
45 
47 
52 UInt_t grayToBin(UInt_t gray);
53 
54 } // namespace mrftools
55 
56 #endif // __MRFTOOLS_H__
Helper functions for single bit manipulations.
UInt_t shiftBy(const int &positions, const UInt_t &value)
Shifts the bits in an integer value.
UInt_t grayToBin(UInt_t gray)
Converts gray encoded values to bianry values.
bool getIntBit(const UInt_t &position, const UInt_t &value)
Retrieves a single bit from an integer value.
void setIntBit(const UInt_t &position, UInt_t &value, const bool &state)
Sets a single bit in an integer value.
unsigned int getIteratorItemCount(const std::map< std::string, TConfItem >::const_iterator &start, const std::map< std::string, TConfItem >::const_iterator &stop)