|
ATLAS Offline Software
|
#include <CacheGlobalMemory.h>
|
const asg::EventStoreType * | m_store {nullptr} |
| Pointer to the event store in use. More...
|
|
std::unique_ptr< IDecisionUnpacker > m_unpacker | ATLAS_THREAD_SAFE |
| Trigger decision unpacker helper. More...
|
|
bool | m_decisionUnpacked {false} |
| Was decision unpacked for this event? More...
|
|
bool | m_navigationUnpacked {false} |
| Was navigation unpacked for this event? More...
|
|
HLT::TrigNavStructure * | m_navigation {nullptr} |
| Navigation owned by CGM. More...
|
|
std::map< std::vector< std::string >, Trig::ChainGroup > m_chainGroups | ATLAS_THREAD_SAFE |
| primary storage for chain groups More...
|
|
std::map< std::vector< std::string >, Trig::ChainGroup * > m_chainGroupsRef | ATLAS_THREAD_SAFE |
| this map keeps the chain group more than once i.e. More...
|
|
std::unordered_map< std::string, const LVL1CTP::Lvl1Item * > | m_itemsByName |
| items keyed by configuration name (chainging every event) More...
|
|
std::unordered_map< std::string, const HLT::Chain * > | m_l2chainsByName |
| L2 chains keyed by chain name (chainging every event) More...
|
|
std::unordered_map< std::string, const HLT::Chain * > | m_efchainsByName |
| L2 chains keyed by chain name (chainging every event) More...
|
|
std::map< CTPID, LVL1CTP::Lvl1Item > | m_itemsCache |
| cache of all CTP items possible (given configuration) More...
|
|
std::map< CHAIN_COUNTER, HLT::Chain > | m_l2chainsCache |
| cache of all L2 chains possible (given configuration) More...
|
|
std::map< CHAIN_COUNTER, HLT::Chain > | m_efchainsCache |
| cache of all EF chains possible (given configuration) More...
|
|
std::map< std::string, std::vector< std::string > > | m_groups |
| mapping from group to list of chains More...
|
|
std::map< std::string, std::vector< std::string > > | m_streams |
| mapping from stream to list of chains More...
|
|
const TrigConf::ItemContainer * | m_confItems {nullptr} |
| items configuration More...
|
|
const TrigConf::HLTChainList * | m_confChains {nullptr} |
| all chains configuration More...
|
|
SG::ReadHandleKey< xAOD::TrigDecision > * | m_decisionKeyPtr {nullptr} |
| Parent TDT's read handle key. More...
|
|
SG::ReadHandleKey< TrigDec::TrigDecision > * | m_oldDecisionKeyPtr {nullptr} |
| Parent TDT's read handle key. More...
|
|
SG::ReadHandleKey< EventInfo > * | m_oldEventInfoKeyPtr {nullptr} |
| Parent TDT's read handle key. More...
|
|
SG::ReadHandleKey< xAOD::TrigNavigation > * | m_run2NavigationKeyPtr {nullptr} |
| Parent TDT's read handle key. More...
|
|
SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > * | m_run3NavigationKeyPtr {nullptr} |
| Parent TDT's read handle key. More...
|
|
ChainHashMap_t | m_mConfChains |
| map of conf chains More...
|
|
char | m_bgCode {0} |
| the encoded bunchgroup information More...
|
|
AnyTypeDeleter m_deleteAtEndOfEvent | ATLAS_THREAD_SAFE |
|
std::recursive_mutex | m_cgmMutex |
| R3 MT protection only against –threads > 1. More...
|
|
Definition at line 67 of file CacheGlobalMemory.h.
◆ CHAIN_COUNTER
◆ ChainHashMap_t
◆ CTPID
◆ CacheGlobalMemory()
Trig::CacheGlobalMemory::CacheGlobalMemory |
( |
| ) |
|
|
default |
◆ ~CacheGlobalMemory()
Trig::CacheGlobalMemory::~CacheGlobalMemory |
( |
| ) |
|
|
default |
◆ assert_decision()
bool Trig::CacheGlobalMemory::assert_decision |
( |
| ) |
const |
checks if new event arrived with the decision Need to use before any call to CacheGlobalMemory.
It is marked const
since it is frequently called from const
methods and is internally locked.
- Returns
- true if all went fine about decision, false otherwise
Definition at line 266 of file CacheGlobalMemory.cxx.
267 std::lock_guard<std::recursive_mutex> lock(
m_cgmMutex);
268 ATH_MSG_VERBOSE(
"asserting decision with unpacker " << m_unpacker.get());
271 bool contains_xAOD_decision =
false;
273 #ifndef XAOD_ANALYSIS // Full Athena
274 bool is_l1result_configured =
false;
275 bool contains_decision =
false;
276 bool contains_old_event_info =
false;
279 const EventContext& context = Gaudi::Hive::currentContext();
281 ATH_MSG_INFO(
"decision not set on first (?) assert. deciding how to unpack");
290 contains_xAOD_decision = decisionReadHandle.
isValid();
293 #ifndef XAOD_ANALYSIS // Full Athena
297 contains_decision = oldDecisionReadHandle.
isValid();
298 if (contains_decision) {
305 contains_old_event_info = oldEventInfoHandle.
isValid();
310 if ( contains_xAOD_decision ){
311 ATH_MSG_INFO(
"SG contains xAOD decision, use DecisionUnpackerStandalone");
312 m_unpacker = std::make_unique<DecisionUnpackerStandalone>
316 else if( is_l1result_configured ){
317 ATH_MSG_INFO(
"SG contains AOD decision, use DecisionUnpackerAthena");
320 else if (contains_old_event_info) {
321 ATH_MSG_INFO(
"SG contains NO(!) L1Result in the AOD TrigDecision, assuming also no HLTResult. Read from EventInfo");
325 if ( contains_xAOD_decision ){
326 ATH_MSG_INFO(
"SG contains xAOD decision, use DecisionUnpackerStandalone");
335 std::stringstream
extra;
336 #ifndef XAOD_ANALYSIS // Full Athena
337 extra <<
". Looked for old TrigDec::TrigDecision? "
339 <<
", has TrigDec::TrigDecision? "
340 << (contains_decision ?
"YES" :
"NO")
341 <<
", TrigDec::TrigDecision has L1? "
342 << (is_l1result_configured ?
"YES" :
"NO")
343 <<
". Looked for old EventInfo? "
345 <<
", has old EventInto? "
346 << (contains_old_event_info ?
"YES" :
"NO");
349 <<
"(Looked for xAOD::TrigDecision? "
351 <<
", has xAOD::TrigDecision? "
352 << (contains_xAOD_decision ?
"YES" :
"NO")
354 <<
". Check UseRun1DecisionFormat and UseOldEventInfoDecisionFormat flags if reading pre-xAOD or BS input).");
355 throw std::runtime_error(
"Trig::CacheGlobalMemory::assert_decision(): No source of Trigger Decision in file.");
361 if( nc_this->unpackDecision(context).isFailure() ) {
◆ chain() [1/2]
◆ chain() [2/2]
◆ config_chain()
◆ config_item()
◆ createChainGroup()
creates new chain group
- Parameters
-
patterns | list of patterns i.e. regexes, if chain groups already exists it is just given back The chain group is considered to exist if the patterns are the same. Patterns are stored and made unique i.e. "EF_mu4", "EF_mu6" is the same as "EF_mu6", "EF_mu4". It is not the same though as "EF_mu.*" even if in particular case that would mean the same 2 chains. |
alias | is the short human readable name for the triggers which are in the group i.e. myMuons |
props | are additional properties for the chain group creation (e.g. disable regex parsing) |
Definition at line 54 of file CacheGlobalMemory.cxx.
58 std::lock_guard<std::recursive_mutex> lock(
m_cgmMutex);
64 auto [itr, inserted] = m_chainGroups.try_emplace (
key,
key, *nc_this);
66 nc_this->updateChainGroup(itr->second, props);
67 m_chainGroupsRef[
key] = &(itr->second);
72 auto [alias_itr, alias_inserted] = m_chainGroupsRef.try_emplace (key_alias, &m_chainGroups.at(
key));
73 if (!alias_inserted && alias_itr->second!=m_chainGroupsRef[
key]) {
74 throw std::runtime_error(
"TrigDecisionTool: The alias "+
alias+
75 " already exists and cannot be overwritten.");
79 return m_chainGroupsRef[
key];
◆ deleteAtTheEndOfEvent()
template<class T >
void Trig::CacheGlobalMemory::deleteAtTheEndOfEvent |
( |
T |
t | ) |
const |
|
inline |
◆ getChainGroup()
Definition at line 83 of file CacheGlobalMemory.cxx.
86 std::lock_guard<std::recursive_mutex> lock(
m_cgmMutex);
87 auto searchRes = m_chainGroupsRef.find(triggerNames);
89 if ( searchRes != m_chainGroupsRef.end()) {
90 return searchRes->second;
◆ getRun3NavigationKey()
◆ getRun3NavigationKeyPtr()
◆ getStreams()
const std::map<std::string, std::vector<std::string> >& Trig::CacheGlobalMemory::getStreams |
( |
| ) |
const |
|
inline |
◆ item() [1/2]
◆ item() [2/2]
◆ item_prescale()
float Trig::CacheGlobalMemory::item_prescale |
( |
int |
ctpid | ) |
const |
Prescale for CPT item.
Definition at line 241 of file CacheGlobalMemory.cxx.
246 <<
" is not present in the configuration" );
249 return m_itemsCache.find(ctpid)->second.prescaleFactor();
◆ msg() [1/2]
MsgStream& Trig::Logger::msg |
( |
| ) |
const |
|
inlineinherited |
◆ msg() [2/2]
MsgStream& Trig::Logger::msg |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
◆ msgLvl()
bool Trig::Logger::msgLvl |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
◆ navigation() [1/2]
< gives back pointer to navigation object (unpacking if necessary)
Definition at line 104 of file CacheGlobalMemory.h.
108 if(cgm->unpackNavigation().isFailure()){
◆ navigation() [2/2]
◆ nChainGroups()
size_t Trig::CacheGlobalMemory::nChainGroups |
( |
| ) |
const |
◆ reset_decision()
void Trig::CacheGlobalMemory::reset_decision |
( |
| ) |
|
invalidate previously unpacked decision Needs to be called at the start of a new event.
Definition at line 372 of file CacheGlobalMemory.cxx.
◆ setDecisionKeyPtr()
◆ setOldDecisionKeyPtr()
◆ setOldEventInfoKeyPtr()
◆ setRun2NavigationKeyPtr()
◆ setRun3NavigationKeyPtr()
◆ setStore()
◆ store()
◆ unpackDecision()
StatusCode Trig::CacheGlobalMemory::unpackDecision |
( |
const EventContext & |
ctx | ) |
|
|
private |
unpacks whole trigger decision for the event
Definition at line 377 of file CacheGlobalMemory.cxx.
382 m_deleteAtEndOfEvent.clear();
389 return StatusCode::SUCCESS;
◆ unpackNavigation()
StatusCode Trig::CacheGlobalMemory::unpackNavigation |
( |
| ) |
|
|
private |
unpacks HLT navigation structure (object access)
Definition at line 393 of file CacheGlobalMemory.cxx.
394 std::lock_guard<std::recursive_mutex> lock(
m_cgmMutex);
402 return StatusCode::SUCCESS;
407 const EventContext& context = Gaudi::Hive::currentContext();
408 if( ! m_unpacker->unpackNavigation( context,
m_navigation ).isSuccess() ) {
409 [[maybe_unused]]
static std::atomic<bool> warningPrinted =
414 return StatusCode::SUCCESS;
◆ update()
Updates configuration of the chain groups (i.e.
regexes are reapplied to new set of chains)
Definition at line 109 of file CacheGlobalMemory.cxx.
111 std::lock_guard<std::recursive_mutex> lock(
m_cgmMutex);
117 "not attempt accessing HLT too" );
128 const std::vector<float>&
prescales =
ctp->prescaleSet().prescales_float();
129 for(
auto item :
ctp->menu().items() ) {
130 const auto ctpid =
item->ctpId();
143 if ( ! confChains ) {
157 int cntr =
ch->chain_counter();
158 if(
ch->level()==
"L2" ) {
164 ATH_MSG_DEBUG(
"Updating configuration, done with basic HLT based on "
174 if ((
ch->level() ==
"EF" ||
ch->level() ==
"HLT") && !
ch->streams().empty() ) {
182 if ( (
ch->level() ==
"EF" ||
ch->level() ==
"HLT") && !
ch->groups().empty() ) {
184 for(
auto&
group :
ch->groups()) {
194 for (
auto& [
key,
group] : m_chainGroups) {
◆ updateChainGroup()
◆ xAODTrigDecisionKey()
◆ DecisionAccess
◆ ATLAS_THREAD_SAFE [1/4]
std::unique_ptr<IDecisionUnpacker> m_unpacker Trig::CacheGlobalMemory::ATLAS_THREAD_SAFE |
|
mutableprivate |
◆ ATLAS_THREAD_SAFE [2/4]
std::map< std::vector< std::string >, Trig::ChainGroup > m_chainGroups Trig::CacheGlobalMemory::ATLAS_THREAD_SAFE |
|
mutableprivate |
◆ ATLAS_THREAD_SAFE [3/4]
std::map< std::vector< std::string >, Trig::ChainGroup* > m_chainGroupsRef Trig::CacheGlobalMemory::ATLAS_THREAD_SAFE |
|
mutableprivate |
this map keeps the chain group more than once i.e.
when alias is given
Definition at line 197 of file CacheGlobalMemory.h.
◆ ATLAS_THREAD_SAFE [4/4]
AnyTypeDeleter m_deleteAtEndOfEvent Trig::CacheGlobalMemory::ATLAS_THREAD_SAFE |
|
mutableprivate |
◆ m_bgCode
char Trig::CacheGlobalMemory::m_bgCode {0} |
|
private |
◆ m_cgmMutex
std::recursive_mutex Trig::CacheGlobalMemory::m_cgmMutex |
|
mutableprivate |
R3 MT protection only against –threads > 1.
Needs refacotring...
Definition at line 274 of file CacheGlobalMemory.h.
◆ m_confChains
◆ m_confItems
◆ m_decisionKeyPtr
◆ m_decisionUnpacked
bool Trig::CacheGlobalMemory::m_decisionUnpacked {false} |
|
private |
◆ m_efchainsByName
std::unordered_map<std::string, const HLT::Chain*> Trig::CacheGlobalMemory::m_efchainsByName |
|
private |
◆ m_efchainsCache
◆ m_groups
std::map<std::string, std::vector<std::string> > Trig::CacheGlobalMemory::m_groups |
|
private |
◆ m_itemsByName
◆ m_itemsCache
◆ m_l2chainsByName
std::unordered_map<std::string, const HLT::Chain*> Trig::CacheGlobalMemory::m_l2chainsByName |
|
private |
◆ m_l2chainsCache
◆ m_mConfChains
◆ m_navigation
◆ m_navigationUnpacked
bool Trig::CacheGlobalMemory::m_navigationUnpacked {false} |
|
private |
◆ m_oldDecisionKeyPtr
◆ m_oldEventInfoKeyPtr
◆ m_run2NavigationKeyPtr
◆ m_run3NavigationKeyPtr
◆ m_store
◆ m_streams
std::map<std::string, std::vector<std::string> > Trig::CacheGlobalMemory::m_streams |
|
private |
The documentation for this class was generated from the following files:
void update(const TrigConf::HLTChainList *confChains, const TrigConf::ItemContainer *confItems, TrigDefs::Group prop=TrigDefs::Group::Default)
SG::ReadHandleKey< xAOD::TrigDecision > * m_decisionKeyPtr
Parent TDT's read handle key.
const asg::EventStoreType * m_store
Pointer to the event store in use.
const Trig::ChainGroup * createChainGroup(const std::vector< std::string > &patterns, const std::string &alias="", TrigDefs::Group props=TrigDefs::Group::Default) const
creates new chain group
std::unique_ptr< IDecisionUnpacker > m_unpacker ATLAS_THREAD_SAFE
Trigger decision unpacker helper.
bool isConfigured() const
is LVL1 configured ?
const LVL1CTP::Lvl1Item * item(const std::string &name) const
CTP item from given name.
std::map< std::string, std::vector< std::string > > m_streams
mapping from stream to list of chains
std::recursive_mutex m_cgmMutex
R3 MT protection only against –threads > 1.
#define ATH_MSG_VERBOSE(x)
bool empty() const
Test if the key is blank.
const TrigConf::HLTChainList * m_confChains
all chains configuration
std::vector< std::string > convertStringToVector(const std::string &triggerNames)
makes a split of list of chains into the vector of chains
ChainHashMap_t m_mConfChains
map of conf chains
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
std::map< std::string, std::vector< std::string > > m_groups
mapping from group to list of chains
const asg::EventStoreType * store() const
Get the event store that the object is using.
SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > * m_run3NavigationKeyPtr
Parent TDT's read handle key.
HLT::TrigNavStructure * m_navigation
Navigation owned by CGM.
const LVL1CTP::Lvl1Result & getL1Result() const
const HLT::Chain * chain(const std::string &name) const
HLT chain object from given name (0 pointer returned if no match)
std::vector< std::string > keyWrap(const std::vector< std::string > &triggerNames)
normalizes the list of triggers (patterns) by sorting and uniquing them
std::unordered_map< std::string, const HLT::Chain * > m_l2chainsByName
L2 chains keyed by chain name (chainging every event)
virtual bool isValid() override final
Can the handle be successfully dereferenced?
CacheGlobalMemory()=default
SG::ReadHandleKey< EventInfo > * m_oldEventInfoKeyPtr
Parent TDT's read handle key.
const TrigConf::ItemContainer * m_confItems
items configuration
const T * as_const_ptr(const T *p)
Helper for getting a const version of a pointer.
std::map< CHAIN_COUNTER, HLT::Chain > m_l2chainsCache
cache of all L2 chains possible (given configuration)
std::unordered_map< std::string, const HLT::Chain * > m_efchainsByName
L2 chains keyed by chain name (chainging every event)
ctp
Retrieve trigger EDM objects.
std::unordered_map< std::string, const LVL1CTP::Lvl1Item * > m_itemsByName
items keyed by configuration name (chainging every event)
bool m_navigationUnpacked
Was navigation unpacked for this event?
void updateChainGroup(Trig::ChainGroup &chainGroup, TrigDefs::Group props=TrigDefs::Group::Default)
unpacks everything that belongs to a ChainGroup
bool m_decisionUnpacked
Was decision unpacked for this event?
#define ATH_MSG_WARNING(x)
char m_bgCode
the encoded bunchgroup information
std::map< CHAIN_COUNTER, HLT::Chain > m_efchainsCache
cache of all EF chains possible (given configuration)
SG::ReadHandleKey< xAOD::TrigNavigation > * m_run2NavigationKeyPtr
Parent TDT's read handle key.
SG::ReadHandleKey< TrigDec::TrigDecision > * m_oldDecisionKeyPtr
Parent TDT's read handle key.
std::map< CTPID, LVL1CTP::Lvl1Item > m_itemsCache
cache of all CTP items possible (given configuration)