PandaRoot
MvdOfflineTBAnalysis_Topix4/mrftools.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 /*============================================================*/
14 /* mrftools.h */
15 /* Toolbox */
16 /* M.C. Mertens */
17 /*============================================================*/
18 
19 #ifndef __MRFTOOLS_H__
20 #define __MRFTOOLS_H__
21 
22 //#include <sys/types.h>
23 #include <map>
24 #include <string>
25 #include "mrf_confitem.h"
26 
28 namespace mrftools {
29 
31 
36 bool getIntBit(const UInt_t &position, const UInt_t &value);
37 
39 
44 void setIntBit(const UInt_t &position, UInt_t &value, const bool &state);
45 
47 
52 UInt_t shiftBy(const int &positions, const UInt_t &value);
53 
54 unsigned int getIteratorItemCount(const std::map<std::string, TConfItem>::const_iterator &start, const std::map<std::string, TConfItem>::const_iterator &stop);
55 unsigned int getIteratorItemCount(const std::map<std::string, std::map<std::string, TConfItem>>::const_iterator &start,
56  const std::map<std::string, std::map<std::string, TConfItem>>::const_iterator &stop);
57 
59 
64 UInt_t grayToBin(UInt_t gray);
65 
66 } // namespace mrftools
67 
68 #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)