CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RBCProcessTestSignal.cc
Go to the documentation of this file.
1 // $Id: RBCProcessTestSignal.cc,v 1.2 2009/05/16 19:43:32 aosorio Exp $
2 // Include files
3 
4 
5 // local
8 //-----------------------------------------------------------------------------
9 // Implementation file for class : RBCProcessTestSignal
10 //
11 // 2008-10-10 : Andres Osorio
12 //-----------------------------------------------------------------------------
13 
14 //=============================================================================
15 // Standard constructor, initializes variables
16 //=============================================================================
18 {
19 
20  m_in = new std::ifstream();
21  m_in->open(f_name);
22 
23  if(!m_in->is_open()) {
24  std::cout << "RBCProcessTestSignal> cannot open file" << std::endl;
25  } else {
26  std::cout << "RBCProcessTestSignal> file is now open" << std::endl;
27  }
28 
29  m_input = new RBCInput();
30  m_lbin = dynamic_cast<RPCInputSignal*>( new RBCLinkBoardSignal( m_input ) );
31 
32  showfirst();
33 
34 }
35 //=============================================================================
36 // Destructor
37 //=============================================================================
39 {
40  m_in->close();
41  delete m_in;
42 
43  if ( m_lbin ) delete m_lbin;
44 
45  if ( m_input ) delete m_input;
46 
47 }
48 
49 //=============================================================================
50 
52 {
53 
54  if ( m_in->fail()) return 0;
55  (*m_in) >> (*m_input);
56  if ( m_in->eof() ) return 0;
57  return 1;
58 
59 }
60 
62 {
63  rewind();
64  (*m_in) >> (*m_input);
65  std::cout << (*m_input);
66  rewind();
67 
68 }
69 
71 {
72  m_in->clear();
73  m_in->seekg(0,std::ios::beg);
74 }
75 
virtual ~RBCProcessTestSignal()
Destructor.
tuple cout
Definition: gather_cfg.py:121
RBCProcessTestSignal()
Standard constructor.