CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ProcessTestSignal Class Reference

#include <ProcessTestSignal.h>

Inheritance diagram for ProcessTestSignal:
ProcessInputSignal

Public Member Functions

void force ()
 
void mask ()
 
int next () override
 
 ProcessTestSignal ()
 Standard constructor. More...
 
 ProcessTestSignal (const char *)
 
void reset ()
 
RPCInputSignalretrievedata () override
 
void rewind ()
 
void showfirst ()
 
 ~ProcessTestSignal () override
 Destructor. More...
 
- Public Member Functions inherited from ProcessInputSignal
virtual ~ProcessInputSignal ()
 

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 28 of file ProcessTestSignal.h.

Constructor & Destructor Documentation

ProcessTestSignal::ProcessTestSignal ( )
inline

Standard constructor.

Definition at line 31 of file ProcessTestSignal.h.

References next(), reset(), rewind(), showfirst(), and ~ProcessTestSignal().

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

Definition at line 17 of file ProcessTestSignal.cc.

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

18 {
19 
20  m_in = new std::ifstream();
21  m_in->open(f_name);
22 
23  if(!m_in->is_open()) {
24  std::cout << "ProcessTestSignal> cannot open file" << std::endl;
25  } else {
26  std::cout << "ProcessTestSignal> file is now open" << std::endl;
27  }
28 
29  m_lbin = dynamic_cast<RPCInputSignal*>( new RBCLinkBoardGLSignal( &m_data ) );
30 
31 }
std::map< int, RBCInput * > m_data
std::ifstream * m_in
RPCInputSignal * m_lbin
ProcessTestSignal::~ProcessTestSignal ( )
override

Destructor.

Definition at line 35 of file ProcessTestSignal.cc.

References m_in, and m_lbin.

Referenced by ProcessTestSignal().

35  {
36 
37  if ( m_lbin ) delete m_lbin;
38 
39  if( m_in ) {
40  m_in->close();
41  delete m_in;
42  }
43 
44 }
std::ifstream * m_in
RPCInputSignal * m_lbin

Member Function Documentation

void ProcessTestSignal::builddata ( )
private

Definition at line 94 of file ProcessTestSignal.cc.

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

Referenced by force(), and next().

95 {
96 
97  int _code(0);
98  std::vector<RPCData*>::iterator itr;
99 
100  for(itr = m_vecdata.begin(); itr != m_vecdata.end(); ++itr)
101  {
102  for(int k=0; k < 6; ++k) {
103 
104  _code = 10000*(*itr)->m_wheel
105  + 100*(*itr)->m_sec1[k]
106  + 1*(*itr)->m_sec2[k];
107  RBCInput * _signal = & (*itr)->m_orsignals[k];
108  _signal->needmapping = true;
109  m_data.insert( std::make_pair( _code , _signal) );
110 
111  }
112  }
113 
114 }
std::map< int, RBCInput * > m_data
int k[5][pyjets_maxn]
bool needmapping
Definition: RBCInput.h:75
std::vector< RPCData * > m_vecdata
void ProcessTestSignal::force ( )
inline

Definition at line 50 of file ProcessTestSignal.h.

References builddata().

50 {};
void ProcessTestSignal::mask ( )
inline

Definition at line 49 of file ProcessTestSignal.h.

49 {};
int ProcessTestSignal::next ( void  )
overridevirtual

Implements ProcessInputSignal.

Definition at line 47 of file ProcessTestSignal.cc.

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

Referenced by ProcessTestSignal().

48 {
49 
50  reset();
51 
52  if ( m_in->fail() ) return 0;
53 
54  for(int j=0; j < 5; ++j) {
55 
56  m_block = new RPCData();
57  (*m_in) >> (*m_block);
58  m_vecdata.push_back( m_block );
59  }
60 
61  builddata();
62 
63  if ( m_in->eof() ) return 0;
64  return 1;
65 
66 }
std::ifstream * m_in
std::vector< RPCData * > m_vecdata
TriggerPrimitive::RPCData RPCData
Definition: Common.h:41
void ProcessTestSignal::reset ( void  )

Definition at line 84 of file ProcessTestSignal.cc.

References m_vecdata.

Referenced by next(), and ProcessTestSignal().

85 {
86 
87  std::vector<RPCData*>::iterator itr;
88  for(itr=m_vecdata.begin();itr!=m_vecdata.end();++itr)
89  delete *itr;
90  m_vecdata.clear();
91 
92 }
std::vector< RPCData * > m_vecdata
RPCInputSignal* ProcessTestSignal::retrievedata ( )
inlineoverridevirtual

Implements ProcessInputSignal.

Definition at line 45 of file ProcessTestSignal.h.

References m_lbin.

45  {
46  return m_lbin;
47  };
RPCInputSignal * m_lbin
void ProcessTestSignal::rewind ( )

Definition at line 78 of file ProcessTestSignal.cc.

References m_in.

Referenced by ProcessTestSignal(), and showfirst().

79 {
80  m_in->clear();
81  m_in->seekg(0,std::ios::beg);
82 }
std::ifstream * m_in
void ProcessTestSignal::showfirst ( )

Definition at line 68 of file ProcessTestSignal.cc.

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

Referenced by ProcessTestSignal().

69 {
70  rewind();
71  std::vector<RPCData*>::iterator itr;
72  for(itr=m_vecdata.begin();itr!=m_vecdata.end();++itr)
73  std::cout << (*(*itr));
74  rewind();
75 
76 }
std::vector< RPCData * > m_vecdata

Member Data Documentation

RPCData* ProcessTestSignal::m_block
private

Definition at line 60 of file ProcessTestSignal.h.

Referenced by next().

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

Definition at line 68 of file ProcessTestSignal.h.

Referenced by builddata(), and ProcessTestSignal().

std::ifstream* ProcessTestSignal::m_in
private

Definition at line 58 of file ProcessTestSignal.h.

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

RPCInputSignal* ProcessTestSignal::m_lbin
private

Definition at line 64 of file ProcessTestSignal.h.

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

RBCInput* ProcessTestSignal::m_rbcinput
private

Definition at line 62 of file ProcessTestSignal.h.

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

Definition at line 66 of file ProcessTestSignal.h.

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