ATLAS Offline Software
Loading...
Searching...
No Matches
TrigDec::TrigDecisionMakerMT Class Reference

#include <TrigDecisionMakerMT.h>

Inheritance diagram for TrigDec::TrigDecisionMakerMT:

Public Member Functions

 TrigDecisionMakerMT (const std::string &name, ISvcLocator *pSvcLocator)
 std Gaudi Algorithm constructor
 ~TrigDecisionMakerMT ()
 std deconstructor
virtual StatusCode initialize () override
 std Gaudi initialize method -> read-in trigger configuration
virtual StatusCode execute (const EventContext &context) const override
 Re-entrant execute to create the xAOD::TrigDecision.
virtual StatusCode finalize () override
 std Gaudi finalize method -> print out statistics
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
virtual void setFilterPassed (bool state, const EventContext &ctx) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode getL1Result (const LVL1CTP::Lvl1Result *&result, const EventContext &context) const
 retrieve LVL1 result (called in execute)
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

Gaudi::Property< bool > m_doL1 {this, "doL1", true, "Read L1 trigger information"}
Gaudi::Property< bool > m_doHLT {this, "doHLT", true, "Read HLT trigger information"}
Gaudi::Property< bool > m_useEDMxAOD {this, "UseEDMxAOD", false, "Flag whether to use xAOD::CTPResult instead of ROIB::RoIBResult for CTP result"}
ToolHandle< HLT::ILvl1ResultAccessToolm_lvl1Tool {this, "Lvl1ResultAccessTool", "HLT::Lvl1ResultAccessTool/Lvl1ResultAccessTool", "L1 tool to fetch"}
 tool to ease the access to the L1 results (RoIs, items, etc)
ToolHandle< ITriggerBitsMakerToolm_bitsMakerTool {this, "BitsMakerTool", "", "Tool to create trigger bits for MC"}
SG::ReadCondHandleKey< TrigConf::L1BunchGroupSetm_bgKey {this, "L1BunchGroup", "L1BunchGroup", "L1BunchGroupSet key name"}
SG::ReadHandleKey< TrigConf::HLTMenum_HLTMenuKey {this, "HLTTriggerMenu", "DetectorStore+HLTTriggerMenu", "HLT Menu key"}
SG::ReadHandleKey< HLT::HLTResultMTm_hltResultKeyIn {this, "HLTResultMT", "HLTResultMT", "Key of the HLTResultMT object to get bits from online bytestream" }
SG::ReadHandleKey< ROIB::RoIBResultm_ROIBResultKeyIn {this, "RoIBResult", "RoIBResult", "RoIB Result Object Key"}
SG::ReadHandleKey< xAOD::CTPResultm_CTPResultKeyIn {this, "CTPResult", "CTPResult", "Key to retrieve the L1 xAOD CTP result from SG" }
SG::ReadHandleKey< xAOD::EventInfom_EventInfoKeyIn {this, "EventInfo", "EventInfo", "Event Info Object Key"}
SG::WriteHandleKey< LVL1CTP::Lvl1Resultm_l1ResultKeyOut { this, "L1Result", "L1Result", "L1 result"}
SG::WriteHandleKey< xAOD::TrigDecisionm_trigDecisionKeyOut {this, "TrigDecisionKey", "xTrigDecision", "Output trigger decision object key"}
std::atomic< uint32_t > m_nEvents {0}
std::atomic< uint32_t > m_l1Passed {0}
std::atomic< uint32_t > m_hltPassed {0}
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

  • Re-entrant algorithm-derived class to run after the MT Trigger
  • Finds the list of defined chains at initialization
  • For each event:
    • Creates a xAODTriggerDecision object
    • Fills it with the outcome of each defined chain & L1 data
    • Output to StoreGate via writehandle written to ESD/AOD
    • Based on TrigDecisionMaker.h
Author
Tim Martin Tim.M.nosp@m.arti.nosp@m.n@cer.nosp@m.n.ch - University of Warwick

Definition at line 63 of file TrigDecisionMakerMT.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TrigDecisionMakerMT()

TrigDec::TrigDecisionMakerMT::TrigDecisionMakerMT ( const std::string & name,
ISvcLocator * pSvcLocator )

std Gaudi Algorithm constructor

Definition at line 28 of file TrigDecisionMakerMT.cxx.

29 : ::AthReentrantAlgorithm(name, pSvcLocator)
30{}

◆ ~TrigDecisionMakerMT()

TrigDec::TrigDecisionMakerMT::~TrigDecisionMakerMT ( )

std deconstructor

Definition at line 32 of file TrigDecisionMakerMT.cxx.

32{}

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode TrigDec::TrigDecisionMakerMT::execute ( const EventContext & context) const
overridevirtual

Re-entrant execute to create the xAOD::TrigDecision.

Definition at line 81 of file TrigDecisionMakerMT.cxx.

82{
83 using namespace TrigCompositeUtils;
84
85 // increment event counter
86 m_nEvents++;
87
88 std::unique_ptr<xAOD::TrigDecision> trigDec = std::make_unique<xAOD::TrigDecision>();
89 std::unique_ptr<xAOD::TrigDecisionAuxInfo> trigDecAux = std::make_unique<xAOD::TrigDecisionAuxInfo>();
90 trigDec->setStore(trigDecAux.get());
91
92 SG::ReadHandle<TrigConf::HLTMenu> hltMenu(m_HLTMenuKey, context);
93 ATH_CHECK(hltMenu.isValid());
94 trigDec->setSMK(hltMenu->smk());
95
96 if (m_doL1) {
97 const LVL1CTP::Lvl1Result* l1Result = nullptr;
98 ATH_CHECK(getL1Result(l1Result, context));
99
100 trigDec->setTAV(l1Result->itemsAfterVeto());
101 trigDec->setTAP(l1Result->itemsAfterPrescale());
102 trigDec->setTBP(l1Result->itemsBeforePrescale());
103
104 if (l1Result->isAccepted()) {
105 ++m_l1Passed;
106 }
107 }
108
109 if (m_doHLT) {
110
111 boost::dynamic_bitset<uint32_t> passRawBitset, prescaledBitset;
112
113 if (m_bitsMakerTool.isSet()) {
114
115 ATH_MSG_DEBUG ("MC Mode: Creating bits with TriggerBitsMakerTool");
116 ATH_CHECK(m_bitsMakerTool->getBits(passRawBitset, prescaledBitset, context));
117
118 } else {
119
120 ATH_MSG_DEBUG ("Data Mode: Reading bits from HLTResultMT");
121 SG::ReadHandle<HLT::HLTResultMT> hltResult = SG::makeHandle<HLT::HLTResultMT>(m_hltResultKeyIn, context);
122 ATH_CHECK(hltResult.isValid());
123
124 passRawBitset = hltResult->getHltPassRawBits();
125 prescaledBitset = hltResult->getHltPrescaledBits();
126
127 // Inspect error codes from event header
128 const std::vector<HLT::OnlineErrorCode> errorCodes = hltResult->getErrorCodes();
129 bool truncated = false;
130 uint32_t code = 0;
131 for (size_t i = 0; i < errorCodes.size(); ++i) {
132 truncated |= (errorCodes.at(i) == HLT::OnlineErrorCode::RESULT_TRUNCATION);
133 if (i == 0) {
134 code = static_cast<uint32_t>(errorCodes.at(0));
135 }
136 }
137
138 // If the event header does not show any truncation check the individual HLT ROBs
139 // to cover the case of allowed result truncation (see ATR-27986).
140 //
141 // We only support one truncation status in the TrigDecision. So the convention is:
142 // 1) If the main HLT result is available, its status is reflected (e.g. Physics stream)
143 // 2) If not, we take the combined status of all other ROBs, but in practice there
144 // should only ever be one (TLA) ROB in a given stream.
145 if (!truncated) {
146 std::set<uint16_t> allModuleIds; // sorted(!) set of module IDs
147 for (const auto& itr : hltResult->getSerialisedData()) allModuleIds.insert(itr.first);
148
149 for (uint16_t moduleId : allModuleIds) {
150 const std::vector<uint32_t>& status = hltResult->getRobStatus(moduleId);
151 if (status.size() > 1) { // status[0] is the generic eformat event status
152 truncated |= (status[1] == static_cast<uint32_t>(HLT::OnlineErrorCode::RESULT_TRUNCATION));
153 code |= status[1];
154 }
155 if (moduleId==0) break;
156 }
157 }
158
159 trigDec->setEFErrorBits(code);
160 trigDec->setEFTruncated(truncated);
161 }
162
163 ATH_MSG_DEBUG ("Number of HLT chains passed raw: " << passRawBitset.count());
164 ATH_MSG_DEBUG ("Number of HLT chains prescaled out: " << prescaledBitset.count());
165
166 if (passRawBitset.any()) {
167 ++m_hltPassed;
168 }
169
170 std::vector<uint32_t> passRaw, prescaled;
171
172 passRaw.resize(passRawBitset.num_blocks());
173 prescaled.resize(prescaledBitset.num_blocks());
174
175 boost::to_block_range(passRawBitset, passRaw.begin());
176 boost::to_block_range(prescaledBitset, prescaled.begin());
177
178 // OFFLINE FIX TO P1 OPERATIONAL ISSUE 28th-31st July 2022
179 // [ATR-26036] These runs had an incomplete fix applied leading to incorrect prescale bits, prior runs in Run 3 had no presacled bits.
180 // Incorrect prescale bits will cause incorrect results from the Trig Decision Tool. Hence these need to be zeroed out (no prescale bits is better than wrong prescale bits)
181 static const std::set<unsigned> buggyPrescaleBitRuns = {429603, 429606, 429612, 429658, 429697, 429716};
182 const bool isBuggyPrescaleBitsRun = (std::find(buggyPrescaleBitRuns.begin(), buggyPrescaleBitRuns.end(), context.eventID().run_number()) != buggyPrescaleBitRuns.end());
183 if (isBuggyPrescaleBitsRun) {
184 ATH_MSG_DEBUG("T0 Trigger fix for 429603-429716 is deleting incorrect isPrescaled trigger bits decoded from the bytestream.");
185 for (size_t i = 0; i < prescaled.size(); ++i) {
186 prescaled.at(i) = 0;
187 }
188 }
189
190 if (passRaw.size() != prescaled.size()) {
191 ATH_MSG_ERROR("Trigger bitsets are not all the same size! passRaw:"
192 << passRaw.size() << " prescaled:" << prescaled.size() );
193 return StatusCode::FAILURE;
194 }
195
196 // Run 3 note: with only a two-level system, with no passthrough bit, no resurrection bit
197 // the raw-pass equates to the physics-pass.
198 trigDec->setEFPassedRaw(passRaw);
199 trigDec->setEFPassedPhysics(passRaw);
200 trigDec->setEFPrescaled(prescaled);
201
202 }
203
204 // get the bunch crossing id
205 const xAOD::EventInfo* eventInfo = SG::get(m_EventInfoKeyIn, context);
206 SG::ReadCondHandle<TrigConf::L1BunchGroupSet> bgkey(m_bgKey, context);
207 ATH_CHECK(bgkey.isValid());
208 const TrigConf::L1BunchGroupSet* l1bgs = *bgkey;
209 if (l1bgs) {
210 // We currently only support 8 bits/bunchgroups (ATR-24030)
211 trigDec->setBGCode( static_cast<char>(l1bgs->bgPattern(eventInfo->bcid())) );
212 }
213 else {
214 ATH_MSG_WARNING("Could not read " << m_bgKey);
215 }
216
217 ATH_MSG_DEBUG ( "Run '" << eventInfo->runNumber()
218 << "'; Event '" << eventInfo->eventNumber()
219 << "'; BCID '" << eventInfo->bcid()
220 << "'; BG Code '" << trigDec->bgCode() << "'" ) ;
221
222 ATH_MSG_DEBUG ("Decision object dump: " << *(trigDec.get()));
223 auto trigDecWriteHandle = SG::makeHandle( m_trigDecisionKeyOut, context );
224 ATH_CHECK( trigDecWriteHandle.record( std::move( trigDec ), std::move( trigDecAux ) ) );
225 ATH_MSG_DEBUG ("Recorded xAOD::TrigDecision to StoreGate with key = " << m_trigDecisionKeyOut.key());
226
227 return StatusCode::SUCCESS;
228}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
const std::vector< uint32_t > & itemsAfterVeto() const
Definition Lvl1Result.h:57
bool isAccepted() const
final LVL1 decision && isConfigured
const std::vector< uint32_t > & itemsAfterPrescale() const
Definition Lvl1Result.h:56
const std::vector< uint32_t > & itemsBeforePrescale() const
Definition Lvl1Result.h:55
virtual bool isValid() override final
Can the handle be successfully dereferenced?
bgPattern_t bgPattern(size_t bcid) const
Return word with bit-pattern of fired bunchgroups for given bcid.
SG::ReadHandleKey< HLT::HLTResultMT > m_hltResultKeyIn
Gaudi::Property< bool > m_doL1
SG::ReadCondHandleKey< TrigConf::L1BunchGroupSet > m_bgKey
StatusCode getL1Result(const LVL1CTP::Lvl1Result *&result, const EventContext &context) const
retrieve LVL1 result (called in execute)
std::atomic< uint32_t > m_nEvents
std::atomic< uint32_t > m_hltPassed
Gaudi::Property< bool > m_doHLT
std::atomic< uint32_t > m_l1Passed
SG::ReadHandleKey< xAOD::EventInfo > m_EventInfoKeyIn
SG::ReadHandleKey< TrigConf::HLTMenu > m_HLTMenuKey
SG::WriteHandleKey< xAOD::TrigDecision > m_trigDecisionKeyOut
ToolHandle< ITriggerBitsMakerTool > m_bitsMakerTool
uint32_t bcid() const
The bunch crossing ID of the event.
uint32_t runNumber() const
The current event's run number.
uint64_t eventNumber() const
The current event's event number.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
status
Definition merge.py:16
EventInfo_v1 EventInfo
Definition of the latest event info version.
setEventNumber uint32_t

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ finalize()

StatusCode TrigDec::TrigDecisionMakerMT::finalize ( )
overridevirtual

std Gaudi finalize method -> print out statistics

Definition at line 67 of file TrigDecisionMakerMT.cxx.

68{
69 // print out stats: used also to do regression tests
70 ATH_MSG_DEBUG ("=============================================");
71 ATH_MSG_DEBUG ("REGTEST Run summary:");
72 ATH_MSG_DEBUG ("REGTEST Events processed : " << m_nEvents);
73 ATH_MSG_DEBUG ("REGTEST Level 1 : passed = " << m_l1Passed);
74 ATH_MSG_DEBUG ("REGTEST HLT : passed = " << m_hltPassed);
75 ATH_MSG_DEBUG ("=============================================");
76
77 return StatusCode::SUCCESS;
78}

◆ getL1Result()

StatusCode TrigDec::TrigDecisionMakerMT::getL1Result ( const LVL1CTP::Lvl1Result *& result,
const EventContext & context ) const
private

retrieve LVL1 result (called in execute)

Definition at line 231 of file TrigDecisionMakerMT.cxx.

232{
233
234 if (m_useEDMxAOD) {
235
236 SG::ReadHandle<xAOD::CTPResult> ctpResult = SG::makeHandle<xAOD::CTPResult>(m_CTPResultKeyIn, context);
237 ATH_CHECK(ctpResult.isValid());
238
239 // Fill TBP, TAP, TAV when creating the Lvl1Result
240 auto lvl1Result = std::make_unique<LVL1CTP::Lvl1Result>(true);
241
242 // TBP words
243 const std::vector<uint32_t> ctpTBPWords = ctpResult->getTBPWords();
244 for (unsigned int iWord=0; iWord < ctpTBPWords.size(); ++iWord) {
245 lvl1Result->itemsBeforePrescale().push_back(ctpTBPWords[iWord]);
246 ATH_MSG_DEBUG( "TBP word #" << iWord << " is 0x" << std::hex << std::setw( 8 ) << std::setfill( '0' ) << ctpTBPWords[iWord] << std::dec);
247 }
248
249 // TAP words
250 const std::vector<uint32_t> ctpTAPWords = ctpResult->getTAPWords();
251 for (unsigned int iWord=0; iWord < ctpTAPWords.size(); ++iWord) {
252 lvl1Result->itemsAfterPrescale().push_back(ctpTAPWords[iWord]);
253 ATH_MSG_DEBUG("TAP word #" << iWord << " is 0x" << std::hex << std::setw( 8 ) << std::setfill( '0' ) << ctpTAPWords[iWord] << std::dec);
254 }
255
256 // TAV words
257 const std::vector<uint32_t> ctpTAVWords = ctpResult->getTAVWords();
258 for (unsigned int iWord = 0; iWord < ctpTAVWords.size(); ++iWord) {
259 lvl1Result->itemsAfterVeto().push_back(ctpTAVWords[iWord]);
260 ATH_MSG_DEBUG("TAV word #" << iWord << " is 0x" << std::hex << std::setw( 8 ) << std::setfill( '0' ) << ctpTAVWords[iWord] << std::dec);
261 }
262
263 // make sure TBP, TAP, TAV all have 8 entries!
264 if (lvl1Result->itemsBeforePrescale().size() < 8) lvl1Result->itemsBeforePrescale().resize(8, 0);
265 if (lvl1Result->itemsAfterPrescale().size() < 8) lvl1Result->itemsAfterPrescale().resize(8, 0);
266 if (lvl1Result->itemsAfterVeto().size() < 8) lvl1Result->itemsAfterVeto().resize(8, 0);
267
268 result = static_cast<const LVL1CTP::Lvl1Result*>(lvl1Result.get());
269 if (result == nullptr) {
270 ATH_MSG_ERROR ( "Could not construct L1 result from xAOD::CTPResult");
271 return StatusCode::FAILURE;
272 }
273
274 ATH_CHECK(SG::makeHandle(m_l1ResultKeyOut, context).record( std::move(lvl1Result)), {});
275 ATH_MSG_DEBUG ( "Built LVL1CTP::Lvl1Result from valid xAOD::CTPResult.");
276
277 } else {
278
279 SG::ReadHandle<ROIB::RoIBResult> roIBResult = SG::makeHandle<ROIB::RoIBResult>(m_ROIBResultKeyIn, context);
280 ATH_CHECK(roIBResult.isValid());
281
282 std::vector< std::unique_ptr<LVL1CTP::Lvl1Item> > itemConfig = m_lvl1Tool->makeLvl1ItemConfig(context);
283
284 if (roIBResult->cTPResult().isComplete()) {
285 m_lvl1Tool->createL1Items(itemConfig, *roIBResult, &result);
286 ATH_MSG_DEBUG ( "Built LVL1CTP::Lvl1Result from valid ROIB::CTPResult.");
287 }
288
289 if (result == nullptr) {
290 ATH_MSG_ERROR ( "Could not construct L1 result from roIBResult");
291 return StatusCode::FAILURE;
292 }
293
294 }
295
296 return StatusCode::SUCCESS;
297}
Gaudi::Property< bool > m_useEDMxAOD
ToolHandle< HLT::ILvl1ResultAccessTool > m_lvl1Tool
tool to ease the access to the L1 results (RoIs, items, etc)
SG::ReadHandleKey< xAOD::CTPResult > m_CTPResultKeyIn
SG::WriteHandleKey< LVL1CTP::Lvl1Result > m_l1ResultKeyOut
SG::ReadHandleKey< ROIB::RoIBResult > m_ROIBResultKeyIn

◆ initialize()

StatusCode TrigDec::TrigDecisionMakerMT::initialize ( )
overridevirtual

std Gaudi initialize method -> read-in trigger configuration

Definition at line 35 of file TrigDecisionMakerMT.cxx.

36{
37
38 bool resultObjectIsUsed = true;
39 if (!m_bitsMakerTool.empty()) {
40 ATH_MSG_INFO("TrigDecisionMakerMT is setting up to run after the Trigger in a job with POOL output. "
41 "The TriggerBitsMakerTool will be used directly to create the xAOD::TrigDecision.");
42 ATH_CHECK( m_bitsMakerTool.retrieve() );
43 resultObjectIsUsed = false;
44 } else {
45 ATH_MSG_INFO("TrigDecisionMakerMT is setting up to read the trigger bits from trigger bytestream. "
46 "The HLTResultMT object will be used as the source of the trigger bits.");
47 }
48 ATH_CHECK( m_hltResultKeyIn.initialize(resultObjectIsUsed) ); // If false, this removes the ReadHandle
49
50 ATH_CHECK( m_bgKey.initialize() );
51 ATH_CHECK( m_HLTMenuKey.initialize() );
52
53 ATH_CHECK( m_ROIBResultKeyIn.initialize() );
54 ATH_CHECK( m_EventInfoKeyIn.initialize() );
55
56 ATH_CHECK( m_trigDecisionKeyOut.initialize() );
57
58 ATH_CHECK( m_lvl1Tool.retrieve() );
59
62
63 return StatusCode::SUCCESS;
64}
#define ATH_MSG_INFO(x)

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107 {
109
110 if (sc.isFailure()) {
111 return sc;
112 }
113
114 ServiceHandle<ICondSvc> cs("CondSvc",name());
115 for (auto h : outputHandles()) {
116 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117 // do this inside the loop so we don't create the CondSvc until needed
118 if ( cs.retrieve().isFailure() ) {
119 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120 return StatusCode::SUCCESS;
121 }
122 if (cs->regHandle(this,*h).isFailure()) {
124 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125 << " with CondSvc");
126 }
127 }
128 }
129 return sc;
130}
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_bgKey

SG::ReadCondHandleKey<TrigConf::L1BunchGroupSet> TrigDec::TrigDecisionMakerMT::m_bgKey {this, "L1BunchGroup", "L1BunchGroup", "L1BunchGroupSet key name"}
private

Definition at line 90 of file TrigDecisionMakerMT.h.

90{this, "L1BunchGroup", "L1BunchGroup", "L1BunchGroupSet key name"};

◆ m_bitsMakerTool

ToolHandle<ITriggerBitsMakerTool> TrigDec::TrigDecisionMakerMT::m_bitsMakerTool {this, "BitsMakerTool", "", "Tool to create trigger bits for MC"}
private

Definition at line 87 of file TrigDecisionMakerMT.h.

87{this, "BitsMakerTool", "", "Tool to create trigger bits for MC"};

◆ m_CTPResultKeyIn

SG::ReadHandleKey<xAOD::CTPResult> TrigDec::TrigDecisionMakerMT::m_CTPResultKeyIn {this, "CTPResult", "CTPResult", "Key to retrieve the L1 xAOD CTP result from SG" }
private

Definition at line 95 of file TrigDecisionMakerMT.h.

95{this, "CTPResult", "CTPResult", "Key to retrieve the L1 xAOD CTP result from SG" };

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doHLT

Gaudi::Property<bool> TrigDec::TrigDecisionMakerMT::m_doHLT {this, "doHLT", true, "Read HLT trigger information"}
private

Definition at line 81 of file TrigDecisionMakerMT.h.

81{this, "doHLT", true, "Read HLT trigger information"};

◆ m_doL1

Gaudi::Property<bool> TrigDec::TrigDecisionMakerMT::m_doL1 {this, "doL1", true, "Read L1 trigger information"}
private

Definition at line 80 of file TrigDecisionMakerMT.h.

80{this, "doL1", true, "Read L1 trigger information"};

◆ m_EventInfoKeyIn

SG::ReadHandleKey<xAOD::EventInfo> TrigDec::TrigDecisionMakerMT::m_EventInfoKeyIn {this, "EventInfo", "EventInfo", "Event Info Object Key"}
private

Definition at line 96 of file TrigDecisionMakerMT.h.

96{this, "EventInfo", "EventInfo", "Event Info Object Key"};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_HLTMenuKey

SG::ReadHandleKey<TrigConf::HLTMenu> TrigDec::TrigDecisionMakerMT::m_HLTMenuKey {this, "HLTTriggerMenu", "DetectorStore+HLTTriggerMenu", "HLT Menu key"}
private

Definition at line 91 of file TrigDecisionMakerMT.h.

91{this, "HLTTriggerMenu", "DetectorStore+HLTTriggerMenu", "HLT Menu key"};

◆ m_hltPassed

std::atomic<uint32_t> TrigDec::TrigDecisionMakerMT::m_hltPassed {0}
private

Definition at line 103 of file TrigDecisionMakerMT.h.

103{0}, m_l1Passed{0}, m_hltPassed{0};

◆ m_hltResultKeyIn

SG::ReadHandleKey<HLT::HLTResultMT> TrigDec::TrigDecisionMakerMT::m_hltResultKeyIn {this, "HLTResultMT", "HLTResultMT", "Key of the HLTResultMT object to get bits from online bytestream" }
private

Definition at line 93 of file TrigDecisionMakerMT.h.

93{this, "HLTResultMT", "HLTResultMT", "Key of the HLTResultMT object to get bits from online bytestream" };

◆ m_l1Passed

std::atomic<uint32_t> TrigDec::TrigDecisionMakerMT::m_l1Passed {0}
private

Definition at line 103 of file TrigDecisionMakerMT.h.

103{0}, m_l1Passed{0}, m_hltPassed{0};

◆ m_l1ResultKeyOut

SG::WriteHandleKey<LVL1CTP::Lvl1Result> TrigDec::TrigDecisionMakerMT::m_l1ResultKeyOut { this, "L1Result", "L1Result", "L1 result"}
private

Definition at line 99 of file TrigDecisionMakerMT.h.

99{ this, "L1Result", "L1Result", "L1 result"};

◆ m_lvl1Tool

ToolHandle<HLT::ILvl1ResultAccessTool> TrigDec::TrigDecisionMakerMT::m_lvl1Tool {this, "Lvl1ResultAccessTool", "HLT::Lvl1ResultAccessTool/Lvl1ResultAccessTool", "L1 tool to fetch"}
private

tool to ease the access to the L1 results (RoIs, items, etc)

Definition at line 85 of file TrigDecisionMakerMT.h.

85{this, "Lvl1ResultAccessTool", "HLT::Lvl1ResultAccessTool/Lvl1ResultAccessTool", "L1 tool to fetch"};

◆ m_nEvents

std::atomic<uint32_t> TrigDec::TrigDecisionMakerMT::m_nEvents {0}
mutableprivate

Definition at line 103 of file TrigDecisionMakerMT.h.

103{0}, m_l1Passed{0}, m_hltPassed{0};

◆ m_ROIBResultKeyIn

SG::ReadHandleKey<ROIB::RoIBResult> TrigDec::TrigDecisionMakerMT::m_ROIBResultKeyIn {this, "RoIBResult", "RoIBResult", "RoIB Result Object Key"}
private

Definition at line 94 of file TrigDecisionMakerMT.h.

94{this, "RoIBResult", "RoIBResult", "RoIB Result Object Key"};

◆ m_trigDecisionKeyOut

SG::WriteHandleKey<xAOD::TrigDecision> TrigDec::TrigDecisionMakerMT::m_trigDecisionKeyOut {this, "TrigDecisionKey", "xTrigDecision", "Output trigger decision object key"}
private

Definition at line 100 of file TrigDecisionMakerMT.h.

100{this, "TrigDecisionKey", "xTrigDecision", "Output trigger decision object key"};

◆ m_useEDMxAOD

Gaudi::Property<bool> TrigDec::TrigDecisionMakerMT::m_useEDMxAOD {this, "UseEDMxAOD", false, "Flag whether to use xAOD::CTPResult instead of ROIB::RoIBResult for CTP result"}
private

Definition at line 82 of file TrigDecisionMakerMT.h.

82{this, "UseEDMxAOD", false, "Flag whether to use xAOD::CTPResult instead of ROIB::RoIBResult for CTP result"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


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