ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaKernel
AthenaKernel
ThinningDecisionBase.h
Go to the documentation of this file.
1
// This file's extension implies that it's C, but it's really -*- C++ -*-.
2
/*
3
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
4
*/
11
12
13
#ifndef ATHENAKERNEL_THINNINGDECISIONBASE_H
14
#define ATHENAKERNEL_THINNINGDECISIONBASE_H
15
16
17
#include "
SGCore/ILockable.h
"
18
#include "boost/dynamic_bitset.hpp"
19
#include <vector>
20
#include <string>
21
22
23
namespace
SG
{
24
25
38
class
ThinningDecisionBase
39
{
40
public
:
42
static
const
std::size_t
RemovedIdx
=
static_cast<
std::size_t
>
(-1);
43
44
enum class
Op
{
45
Set
= 0,
46
And
= 1,
47
Or
= 2
48
};
49
50
57
ThinningDecisionBase
(
size_t
sz
= 0);
58
59
64
void
resize
(
const
size_t
size
);
65
66
70
bool
thinned
(
size_t
ndx)
const
;
71
72
76
size_t
size
()
const
;
77
78
82
size_t
thinnedSize
()
const
;
83
84
88
void
thinAll
();
89
90
94
void
keepAll
();
95
96
101
void
thin
(
size_t
ndx);
102
103
109
void
keep
(
size_t
ndx);
110
111
121
void
thin
(
size_t
ndx,
bool
flag,
Op
op =
Op::Set
);
122
123
133
void
keep
(
size_t
ndx,
bool
flag,
Op
op =
Op::Set
);
134
135
145
void
thin
(
const
std::vector<bool>& v,
Op
op =
Op::Set
);
146
147
157
void
keep
(
const
std::vector<bool>& v,
Op
op =
Op::Set
);
158
159
169
void
thin
(
const
ThinningDecisionBase
& other,
Op
op =
Op::Set
);
170
171
181
void
keep
(
const
ThinningDecisionBase
& other,
Op
op =
Op::Set
);
182
183
187
void
buildIndexMap
();
188
189
199
size_t
index
(
size_t
ndxOrig)
const
;
200
201
202
private
:
204
boost::dynamic_bitset<>
m_mask
;
205
207
std::vector<size_t>
m_indexMap
;
208
};
209
210
211
}
// namespace SG
212
213
214
#include "
AthenaKernel/ThinningDecisionBase.icc
"
215
216
217
#endif
// not ATHENAKERNEL_THINNINGDECISIONBASE_H
ILockable.h
sz
static Double_t sz
Definition
LArPhysWaveHECTool.cxx:37
ThinningDecisionBase.icc
SG::ThinningDecisionBase::RemovedIdx
static const std::size_t RemovedIdx
Flag used to show that an index has been thinned away.
Definition
ThinningDecisionBase.h:42
SG::ThinningDecisionBase::m_indexMap
std::vector< size_t > m_indexMap
Mapping from original indices to thinned indices.
Definition
ThinningDecisionBase.h:207
SG::ThinningDecisionBase::ThinningDecisionBase
ThinningDecisionBase(size_t sz=0)
Constructor.
Definition
ThinningDecisionBase.cxx:23
SG::ThinningDecisionBase::thinAll
void thinAll()
Mark that all elements should be thinned away.
Definition
ThinningDecisionBase.cxx:51
SG::ThinningDecisionBase::keepAll
void keepAll()
Mark that all elements should be kept (not thinned).
Definition
ThinningDecisionBase.cxx:60
SG::ThinningDecisionBase::keep
void keep(size_t ndx)
Mark that index ndx in the container should be kept (not thinned away).
Definition
ThinningDecisionBase.cxx:84
SG::ThinningDecisionBase::Op
Op
Definition
ThinningDecisionBase.h:44
SG::ThinningDecisionBase::Op::Or
@ Or
Definition
ThinningDecisionBase.h:47
SG::ThinningDecisionBase::Op::Set
@ Set
Definition
ThinningDecisionBase.h:45
SG::ThinningDecisionBase::Op::And
@ And
Definition
ThinningDecisionBase.h:46
SG::ThinningDecisionBase::thin
void thin(size_t ndx)
Mark that index ndx in the container should be thinned away.
Definition
ThinningDecisionBase.cxx:70
SG::ThinningDecisionBase::thinned
bool thinned(size_t ndx) const
Return true if element ndx should be thinned.
SG::ThinningDecisionBase::buildIndexMap
void buildIndexMap()
Build the index map.
Definition
ThinningDecisionBase.cxx:240
SG::ThinningDecisionBase::index
size_t index(size_t ndxOrig) const
Return the index corresponding to ndxOrig after thinning.
SG::ThinningDecisionBase::size
size_t size() const
Return the total size of the container being thinned.
SG::ThinningDecisionBase::thinnedSize
size_t thinnedSize() const
Return the size of the container being thinned after thinning.
Definition
ThinningDecisionBase.cxx:42
SG::ThinningDecisionBase::m_mask
boost::dynamic_bitset m_mask
Thinning map. Set to 1 for thinned elements.
Definition
ThinningDecisionBase.h:204
SG::ThinningDecisionBase::resize
void resize(const size_t size)
Change the number of elements.
Definition
ThinningDecisionBase.cxx:33
SG
Forward declaration.
Definition
CaloCellPacker_400_500.h:32
SG::size
virtual size_t size() const override
Return the number of elements in the store.
Set
struct _Set Set
Represents a set of values.
Definition
set.h:59
Generated on
for ATLAS Offline Software by
1.17.0