ATLAS Offline Software
Loading...
Searching...
No Matches
LVL1CTP::ResultBuilder Class Reference

Class used to create the CTP output (RDO, SLink and TriggerInfo) More...

#include <ResultBuilder.h>

Inheritance diagram for LVL1CTP::ResultBuilder:
Collaboration diagram for LVL1CTP::ResultBuilder:

Public Member Functions

 ResultBuilder (const std::string &type, const std::string &name, const IInterface *parent)
 ~ResultBuilder ()
void setRandomEngine (CLHEP::HepRandomEngine *rndmEngine)
StatusCode setConfiguration (const TrigConf::L1Menu &l1menu)
StatusCode buildItemDecision (const std::map< std::string, unsigned int > &thrMultiMap, std::map< std::string, unsigned int > &itemDecisionMap, CLHEP::HepRandomEngine *rndmEngine) const
StatusCode constructResultVectors (const std::map< std::string, unsigned int > &itemDecisionMap, std::vector< uint32_t > &tbp, std::vector< uint32_t > &tap, std::vector< uint32_t > &tav, unsigned char &triggerType) const
StatusCode constructTIPVector (const std::map< std::string, unsigned int > &thrMultiMap, std::vector< uint32_t > &tip) const
std::unique_ptr< CTPSLinkconstructRoIResult (const EventIDBase &eventID, const std::vector< uint32_t > &tbp, const std::vector< uint32_t > &tap, const std::vector< uint32_t > &tav, const std::vector< uint32_t > &tip, const std::vector< uint32_t > &extra, const unsigned char triggerType) const
 build RoI result (LVL1CTP::CTPSLink)
std::unique_ptr< CTP_RDOconstructRDOResult (const EventIDBase &eventID, const std::vector< uint32_t > &tbp, const std::vector< uint32_t > &tap, const std::vector< uint32_t > &tav, const std::vector< uint32_t > &tip, const std::vector< uint32_t > &extra) const
 build RDO result (CTP_RDO) - TODO obsolete it in favor of xAOD::CTPResult
std::pair< std::unique_ptr< xAOD::CTPResult >, std::unique_ptr< xAOD::CTPResultAuxInfo > > constructCTPResult (const EventIDBase &eventID, const std::vector< uint32_t > &tbp, const std::vector< uint32_t > &tap, const std::vector< uint32_t > &tav, const std::vector< uint32_t > &tip, const std::vector< uint32_t > &extra, const unsigned char triggerType) const
 build RDO result (CTPResult)
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 sysInitialize () override
 Perform system initialization for an algorithm.
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

enum  WrdType { TBP = 0x01 , TAP = 0x02 , TAV = 0x04 }
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode createTriggerConfigMaps (const TrigConf::L1Menu &l1menu)
std::vector< std::string > firedItems (const std::vector< uint32_t > &triggerWords) const
 build list of fired items and dump to string
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

std::unique_ptr< ThresholdMapm_thrConfigMap { nullptr }
 Map between threshold objects and their CTP-internal description.
std::unique_ptr< ItemMapm_itemConfigMap { nullptr }
 Map between item objects and their CTP-internal description.
InternalTriggerMap m_internalTrigger
 internal triggers BGRP and RNDM
unsigned int m_ctpVersionNumber { 4 }
 CTP data format version (4 in most of Run 2 and in Run 3)
CTPdataformatVersion * m_ctpDataFormat { nullptr }
 CTP data format details.
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

Class used to create the CTP output (RDO, SLink and TriggerInfo)

This class constructs and uses vectors of the following words to form the CTP output:

  • tbp: Trigger before prescale words
  • tap: Trigger after prescale words
  • tav: Trigger after veto words
  • tip: Trigger input pattern words
  • extra: Extra data words

Definition at line 51 of file ResultBuilder.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ WrdType

Enumerator
TBP 
TAP 
TAV 

Definition at line 98 of file ResultBuilder.h.

Constructor & Destructor Documentation

◆ ResultBuilder()

LVL1CTP::ResultBuilder::ResultBuilder ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 33 of file ResultBuilder.cxx.

36 : AthAlgTool(type, name, parent)
37{
38 m_ctpDataFormat = new CTPdataformatVersion(m_ctpVersionNumber);
39}
AthAlgTool()
Default constructor:
CTPdataformatVersion * m_ctpDataFormat
CTP data format details.
unsigned int m_ctpVersionNumber
CTP data format version (4 in most of Run 2 and in Run 3)

◆ ~ResultBuilder()

LVL1CTP::ResultBuilder::~ResultBuilder ( )

Definition at line 42 of file ResultBuilder.cxx.

42 {
43 delete m_ctpDataFormat;
44 for(auto & x : m_internalTrigger) {
45 delete x.second;
46 }
47}
#define x
InternalTriggerMap m_internalTrigger
internal triggers BGRP and RNDM

Member Function Documentation

◆ buildItemDecision()

StatusCode LVL1CTP::ResultBuilder::buildItemDecision ( const std::map< std::string, unsigned int > & thrMultiMap,
std::map< std::string, unsigned int > & itemDecisionMap,
CLHEP::HepRandomEngine * rndmEngine ) const

Definition at line 149 of file ResultBuilder.cxx.

152{
153 // build trigger result for all items
154 itemDecisionMap.clear();
155
156 try {
157 for( const auto & itemName : m_itemConfigMap->itemNames() ) {
158 auto ctpItem = m_itemConfigMap->getItem(itemName);
159
160 bool pass_beforePrescale = ctpItem->evaluate(thrMultiMap);
161 bool pass_afterPrescale = false;
162 bool pass_afterVeto = false;
163
164 if ( pass_beforePrescale ) {
165 long random = CLHEP::RandFlat::shootInt( rndmEngine, pow(2,24) );
166 int32_t cut = TrigConf::PrescaleSet::getCutFromPrescale( m_itemConfigMap->getItem( itemName )->prescale() );
167 pass_afterPrescale = (random >= cut) && (cut > 0); // no pass if PS set to "-1"
168 pass_afterVeto = pass_afterPrescale; // dead time is not simulated
169 }
170
171 unsigned int result = (pass_beforePrescale ? TBP : 0) + (pass_afterPrescale ? TAP : 0) + (pass_afterVeto ? TAV : 0);
172
173 itemDecisionMap[itemName] = result;
174 }
175 } catch (TrigConf::LogicParsingException & ex) {
176 ATH_MSG_FATAL("Error in evaluating logic. " << ex.msg());
177 return StatusCode::FAILURE;
178 }
179 return StatusCode::SUCCESS;
180}
#define ATH_MSG_FATAL(x)
constexpr int pow(int base, int exp) noexcept
std::unique_ptr< ItemMap > m_itemConfigMap
Map between item objects and their CTP-internal description.
const std::string & msg() const
Definition Logic.h:21
static int32_t getCutFromPrescale(double prescale)
calculate cut value for hardware configuration cut = 2*24/prescale - 1
cut
This script demonstrates how to call a C++ class from Python Also how to use PyROOT is shown.

◆ constructCTPResult()

std::pair< std::unique_ptr< xAOD::CTPResult >, std::unique_ptr< xAOD::CTPResultAuxInfo > > LVL1CTP::ResultBuilder::constructCTPResult ( const EventIDBase & eventID,
const std::vector< uint32_t > & tbp,
const std::vector< uint32_t > & tap,
const std::vector< uint32_t > & tav,
const std::vector< uint32_t > & tip,
const std::vector< uint32_t > & extra,
const unsigned char triggerType ) const

build RDO result (CTPResult)

Definition at line 352 of file ResultBuilder.cxx.

359{
360 auto wrongSize = [this](const std::vector<uint32_t> & vec, uint32_t exp, std::string_view name) {
361 if (vec.size() == exp) {return false;}
362 ATH_MSG_ERROR("Wrong " << name << " vector size passed to constructCTPResult, " << vec.size() << " instead of " << exp);
363 return true;
364 };
365 if (wrongSize(tip, m_ctpDataFormat->getTIPwords(), "TIP")
366 || wrongSize(tbp, m_ctpDataFormat->getTBPwords(), "TBP")
367 || wrongSize(tap, m_ctpDataFormat->getTAPwords(), "TAP")
368 || wrongSize(tav, m_ctpDataFormat->getTAVwords(), "TAV")) {
369 return {nullptr, nullptr};
370 }
371
372 std::vector<uint32_t> data(static_cast<size_t>(m_ctpDataFormat->getNumberTimeWords()), uint32_t{0});
373 data.reserve(m_ctpDataFormat->getNumberTimeWords() + m_ctpDataFormat->getDAQwordsPerBunch() + extra.size());
374 data[m_ctpDataFormat->getTimeSecondsPos()] = eventID.time_stamp(); // Time stamp in seconds
375 data[m_ctpDataFormat->getTimeNanosecondsPos()] = eventID.time_stamp_ns_offset(); // Time stamp in nanoseconds
376 data.insert(data.end(),tip.begin(),tip.end());
377 data.insert(data.end(),tbp.begin(),tbp.end());
378 data.insert(data.end(),tap.begin(),tap.end());
379 data.insert(data.end(),tav.begin(),tav.end());
380 data.insert(data.end(),extra.begin(),extra.end());
381
382 // Source id for header words. Convention for source id in LVL1: 0 for DAQ
383 const uint32_t source_id{eformat::helper::SourceIdentifier(eformat::TDAQ_CTP, 1).code()};
384
385 // Version word for header words
386 uint32_t version_word = eformat::DEFAULT_ROD_VERSION;
387 const uint32_t l1a_pos{0};
388 version_word |= ((extra.size() & m_ctpDataFormat->getProgrammableExtraWordsMask()) << m_ctpDataFormat->getProgrammableExtraWordsShift());
389 version_word |= ((l1a_pos & m_ctpDataFormat->getL1APositionMask()) << m_ctpDataFormat->getL1APositionShift());
390 version_word |= ((m_ctpVersionNumber & m_ctpDataFormat->getCTPFormatVersionMask()) << m_ctpDataFormat->getCTPFormatVersionShift());
391
392 // Create the CTPResult and CTPResultAuxInfo objects
393 auto result = std::make_unique<xAOD::CTPResult>();
394 auto resultAux = std::make_unique<xAOD::CTPResultAuxInfo>();
395 result->setStore(resultAux.get());
396 CTPResultUtils::initialize(*result, m_ctpVersionNumber, data, extra.size()); // Payload words
397 result->setHeader(eformat::ROD, version_word, source_id, 0, eventID.run_number(), eventID.bunch_crossing_id(), triggerType, 0); // Header words
398 result->setTrailer(data.size()); // Trailer words
399 result->setL1AcceptBunchPosition(l1a_pos); // L1A bunch position
401 ATH_MSG_DEBUG( "Created CTPResult object" );
402 return std::make_pair(std::move(result), std::move(resultAux));
403}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
std::vector< size_t > vec
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
void initialize(xAOD::CTPResult &ctpRes, const uint32_t ctpVersionNumber, std::vector< uint32_t > &data, const uint32_t nExtraWords)
Initialize the object using xAOD::Header, xAOD::Trailer, and the payload data.
void dumpData(xAOD::CTPResult &ctpRes)
Print object content to default message stream.
setBGCode tap
setEventNumber uint32_t

◆ constructRDOResult()

std::unique_ptr< CTP_RDO > LVL1CTP::ResultBuilder::constructRDOResult ( const EventIDBase & eventID,
const std::vector< uint32_t > & tbp,
const std::vector< uint32_t > & tap,
const std::vector< uint32_t > & tav,
const std::vector< uint32_t > & tip,
const std::vector< uint32_t > & extra ) const

build RDO result (CTP_RDO) - TODO obsolete it in favor of xAOD::CTPResult

Definition at line 314 of file ResultBuilder.cxx.

320{
321 auto wrongSize = [this](const std::vector<uint32_t> & vec, uint32_t exp, std::string_view name) {
322 if (vec.size() == exp) {return false;}
323 ATH_MSG_ERROR("Wrong " << name << " vector size passed to constructRDOResult, " << vec.size() << " instead of " << exp);
324 return true;
325 };
326 if (wrongSize(tip, m_ctpDataFormat->getTIPwords(), "TIP")
327 || wrongSize(tbp, m_ctpDataFormat->getTBPwords(), "TBP")
328 || wrongSize(tap, m_ctpDataFormat->getTAPwords(), "TAP")
329 || wrongSize(tav, m_ctpDataFormat->getTAVwords(), "TAV")) {
330 return nullptr;
331 }
332
333 std::vector<uint32_t> data(static_cast<size_t>(m_ctpDataFormat->getNumberTimeWords()), uint32_t{0});
334 data.reserve(m_ctpDataFormat->getNumberTimeWords() + m_ctpDataFormat->getDAQwordsPerBunch() + extra.size());
335 data.insert(data.end(),tip.begin(),tip.end());
336 data.insert(data.end(),tbp.begin(),tbp.end());
337 data.insert(data.end(),tap.begin(),tap.end());
338 data.insert(data.end(),tav.begin(),tav.end());
339 data.insert(data.end(),extra.begin(),extra.end());
340
341 std::unique_ptr<CTP_RDO> result( new CTP_RDO(m_ctpVersionNumber, std::move(data), extra.size()) );
342 result->setTimeSec(eventID.time_stamp()); // Time stamp: 32-bit UTC seconds
343 result->setTimeNanoSec(eventID.time_stamp_ns_offset()); // Time stamp: 28-bit nanoseconds
344 ATH_MSG_DEBUG( "Created CTP_RDO object" );
345 return result;
346}

◆ constructResultVectors()

StatusCode LVL1CTP::ResultBuilder::constructResultVectors ( const std::map< std::string, unsigned int > & itemDecisionMap,
std::vector< uint32_t > & tbp,
std::vector< uint32_t > & tap,
std::vector< uint32_t > & tav,
unsigned char & triggerType ) const

Definition at line 183 of file ResultBuilder.cxx.

186{
187 tbp.resize( m_ctpDataFormat->getTBPwords(), 0 );
188 tap.resize( m_ctpDataFormat->getTAPwords(), 0 );
189 tav.resize( m_ctpDataFormat->getTAVwords(), 0 );
190 triggerType = 0;
191
192 for( auto & entry : itemDecisionMap ) {
193 const std::string & itemName = entry.first;
194 unsigned int result = entry.second;
195 bool passBP = (result & TBP) != 0;
196 bool passAP = (result & TAP) != 0;
197 bool passAV = (result & TAV) != 0;
198
199
200
201
202 auto l1Item = m_itemConfigMap->getItem( itemName );
203
204 if( passAV ) {
205 triggerType |= l1Item->triggerType();
206 }
207
208 auto ctpId = l1Item->ctpId();
209 unsigned int wordNr = ctpId / 32;
210 unsigned int posWithinWord = ctpId % 32;
211
212 if( passBP ) { tbp[wordNr] |= 1L << posWithinWord; }
213 if( passAP ) { tap[wordNr] |= 1L << posWithinWord; }
214 if( passAV ) { tav[wordNr] |= 1L << posWithinWord; }
215
216 ATH_MSG_DEBUG( " --> Trigger item " << itemName <<
217 " is " << ( !passBP ? "INACTIVE" : ( passAV ? "ACTIVE" : "ACTIVE (but PRESCALED)" ) ) );
218 }
219 ATH_MSG_DEBUG( "REGTEST - " << "TriggerType byte is: 0x" << std::setw( 2 ) << std::setfill( '0' ) << std::hex << int(triggerType) );
220
221 return StatusCode::SUCCESS;
222}

◆ constructRoIResult()

std::unique_ptr< LVL1CTP::CTPSLink > LVL1CTP::ResultBuilder::constructRoIResult ( const EventIDBase & eventID,
const std::vector< uint32_t > & tbp,
const std::vector< uint32_t > & tap,
const std::vector< uint32_t > & tav,
const std::vector< uint32_t > & tip,
const std::vector< uint32_t > & extra,
const unsigned char triggerType ) const

build RoI result (LVL1CTP::CTPSLink)

Definition at line 228 of file ResultBuilder.cxx.

235{
236 //
237 // Build the data words:
238 //
239 std::vector<uint32_t> roi_vector;
240 roi_vector.push_back( eventID.time_stamp_ns_offset() ); // Time stamp: 28-bit nanoseconds
241 roi_vector.push_back( eventID.time_stamp() ); // Time stamp: 32-bit UTC seconds
242
243 roi_vector.insert(roi_vector.end(), tip.begin(), tip.end()); // TIP + 1 extra word
244 roi_vector.insert(roi_vector.end(), tbp.begin(), tbp.end()); // TBP
245 roi_vector.insert(roi_vector.end(), tap.begin(), tap.end()); // TAP
246 roi_vector.insert(roi_vector.end(), tav.begin(), tav.end()); // TAV
247 roi_vector.insert(roi_vector.end(), extra.begin(), extra.end()); // Extra words
248
249 ATH_MSG_VERBOSE( "Stored data elements of RoI result" );
250
251 //
252 // Build the trailer:
253 //
254
255 std::vector<unsigned int> trailer(ROIB::Trailer(roi_vector.size()).trailer());
256 roi_vector.insert(roi_vector.end(), trailer.begin(), trailer.end());
257 ATH_MSG_VERBOSE( "Created trailer of RoI result" );
258
259 //
260 // Build the header:
261 //
262
263 // convention for source id in LVL1: 0 for DAQ, 1 for RoIB
264 const uint32_t source_id{eformat::helper::SourceIdentifier(eformat::TDAQ_CTP, 1).code()};
265
266 // version word
267 uint32_t version_word = eformat::DEFAULT_ROD_VERSION;
268 const uint32_t l1a_pos{0}; // there's only one BC in RoIB fragment, which is the L1A one
269 version_word |= ((extra.size() & m_ctpDataFormat->getProgrammableExtraWordsMask()) << m_ctpDataFormat->getProgrammableExtraWordsShift());
270 version_word |= ((l1a_pos & m_ctpDataFormat->getL1APositionMask()) << m_ctpDataFormat->getL1APositionShift());
271 version_word |= ((m_ctpVersionNumber & m_ctpDataFormat->getCTPFormatVersionMask()) << m_ctpDataFormat->getCTPFormatVersionShift());
272
273 ROIB::Header helperHeader(source_id, 0, version_word);
274
275 helperHeader.setRunNumber( eventID.run_number());
276 //helperHeader.setL1ID( eventID.extendedL1ID());
277 helperHeader.setBCID( eventID.bunch_crossing_id());
278 helperHeader.setTriggerType(triggerType);
279 //helperHeader.setEventType(EventInfo::instance().eventType());
280
281 std::vector<unsigned int> header(helperHeader.header());
282 roi_vector.insert(roi_vector.begin(), header.begin(), header.end());
283 ATH_MSG_VERBOSE( "Created header of RoI result" );
284
285 //
286 // Build the SLink:
287 //
288
289 std::unique_ptr<CTPSLink> result ( new CTPSLink( roi_vector, m_ctpVersionNumber ));
290 ATH_MSG_DEBUG( "Created CTPSlink object" );
291 ATH_MSG_VERBOSE( "Dump CTPSlink object:\n" + result->dump() );
292
293 //
294 // Debug output for ART
295 //
296 if( msgLvl(MSG::VERBOSE) ) {
297 for( auto & itemName : firedItems(tbp) ) {
298 ATH_MSG_VERBOSE( "REGTEST - Items fired before prescale: " << itemName );
299 }
300 for( auto & itemName : firedItems(tap) ) {
301 ATH_MSG_VERBOSE( "REGTEST - Items fired after prescale: " << itemName );
302 }
303 for( auto & itemName : firedItems(tav) ) {
304 ATH_MSG_VERBOSE( "REGTEST - Items fired after veto: " << itemName );
305 }
306 }
307 return result;
308}
#define ATH_MSG_VERBOSE(x)
bool msgLvl(const MSG::Level lvl) const
std::vector< std::string > firedItems(const std::vector< uint32_t > &triggerWords) const
build list of fired items and dump to string

◆ constructTIPVector()

StatusCode LVL1CTP::ResultBuilder::constructTIPVector ( const std::map< std::string, unsigned int > & thrMultiMap,
std::vector< uint32_t > & tip ) const

Definition at line 89 of file ResultBuilder.cxx.

91{
92 tip.resize( m_ctpDataFormat->getTIPwords(), 0 );
93
94 for( auto & entry : thrMultiMap ) {
95 const std::string & thrName = entry.first;
96 size_t multiplicity = entry.second;
97
98 // if multiplicity is 0 then there is nothing to set
99 if(multiplicity==0) {
100 continue;
101 }
102
103 auto x = m_internalTrigger.find(thrName);
104 if(x != m_internalTrigger.end()) {
105 // internal triggers (BGRP or RNDM)
106
107 size_t wordNr = m_ctpDataFormat->getTIPwords() - 1; // internal triggers are stored in the last word
108 size_t posWithinWord = x->second->pitPos() % 32;
109
110 tip[wordNr] |= ( 1L << posWithinWord );
111
112 } else {
113 // all other trigger threshold multiplicities
114
115 const CTPTriggerThreshold & ctpTT = m_thrConfigMap->getCTPThreshold( thrName );
116 size_t startBit = ctpTT.startBit();
117 size_t nBits = ctpTT.endBit() - startBit + 1;
118
119 // restrict to the maximum possible multiplicity
120 if(multiplicity >= (1U<<nBits)) {
121 multiplicity = (1U<<nBits)-1;
122 }
123
124 size_t wordNr = startBit / 32;
125 size_t posWithinWord = startBit % 32;
126
127 uint64_t result = multiplicity; // need 64 bit in case the word boundary is crossed by the threshold start..end
128 result <<= posWithinWord;
129
130 tip[wordNr] |= result & 0xFFFFFFFF;
131 if(wordNr+1 < m_ctpDataFormat->getTIPwords()-1) {
132 tip[wordNr+1] |= uint32_t((result & 0xFFFFFFFF00000000) >> 32);
133 }
134 }
135 }
136
137 size_t wrdNr(0);
138 for( uint32_t word : tip ) {
139 ATH_MSG_DEBUG( "REGTEST - " << "TIP word #" << std::dec << wrdNr++
140 << " is: 0x" << std::hex << std::setw( 8 ) << std::setfill( '0' ) << word );
141 }
142
143 return StatusCode::SUCCESS;
144}
std::unique_ptr< ThresholdMap > m_thrConfigMap
Map between threshold objects and their CTP-internal description.

◆ createTriggerConfigMaps()

StatusCode LVL1CTP::ResultBuilder::createTriggerConfigMaps ( const TrigConf::L1Menu & l1menu)
private

Definition at line 60 of file ResultBuilder.cxx.

61{
62 ATH_MSG_DEBUG("Creating trigger configuration maps from run-3-style menu");
63
64 std::vector<unsigned int> bg{1};
65 std::vector<unsigned int> bgEmpty{1};
66
67 // declare internal bunch group triggers
68 for (size_t i = 0; i < 16; ++i) {
69 auto bgrp = new BunchGroupTrigger(i, bg, m_ctpDataFormat);
70 m_internalTrigger[ bgrp->name() ] = bgrp;
71 }
72
73 // declare internal random triggers
74 for(int rndmIdx = 0; rndmIdx<4; rndmIdx++) {
75 auto rndm = new RandomTrigger(rndmIdx, m_ctpDataFormat);
76 m_internalTrigger[ rndm->name() ] = rndm;
77 }
78
79 // build map of name to ctp thresholds
80 m_thrConfigMap = std::make_unique<ThresholdMap>( &l1menu );
81
82 // build map of name to ctp items
83 m_itemConfigMap = std::make_unique<ItemMap>( &l1menu );
84
85 return StatusCode::SUCCESS;
86}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::evtStore ( )
inlineinherited

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

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::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

◆ firedItems()

std::vector< std::string > LVL1CTP::ResultBuilder::firedItems ( const std::vector< uint32_t > & triggerWords) const
private

build list of fired items and dump to string

Definition at line 407 of file ResultBuilder.cxx.

407 {
408 std::vector<std::string> passedItems;
409 for( const std::string & itemName : m_itemConfigMap->itemNames() ) {
410 auto item = m_itemConfigMap->getItem(itemName);
411 size_t idx = item->ctpId() / 32;
412 size_t bit = item->ctpId() % 32;
413 if ( triggerWords[idx] % (1L << bit) ) {
414 passedItems.push_back(item->name());
415 }
416 }
417 std::sort(passedItems.begin(), passedItems.end());
418 return passedItems;
419}
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::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.

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< AlgTool >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setConfiguration()

StatusCode LVL1CTP::ResultBuilder::setConfiguration ( const TrigConf::L1Menu & l1menu)

Definition at line 51 of file ResultBuilder.cxx.

52{
53 ATH_MSG_DEBUG( "Set configuration with CTP version " << m_ctpVersionNumber );
54
55 return createTriggerConfigMaps(l1menu);
56}
StatusCode createTriggerConfigMaps(const TrigConf::L1Menu &l1menu)

◆ setRandomEngine()

void LVL1CTP::ResultBuilder::setRandomEngine ( CLHEP::HepRandomEngine * rndmEngine)

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_ctpDataFormat

CTPdataformatVersion* LVL1CTP::ResultBuilder::m_ctpDataFormat { nullptr }
private

CTP data format details.

Definition at line 110 of file ResultBuilder.h.

110{ nullptr };

◆ m_ctpVersionNumber

unsigned int LVL1CTP::ResultBuilder::m_ctpVersionNumber { 4 }
private

CTP data format version (4 in most of Run 2 and in Run 3)

Definition at line 109 of file ResultBuilder.h.

109{ 4 };

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_internalTrigger

InternalTriggerMap LVL1CTP::ResultBuilder::m_internalTrigger
private

internal triggers BGRP and RNDM

Definition at line 108 of file ResultBuilder.h.

◆ m_itemConfigMap

std::unique_ptr<ItemMap> LVL1CTP::ResultBuilder::m_itemConfigMap { nullptr }
private

Map between item objects and their CTP-internal description.

Definition at line 107 of file ResultBuilder.h.

107{ nullptr };

◆ m_thrConfigMap

std::unique_ptr<ThresholdMap> LVL1CTP::ResultBuilder::m_thrConfigMap { nullptr }
private

Map between threshold objects and their CTP-internal description.

Definition at line 106 of file ResultBuilder.h.

106{ nullptr };

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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