ATLAS Offline Software
|
Handle for requesting thinning for a data object. More...
#include <ThinningHandle.h>
Public Types | |
using | Op = ThinningDecision::Op |
Public Member Functions | |
ThinningHandle (const ThinningHandleKey< T > &key) | |
Constructor from a ThinningHandleKey. More... | |
ThinningHandle (const ThinningHandleKey< T > &key, const EventContext &ctx) | |
Constructor from a ThinningHandleKey and an explicit event context. More... | |
void | thin (size_t ndx) |
Mark that index ndx in the container should be 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 | thin (const ThinningDecisionBase &other, Op op=Op::Set) |
Set the thinning state for the container from a bitmask. More... | |
void | keep (size_t ndx) |
Mark that index ndx in the container should be kept (not thinned away). More... | |
void | keep (const std::vector< bool > &v, 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 for a data object.
A ThinningHandle
+ ThinningHandleKey
is used to request thinning for a data object for a particular stream.
To use it, you should first create a ThinningHandleKey
referencing the object you want to thin, in the same way as for a ReadHandle:
When you initialize the key, you should pass it the the name of the stream for which thinning is being done:
Then you can create a ThinningHandle
from the key in the way in which you would create a ReadHandle:
This handle can then be used to access the object in the same way in which you would use a ReadHandle
. In addition, you can call methods on the handle to specify objects to thin:
See ThinningHandleBase
for a full list of the methods that may be used to specify the thinning.
The thinning request will be committed when the ThinningHandle
is destroyed.
If the same object is thinned for the same stream in multiple algorithms, then the result will be the AND of all of them; that is, an element will be thinned on the output only if it has been requested to be thinned by all algorithms.
For a complete example, see DataModelTestDataCommon/xAODTestThinCVec.
Definition at line 82 of file ThinningHandle.h.
using SG::ThinningHandle< T >::Op = ThinningDecision::Op |
Definition at line 86 of file ThinningHandle.h.
|
inlineexplicit |
Constructor from a ThinningHandleKey.
key | The key object holding the clid/key/store. |
This will raise an exception if the StoreGate key is blank, or if the event store cannot be found.
Definition at line 96 of file ThinningHandle.h.
|
inlineexplicit |
Constructor from a ThinningHandleKey and an explicit event context.
key | The key object holding the clid/key/store. |
ctx | The event context. |
This will raise an exception if the StoreGate key is blank, or if the event store cannot be found.
If the default event store has been requested, then the thread-specific store from the event context will be used.
Definition at line 113 of file ThinningHandle.h.
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
Mark that all elements should be thinned away.
Definition at line 136 of file ThinningHandleBase.cxx.
|
privateinherited |
The thinning object we're building.
Definition at line 141 of file ThinningHandleBase.h.
|
privateinherited |
Handle for writing the decision object.
Definition at line 138 of file ThinningHandleBase.h.