ATLAS Offline Software
TrigCostDataStore.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGCOSTMONITOR_TRIGCOSTDATASTORE_H
6 #define TRIGCOSTMONITOR_TRIGCOSTDATASTORE_H 1
7 
8 #include <tbb/concurrent_hash_map.h>
9 #include <tbb/concurrent_vector.h>
10 
12 
14 
15 #include "GaudiKernel/EventContext.h"
16 #include "AthViews/View.h"
17 
27 template<typename PAYLOAD>
29  public:
30 
35 
40 
45  StatusCode initialize(size_t nSlots);
46 
54  StatusCode insert(const AlgorithmIdentifier& ai, const PAYLOAD& payload,
55  MsgStream& msg);
56 
64  template<typename ENTRY>
66  MsgStream& msg);
67 
76  typename tbb::concurrent_hash_map<AlgorithmIdentifier, PAYLOAD, AlgorithmIdentifierHashCompare>::const_accessor& payload,
77  MsgStream& msg) const;
78 
85  StatusCode clear(const EventContext& context, MsgStream& msg);
86 
95  StatusCode getIterators(const EventContext& context, MsgStream& msg,
96  typename tbb::concurrent_hash_map< AlgorithmIdentifier, PAYLOAD, AlgorithmIdentifierHashCompare>::const_iterator& begin,
97  typename tbb::concurrent_hash_map< AlgorithmIdentifier, PAYLOAD, AlgorithmIdentifierHashCompare>::const_iterator& end);
98 
99  private:
100 
107  StatusCode checkSlot(const size_t slot, MsgStream& msg) const;
108 
109  std::vector< tbb::concurrent_hash_map< AlgorithmIdentifier, PAYLOAD, AlgorithmIdentifierHashCompare> > m_store;
110 };
111 
112 #include "TrigCostDataStore.icc"
113 
114 #endif // TRIGCOSTMONITOR_TRIGCOSTDATASTORE_H
115 
TrigCostDataStore::m_store
std::vector< tbb::concurrent_hash_map< AlgorithmIdentifier, PAYLOAD, AlgorithmIdentifierHashCompare > > m_store
Underlying thread-safe data store for all slots: vector< hashmap< AlgorithmIdentifier,...
Definition: TrigCostDataStore.h:109
TrigCostDataStore::push_back
StatusCode push_back(const AlgorithmIdentifier &ai, ENTRY &&entry, MsgStream &msg)
Inserts the entry in the vector payload into the map.
TrigCostDataStore::checkSlot
StatusCode checkSlot(const size_t slot, MsgStream &msg) const
Internal check that the supplied slot number is in range.
AlgorithmIdentifier
Small structure to hold an algorithm's name and store, plus some details on its EventView....
Definition: AlgorithmIdentifier.h:21
TrigCostDataStore
Thread safe and multi-slot hash-map to cache PAYLOAD objects/primitives during event execution.
Definition: TrigCostDataStore.h:28
AlgorithmIdentifier.h
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
TrigCostDataStore::retrieve
StatusCode retrieve(const AlgorithmIdentifier &ai, typename tbb::concurrent_hash_map< AlgorithmIdentifier, PAYLOAD, AlgorithmIdentifierHashCompare >::const_accessor &payload, MsgStream &msg) const
Retrieve a payload from the map given an AlgorithmIdentifier.
TrigCostDataStore::~TrigCostDataStore
~TrigCostDataStore()
Destructor.
Definition: TrigCostDataStore.h:39
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
TrigCostDataStore::getIterators
StatusCode getIterators(const EventContext &context, MsgStream &msg, typename tbb::concurrent_hash_map< AlgorithmIdentifier, PAYLOAD, AlgorithmIdentifierHashCompare >::const_iterator &begin, typename tbb::concurrent_hash_map< AlgorithmIdentifier, PAYLOAD, AlgorithmIdentifierHashCompare >::const_iterator &end)
Fetches Begin and End const iterators to iterate over the data store.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TrigCostDataStore.icc
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
TrigCostDataStore::clear
StatusCode clear(const EventContext &context, MsgStream &msg)
Clears all data stored in an event slot.
TrigCostDataStore::TrigCostDataStore
TrigCostDataStore()
Default constructor.
Definition: TrigCostDataStore.h:34
View.h
TrigTimeStamp.h
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
TrigCostDataStore::initialize
StatusCode initialize(size_t nSlots)
Initialise internal storage.
TrigCostDataStore::insert
StatusCode insert(const AlgorithmIdentifier &ai, const PAYLOAD &payload, MsgStream &msg)
Inserts the payload into the map.