CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TTULogicUnit.cc
Go to the documentation of this file.
1 // Include files
2 
3 
4 
5 // local
7 
8 //-----------------------------------------------------------------------------
9 // Implementation file for class : TTULogicUnit
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 TTULogicUnit::TTULogicUnit( 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(true);
48 
49  status = m_logtool->initialise();
50  if ( !status ) {
51  if( m_debug ) std::cout << "TTULogicUnit> Problem initialising LogicTool \n";
52  return 0; };
53 
54  m_logic = dynamic_cast<TTULogic*> ( m_logtool->retrieve(m_logtype) );
55 
56  if ( ! m_logic ) {
57  if( m_debug ) std::cout << "TTULogicUnit> No logic found \n";
58  return 0; };
59 
60  return 1;
61 
62 }
63 
64 void TTULogicUnit::setlogic( const char * logic )
65 {
66 
67  m_logtype = std::string( logic );
68 
69 }
70 
72 {
73 
74  m_logic->setBoardSpecs ( boardSpcs );
75 
76 }
77 
79 {
80 
81  //... check the thresholds
82 
83  //... by Sector
84 
85  //... by Tower
86 
87  //... by Wheel
88 
89  m_logic->process( input );
90 
91  //m_logic->m_triggersignal = false;
92 
93 
94 }
95 
96 void TTULogicUnit::run( const TTUInput & input , int option )
97 {
98 
99  m_logic->setOption( option );
100  m_logic->process( input );
101 
102  //m_logic->m_triggersignal = false;
103 
104 }
virtual void setOption(int option)
Definition: TTULogic.h:28
std::string m_logtype
Definition: TTULogicUnit.h:42
TTULogic * m_logic
Definition: TTULogicUnit.h:50
virtual void setBoardSpecs(const TTUBoardSpecs::TTUBoardConfig &)=0
GenLogic * retrieve(const std::string &_logic_name)
Definition: LogicTool.h:97
virtual ~TTULogicUnit()
Destructor.
Definition: TTULogicUnit.cc:34
static std::string const input
Definition: EdmProvDump.cc:44
LogicTool< TTULogic > * m_logtool
Definition: TTULogicUnit.h:52
bool initialise()
Definition: TTULogicUnit.cc:44
void run(const TTUInput &)
Definition: TTULogicUnit.cc:78
void setlogic(const char *)
Definition: TTULogicUnit.cc:64
bool initialise()
Definition: LogicTool.h:38
TTULogicUnit()
Standard constructor.
Definition: TTULogicUnit.cc:17
void setBoardSpecs(const TTUBoardSpecs::TTUBoardConfig &)
Definition: TTULogicUnit.cc:71
virtual bool process(const TTUInput &)=0
bool endjob()
Definition: LogicTool.h:104
tuple cout
Definition: gather_cfg.py:145
tuple status
Definition: ntuplemaker.py:245