CMS 3D CMS Logo

RBCLogicUnit.cc
Go to the documentation of this file.
1 // Include files
2 
3 // local
5 
6 //-----------------------------------------------------------------------------
7 // Implementation file for class : RBCLogicUnit
8 //
9 // 2008-10-25 : Andres Osorio
10 //-----------------------------------------------------------------------------
11 
12 //=============================================================================
13 // Standard constructor, initializes variables
14 //=============================================================================
15 RBCLogicUnit::RBCLogicUnit() : RPCLogicUnit(), m_debug{false} {}
16 
17 RBCLogicUnit::RBCLogicUnit(const char* logic_type) : RPCLogicUnit(), m_logtype{logic_type}, m_debug{false} {}
18 //=============================================================================
19 // Destructor
20 //=============================================================================
22 
23 //=============================================================================
25  LogicTool<RBCLogic> logtool;
26 
27  m_logic = logtool.retrieve(m_logtype);
28 
29  if (!m_logic) {
30  if (m_debug)
31  std::cout << "RBCLogicUnit> No logic found \n";
32  return false;
33  };
34 
35  return true;
36 }
37 
38 void RBCLogicUnit::setlogic(const char* _logic) { m_logtype = std::string(_logic); }
39 
41 
42 void RBCLogicUnit::run(const RBCInput& _input, std::bitset<2>& _decision) {
43  m_logic->process(_input, _decision);
44  m_layersignal[0] = m_logic->getlayersignal(0);
45  m_layersignal[1] = m_logic->getlayersignal(1);
46 }
void run(const RBCInput &, std::bitset< 2 > &)
Definition: RBCLogicUnit.cc:42
void setBoardSpecs(const RBCBoardSpecs::RBCBoardConfig &)
Definition: RBCLogicUnit.cc:40
RBCLogicUnit()
Standard constructor.
Definition: RBCLogicUnit.cc:15
~RBCLogicUnit() override
Destructor.
Definition: RBCLogicUnit.cc:21
void setlogic(const char *)
Definition: RBCLogicUnit.cc:38
bool initialise()
Definition: RBCLogicUnit.cc:24
std::unique_ptr< RBCLogic > m_logic
Definition: RBCLogicUnit.h:46
std::string m_logtype
Definition: RBCLogicUnit.h:38
std::bitset< 6 > * m_layersignal[2]
Definition: RBCLogicUnit.h:44
std::unique_ptr< GenLogic > retrieve(const std::string &_logic_name)
...
Definition: LogicTool.h:28