CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

ProcessTestSignal Class Reference

#include <ProcessTestSignal.h>

Inheritance diagram for ProcessTestSignal:
ProcessInputSignal

List of all members.

Public Member Functions

void force ()
void mask ()
int next ()
 ProcessTestSignal (const char *)
 ProcessTestSignal ()
 Standard constructor.
void reset ()
RPCInputSignalretrievedata ()
void rewind ()
void showfirst ()
virtual ~ProcessTestSignal ()
 Destructor.

Private Member Functions

void builddata ()

Private Attributes

RPCDatam_block
std::map< int, RBCInput * > m_data
std::ifstream * m_in
RPCInputSignalm_lbin
RBCInputm_rbcinput
std::vector< RPCData * > m_vecdata

Detailed Description

Author:
Andres Osorio
Date:
2008-11-14

Definition at line 29 of file ProcessTestSignal.h.


Constructor & Destructor Documentation

ProcessTestSignal::ProcessTestSignal ( ) [inline]

Standard constructor.

Definition at line 32 of file ProcessTestSignal.h.

{ }; 
ProcessTestSignal::ProcessTestSignal ( const char *  f_name)

Definition at line 18 of file ProcessTestSignal.cc.

References gather_cfg::cout, m_data, m_in, and m_lbin.

{
  
  m_in = new std::ifstream();
  m_in->open(f_name);
  
  if(!m_in->is_open()) {
    std::cout << "ProcessTestSignal> cannot open file" << std::endl;
  } else { 
    std::cout << "ProcessTestSignal> file is now open" << std::endl;
  }
  
  m_lbin = dynamic_cast<RPCInputSignal*>( new RBCLinkBoardGLSignal( &m_data ) );
  
}
ProcessTestSignal::~ProcessTestSignal ( ) [virtual]

Destructor.

Definition at line 36 of file ProcessTestSignal.cc.

References m_in, and m_lbin.

                                      {

  if ( m_lbin ) delete m_lbin;
  
  if( m_in ) {
    m_in->close();
    delete m_in;
  }

} 

Member Function Documentation

void ProcessTestSignal::builddata ( ) [private]

Definition at line 95 of file ProcessTestSignal.cc.

References gen::k, m_data, m_vecdata, and RBCInput::needmapping.

Referenced by next().

{
  
  int _code(0);
  std::vector<RPCData*>::iterator itr;
  
  for(itr = m_vecdata.begin(); itr != m_vecdata.end(); ++itr)
  {
    for(int k=0; k < 6; ++k) {
      
      _code = 10000*(*itr)->m_wheel
        + 100*(*itr)->m_sec1[k]
        + 1*(*itr)->m_sec2[k];
      RBCInput * _signal = & (*itr)->m_orsignals[k];
      _signal->needmapping = true;
      m_data.insert( std::make_pair( _code , _signal) );
      
    }
  }
  
}
void ProcessTestSignal::force ( ) [inline]

Definition at line 51 of file ProcessTestSignal.h.

{};
void ProcessTestSignal::mask ( ) [inline]

Definition at line 50 of file ProcessTestSignal.h.

{};
int ProcessTestSignal::next ( void  ) [virtual]

Implements ProcessInputSignal.

Definition at line 48 of file ProcessTestSignal.cc.

References builddata(), j, m_block, m_in, m_vecdata, and reset().

{
  
  reset();
  
  if ( m_in->fail() ) return 0;
  
  for(int j=0; j < 5; ++j) {
    
    m_block = new RPCData();
    (*m_in) >> (*m_block);
    m_vecdata.push_back( m_block );
  }
  
  builddata();
  
  if ( m_in->eof() ) return 0;
  return 1;
  
}
void ProcessTestSignal::reset ( void  )

Definition at line 85 of file ProcessTestSignal.cc.

References m_vecdata.

Referenced by next().

{
  
  std::vector<RPCData*>::iterator itr;
  for(itr=m_vecdata.begin();itr!=m_vecdata.end();++itr)
    delete *itr;
  m_vecdata.clear();
  
}
RPCInputSignal* ProcessTestSignal::retrievedata ( ) [inline, virtual]

Implements ProcessInputSignal.

Definition at line 46 of file ProcessTestSignal.h.

References m_lbin.

                                  {
    return  m_lbin;
  };
void ProcessTestSignal::rewind ( )

Definition at line 79 of file ProcessTestSignal.cc.

References m_in.

Referenced by showfirst().

{ 
  m_in->clear();
  m_in->seekg(0,std::ios::beg); 
}
void ProcessTestSignal::showfirst ( )

Definition at line 69 of file ProcessTestSignal.cc.

References gather_cfg::cout, m_vecdata, and rewind().

{
  rewind();
  std::vector<RPCData*>::iterator itr;
  for(itr=m_vecdata.begin();itr!=m_vecdata.end();++itr)
    std::cout << (*(*itr));
  rewind();
  
}

Member Data Documentation

Definition at line 61 of file ProcessTestSignal.h.

Referenced by next().

std::map<int,RBCInput*> ProcessTestSignal::m_data [private]

Definition at line 69 of file ProcessTestSignal.h.

Referenced by builddata(), and ProcessTestSignal().

std::ifstream* ProcessTestSignal::m_in [private]

Definition at line 59 of file ProcessTestSignal.h.

Referenced by next(), ProcessTestSignal(), rewind(), and ~ProcessTestSignal().

Definition at line 65 of file ProcessTestSignal.h.

Referenced by ProcessTestSignal(), retrievedata(), and ~ProcessTestSignal().

Definition at line 63 of file ProcessTestSignal.h.

std::vector<RPCData*> ProcessTestSignal::m_vecdata [private]

Definition at line 67 of file ProcessTestSignal.h.

Referenced by builddata(), next(), reset(), and showfirst().