ATLAS Offline Software
|
Cache thinning decisions for converters. More...
#include <ThinningCache.h>
Public Member Functions | |
bool | empty () const |
Test to see if there's any thinning defined. More... | |
const ThinningDecisionBase * | thinning (const std::string &key) const |
Return thinning for key . More... | |
const ThinningDecisionBase * | thinning (const sgkey_t sgkey) const |
Return thinning for sgkey . More... | |
void | addThinning (const std::string &key, const std::vector< sgkey_t > &sgkeys, const ThinningDecisionBase *thinning, bool unique=false) |
Add thinning information for one object. More... | |
const ITrigNavigationThinningSvc * | trigNavigationThinningSvc () const |
Return the TrigNavigation helper for this stream, or nullptr. More... | |
void | setTrigNavigationThinningSvc (const ITrigNavigationThinningSvc *thinning) |
Set the TrigNavigation helper for this stream. More... | |
void | lockOwned () |
Lock all the ThinningDecisionBase objects that we own. More... | |
void | setVetoed (const std::string &key, const CxxUtils::ConcurrentBitset &vetoed) |
Set vetoed variable information one object. More... | |
void | setCompression (const std::string &key, const ThinningInfo::compression_map_t &compression) |
Set lossy float compression information for the object. More... | |
const ThinningInfo * | thinningInfo (const std::string &key) const |
Return thinning information for key . More... | |
void | clear () |
Clear the cache. More... | |
Private Types | |
typedef std::unordered_map< std::string, ThinningInfo > | map_t |
Mapping by string SG key. More... | |
typedef SGKeyMap< ThinningInfo > | sgmap_t |
Mapping by hashed SG key. More... | |
Private Member Functions | |
void | merge (ThinningInfo &info, const std::vector< sgkey_t > &sgkeys, const ThinningDecisionBase &thinning) |
Merge a new thinning request into an existing one via AND. More... | |
Private Attributes | |
map_t | m_map |
sgmap_t | m_sgmap |
std::vector< std::unique_ptr< ThinningDecisionBase > > | m_owned |
List of decision objects we've copied in order to handle merges. More... | |
const ITrigNavigationThinningSvc * | m_trigNavigationThinningSvc = nullptr |
Optional TrigNavigation thinning helper for this stream. More... | |
Cache thinning decisions for converters.
This class caches thinning decisions for a single stream for the use of converters. ThinningDecision objects may be looked up by SG key, either as a string or as a hashed value.
While writing is in progress, a pointer to the current cache is saved in the EventContext
. Converters can find it there.
Definition at line 47 of file ThinningCache.h.
|
private |
Mapping by string SG key.
Definition at line 152 of file ThinningCache.h.
|
private |
Mapping by hashed SG key.
Definition at line 156 of file ThinningCache.h.
void SG::ThinningCache::addThinning | ( | const std::string & | key, |
const std::vector< sgkey_t > & | sgkeys, | ||
const ThinningDecisionBase * | thinning, | ||
bool | unique = false |
||
) |
Add thinning information for one object.
key | SG string key of the object being added. |
sgkeys | SG hashed keys of the object being added. |
thinning | Thinning information for the object. |
unique | If true, the object must not already be listed in the cache. |
If there is already thinning information in the cache for the object identified by key:
unique
is false, the new thinning request will be merged with the existing one via AND.unique
is true, an exception will be thrown. Definition at line 77 of file ThinningCache.cxx.
void SG::ThinningCache::clear | ( | ) |
bool SG::ThinningCache::empty | ( | ) | const |
Test to see if there's any thinning defined.
Definition at line 22 of file ThinningCache.cxx.
void SG::ThinningCache::lockOwned | ( | ) |
Lock all the ThinningDecisionBase
objects that we own.
This should be called after all thinning objects have been added, but before the cache is installed in the EventContext.
Definition at line 134 of file ThinningCache.cxx.
|
private |
Merge a new thinning request into an existing one via AND.
info | ThinningInfo with existing decision. |
sgkeys | SG hashed keys of the object being added. |
thinning | New thinning decision. |
The new thinning decision will be combined with the old one via AND.
Definition at line 203 of file ThinningCache.cxx.
void SG::ThinningCache::setCompression | ( | const std::string & | key, |
const ThinningInfo::compression_map_t & | compression | ||
) |
Set lossy float compression information for the object.
key | SG string key of the object being added. |
compression | Map of compression levels to variables for this object. |
Definition at line 160 of file ThinningCache.cxx.
void SG::ThinningCache::setTrigNavigationThinningSvc | ( | const ITrigNavigationThinningSvc * | thinning | ) |
Set the TrigNavigation helper for this stream.
thinning | TrigNavigation helper. |
Definition at line 122 of file ThinningCache.cxx.
void SG::ThinningCache::setVetoed | ( | const std::string & | key, |
const CxxUtils::ConcurrentBitset & | vetoed | ||
) |
Set vetoed variable information one object.
Set selected variable information one object.
key | SG string key of the object being added. |
vetoed | Set of vetoed variables for this object. |
key | SG string key of the object being added. |
sgkeys | SG hashed keys of the object being added. |
vetoed | Set of vetoed variables for this object. |
Definition at line 148 of file ThinningCache.cxx.
const ThinningDecisionBase * SG::ThinningCache::thinning | ( | const sgkey_t | sgkey | ) | const |
Return thinning for sgkey
.
key | SG key for which to return thinning. |
Return thinning defined for sgkey
. Returns nullptr if that object is not thinned.
Definition at line 54 of file ThinningCache.cxx.
const ThinningDecisionBase * SG::ThinningCache::thinning | ( | const std::string & | key | ) | const |
Return thinning for key
.
key | SG key for which to return thinning. |
Return thinning defined for key
. Returns nullptr if that object is not thinned.
Definition at line 36 of file ThinningCache.cxx.
const ThinningInfo * SG::ThinningCache::thinningInfo | ( | const std::string & | key | ) | const |
Return thinning information for key
.
key | SG key for which to return selected variables. |
Return thinning information key
, or nullptr.
Definition at line 173 of file ThinningCache.cxx.
const ITrigNavigationThinningSvc * SG::ThinningCache::trigNavigationThinningSvc | ( | ) | const |
Return the TrigNavigation helper for this stream, or nullptr.
Definition at line 112 of file ThinningCache.cxx.
|
private |
Definition at line 153 of file ThinningCache.h.
|
private |
List of decision objects we've copied in order to handle merges.
Definition at line 160 of file ThinningCache.h.
|
private |
Definition at line 157 of file ThinningCache.h.
|
private |
Optional TrigNavigation thinning helper for this stream.
Definition at line 163 of file ThinningCache.h.