48 x = (((x & 0xaaaaaaaa) >> 1) | ((x & 0x55555555) << 1));
49 x = (((x & 0xcccccccc) >> 2) | ((x & 0x33333333) << 2));
50 x = (((x & 0xf0f0f0f0) >> 4) | ((x & 0x0f0f0f0f) << 4));
51 x = (((x & 0xff00ff00) >> 8) | ((x & 0x00ff00ff) << 8));
52 return((x >> 16) | (x << 16));
61 x = (((x & 0xaaaaaaaa) >> 1) | ((x & 0x55555555) << 1));
62 x = (((x & 0xcccccccc) >> 2) | ((x & 0x33333333) << 2));
63 x = (((x & 0xf0f0f0f0) >> 4) | ((x & 0x0f0f0f0f) << 4));
64 x = (((x & 0xff00ff00) >> 8) | ((x & 0x00ff00ff) << 8));
65 x = ((x >> 16) | (x << 16));
66 x = x >> (32 - iBits);
82 if ( pointer == NULL )
return (
char*)NULL;
84 for ( c = 31 ; c >= 0 ; c-- )
89 *(pointer+count) = 1 +
'0';
91 *(pointer+count) = 0 +
'0';
95 *(pointer+count) =
'\0';
107 for(UInt_t i=0; i<
sizeof(data)/
sizeof(UInt_t); i++) data[i] = 0;
112 for(UInt_t i=0; i<
sizeof(
data)/
sizeof(UInt_t); i++)
data[i] = 0;
113 for(UInt_t i=0; i<len/
sizeof(UInt_t); i++) {
139 t = (double) itemp * 0.0625;
140 if (
Tsign != 0 ) t *= -1;
152 std::cout <<
"Pmm2 Status" << std::endl;
153 std::cout << std::setfill(
'0') << std::setiosflags(std::ios::uppercase);
154 for(i=0; i<
sizeof(
data)/
sizeof(UInt_t); i++) {
160 std::cout <<
"0x" << std::hex << std::setw(8) << word << std::dec
161 <<
" " << binstr << std::endl;
163 std::cout << std::setfill(
' ') << std::resetiosflags(std::ios::uppercase);
169 std::cout <<
"FW version: " <<
getFwVersion() << std::endl;
182 case 10:
return triger[8];
183 case 11:
return triger[9];
184 case 12:
return triger[10];
186 case 14:
return triger[11];
187 case 15:
return triger[12];
192 if(trig>0 && trig<20)
202 std::cout <<
"Pmm2 Status " << std::endl
203 << std::setfill(
'0') << std::setiosflags(std::ios::uppercase)
204 << std::hex << std::setw(1) <<
"Fpga Id 0x" <<
getFpgaId()
207 << std::setfill(
' ') << std::resetiosflags(std::ios::uppercase)
208 << std::dec << std::endl;
UInt_t ReverseInt32(UInt_t x)
Reverse bits in int32_t word.
A class Pmm2Status is bits representation of pmm2 status register (0x400).
unsigned int getFwVersion() const
UInt_t ReverseBits(UInt_t u32Value, int iBits)
Reverse N bits word ( N <= 32 )
unsigned int getTrigger(int trig) const
unsigned int getFpgaId() const
double getTemperature() const
char * decimal_to_bin(char *str, UInt_t n)
Integer to Binary string.