CMS 3D CMS Logo

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