BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Calibration/facilities/include/facilities/bitmanip.h
Go to the documentation of this file.
1// $Id: bitmanip.h,v 1.1.1.1 2005/10/17 06:11:40 maqm Exp $
2// bitmanip.h
3// Author: Sawyer Gillespie
4// University of Washington, Physics Department
5// March 1999
6// hgillesp@u.washington.edu
7//
8// Defines several inline routines to provide access to various
9// bit-patterns within various words. The functions byte_N return
10// the Nth byte of a given word counting from low to high bits.
11
12#ifndef _bitmanip_H__
13#define _bitmanip_H__
14
15#ifdef _MSC_VER
16# pragma once
17#endif
18
19namespace bitmanip {
20
21 // template functions for getting/setting four bit words
22 // i is the word #
23 // v is the value
24 // s it the new value
25
26 template <class _T> inline short int word( short i, const _T& v ) {
27 short shft = i * 4;
28 _T mask = 0x000F << shft;
29 return ( v & mask ) >> shft;
30 }
31
32 template <class _T> void set_word( short i, _T& v, const _T& s ) {
33 short shft = i * 4;
34 _T mask = 0x000F << shft;
35 v = ( ( v & ~mask ) | ( ( s << shft ) & mask ) );
36 }
37
38} // namespace bitmanip
39
40#endif
#define _T(str)
XmlRpcServer s
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition KarLud.h:35
short int word(short i, const _T &v)
void set_word(short i, _T &v, const _T &s)