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 // $Id: RBCLogicUnit.cc,v 1.3 2009/06/07 21:18:50 aosorio Exp $
2 // Include files
3 
4 
5 
6 // local
8 
9 //-----------------------------------------------------------------------------
10 // Implementation file for class : RBCLogicUnit
11 //
12 // 2008-10-25 : Andres Osorio
13 //-----------------------------------------------------------------------------
14 
15 //=============================================================================
16 // Standard constructor, initializes variables
17 //=============================================================================
19 
21  m_debug = false;
22 
23 }
24 
25 RBCLogicUnit::RBCLogicUnit( const char * logic_type ) : RPCLogicUnit() {
26 
28  m_logtype = std::string( logic_type );
29  m_debug = false;
30 
31 }
32 //=============================================================================
33 // Destructor
34 //=============================================================================
36 
37  if (m_logtool) {
38  if ( m_logtool->endjob() )
39  delete m_logtool;
40  }
41 
42 }
43 
44 //=============================================================================
46 {
47 
48  bool status(false);
49 
50  status = m_logtool->initialise();
51  if ( !status ) {
52  if( m_debug ) std::cout << "RBCLogicUnit> Problem initialising LogicTool \n";
53  return 0; };
54 
55  m_logic = dynamic_cast<RBCLogic*> ( m_logtool->retrieve(m_logtype) );
56 
57  if ( ! m_logic ) {
58  if( m_debug ) std::cout << "RBCLogicUnit> No logic found \n";
59  return 0; };
60 
61  return 1;
62 
63 }
64 
65 void RBCLogicUnit::setlogic( const char * _logic )
66 {
67  m_logtype = std::string(_logic);
68 }
69 
71 {
72 
73  m_logic->setBoardSpecs( specs );
74 
75 }
76 
77 void RBCLogicUnit::run( const RBCInput & _input , std::bitset<2> & _decision )
78 {
79 
80  m_logic->process( _input , _decision );
83 
84 }
void run(const RBCInput &, std::bitset< 2 > &)
Definition: RBCLogicUnit.cc:77
RBCLogic * m_logic
Definition: RBCLogicUnit.h:51
void setBoardSpecs(const RBCBoardSpecs::RBCBoardConfig &)
Definition: RBCLogicUnit.cc:70
virtual std::bitset< 6 > * getlayersignal(int)=0
RBCLogicUnit()
Standard constructor.
Definition: RBCLogicUnit.cc:18
GenLogic * retrieve(const std::string &_logic_name)
Definition: LogicTool.h:98
virtual void setBoardSpecs(const RBCBoardSpecs::RBCBoardConfig &)=0
void setlogic(const char *)
Definition: RBCLogicUnit.cc:65
bool initialise()
Definition: RBCLogicUnit.cc:45
bool initialise()
Definition: LogicTool.h:39
virtual void process(const RBCInput &, std::bitset< 2 > &)=0
virtual ~RBCLogicUnit()
Destructor.
Definition: RBCLogicUnit.cc:35
std::string m_logtype
Definition: RBCLogicUnit.h:41
std::bitset< 6 > * m_layersignal[2]
Definition: RBCLogicUnit.h:49
bool endjob()
Definition: LogicTool.h:105
LogicTool< RBCLogic > * m_logtool
Definition: RBCLogicUnit.h:53
tuple cout
Definition: gather_cfg.py:121
tuple status
Definition: ntuplemaker.py:245