ATLAS Offline Software
Loading...
Searching...
No Matches
TrigPassBitsCnv_p1.cxx File Reference
Include dependency graph for TrigPassBitsCnv_p1.cxx:

Go to the source code of this file.

Functions

void store_bits (const std::vector< bool > &bits, std::vector< uint32_t > &store)
void restore_bits (std::vector< bool > &bits, const std::vector< uint32_t > &store)
unsigned necessary_words (unsigned size)

Function Documentation

◆ necessary_words()

unsigned necessary_words ( unsigned size)

Definition at line 52 of file TrigPassBitsCnv_p1.cxx.

52 {
53 return (size ? 1 : 0) + size/32;
54}

◆ restore_bits()

void restore_bits ( std::vector< bool > & bits,
const std::vector< uint32_t > & store )

Definition at line 30 of file TrigPassBitsCnv_p1.cxx.

30 {
31 const unsigned word_count = store.size();
32 const unsigned bits_count = bits.size();
33
34
35 for ( unsigned word = 0; word < word_count; ++word) {
36 const uint32_t& temp(store[word]);
37
38 for ( unsigned bit = 0; bit < 32; ++bit) {
39 const unsigned position = word*32+bit;
40 if (position >= bits_count )
41 return;
42
43 if (temp & (1 << bit))
44 bits[position] = true;
45 else
46 bits[position] = false;
47 }
48 }
49}
TestStore store
Definition TestStore.cxx:23
setEventNumber uint32_t

◆ store_bits()

void store_bits ( const std::vector< bool > & bits,
std::vector< uint32_t > & store )

Definition at line 13 of file TrigPassBitsCnv_p1.cxx.

13 {
14 const unsigned word_count = store.size();
15 const unsigned bits_count = bits.size();
16
17 for ( unsigned word = 0; word < word_count; ++word) {
18 uint32_t& temp(store[word]);
19
20 for ( unsigned bit = 0; bit < 32; ++bit) {
21 const unsigned position = word*32+bit;
22 if (position >= bits_count )
23 return;
24 if (bits[position])
25 temp |= (1 << bit);
26 }
27 }
28}