ATLAS Offline Software
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
TCS::DecisionConnector Class Reference

#include <DecisionConnector.h>

Inheritance diagram for TCS::DecisionConnector:
Collaboration diagram for TCS::DecisionConnector:

Public Types

enum  ConnectorType {
  NONE =0, INPUT, SORT, DECISION,
  COUNT
}
 

Public Member Functions

 DecisionConnector (const std::string &name, const std::vector< std::string > &inputs, const std::string &algorithm, const std::vector< std::string > &outputs)
 
virtual ~DecisionConnector ()
 
virtual bool isDecisionConnector () const
 
TCS::DecisionAlgdecisionAlgorithm ()
 
const TCS::DecisionAlgdecisionAlgorithm () const
 
virtual StatusCode clearOutput ()
 
const Decisiondecision () const
 
bool decision (const std::string &trigger) const
 
const std::vector< TrigConf::TriggerLine > & triggers () const
 
void attachOutputData (const std::vector< TOBArray * > &)
 
TOBArray constoutput (const std::string &trigger) const
 
const std::vector< TOBArray const * > & outputData () const
 
bool isInputConnector () const
 
bool isSortingConnector () const
 
bool isCountingConnector () const
 
const std::string & name () const
 
const std::string & algorithmName () const
 
const std::vector< std::string > & inputNames () const
 
const std::vector< std::string > & outputNames () const
 
const std::vector< TCS::Connector * > & inputConnectors () const
 
const TCS::ConfigurableAlgalgorithm () const
 
StatusCode reset ()
 
bool isExecuted () const
 
StatusCode executionStatusCode () const
 
unsigned int numberOutputBits () const
 
void toggleInputOverflow (const bool value)
 to be toggled after 'attachOutputData' is called. More...
 
bool hasInputOverflow () const
 
void toggleAmbiguity (const bool value)
 
bool hasAmbiguity () const
 

Protected Member Functions

std::vector< TCS::Connector * > & inputConnectors ()
 
TCS::ConfigurableAlgalgorithm ()
 
void setIsExecuted (bool isExecuted)
 
void setExecutionStatusCode (StatusCode statusCode)
 

Protected Attributes

std::string m_name {""}
 
std::string m_algorithmName {""}
 
std::vector< std::string > m_inputNames
 
std::vector< std::string > m_outputNames
 
std::vector< TCS::Connector * > m_inputConnectors
 
TCS::ConfigurableAlgm_algorithm { nullptr }
 the algorithm that belongs to this connector More...
 
bool m_isExecuted {false}
 
StatusCode m_executionStatusCode {StatusCode::SUCCESS}
 
bool m_hasInputOverflow
 whether the input data came with an overflow bit More...
 
bool m_hasAmbiguity
 

Private Member Functions

void setAlgorithm (TCS::ConfigurableAlg *alg)
 
void setFirstOutputBit (unsigned int firstOutputBit)
 

Private Attributes

Decision m_decision
 
TCS::DecisionAlgm_decisionAlgorithm
 
std::vector< TrigConf::TriggerLinem_triggers
 
std::vector< TOBArray const * > m_outputData
 
ConnectorType m_conntype { NONE }
 

Friends

class TopoSteering
 
class TopoSteeringStructure
 

Detailed Description

Definition at line 23 of file DecisionConnector.h.

Member Enumeration Documentation

◆ ConnectorType

Enumerator
NONE 
INPUT 
SORT 
DECISION 
COUNT 

Definition at line 25 of file Connector.h.

25 { NONE=0, INPUT, SORT, DECISION, COUNT };

Constructor & Destructor Documentation

◆ DecisionConnector()

DecisionConnector::DecisionConnector ( const std::string &  name,
const std::vector< std::string > &  inputs,
const std::string &  algorithm,
const std::vector< std::string > &  outputs 
)

Definition at line 14 of file DecisionConnector.cxx.

◆ ~DecisionConnector()

DecisionConnector::~DecisionConnector ( )
virtual

Definition at line 22 of file DecisionConnector.cxx.

22  {
24 }

Member Function Documentation

◆ algorithm() [1/2]

TCS::ConfigurableAlg* TCS::Connector::algorithm ( )
inlineprotectedinherited

Definition at line 87 of file Connector.h.

87 { return m_algorithm; }

◆ algorithm() [2/2]

const TCS::ConfigurableAlg* TCS::Connector::algorithm ( ) const
inlineinherited

Definition at line 50 of file Connector.h.

50 { return m_algorithm; }

◆ algorithmName()

const std::string& TCS::Connector::algorithmName ( ) const
inlineinherited

Definition at line 45 of file Connector.h.

45 { return m_algorithmName; }

◆ attachOutputData()

void DecisionConnector::attachOutputData ( const std::vector< TOBArray * > &  data)

Definition at line 77 of file DecisionConnector.cxx.

77  {
78  if(m_outputData.size() != 0) {
79  TCS_EXCEPTION("Trying to attach data to decision connector '" << name() << "' which has already data attached");
80  }
81 
82  //std::vector<TOBArray const *> m_outputData;
83  for(TOBArray * x : data)
84  m_outputData.push_back( (TOBArray const *) x );
85 }

◆ clearOutput()

TCS::StatusCode TCS::DecisionConnector::clearOutput ( )
virtual

Implements TCS::Connector.

Definition at line 53 of file DecisionConnector.cxx.

53  {
54  for(TOBArray const * x : m_outputData) {
55  delete x;
56  }
57  m_outputData.clear();
58 
59  // set decision to 0
60  m_decision.reset();
61 
62  return StatusCode::SUCCESS;
63 }

◆ decision() [1/2]

const Decision& TCS::DecisionConnector::decision ( ) const
inline

Definition at line 40 of file DecisionConnector.h.

40 { return m_decision; }

◆ decision() [2/2]

bool TCS::DecisionConnector::decision ( const std::string &  trigger) const

Definition at line 27 of file DecisionConnector.cxx.

27  {
28  unsigned int index(0);
29  for(const TrigConf::TriggerLine & tl : m_triggers) {
30  if(tl.name() == trigger)
31  return m_decision.bit(index);
32  ++index;
33  }
34  TCS_EXCEPTION("Decision connector '" << name() << "' has no output trigger '" << trigger << "'");
35  return false;
36 }

◆ decisionAlgorithm() [1/2]

TCS::DecisionAlg* TCS::DecisionConnector::decisionAlgorithm ( )
inline

Definition at line 35 of file DecisionConnector.h.

35 { return m_decisionAlgorithm; }

◆ decisionAlgorithm() [2/2]

const TCS::DecisionAlg* TCS::DecisionConnector::decisionAlgorithm ( ) const
inline

Definition at line 36 of file DecisionConnector.h.

36 { return m_decisionAlgorithm; }

◆ executionStatusCode()

StatusCode TCS::Connector::executionStatusCode ( ) const
inlineinherited

Definition at line 61 of file Connector.h.

61 { return m_executionStatusCode; }

◆ hasAmbiguity()

bool TCS::Connector::hasAmbiguity ( ) const
inlineinherited

Definition at line 73 of file Connector.h.

73 { return m_hasAmbiguity; }

◆ hasInputOverflow()

bool TCS::Connector::hasInputOverflow ( ) const
inlineinherited

Definition at line 70 of file Connector.h.

70 { return m_hasInputOverflow; }

◆ inputConnectors() [1/2]

std::vector<TCS::Connector*>& TCS::Connector::inputConnectors ( )
inlineprotectedinherited

Definition at line 85 of file Connector.h.

85 { return m_inputConnectors; }

◆ inputConnectors() [2/2]

const std::vector<TCS::Connector*>& TCS::Connector::inputConnectors ( ) const
inlineinherited

Definition at line 49 of file Connector.h.

49 { return m_inputConnectors; }

◆ inputNames()

const std::vector<std::string>& TCS::Connector::inputNames ( ) const
inlineinherited

Definition at line 46 of file Connector.h.

46 { return m_inputNames; }

◆ isCountingConnector()

bool TCS::Connector::isCountingConnector ( ) const
inlineinherited

Definition at line 42 of file Connector.h.

42 { return m_conntype == COUNT; }

◆ isDecisionConnector()

virtual bool TCS::DecisionConnector::isDecisionConnector ( ) const
inlinevirtual

Definition at line 33 of file DecisionConnector.h.

33 { return true; }

◆ isExecuted()

bool TCS::Connector::isExecuted ( ) const
inlineinherited

Definition at line 59 of file Connector.h.

59 { return m_isExecuted; }

◆ isInputConnector()

bool TCS::Connector::isInputConnector ( ) const
inlineinherited

Definition at line 39 of file Connector.h.

39 { return m_conntype == INPUT; }

◆ isSortingConnector()

bool TCS::Connector::isSortingConnector ( ) const
inlineinherited

Definition at line 40 of file Connector.h.

40 { return m_conntype == SORT; }

◆ name()

const std::string& TCS::Connector::name ( ) const
inlineinherited

Definition at line 44 of file Connector.h.

44 { return m_name; }

◆ numberOutputBits()

unsigned int TCS::Connector::numberOutputBits ( ) const
inherited

Definition at line 68 of file Connector.cxx.

68  {
69  if(isDecisionConnector()) {
70  return ((DecisionAlg*) algorithm())->numberOutputBits();
71  } else {
72  return 0;
73  }
74 }

◆ output()

TCS::TOBArray const * TCS::DecisionConnector::output ( const std::string &  trigger) const

Definition at line 40 of file DecisionConnector.cxx.

40  {
41  unsigned int index(0);
42  for(const TrigConf::TriggerLine & tl : m_triggers) {
43  if(tl.name() == trigger)
44  return m_outputData[index];
45  ++index;
46  }
47  TCS_EXCEPTION("Decision connector '" << name() << "' has no output trigger '" << trigger << "'");
48  return nullptr;
49 }

◆ outputData()

const std::vector<TOBArray const *>& TCS::DecisionConnector::outputData ( ) const
inline

Definition at line 51 of file DecisionConnector.h.

51 { return m_outputData; }

◆ outputNames()

const std::vector<std::string>& TCS::Connector::outputNames ( ) const
inlineinherited

Definition at line 47 of file Connector.h.

47 { return m_outputNames; }

◆ reset()

TCS::StatusCode TCS::Connector::reset ( )
inherited

Definition at line 48 of file Connector.cxx.

48  {
50 
51  // clear the output data
52  sc &= clearOutput();
53  m_hasInputOverflow = false;
54  m_hasAmbiguity = false;
55 
56  // reset the algorithm
57  if(m_algorithm)
58  sc &= m_algorithm->reset();
59 
60  // reset the execution flags
61  m_isExecuted = false;
63 
64  return sc;
65 }

◆ setAlgorithm()

void DecisionConnector::setAlgorithm ( TCS::ConfigurableAlg alg)
privatevirtual

Reimplemented from TCS::Connector.

Definition at line 66 of file DecisionConnector.cxx.

66  {
68  m_decisionAlgorithm = dynamic_cast<DecisionAlg*>(alg);
69  if(m_decisionAlgorithm == nullptr && alg != nullptr) {
70  cerr << "Error: algorithm" << alg->name() << " is not a DecisionAlg" << endl;
71  }
72 }

◆ setExecutionStatusCode()

void TCS::Connector::setExecutionStatusCode ( StatusCode  statusCode)
inlineprotectedinherited

Definition at line 83 of file Connector.h.

◆ setFirstOutputBit()

void DecisionConnector::setFirstOutputBit ( unsigned int  firstOutputBit)
private

Definition at line 89 of file DecisionConnector.cxx.

89  {
90  m_decision.setFirstBit(firstOutputBit);
91 }

◆ setIsExecuted()

void TCS::Connector::setIsExecuted ( bool  isExecuted)
inlineprotectedinherited

Definition at line 81 of file Connector.h.

◆ toggleAmbiguity()

void TCS::Connector::toggleAmbiguity ( const bool  value)
inherited

Definition at line 81 of file Connector.cxx.

82 {
84 }

◆ toggleInputOverflow()

void TCS::Connector::toggleInputOverflow ( const bool  value)
inherited

to be toggled after 'attachOutputData' is called.

This flag is reset with reset().

Definition at line 76 of file Connector.cxx.

77 {
79 }

◆ triggers()

const std::vector<TrigConf::TriggerLine>& TCS::DecisionConnector::triggers ( ) const
inline

Definition at line 44 of file DecisionConnector.h.

44 { return m_triggers; }

Friends And Related Function Documentation

◆ TopoSteering

friend class TopoSteering
friend

Definition at line 55 of file DecisionConnector.h.

◆ TopoSteeringStructure

friend class TopoSteeringStructure
friend

Definition at line 56 of file DecisionConnector.h.

Member Data Documentation

◆ m_algorithm

TCS::ConfigurableAlg* TCS::Connector::m_algorithm { nullptr }
protectedinherited

the algorithm that belongs to this connector

Definition at line 102 of file Connector.h.

◆ m_algorithmName

std::string TCS::Connector::m_algorithmName {""}
protectedinherited

Definition at line 93 of file Connector.h.

◆ m_conntype

ConnectorType TCS::Connector::m_conntype { NONE }
privateinherited

Definition at line 117 of file Connector.h.

◆ m_decision

Decision TCS::DecisionConnector::m_decision
private

Definition at line 65 of file DecisionConnector.h.

◆ m_decisionAlgorithm

TCS::DecisionAlg* TCS::DecisionConnector::m_decisionAlgorithm
private

Definition at line 67 of file DecisionConnector.h.

◆ m_executionStatusCode

StatusCode TCS::Connector::m_executionStatusCode {StatusCode::SUCCESS}
protectedinherited

Definition at line 107 of file Connector.h.

◆ m_hasAmbiguity

bool TCS::Connector::m_hasAmbiguity
protectedinherited

Definition at line 113 of file Connector.h.

◆ m_hasInputOverflow

bool TCS::Connector::m_hasInputOverflow
protectedinherited

whether the input data came with an overflow bit

Definition at line 111 of file Connector.h.

◆ m_inputConnectors

std::vector<TCS::Connector*> TCS::Connector::m_inputConnectors
protectedinherited

Definition at line 98 of file Connector.h.

◆ m_inputNames

std::vector<std::string> TCS::Connector::m_inputNames
protectedinherited

Definition at line 94 of file Connector.h.

◆ m_isExecuted

bool TCS::Connector::m_isExecuted {false}
protectedinherited

Definition at line 105 of file Connector.h.

◆ m_name

std::string TCS::Connector::m_name {""}
protectedinherited

Definition at line 92 of file Connector.h.

◆ m_outputData

std::vector<TOBArray const *> TCS::DecisionConnector::m_outputData
private

Definition at line 72 of file DecisionConnector.h.

◆ m_outputNames

std::vector<std::string> TCS::Connector::m_outputNames
protectedinherited

Definition at line 95 of file Connector.h.

◆ m_triggers

std::vector<TrigConf::TriggerLine> TCS::DecisionConnector::m_triggers
private

Definition at line 69 of file DecisionConnector.h.


The documentation for this class was generated from the following files:
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
TCS::Connector::m_executionStatusCode
StatusCode m_executionStatusCode
Definition: Connector.h:107
SGout2dot.alg
alg
Definition: SGout2dot.py:243
TCS::Connector::m_inputConnectors
std::vector< TCS::Connector * > m_inputConnectors
Definition: Connector.h:98
index
Definition: index.py:1
TCS::Connector::m_algorithm
TCS::ConfigurableAlg * m_algorithm
the algorithm that belongs to this connector
Definition: Connector.h:102
TCS::Connector::m_hasAmbiguity
bool m_hasAmbiguity
Definition: Connector.h:113
athena.value
value
Definition: athena.py:124
TCS::Connector::COUNT
@ COUNT
Definition: Connector.h:25
TCS::Connector::m_name
std::string m_name
Definition: Connector.h:92
TCS::Connector::INPUT
@ INPUT
Definition: Connector.h:25
dumpTruth.statusCode
statusCode
Definition: dumpTruth.py:85
TCS::DecisionConnector::m_decisionAlgorithm
TCS::DecisionAlg * m_decisionAlgorithm
Definition: DecisionConnector.h:67
x
#define x
postInclude.inputs
inputs
Definition: postInclude.SortInput.py:15
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
TCS::DecisionConnector::m_decision
Decision m_decision
Definition: DecisionConnector.h:65
TCS::DecisionConnector::m_triggers
std::vector< TrigConf::TriggerLine > m_triggers
Definition: DecisionConnector.h:69
TCS::DecisionAlg
Definition: Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/DecisionAlg.h:22
TCS::Decision::reset
StatusCode reset()
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:32
TrigConf::TriggerLine
a TriggerLine entry describes the location of a threshold multiplicity on a cable (connector)
Definition: L1Connector.h:21
TCS::Connector::m_algorithmName
std::string m_algorithmName
Definition: Connector.h:93
TCS::Connector::m_conntype
ConnectorType m_conntype
Definition: Connector.h:117
TCS::Connector::Connector
Connector(const std::string &name, ConnectorType conntype)
Definition: Connector.cxx:31
TCS::ConfigurableAlg::reset
StatusCode reset()
Definition: ConfigurableAlg.h:58
TCS_EXCEPTION
#define TCS_EXCEPTION(MSG)
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/Exception.h:14
TCS::TOBArray
Definition: TOBArray.h:24
TCS::Connector::isExecuted
bool isExecuted() const
Definition: Connector.h:59
python.CreateTierZeroArgdict.outputs
outputs
Definition: CreateTierZeroArgdict.py:189
TCS::Connector::algorithm
const TCS::ConfigurableAlg * algorithm() const
Definition: Connector.h:50
TCS::Connector::name
const std::string & name() const
Definition: Connector.h:44
TCS::Connector::m_outputNames
std::vector< std::string > m_outputNames
Definition: Connector.h:95
TCS::Connector::m_inputNames
std::vector< std::string > m_inputNames
Definition: Connector.h:94
TCS::Connector::DECISION
@ DECISION
Definition: Connector.h:25
TCS::Connector::SORT
@ SORT
Definition: Connector.h:25
TCS::Connector::m_isExecuted
bool m_isExecuted
Definition: Connector.h:105
TCS::DecisionConnector::clearOutput
virtual StatusCode clearOutput()
Definition: DecisionConnector.cxx:53
TCS::Connector::isDecisionConnector
bool isDecisionConnector() const
Definition: Connector.h:41
DeMoScan.index
string index
Definition: DeMoScan.py:364
TCS::DecisionConnector::m_outputData
std::vector< TOBArray const * > m_outputData
Definition: DecisionConnector.h:72
TCS::Connector::NONE
@ NONE
Definition: Connector.h:25
TCS::Decision::bit
bool bit(unsigned int index) const
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:40
dqt_zlumi_alleff_HIST.tl
tl
Definition: dqt_zlumi_alleff_HIST.py:73
TCS::Connector::clearOutput
virtual StatusCode clearOutput()=0
TCS::Decision::setFirstBit
void setFirstBit(unsigned int startBit)
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:35
TCS::Connector::m_hasInputOverflow
bool m_hasInputOverflow
whether the input data came with an overflow bit
Definition: Connector.h:111
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15
TCS::Connector::setAlgorithm
virtual void setAlgorithm(TCS::ConfigurableAlg *)
Definition: Connector.cxx:42