ATLAS Offline Software
TrigHolderStructure.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 HLT::TrigHolderStructure::TrigHolderStructure() : asg::AsgMessaging("TrigHolderStructure"){
8 }
9 
11  m_holderByClidAndIndex.clear();
12  m_lookupLabels.clear();
13  m_lookupSubIndex.clear();
14 }
15 
17  if( sti == HLT::invalid_sub_index){
18  ATH_MSG_DEBUG("requested holder with invalid sub_type_index");
19  return 0;
20  }
21  auto allsti_it = m_holderByClidAndIndex.find(clid);
22  if(allsti_it == m_holderByClidAndIndex.end()){
23  return 0;
24  }
25  auto sti_holder_map = allsti_it->second;
26  auto holder_it = sti_holder_map.find(sti);
27  if(holder_it == sti_holder_map.end()){
28  return 0;
29  }
30  return holder_it->second.get();
31 }
32 
33 
34 bool HLT::TrigHolderStructure::registerHolder(const std::shared_ptr<BaseHolder>& holder){
35  auto clid = holder->typeClid();
36  auto subtypeindex = holder->subTypeIndex();
37  auto label = holder->label();
38 
39  if(getHolder(clid,subtypeindex)){
40  ATH_MSG_WARNING("we already have a holder like this! clid:" << clid << " subtypeIndex: " << subtypeindex << " label: " << label);
41  return false;
42  }
43 
44 
45 
46  m_holderByClidAndIndex[clid][subtypeindex] = holder;
47  m_lookupLabels[clid][subtypeindex] = label;
48  m_lookupSubIndex[clid][label] = subtypeindex;
49 
50  return true;
51 }
HLT::BaseHolder::label
virtual const std::string & label() const =0
HLT::BaseHolder::typeClid
virtual class_id_type typeClid() const =0
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
asg
Definition: DataHandleTestTool.h:28
TrigHolderStructure.h
HLT::TrigHolderStructure::registerHolder
bool registerHolder(const std::shared_ptr< BaseHolder > &holder)
Definition: TrigHolderStructure.cxx:34
HLT::TrigHolderStructure::reset
void reset()
Definition: TrigHolderStructure.cxx:10
HLT::TrigHolderStructure::TrigHolderStructure
TrigHolderStructure()
Definition: TrigHolderStructure.cxx:7
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
HLT::BaseHolder::subTypeIndex
virtual sub_index_type subTypeIndex() const =0
HLT::BaseHolder
Definition: BaseHolder.h:14
HLT::class_id_type
uint32_t class_id_type
Definition: Trigger/TrigEvent/TrigNavStructure/Root/Types.h:11
HLT::sub_index_type
uint16_t sub_index_type
Definition: Trigger/TrigEvent/TrigNavStructure/Root/Types.h:9
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
HLT::TrigHolderStructure::getBaseHolder
BaseHolder * getBaseHolder(class_id_type clid, sub_index_type sti) const
Definition: TrigHolderStructure.cxx:16