CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
20  m_debug = false;
21 
22 }
23 
24 RBCLogicUnit::RBCLogicUnit( const char * logic_type ) : RPCLogicUnit() {
25 
27  m_logtype = std::string( logic_type );
28  m_debug = false;
29 
30 }
31 //=============================================================================
32 // Destructor
33 //=============================================================================
35 
36  if (m_logtool) {
37  if ( m_logtool->endjob() )
38  delete m_logtool;
39  }
40 
41 }
42 
43 //=============================================================================
45 {
46 
47  bool status(false);
48 
49  status = m_logtool->initialise();
50  if ( !status ) {
51  if( m_debug ) std::cout << "RBCLogicUnit> Problem initialising LogicTool \n";
52  return 0; };
53 
54  m_logic = dynamic_cast<RBCLogic*> ( m_logtool->retrieve(m_logtype) );
55 
56  if ( ! m_logic ) {
57  if( m_debug ) std::cout << "RBCLogicUnit> No logic found \n";
58  return 0; };
59 
60  return 1;
61 
62 }
63 
64 void RBCLogicUnit::setlogic( const char * _logic )
65 {
66  m_logtype = std::string(_logic);
67 }
68 
70 {
71 
72  m_logic->setBoardSpecs( specs );
73 
74 }
75 
76 void RBCLogicUnit::run( const RBCInput & _input , std::bitset<2> & _decision )
77 {
78 
79  m_logic->process( _input , _decision );
82 
83 }
void run(const RBCInput &, std::bitset< 2 > &)
Definition: RBCLogicUnit.cc:76
RBCLogic * m_logic
Definition: RBCLogicUnit.h:50
void setBoardSpecs(const RBCBoardSpecs::RBCBoardConfig &)
Definition: RBCLogicUnit.cc:69
virtual std::bitset< 6 > * getlayersignal(int)=0
RBCLogicUnit()
Standard constructor.
Definition: RBCLogicUnit.cc:17
GenLogic * retrieve(const std::string &_logic_name)
Definition: LogicTool.h:97
virtual void setBoardSpecs(const RBCBoardSpecs::RBCBoardConfig &)=0
void setlogic(const char *)
Definition: RBCLogicUnit.cc:64
bool initialise()
Definition: RBCLogicUnit.cc:44
bool initialise()
Definition: LogicTool.h:38
virtual void process(const RBCInput &, std::bitset< 2 > &)=0
virtual ~RBCLogicUnit()
Destructor.
Definition: RBCLogicUnit.cc:34
std::string m_logtype
Definition: RBCLogicUnit.h:40
std::bitset< 6 > * m_layersignal[2]
Definition: RBCLogicUnit.h:48
bool endjob()
Definition: LogicTool.h:104
LogicTool< RBCLogic > * m_logtool
Definition: RBCLogicUnit.h:52
tuple cout
Definition: gather_cfg.py:121
tuple status
Definition: ntuplemaker.py:245