CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/L1Trigger/RPCTechnicalTrigger/src/RBCLogicUnit.cc

Go to the documentation of this file.
00001 // $Id: RBCLogicUnit.cc,v 1.3 2009/06/07 21:18:50 aosorio Exp $
00002 // Include files 
00003 
00004 
00005 
00006 // local
00007 #include "L1Trigger/RPCTechnicalTrigger/interface/RBCLogicUnit.h"
00008 
00009 //-----------------------------------------------------------------------------
00010 // Implementation file for class : RBCLogicUnit
00011 //
00012 // 2008-10-25 : Andres Osorio
00013 //-----------------------------------------------------------------------------
00014 
00015 //=============================================================================
00016 // Standard constructor, initializes variables
00017 //=============================================================================
00018 RBCLogicUnit::RBCLogicUnit( ) : RPCLogicUnit() {
00019   
00020   m_logtool = new LogicTool<RBCLogic>();
00021   m_debug = false;
00022   
00023 }
00024 
00025 RBCLogicUnit::RBCLogicUnit( const char * logic_type ) : RPCLogicUnit() {
00026   
00027   m_logtool = new LogicTool<RBCLogic>();
00028   m_logtype = std::string( logic_type );
00029   m_debug = false;
00030 
00031 }
00032 //=============================================================================
00033 // Destructor
00034 //=============================================================================
00035 RBCLogicUnit::~RBCLogicUnit() {
00036   
00037   if (m_logtool) {
00038     if ( m_logtool->endjob() )
00039       delete m_logtool;
00040   }
00041   
00042 } 
00043 
00044 //=============================================================================
00045 bool RBCLogicUnit::initialise() 
00046 {
00047   
00048   bool status(false);
00049   
00050   status = m_logtool->initialise();
00051   if ( !status ) { 
00052     if( m_debug ) std::cout << "RBCLogicUnit> Problem initialising LogicTool \n"; 
00053     return 0; };
00054   
00055   m_logic  = dynamic_cast<RBCLogic*> ( m_logtool->retrieve(m_logtype) );
00056   
00057   if ( ! m_logic ) { 
00058     if( m_debug ) std::cout << "RBCLogicUnit> No logic found \n"; 
00059     return 0; };
00060   
00061   return 1;
00062   
00063 }
00064 
00065 void RBCLogicUnit::setlogic( const char * _logic )
00066 {
00067   m_logtype = std::string(_logic);
00068 }
00069 
00070 void RBCLogicUnit::setBoardSpecs( const RBCBoardSpecs::RBCBoardConfig & specs)
00071 {
00072 
00073   m_logic->setBoardSpecs( specs );
00074   
00075 }
00076 
00077 void RBCLogicUnit::run( const RBCInput & _input , std::bitset<2> & _decision )
00078 {
00079   
00080   m_logic->process( _input , _decision );
00081   m_layersignal[0] = m_logic->getlayersignal( 0 );
00082   m_layersignal[1] = m_logic->getlayersignal( 1 );
00083   
00084 }