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

#include <CountingConnector.h>

Inheritance diagram for TCS::CountingConnector:
Collaboration diagram for TCS::CountingConnector:

Public Types

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

Public Member Functions

 CountingConnector (const std::string &name, const std::string &input, const std::string &algorithm, const std::string &output)
 
virtual ~CountingConnector ()
 
InputConnectorinputConnector () const
 
virtual bool isCountingConnector () const
 
TCS::CountingAlgcountingAlgorithm ()
 
const TCS::CountingAlgcountingAlgorithm () const
 
virtual StatusCode clearOutput ()
 
const Countcount () 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 isDecisionConnector () 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

Count m_count
 
TCS::CountingAlgm_countingAlgorithm
 
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 26 of file CountingConnector.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

◆ CountingConnector()

CountingConnector::CountingConnector ( const std::string &  name,
const std::string &  input,
const std::string &  algorithm,
const std::string &  output 
)

Definition at line 17 of file CountingConnector.cxx.

20  :
23 {}

◆ ~CountingConnector()

CountingConnector::~CountingConnector ( )
virtual

Definition at line 25 of file CountingConnector.cxx.

25  {
27 }

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 CountingConnector::attachOutputData ( const std::vector< TOBArray * > &  data)

Definition at line 75 of file CountingConnector.cxx.

75  {
76  if(m_outputData.size() != 0) {
77  TCS_EXCEPTION("Trying to attach data to multiplicity connector '" << name() <<"' which has already data attached");
78  }
79 
80  for(TOBArray * x : data)
81  m_outputData.push_back( dynamic_cast<const TOBArray*>(x) );
82 }

◆ clearOutput()

TCS::StatusCode TCS::CountingConnector::clearOutput ( )
virtual

Implements TCS::Connector.

Definition at line 47 of file CountingConnector.cxx.

47  {
48  for(TOBArray const * x : m_outputData) {
49  delete x;
50  }
51  m_outputData.clear();
52 
53  // set counting to 0
54  m_count.reset();
55 
56  return StatusCode::SUCCESS;
57 }

◆ count()

const Count& TCS::CountingConnector::count ( ) const
inline

Definition at line 45 of file CountingConnector.h.

45 { return m_count; }

◆ countingAlgorithm() [1/2]

TCS::CountingAlg* TCS::CountingConnector::countingAlgorithm ( )
inline

Definition at line 40 of file CountingConnector.h.

40 { return m_countingAlgorithm; }

◆ countingAlgorithm() [2/2]

const TCS::CountingAlg* TCS::CountingConnector::countingAlgorithm ( ) const
inline

Definition at line 41 of file CountingConnector.h.

41 { return m_countingAlgorithm; }

◆ 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; }

◆ inputConnector()

InputConnector * CountingConnector::inputConnector ( ) const

Definition at line 60 of file CountingConnector.cxx.

60  {
61  return dynamic_cast<InputConnector*>(m_inputConnectors[0]);
62 }

◆ 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()

virtual bool TCS::CountingConnector::isCountingConnector ( ) const
inlinevirtual

Definition at line 38 of file CountingConnector.h.

38 { return true; }

◆ isDecisionConnector()

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

Definition at line 41 of file Connector.h.

41 { return m_conntype == DECISION; }

◆ 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::CountingConnector::output ( const std::string &  trigger) const

Definition at line 34 of file CountingConnector.cxx.

34  {
35  unsigned int index(0);
36  for(const TrigConf::TriggerLine & tl : m_triggers) {
37  if(tl.name() == trigger)
38  return m_outputData[index];
39  ++index;
40  }
41  TCS_EXCEPTION("Counting connector '" << name() << "' has no output trigger '" << trigger << "'");
42  return nullptr;
43 }

◆ outputData()

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

Definition at line 54 of file CountingConnector.h.

54 { 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 CountingConnector::setAlgorithm ( TCS::ConfigurableAlg alg)
privatevirtual

Reimplemented from TCS::Connector.

Definition at line 65 of file CountingConnector.cxx.

65  {
67  m_countingAlgorithm = dynamic_cast<CountingAlg*>(alg);
68  if(m_countingAlgorithm == nullptr && alg != nullptr) {
69  TCS_EXCEPTION("Error: algorithm " << alg->name() << " is not a CountingAlg");
70  }
71 }

◆ setExecutionStatusCode()

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

Definition at line 83 of file Connector.h.

◆ setFirstOutputBit()

void CountingConnector::setFirstOutputBit ( unsigned int  firstOutputBit)
private

Definition at line 86 of file CountingConnector.cxx.

86  {
87  m_count.setFirstBit(firstOutputBit);
88 }

◆ 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::CountingConnector::triggers ( ) const
inline

Definition at line 47 of file CountingConnector.h.

47 { return m_triggers; }

Friends And Related Function Documentation

◆ TopoSteering

friend class TopoSteering
friend

Definition at line 58 of file CountingConnector.h.

◆ TopoSteeringStructure

friend class TopoSteeringStructure
friend

Definition at line 59 of file CountingConnector.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_count

Count TCS::CountingConnector::m_count
private

Definition at line 68 of file CountingConnector.h.

◆ m_countingAlgorithm

TCS::CountingAlg* TCS::CountingConnector::m_countingAlgorithm
private

Definition at line 70 of file CountingConnector.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::CountingConnector::m_outputData
private

Definition at line 75 of file CountingConnector.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::CountingConnector::m_triggers
private

Definition at line 72 of file CountingConnector.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::Count::setFirstBit
void setFirstBit(unsigned int startBit)
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Count.h:37
TCS::Connector::m_inputConnectors
std::vector< TCS::Connector * > m_inputConnectors
Definition: Connector.h:98
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
TCS::Count::reset
StatusCode reset()
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Count.h:35
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
x
#define x
TCS::CountingConnector::m_triggers
std::vector< TrigConf::TriggerLine > m_triggers
Definition: CountingConnector.h:72
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
TCS::CountingConnector::m_countingAlgorithm
TCS::CountingAlg * m_countingAlgorithm
Definition: CountingConnector.h:70
TCS::DecisionAlg
Definition: Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/DecisionAlg.h:22
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::InputConnector
Definition: InputConnector.h:22
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
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
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::CountingConnector::output
TOBArray const * output(const std::string &trigger) const
Definition: CountingConnector.cxx:34
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::Connector::isDecisionConnector
bool isDecisionConnector() const
Definition: Connector.h:41
DeMoScan.index
string index
Definition: DeMoScan.py:364
TCS::CountingConnector::m_count
Count m_count
Definition: CountingConnector.h:68
TCS::Connector::NONE
@ NONE
Definition: Connector.h:25
dqt_zlumi_alleff_HIST.tl
tl
Definition: dqt_zlumi_alleff_HIST.py:73
TCS::Connector::clearOutput
virtual StatusCode clearOutput()=0
TCS::CountingConnector::clearOutput
virtual StatusCode clearOutput()
Definition: CountingConnector.cxx:47
TCS::Connector::m_hasInputOverflow
bool m_hasInputOverflow
whether the input data came with an overflow bit
Definition: Connector.h:111
TCS::CountingAlg
Definition: CountingAlg.h:25
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15
TCS::Connector::setAlgorithm
virtual void setAlgorithm(TCS::ConfigurableAlg *)
Definition: Connector.cxx:42
TCS::CountingConnector::m_outputData
std::vector< TOBArray const * > m_outputData
Definition: CountingConnector.h:75