#include <SelectedParticles.h>
|
| std::vector< unsigned > | m_bits |
Definition at line 54 of file SelectedParticles.h.
◆ SelectedParticles() [1/2]
| SelectedParticles::SelectedParticles |
( |
| ) |
|
|
inline |
◆ SelectedParticles() [2/2]
| SelectedParticles::SelectedParticles |
( |
const std::vector< unsigned > & | indices | ) |
|
Definition at line 11 of file SelectedParticles.cxx.
14 for(
int i=0;
i<nind;++
i){
15 this->
SetBit(indices[i],
true);
16 }
17}
void SetMaxBits(unsigned maxbits)
void SetBit(unsigned i, bool good=true)
std::pair< long int, long int > indices
◆ ~SelectedParticles()
| SelectedParticles::~SelectedParticles |
( |
| ) |
|
|
inline |
◆ AllBits()
| const std::vector< unsigned > & SelectedParticles::AllBits |
( |
| ) |
const |
|
inline |
◆ displayBits()
| string SelectedParticles::displayBits |
( |
| ) |
const |
Definition at line 49 of file SelectedParticles.cxx.
50{
53
54 unsigned nwords=
m_bits.size();
55 vector<unsigned>::const_iterator itb=
m_bits.begin();
56 int j=0;
57 for (; itb !=
m_bits.end(); ++itb){
58
59 unsigned displayMask = 1u << 31;
60
61 int temp = nwords - j - 1;
62 ++j;
63
64
65 for (c = 0;
c != 32;
c++ ) {
66
67
68 os << (
m_bits[temp] & displayMask ?
'1' :
'0');
69
70
71 displayMask >>= 1;
72
73
74 if (c % 8 == 7 )
76 }
77
79 }
82}
◆ goodParticles()
| void SelectedParticles::goodParticles |
( |
std::vector< unsigned > & | goodparts | ) |
const |
Definition at line 121 of file SelectedParticles.cxx.
122{
123 unsigned nbits=
m_bits.size()*32;
124 for(unsigned ibit=0; ibit<nbits; ++ibit) {
125 if(
isGood(ibit)) goodparts.push_back(ibit);
126 }
127 return;
128}
bool isGood(unsigned i) const
◆ isGood()
| bool SelectedParticles::isGood |
( |
unsigned | i | ) |
const |
Definition at line 84 of file SelectedParticles.cxx.
85{
86
88 unsigned nwords=
m_bits.size();
89 vector<unsigned>::const_iterator itb=
m_bits.begin();
90 unsigned j=ipart/32;
91 if(j>nwords-1) return false;
92 for (; itb !=
m_bits.end(); ++itb){
93
94 unsigned displayMask = 1;
95
96
97
98 for (c = 0;
c != 32;
c++ ) {
99
100
101 if (
m_bits[j] & displayMask) {
102 if(c==ipart) return true;
103 }
104
105
106 displayMask <<= 1;
107 }
108 }
109 return false;
110}
◆ numGood()
| unsigned SelectedParticles::numGood |
( |
| ) |
const |
Definition at line 112 of file SelectedParticles.cxx.
113{
114 unsigned nwords=
m_bits.size();
115 if(nwords==0) return 0;
116 vector<unsigned> goodparts;
118 return goodparts.size();
119}
void goodParticles(std::vector< unsigned > &goodparts) const
◆ Set()
| void SelectedParticles::Set |
( |
const std::vector< unsigned > & | onoffBits | ) |
|
|
inline |
◆ SetBit()
| void SelectedParticles::SetBit |
( |
unsigned | i, |
|
|
bool | good = true ) |
Definition at line 19 of file SelectedParticles.cxx.
19 {
20 unsigned nwords=
m_bits.size();
22
23 if(iword+1>nwords){
24 for(unsigned iw=nwords; iw<iword+1; ++iw){
25 unsigned temp=0;
27 }
28 }
29
30 if(good==false) return;
31
32 unsigned bitnum =
i % 32 ;
33 unsigned temp = 1 << bitnum;
35
36 return;
37}
◆ SetMaxBits()
| void SelectedParticles::SetMaxBits |
( |
unsigned | maxbits | ) |
|
Definition at line 39 of file SelectedParticles.cxx.
40{
41 unsigned nwords=maxbits/32;
42 for(unsigned iw=0; iw<nwords+1; ++iw){
43 unsigned temp=0;
45 }
46}
◆ m_bits
| std::vector<unsigned> SelectedParticles::m_bits |
|
private |
The documentation for this class was generated from the following files: