ATLAS Offline Software
Loading...
Searching...
No Matches
Trig::DecisionUnpackerEventInfo Class Reference

#include <DecisionUnpackerEventInfo.h>

Inheritance diagram for Trig::DecisionUnpackerEventInfo:
Collaboration diagram for Trig::DecisionUnpackerEventInfo:

Public Types

typedef unsigned CTPID
typedef unsigned CHAIN_COUNTER

Public Member Functions

 DecisionUnpackerEventInfo (const SG::ReadHandleKey< EventInfo > *oldEventInfoKey)
virtual ~DecisionUnpackerEventInfo ()
 DecisionUnpackerEventInfo (const DecisionUnpackerEventInfo &)=delete
DecisionUnpackerEventInfooperator= (const DecisionUnpackerEventInfo &)=delete
virtual StatusCode unpackDecision (const EventContext &, std::unordered_map< std::string, const LVL1CTP::Lvl1Item * > &, std::map< CTPID, LVL1CTP::Lvl1Item > &, std::unordered_map< std::string, const HLT::Chain * > &, std::map< CHAIN_COUNTER, HLT::Chain > &, std::unordered_map< std::string, const HLT::Chain * > &, std::map< CHAIN_COUNTER, HLT::Chain > &, char &, bool) const override
virtual StatusCode unpackNavigation (const EventContext &, HLT::TrigNavStructure *) const override
MsgStream & msg () const
MsgStream & msg (const MSG::Level lvl) const
bool msgLvl (const MSG::Level lvl) const

Private Member Functions

StatusCode unpackItems (const std::vector< uint32_t > &level1TriggerInfo, std::map< CTPID, LVL1CTP::Lvl1Item > &itemsCache, std::unordered_map< std::string, const LVL1CTP::Lvl1Item * > &itemsByName) const
StatusCode unpackChains (const std::vector< uint32_t > &chainTriggerInfo, std::map< unsigned, HLT::Chain > &cache, std::unordered_map< std::string, const HLT::Chain * > &output) const

Private Attributes

const SG::ReadHandleKey< EventInfo > * m_eventInfoKey {nullptr}

Static Private Attributes

static asg::AsgTool *s_logger ATLAS_THREAD_SAFE {nullptr}

Detailed Description

Definition at line 30 of file DecisionUnpackerEventInfo.h.

Member Typedef Documentation

◆ CHAIN_COUNTER

typedef unsigned Trig::IDecisionUnpacker::CHAIN_COUNTER
inherited

Definition at line 33 of file IDecisionUnpacker.h.

◆ CTPID

typedef unsigned Trig::IDecisionUnpacker::CTPID
inherited

Definition at line 32 of file IDecisionUnpacker.h.

Constructor & Destructor Documentation

◆ DecisionUnpackerEventInfo() [1/2]

Trig::DecisionUnpackerEventInfo::DecisionUnpackerEventInfo ( const SG::ReadHandleKey< EventInfo > * oldEventInfoKey)

Definition at line 32 of file DecisionUnpackerEventInfo.cxx.

32 :
33 m_eventInfoKey(oldEventInfoKey){
34 }
const SG::ReadHandleKey< EventInfo > * m_eventInfoKey

◆ ~DecisionUnpackerEventInfo()

Trig::DecisionUnpackerEventInfo::~DecisionUnpackerEventInfo ( )
virtual

Definition at line 36 of file DecisionUnpackerEventInfo.cxx.

36 {
37 }

◆ DecisionUnpackerEventInfo() [2/2]

Trig::DecisionUnpackerEventInfo::DecisionUnpackerEventInfo ( const DecisionUnpackerEventInfo & )
delete

Member Function Documentation

◆ msg() [1/2]

MsgStream & Trig::Logger::msg ( ) const
inlineinherited

Definition at line 29 of file Trigger/TrigAnalysis/TrigDecisionTool/TrigDecisionTool/Logger.h.

29 {
30 if (s_logger) return s_logger->msg();
31 else throw std::runtime_error("TrigDecisionTool Logger not initialized.");
32 }

◆ msg() [2/2]

MsgStream & Trig::Logger::msg ( const MSG::Level lvl) const
inlineinherited

◆ msgLvl()

bool Trig::Logger::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 34 of file Trigger/TrigAnalysis/TrigDecisionTool/TrigDecisionTool/Logger.h.

34{ return s_logger && s_logger->msgLvl(lvl); }

◆ operator=()

DecisionUnpackerEventInfo & Trig::DecisionUnpackerEventInfo::operator= ( const DecisionUnpackerEventInfo & )
delete

◆ unpackChains()

StatusCode Trig::DecisionUnpackerEventInfo::unpackChains ( const std::vector< uint32_t > & chainTriggerInfo,
std::map< unsigned, HLT::Chain > & cache,
std::unordered_map< std::string, const HLT::Chain * > & output ) const
private

Definition at line 76 of file DecisionUnpackerEventInfo.cxx.

78 {
79 output.reserve( output.size() + cache.size() );
80 for( auto& [cntr, chain] : cache){
81 chain.reset();
82
83 //we have to make a guess here
84 //the bit form the event header is set according to
85 //HLT::Chain::chainPassed() i.e. either non-prescaled, non-ressurected && passed
86 //or it was passed through.
87 //if the bit is set, we will chose the first version for all chains
88 //even though some may be passed through
89 //if the bit is not set we will set all flags to false
90
91 bool decision = get32BitDecision( cntr, chainTriggerInfo );
92 if(decision){
93 chain.setDecisions( true, //raw
94 false,//passedthrough
95 false,//prescaled
96 false //resurrected
97 );
98 }
99 else {
100 chain.setDecisions( false,//raw
101 false,//passedthrough
102 false,//prescaled
103 false //resurrected
104 );
105 }
106 output[chain.getChainName()] = &chain;
107 }
108 return StatusCode::SUCCESS;
109 }
bool get32BitDecision(unsigned int index, const std::vector< uint32_t > &vec)
output
Definition merge.py:16

◆ unpackDecision()

StatusCode Trig::DecisionUnpackerEventInfo::unpackDecision ( const EventContext & ctx,
std::unordered_map< std::string, const LVL1CTP::Lvl1Item * > & itemsByName,
std::map< CTPID, LVL1CTP::Lvl1Item > & itemsCache,
std::unordered_map< std::string, const HLT::Chain * > & l2chainsByName,
std::map< CHAIN_COUNTER, HLT::Chain > & l2chainsCache,
std::unordered_map< std::string, const HLT::Chain * > & efchainsByName,
std::map< CHAIN_COUNTER, HLT::Chain > & efchainsCache,
char & ,
bool unpackHLT ) const
overridevirtual

Implements Trig::IDecisionUnpacker.

Definition at line 111 of file DecisionUnpackerEventInfo.cxx.

121 {
122
123 ATH_MSG_DEBUG("unpacking decision from EventInfo");
124
125 SG::ReadHandle<EventInfo> eventInfo(*m_eventInfoKey, ctx);
126 const TriggerInfo* dec = eventInfo->trigger_info();
127
128 // bgCode = dec->BGCode();
129
130 // L1 items
131 itemsByName.clear();
132 ATH_MSG_DEBUG("Unpacking of L1 items");
133 if( unpackItems(dec->level1TriggerInfo(),itemsCache,itemsByName).isFailure() ) {
134 ATH_MSG_WARNING("Unpacking of L1 items failed");
135 }
136
137
138 // protect from unpacking in case HLT was not run (i.e. configuration chains are 0)
139 if (!unpackHLT) return StatusCode::SUCCESS;
140
141
142 // L2 chains
143 l2chainsByName.clear();
144 const auto& level2TriggerInfo = dec->level2TriggerInfo();
145
146 if ( unpackChains(level2TriggerInfo, l2chainsCache, l2chainsByName).isFailure() ) {
147 ATH_MSG_WARNING("Unpacking of L2 chains failed");
148 }
149
150 // EF chains
151 efchainsByName.clear();
152 const auto& eventFilterInfo = dec->eventFilterInfo();
153
154 if ( unpackChains(eventFilterInfo, efchainsCache, efchainsByName).isFailure() ) {
155 ATH_MSG_WARNING("Unpacking of EF/HLT chains failed");
156 }
157
158 return StatusCode::SUCCESS;
159 }
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
StatusCode unpackItems(const std::vector< uint32_t > &level1TriggerInfo, std::map< CTPID, LVL1CTP::Lvl1Item > &itemsCache, std::unordered_map< std::string, const LVL1CTP::Lvl1Item * > &itemsByName) const
StatusCode unpackChains(const std::vector< uint32_t > &chainTriggerInfo, std::map< unsigned, HLT::Chain > &cache, std::unordered_map< std::string, const HLT::Chain * > &output) const
const std::vector< number_type > & eventFilterInfo() const
get event filter trigger info
const std::vector< number_type > & level1TriggerInfo() const
get level1 trigger info
const std::vector< number_type > & level2TriggerInfo() const
get level2 trigger info

◆ unpackItems()

StatusCode Trig::DecisionUnpackerEventInfo::unpackItems ( const std::vector< uint32_t > & level1TriggerInfo,
std::map< CTPID, LVL1CTP::Lvl1Item > & itemsCache,
std::unordered_map< std::string, const LVL1CTP::Lvl1Item * > & itemsByName ) const
private

Definition at line 40 of file DecisionUnpackerEventInfo.cxx.

42 {
43
44 uint32_t L1SIZE = level1TriggerInfo.size()/3;
45 std::vector<uint32_t>::const_iterator begin, end;
46
47 begin = level1TriggerInfo.begin();
48 end = begin;
49 std::advance(end,L1SIZE);
50 std::vector<uint32_t> tbp(begin,end);
51
52 begin = end;
53 std::advance(end,L1SIZE);
54 std::vector<uint32_t> tap(begin,end);
55
56 begin = end;
57 std::advance(end,L1SIZE);
58 std::vector<uint32_t> tav(begin,end);
59
60 itemsByName.reserve( itemsByName.size() + itemsCache.size() );
61 for ( auto [ctpid, item] : itemsCache ) {
62 ATH_MSG_VERBOSE("Unpacking bits for item: " << ctpid << " " << item.name());
63 const bool passBP = get32BitDecision(ctpid,tbp);
64 const bool passAP = get32BitDecision(ctpid,tap);
65 const bool passAV = get32BitDecision(ctpid,tav);
66 LVL1CTP::Lvl1Item itemNew (item.name(), item.hashId(),
67 passBP, passAP, passAV,
68 item.prescaleFactor());
69 item = std::move (itemNew);
70 itemsByName[item.name()] = &item;
71 }
72 return StatusCode::SUCCESS;
73 }
#define ATH_MSG_VERBOSE(x)
setBGCode tap
setEventNumber uint32_t

◆ unpackNavigation()

StatusCode Trig::DecisionUnpackerEventInfo::unpackNavigation ( const EventContext & ,
HLT::TrigNavStructure *  ) const
overridevirtual

Implements Trig::IDecisionUnpacker.

Definition at line 161 of file DecisionUnpackerEventInfo.cxx.

162 {
163 ATH_MSG_WARNING("This is the EventInfo Unpacker, there is no Navigation available -- but someone seems to try to access features triggering a navi unpacking");
164 return StatusCode::SUCCESS;
165 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

asg::AsgTool* s_logger Trig::Logger::ATLAS_THREAD_SAFE {nullptr}
inlinestaticprivateinherited

Definition at line 38 of file Trigger/TrigAnalysis/TrigDecisionTool/TrigDecisionTool/Logger.h.

38{nullptr};

◆ m_eventInfoKey

const SG::ReadHandleKey<EventInfo>* Trig::DecisionUnpackerEventInfo::m_eventInfoKey {nullptr}
private

Definition at line 51 of file DecisionUnpackerEventInfo.h.

51{nullptr};

The documentation for this class was generated from the following files: