![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
37 TopoSteering::TopoSteering() :
47 sc &= m_simulationResult.setupFromMenu( m_structure.outputConnectors(), m_structure.countConnectors() );
92 TCS_EXCEPTION(
"L1Topo Steering has not been configured, can't run")
125 TRG_MSG_WARNING(
"saveHist called without an L1TopoHistSvc being available");
139 TRG_MSG_INFO(
"L1Topo Steering has not been configured, can't run");
140 TCS_EXCEPTION(
"L1Topo Steering has not been configured, can't run");
149 TRG_MSG_INFO(
"executing trigger line " << outConn.first);
151 TRG_MSG_INFO(
"result of trigger line " << outConn.first <<
" : " << outConn.second->decision().decision());
155 TRG_MSG_INFO(
"executing trigger line " << multConn.first);
172 TCS_EXCEPTION(
"TopoSteering has not been configured, can't run");
196 if(
conn->isExecuted())
197 return conn->executionStatusCode();
201 if(
conn->isInputConnector()) {
204 }
else if(
conn->isSortingConnector()) {
207 }
else if(
conn->isDecisionConnector()){
210 }
else if(
conn->isCountingConnector()){
214 conn->setIsExecuted(
true);
215 conn->setExecutionStatusCode(
sc);
235 conn->attachOutputData( inputData );
236 conn->toggleInputOverflow(hasInputOverflow);
238 TRG_MSG_DEBUG(
" ... executing input connector '" <<
conn->name() <<
"' -> attaching '" << inputData->
name() <<
"' of size " << inputData->
size());
257 conn->toggleInputOverflow(
conn->hasInputOverflow() ||
258 inputConn->hasInputOverflow());
268 TRG_MSG_DEBUG(
" ... executing sorting connector '" <<
conn->name() <<
"' -> attaching '" << sortedOutput->
name() <<
"' of size " << sortedOutput->
size());
270 conn->attachOutputData(sortedOutput);
289 conn->toggleInputOverflow(
conn->hasInputOverflow() ||
290 inputConn->hasInputOverflow());
291 conn->toggleAmbiguity(
conn->hasAmbiguity() ||
292 inputConn->hasAmbiguity());
300 vector<TOBArray *>
output(
alg->numberOutputBits() );
302 for(
unsigned int i=0;
i<
alg->numberOutputBits(); ++
i) {
309 TRG_MSG_DEBUG(
" ... executing decision connector '" <<
conn->name() <<
"' -> attaching output data:");
311 TRG_MSG_DEBUG(
" data '" << outarr->name() <<
"' of size " << outarr->size());
312 conn->toggleAmbiguity(outarr->ambiguityFlag());
317 conn->setIsExecuted(
true);
318 conn->setExecutionStatusCode(
sc);
319 bool sortOverflow =
false;
322 if(inputConnector->isSortingConnector()) {
324 sortOverflow = sortConn->sortingAlgorithm()->overflow();
325 if (sortOverflow)
break;
329 conn->m_decision.setOverflow(
conn->hasInputOverflow() || sortOverflow);
330 conn->m_decision.setAmbiguity(
conn->hasAmbiguity());
347 conn->toggleInputOverflow(
conn->hasInputOverflow() ||
348 inputConn->hasInputOverflow());
357 conn->setIsExecuted(
true);
358 conn->setExecutionStatusCode(
sc);
378 else alg->sort(*
input, *sortedOutput);
387 const std::vector<Connector*> & inputConnectors,
388 const std::vector<TCS::TOBArray *> &
output,
394 if(inputConnectors.size()<1) {
395 TCS_EXCEPTION(
"L1Topo Steering: Decision algorithm expects at least 1 input array but got 0");
398 std::vector<TCS::TOBArray const *>
input;
399 for(
const Connector* inConn: inputConnectors)
401 if (inConn ==
nullptr)
continue;
404 TCS_EXCEPTION(
"L1Topo Steering: Decision algorithm " <<
alg->name() <<
" could not cast as SortingConnector* the input connector " << inConn->name());
409 TCS_EXCEPTION(
"L1Topo Steering: Decision algorithm " <<
alg->name() <<
" expects TOBArray(s) as input, but did not get it from connector " << (inConn ? inConn->name() :
""));
411 input.push_back( tobA );
431 TRG_MSG_DEBUG(
" ... executing multiplicity alg '" <<
alg->fullname() <<
"'");
457 o <<
"==========================" << endl
458 <<
"TopoSteering configuration" << endl
459 <<
"--------------------------" << endl;
461 o <<
"==========================" << endl;
485 if(
alg==
nullptr)
continue;
486 alg->msg().setLevel(lvl);
492 const std::bitset<numberOfL1TopoBits> &ovrflowBits)
501 const string &connectorName = connector.first;
504 unsigned int pos = 0;
506 unsigned int bitNumber =
trigger.flatindex();
511 TRG_MSG_DEBUG(
"propagating hardware bit (dec/ovr) "<<bitNumber
512 <<
" to algo "<<connectorName<<
"["<<
pos<<
"]"
523 const string &connectorName = connector.first;
528 TRG_MSG_DEBUG(
"skipping invalid DecisionConnector '"<<connectorName<<
"'");
536 const string &connectorName = connector.first;
541 TRG_MSG_DEBUG(
"skipping invalid DecisionConnector '"<<connectorName<<
"'");
void setHardwareBits(const std::bitset< numberOfL1TopoBits > &triggerBits, const std::bitset< numberOfL1TopoBits > &ovrflowBits)
cache the decision/overflow bits from hardware These bits are propagated to the algorithms with propa...
static const Heap< TCS::JetTOB > & heap()
const std::vector< TCS::Connector * > & connectors() const
std::bitset< numberOfL1TopoBits > m_ovrflowHdwBits
StatusCode executeDecisionAlgorithm(TCS::DecisionAlg *alg, const std::vector< Connector * > &inputConnectors, const std::vector< TCS::TOBArray * > &output, Decision &decsion)
static const Heap< TCS::MuonTOB > & heap()
const std::map< std::string, TCS::CountingConnector * > & countConnectors() const
DecisionConnector * outputConnector(const std::string &output)
bool ambiguityFlag() const
void setOutputAlgosFillBasedOnHardware(const bool &value)
tell output algos to fill accept/reject histos based on hdw decision.
StatusCode executeInputConnector(TCS::InputConnector *conn)
const TopoSteeringStructure & structure() const
StatusCode executeSortingConnector(TCS::SortingConnector *conn)
void propagateHardwareBitsToAlgos()
propagate the bits from hardware to each simulated decision algo.
DecisionAlg & setFillHistosBasedOnHardware(const bool &value)
! toggle m_fillHistosBasedOnHardware
void printConfiguration(std::ostream &o) const
std::bitset< numberOfL1TopoBits > m_triggerHdwBits
static const Heap< TCS::eEmTOB > & heap()
const std::string & name() const
const std::map< std::string, TCS::DecisionConnector * > & outputConnectors() const
void setAlgMsgLevel(TrigConf::MSGTC::Level lvl)
DecisionAlg & setSkipHistos(const bool &value)
! toggle m_skipHistos (see TopoSteering::setOutputAlgosSkipHistograms)
TopoInputEvent & inputEvent()
void setMsgLevel(TrigConf::MSGTC::Level lvl)
Forward iterator to traverse the main components of the trigger configuration.
TrigConf::MSGTC::Level m_AlgMsgLvl
a TriggerLine entry describes the location of a threshold multiplicity on a cable (connector)
const GlobalOutput & globalOutput() const
static const Heap< TCS::LateMuonTOB > & heap()
StatusCode executeCountingAlgorithm(TCS::CountingAlg *alg, TCS::InputConnector *inputConnector, Count &count)
DecisionAlg & setHardwareBits(const unsigned int &bitNumber, const bool &valueDecision, const bool &valueOverflow)
propagate the hardware decision bits for each output bit of this algo
std::shared_ptr< IL1TopoHistSvc > m_histSvc
TCS::DecisionAlg * decisionAlgorithm()
MsgStreamTC & msg() const
The standard message stream.
StatusCode executeConnector(TCS::Connector *conn)
StatusCode executeCountingConnector(TCS::CountingConnector *conn)
void setMsgLevel(TrigConf::MSGTC::Level lvl)
StatusCode executeEvent()
StatusCode executeSortingAlgorithm(SortingAlg *alg, TCS::InputConnector *inputConnector, TOBArray *&output)
#define TCS_EXCEPTION(MSG)
StatusCode initializeAlgorithms()
static const Heap< TCS::ClusterTOB > & heap()
StatusCode collectResult(TCS::DecisionConnector *outputConn=nullptr, TCS::CountingConnector *countConn=nullptr)
#define TRG_MSG_WARNING(x)
static const Heap< TCS::CompositeTOB > & heap()
const std::vector< TrigConf::TriggerLine > & triggers() const
TopoCoreSimResult m_simulationResult
DecisionAlg & resetHardwareBits()
! reset all hardware bits for this algo
Class to provide easy access to TrigConf::MsgStream for TrigConf classes.
TopoSteeringStructure m_structure
static const Heap< TCS::GenericTOB > & heap()
StatusCode executeDecisionConnector(TCS::DecisionConnector *conn)
void setLevel(MSGTC::Level lvl)
Set message level of stream.
StatusCode executeTrigger(const std::string &triggerName)
void setOutputAlgosSkipHistograms(const bool &value)
skip filling the histos
StatusCode setHistSvc(std::shared_ptr< IL1TopoHistSvc > histSvc)
enables the histogramming service
void print(std::ostream &o) const
static const Heap< TCS::jJetTOB > & heap()
unsigned int m_evtCounter
TCS::StatusCode TopoSteering::setupFromConfiguration ATLAS_NOT_THREAD_SAFE(const TrigConf::L1Menu &l1menu)