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 // $Id: TTULogicUnit.cc,v 1.6 2009/08/19 15:04:01 aosorio Exp $
2 // Include files
3 
4 
5 
6 // local
8 
9 //-----------------------------------------------------------------------------
10 // Implementation file for class : TTULogicUnit
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 TTULogicUnit::TTULogicUnit( 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(true);
49 
50  status = m_logtool->initialise();
51  if ( !status ) {
52  if( m_debug ) std::cout << "TTULogicUnit> Problem initialising LogicTool \n";
53  return 0; };
54 
55  m_logic = dynamic_cast<TTULogic*> ( m_logtool->retrieve(m_logtype) );
56 
57  if ( ! m_logic ) {
58  if( m_debug ) std::cout << "TTULogicUnit> No logic found \n";
59  return 0; };
60 
61  return 1;
62 
63 }
64 
65 void TTULogicUnit::setlogic( const char * logic )
66 {
67 
68  m_logtype = std::string( logic );
69 
70 }
71 
73 {
74 
75  m_logic->setBoardSpecs ( boardSpcs );
76 
77 }
78 
80 {
81 
82  //... check the thresholds
83 
84  //... by Sector
85 
86  //... by Tower
87 
88  //... by Wheel
89 
90  m_logic->process( input );
91 
92  //m_logic->m_triggersignal = false;
93 
94 
95 }
96 
97 void TTULogicUnit::run( const TTUInput & input , int option )
98 {
99 
100  m_logic->setOption( option );
101  m_logic->process( input );
102 
103  //m_logic->m_triggersignal = false;
104 
105 }
virtual void setOption(int option)
Definition: TTULogic.h:29
std::string m_logtype
Definition: TTULogicUnit.h:43
TTULogic * m_logic
Definition: TTULogicUnit.h:51
virtual void setBoardSpecs(const TTUBoardSpecs::TTUBoardConfig &)=0
GenLogic * retrieve(const std::string &_logic_name)
Definition: LogicTool.h:98
virtual ~TTULogicUnit()
Destructor.
Definition: TTULogicUnit.cc:35
LogicTool< TTULogic > * m_logtool
Definition: TTULogicUnit.h:53
bool initialise()
Definition: TTULogicUnit.cc:45
void run(const TTUInput &)
Definition: TTULogicUnit.cc:79
void setlogic(const char *)
Definition: TTULogicUnit.cc:65
bool initialise()
Definition: LogicTool.h:39
TTULogicUnit()
Standard constructor.
Definition: TTULogicUnit.cc:18
tuple input
Definition: collect_tpl.py:10
void setBoardSpecs(const TTUBoardSpecs::TTUBoardConfig &)
Definition: TTULogicUnit.cc:72
virtual bool process(const TTUInput &)=0
bool endjob()
Definition: LogicTool.h:105
tuple cout
Definition: gather_cfg.py:41
tuple status
Definition: ntuplemaker.py:245