CMS 3D CMS Logo

Public Member Functions | Private Attributes

RBCLogicUnit Class Reference

#include <RBCLogicUnit.h>

Inheritance diagram for RBCLogicUnit:
RPCLogicUnit

List of all members.

Public Member Functions

std::bitset< 6 > * getlayersignal (int _idx)
bool initialise ()
bool isTriggered ()
 RBCLogicUnit (const char *)
 RBCLogicUnit ()
 Standard constructor.
void run (const RBCInput &, std::bitset< 2 > &)
void setBoardSpecs (const RBCBoardSpecs::RBCBoardConfig &)
void setlogic (const char *)
virtual ~RBCLogicUnit ()
 Destructor.

Private Attributes

bool m_debug
std::bitset< 6 > * m_layersignal [2]
RBCLogicm_logic
LogicTool< RBCLogic > * m_logtool
std::string m_logtype

Detailed Description

Author:
Andres Osorio
Date:
2008-10-25

Definition at line 20 of file RBCLogicUnit.h.


Constructor & Destructor Documentation

RBCLogicUnit::RBCLogicUnit ( )

Standard constructor.

Definition at line 18 of file RBCLogicUnit.cc.

References m_debug, and m_logtool.

RBCLogicUnit::RBCLogicUnit ( const char *  logic_type)

Definition at line 25 of file RBCLogicUnit.cc.

References m_debug, m_logtool, and m_logtype.

                                                    : RPCLogicUnit() {
  
  m_logtool = new LogicTool<RBCLogic>();
  m_logtype = std::string( logic_type );
  m_debug = false;

}
RBCLogicUnit::~RBCLogicUnit ( ) [virtual]

Destructor.

Definition at line 35 of file RBCLogicUnit.cc.

References LogicTool< GenLogic >::endjob(), and m_logtool.

                            {
  
  if (m_logtool) {
    if ( m_logtool->endjob() )
      delete m_logtool;
  }
  
} 

Member Function Documentation

std::bitset<6>* RBCLogicUnit::getlayersignal ( int  _idx) [inline]

Definition at line 37 of file RBCLogicUnit.h.

References m_layersignal.

Referenced by RBCEmulator::emulate().

{ return m_layersignal[_idx]; };
bool RBCLogicUnit::initialise ( )

Definition at line 45 of file RBCLogicUnit.cc.

References gather_cfg::cout, LogicTool< GenLogic >::initialise(), m_debug, m_logic, m_logtool, m_logtype, LogicTool< GenLogic >::retrieve(), and ntuplemaker::status.

Referenced by RBCBasicConfig::initialise().

{
  
  bool status(false);
  
  status = m_logtool->initialise();
  if ( !status ) { 
    if( m_debug ) std::cout << "RBCLogicUnit> Problem initialising LogicTool \n"; 
    return 0; };
  
  m_logic  = dynamic_cast<RBCLogic*> ( m_logtool->retrieve(m_logtype) );
  
  if ( ! m_logic ) { 
    if( m_debug ) std::cout << "RBCLogicUnit> No logic found \n"; 
    return 0; };
  
  return 1;
  
}
bool RBCLogicUnit::isTriggered ( ) [inline]

Definition at line 39 of file RBCLogicUnit.h.

References m_logic, and RBCLogic::m_triggersignal.

                     {
    return m_logic->m_triggersignal;
  };
void RBCLogicUnit::run ( const RBCInput _input,
std::bitset< 2 > &  _decision 
)

Definition at line 77 of file RBCLogicUnit.cc.

References RBCLogic::getlayersignal(), m_layersignal, m_logic, and RBCLogic::process().

Referenced by RBCEmulator::emulate().

{
  
  m_logic->process( _input , _decision );
  m_layersignal[0] = m_logic->getlayersignal( 0 );
  m_layersignal[1] = m_logic->getlayersignal( 1 );
  
}
void RBCLogicUnit::setBoardSpecs ( const RBCBoardSpecs::RBCBoardConfig specs)

Definition at line 70 of file RBCLogicUnit.cc.

References m_logic, and RBCLogic::setBoardSpecs().

Referenced by RBCBasicConfig::initialise().

{

  m_logic->setBoardSpecs( specs );
  
}
void RBCLogicUnit::setlogic ( const char *  _logic)

Definition at line 65 of file RBCLogicUnit.cc.

References m_logtype.

Referenced by RBCBasicConfig::initialise().

{
  m_logtype = std::string(_logic);
}

Member Data Documentation

bool RBCLogicUnit::m_debug [private]

Definition at line 55 of file RBCLogicUnit.h.

Referenced by initialise(), and RBCLogicUnit().

std::bitset<6>* RBCLogicUnit::m_layersignal[2] [private]

Definition at line 49 of file RBCLogicUnit.h.

Referenced by getlayersignal(), and run().

Definition at line 51 of file RBCLogicUnit.h.

Referenced by initialise(), isTriggered(), run(), and setBoardSpecs().

Definition at line 53 of file RBCLogicUnit.h.

Referenced by initialise(), RBCLogicUnit(), and ~RBCLogicUnit().

std::string RBCLogicUnit::m_logtype [private]

Definition at line 41 of file RBCLogicUnit.h.

Referenced by initialise(), RBCLogicUnit(), and setlogic().