ATLAS Offline Software
|
Handle for requesting thinning: factor out type-independent code. More...
#include <ThinningHandleBase.h>
Public Types | |
using | Op = ThinningDecision::Op |
Public Member Functions | |
ThinningHandleBase (const WriteHandleKey< ThinningDecision > &dkey, const std::string &sgkey, const EventContext &ctx) | |
Constructor. More... | |
~ThinningHandleBase () | |
Destructor. More... | |
void | thin (size_t ndx) |
Mark that index ndx in the container should be thinned away. More... | |
void | keep (size_t ndx) |
Mark that index ndx in the container should be kept (not thinned away). More... | |
void | thin (const std::vector< bool > &v, Op op=Op::Set) |
Set the thinning state for the container from a bitmask. More... | |
void | keep (const std::vector< bool > &v, Op op=Op::Set) |
Set the thinning state for the container from a bitmask. More... | |
void | thin (const ThinningDecisionBase &other, Op op=Op::Set) |
Set the thinning state for the container from a bitmask. More... | |
void | keep (const ThinningDecisionBase &other, Op op=Op::Set) |
Set the thinning state for the container from a bitmask. More... | |
void | thinAll () |
Mark that all elements should be thinned away. More... | |
void | keepAll () |
Mark that all elements should be kept (not thinned). More... | |
const ThinningDecision & | decision () const |
Return the thinning object we're building. More... | |
Private Attributes | |
WriteHandle< ThinningDecision > | m_decisionHandle |
Handle for writing the decision object. More... | |
std::unique_ptr< ThinningDecision > | m_decision |
The thinning object we're building. More... | |
Handle for requesting thinning: factor out type-independent code.
Base class for ThinningHandle, which factors out the code that doesn't depend on the type of object being thinned.
Definition at line 31 of file ThinningHandleBase.h.
Definition at line 34 of file ThinningHandleBase.h.
|
explicit |
Constructor.
dkey | Handle key to use to write the ThinningDecision. |
sgkey | StoreGate key of the object being thinned. |
ctx | Event context. |
Definition at line 26 of file ThinningHandleBase.cxx.
SG::ThinningHandleBase::~ThinningHandleBase | ( | ) |
Destructor.
Records the thinning decision object in StoreGate.
Definition at line 41 of file ThinningHandleBase.cxx.
const ThinningDecision & SG::ThinningHandleBase::decision | ( | ) | const |
Return the thinning object we're building.
Definition at line 154 of file ThinningHandleBase.cxx.
Set the thinning state for the container from a bitmask.
v | Thinning state mask; should have the same size as the container. Element ndx should be kept if bit ndx is set in the map. |
op | Logical operation for combining with existing thinning state. Set — Keep if flag is true (overwriting anything originally set for this element). And — Keep if flag is true and element was originally kept, else not. Or — Keep if flag is true or element was originally kept, else not. |
Definition at line 98 of file ThinningHandleBase.cxx.
void SG::ThinningHandleBase::keep | ( | const ThinningDecisionBase & | other, |
Op | op = Op::Set |
||
) |
Set the thinning state for the container from a bitmask.
other | Thinning state mask; should have the same size as the container. Element ndx should be kept if bit ndx is set in the map. |
op | Logical operation for combining with existing thinning state. Set — Keep if flag is true (overwriting anything originally set for this element). And — Keep if flag is true and element was originally kept, else not. Or — Keep if flag is true or element was originally kept, else not. |
Definition at line 127 of file ThinningHandleBase.cxx.
void SG::ThinningHandleBase::keep | ( | size_t | ndx | ) |
Mark that index ndx
in the container should be kept (not thinned away).
ndx | Index of element to keep. |
Definition at line 68 of file ThinningHandleBase.cxx.
void SG::ThinningHandleBase::keepAll | ( | ) |
Mark that all elements should be kept (not thinned).
Definition at line 145 of file ThinningHandleBase.cxx.
Set the thinning state for the container from a bitmask.
v | Thinning state mask; should have the same size as the container. Element ndx should be thinned if bit ndx is set in the map. |
op | Logical operation for combining with existing thinning state. Set — Thin if flag is true (overwriting anything originally set for this element). And — Thin if flag is true and element was originally thinned, else not. Or — Thin if flag is true or element was originally thinned, else not. |
Definition at line 83 of file ThinningHandleBase.cxx.
void SG::ThinningHandleBase::thin | ( | const ThinningDecisionBase & | other, |
Op | op = Op::Set |
||
) |
Set the thinning state for the container from a bitmask.
other | Thinning state mask; should have the same size as the container. Element ndx should be thinned if bit ndx is set in the map. |
op | Logical operation for combining with existing thinning state. Set — Thin if flag is true (overwriting anything originally set for this element). And — Thin if flag is true and element was originally thinned, else not. Or — Thin if flag is true or element was originally thinned, else not. |
Definition at line 112 of file ThinningHandleBase.cxx.
void SG::ThinningHandleBase::thin | ( | size_t | ndx | ) |
Mark that index ndx
in the container should be thinned away.
ndx | Index of element to thin. |
Definition at line 57 of file ThinningHandleBase.cxx.
void SG::ThinningHandleBase::thinAll | ( | ) |
Mark that all elements should be thinned away.
Definition at line 136 of file ThinningHandleBase.cxx.
|
private |
The thinning object we're building.
Definition at line 141 of file ThinningHandleBase.h.
|
private |
Handle for writing the decision object.
Definition at line 138 of file ThinningHandleBase.h.