ATLAS Offline Software
Connector.cxx
Go to the documentation of this file.
1 // Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
2 
4 
9 
13 
14 using namespace std;
15 using namespace TCS;
16 
17 TCS::Connector::Connector( const std::string & name,
18  const std::vector<std::string> & inputs,
19  const std::string & algorithm,
20  const std::vector<std::string> & outputs,
21  ConnectorType conntype ) :
22  m_name(name),
23  m_algorithmName(algorithm),
24  m_inputNames(inputs),
25  m_outputNames(outputs),
26  m_conntype(conntype)
27 {}
28 
29 
30 
31 TCS::Connector::Connector( const std::string & name,
32  ConnectorType conntype ) :
33  m_name(name),
34  m_conntype(conntype)
35 {}
36 
37 
39 
40 
41 void
42 TCS::Connector::setAlgorithm(TCS::ConfigurableAlg* alg) { // alg ownership is with the factory
43  m_algorithm = alg;
44 }
45 
46 
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;
62  m_executionStatusCode = StatusCode::SUCCESS;
63 
64  return sc;
65 }
66 
67 unsigned int
69  if(isDecisionConnector()) {
70  return ((DecisionAlg*) algorithm())->numberOutputBits();
71  } else {
72  return 0;
73  }
74 }
75 
77 {
78  m_hasInputOverflow = value;
79 }
80 
82 {
83  m_hasAmbiguity = value;
84 }
85 
86 ostream &
87 operator<<(ostream &o, const TCS::Connector & conn) {
88  try {
89  o << dynamic_cast<const TCS::DecisionConnector&>(conn);
90  return o;
91  } catch(...) {}
92  try {
93  o << dynamic_cast<const TCS::SortingConnector&>(conn);
94  return o;
95  } catch(...) {}
96  try {
97  o << dynamic_cast<const TCS::InputConnector&>(conn);
98  return o;
99  } catch(...) {}
100 
101  return o;
102 }
checkCorrelInHIST.conn
conn
Definition: checkCorrelInHIST.py:25
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
algorithm
std::string algorithm
Definition: hcg.cxx:82
SGout2dot.alg
alg
Definition: SGout2dot.py:243
TCS::Connector
Definition: Connector.h:22
InputConnector.h
ConfigurableAlg.h
athena.value
value
Definition: athena.py:122
postInclude.inputs
inputs
Definition: postInclude.SortInput.py:15
DecisionConnector.h
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
TCS::DecisionAlg
Definition: Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/DecisionAlg.h:22
TopoInputEvent.h
TCS::Connector::reset
StatusCode reset()
Definition: Connector.cxx:48
TCS::Connector::Connector
Connector(const std::string &name, ConnectorType conntype)
Definition: Connector.cxx:31
TCS::Connector::toggleInputOverflow
void toggleInputOverflow(const bool value)
to be toggled after 'attachOutputData' is called.
Definition: Connector.cxx:76
Connector.h
python.CreateTierZeroArgdict.outputs
outputs
Definition: CreateTierZeroArgdict.py:189
TCS::Connector::ConnectorType
ConnectorType
Definition: Connector.h:25
TCS::ConfigurableAlg
Definition: ConfigurableAlg.h:30
DecisionAlg.h
TCS::Connector::toggleAmbiguity
void toggleAmbiguity(const bool value)
Definition: Connector.cxx:81
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
TCS::Connector::~Connector
virtual ~Connector()
Definition: Connector.cxx:38
TCS::Connector::numberOutputBits
unsigned int numberOutputBits() const
Definition: Connector.cxx:68
TCS
Definition: Global/GlobalSimulation/src/IO/Decision.h:18
TCS::operator<<
std::ostream & operator<<(std::ostream &, const TCS::CountingConnector &)
Definition: CountingConnector.cxx:93
Exception.h
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15
TCS::Connector::setAlgorithm
virtual void setAlgorithm(TCS::ConfigurableAlg *)
Definition: Connector.cxx:42
SortingConnector.h