ATLAS Offline Software
ThinningCache.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-2022 CERN for the benefit of the ATLAS collaboration.
4  */
13 #ifndef ATHENAKERNEL_THINNINGCACHE_H
14 #define ATHENAKERNEL_THINNINGCACHE_H
15 
16 
19 #include "CxxUtils/sgkey_t.h"
21 #include <unordered_map>
22 #include <string>
23 #include <vector>
24 #include <memory>
25 
26 
28 
29 
30 namespace SG {
31 
32 
33 class ThinningDecisionBase;
34 class auxid_set_t;
35 
36 
48 {
49 public:
53  bool empty() const;
54 
55 
63  const ThinningDecisionBase* thinning (const std::string& key) const;
64 
65 
73  const ThinningDecisionBase* thinning (const sgkey_t sgkey) const;
74 
75 
89  void addThinning (const std::string& key,
90  const std::vector<sgkey_t>& sgkeys,
92  bool unique = false);
93 
94 
99 
100 
106 
107 
114  void lockOwned();
115 
116 
122  void setVetoed (const std::string& key,
123  const CxxUtils::ConcurrentBitset& vetoed);
124 
131  void setCompression(const std::string& key,
133 
140  const ThinningInfo* thinningInfo (const std::string& key) const;
141 
142 
146  void clear();
147 
148 
149 
150 private:
152  typedef std::unordered_map<std::string, ThinningInfo> map_t;
154 
158 
160  std::vector<std::unique_ptr<ThinningDecisionBase> > m_owned;
161 
164 
165 
174  void merge (ThinningInfo& info,
175  const std::vector<sgkey_t>& sgkeys,
177 };
178 
179 
180 } // namespace ThinningCache
181 
182 
183 #endif // not ATHENAKERNEL_THINNINGCACHE_H
grepfile.info
info
Definition: grepfile.py:38
common.sgkey
def sgkey(tool)
Definition: common.py:1028
SG::ThinningCache::setCompression
void setCompression(const std::string &key, const ThinningInfo::compression_map_t &compression)
Set lossy float compression information for the object.
Definition: ThinningCache.cxx:160
SG::ThinningCache::m_trigNavigationThinningSvc
const ITrigNavigationThinningSvc * m_trigNavigationThinningSvc
Optional TrigNavigation thinning helper for this stream.
Definition: ThinningCache.h:163
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
SG::ThinningCache::sgmap_t
SGKeyMap< ThinningInfo > sgmap_t
Mapping by hashed SG key.
Definition: ThinningCache.h:156
ConcurrentBitset.h
Variable-sized bitset allowing (mostly) concurrent access.
CxxUtils::ConcurrentBitset
Variable-sized bitset allowing (mostly) concurrent access.
Definition: ConcurrentBitset.h:146
SG::ThinningDecisionBase
Hold thinning decisions for one container.
Definition: ThinningDecisionBase.h:39
SG::ThinningCache::m_map
map_t m_map
Definition: ThinningCache.h:153
SG::ThinningCache::lockOwned
void lockOwned()
Lock all the ThinningDecisionBase objects that we own.
Definition: ThinningCache.cxx:134
SG::ThinningInfo::compression_map_t
std::map< unsigned int, CxxUtils::ConcurrentBitset > compression_map_t
This map holds a set of auxids to be lossy compressed for each compression level (nmantissa).
Definition: ThinningInfo.h:66
SG::ThinningCache::trigNavigationThinningSvc
const ITrigNavigationThinningSvc * trigNavigationThinningSvc() const
Return the TrigNavigation helper for this stream, or nullptr.
Definition: ThinningCache.cxx:112
ThinningDecisionBase.h
Hold thinning decisions for one container.
SG::ThinningCache::addThinning
void addThinning(const std::string &key, const std::vector< sgkey_t > &sgkeys, const ThinningDecisionBase *thinning, bool unique=false)
Add thinning information for one object.
Definition: ThinningCache.cxx:77
ThinningInfo.h
Hold thinning/slimming information for a given object.
SG::ThinningCache::thinningInfo
const ThinningInfo * thinningInfo(const std::string &key) const
Return thinning information for key.
Definition: ThinningCache.cxx:173
SG::ThinningCache::clear
void clear()
Clear the cache.
Definition: ThinningCache.cxx:186
SG::ThinningInfo
Hold thinning/slimming information for a given object.
Definition: ThinningInfo.h:40
SG::ThinningCache::m_sgmap
sgmap_t m_sgmap
Definition: ThinningCache.h:157
ITrigNavigationThinningSvc
Define interface for doing TrigNavigation thinning.
Definition: ITrigNavigationThinningSvc.h:31
SG::ThinningCache::setVetoed
void setVetoed(const std::string &key, const CxxUtils::ConcurrentBitset &vetoed)
Set vetoed variable information one object.
Definition: ThinningCache.cxx:148
SG::ThinningCache::m_owned
std::vector< std::unique_ptr< ThinningDecisionBase > > m_owned
List of decision objects we've copied in order to handle merges.
Definition: ThinningCache.h:160
SG::sgkey_t
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
Definition: CxxUtils/CxxUtils/sgkey_t.h:32
SG::ThinningCache::setTrigNavigationThinningSvc
void setTrigNavigationThinningSvc(const ITrigNavigationThinningSvc *thinning)
Set the TrigNavigation helper for this stream.
Definition: ThinningCache.cxx:122
SG::ThinningCache::empty
bool empty() const
Test to see if there's any thinning defined.
Definition: ThinningCache.cxx:22
SG::ThinningCache::thinning
const ThinningDecisionBase * thinning(const std::string &key) const
Return thinning for key.
Definition: ThinningCache.cxx:36
sgkey_t.h
Define the type used for hashed StoreGate key+CLID pairs.
SG::SGKeyMap
std::unordered_map< sgkey_t, T > SGKeyMap
A map using sgkey_t as a key.
Definition: CxxUtils/CxxUtils/sgkey_t.h:93
SG::ThinningCache::map_t
std::unordered_map< std::string, ThinningInfo > map_t
Mapping by string SG key.
Definition: ThinningCache.h:152
SG::ThinningCache
Cache thinning decisions for converters.
Definition: ThinningCache.h:48
SG::ThinningCache::merge
void merge(ThinningInfo &info, const std::vector< sgkey_t > &sgkeys, const ThinningDecisionBase &thinning)
Merge a new thinning request into an existing one via AND.
Definition: ThinningCache.cxx:203
python.BeamSpotUpdate.compression
compression
Definition: BeamSpotUpdate.py:188
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37