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 (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

std::map< int, RBCInput * > m_data
 
std::ifstream m_in
 
std::unique_ptr< RPCInputSignalm_lbin
 
std::vector< std::unique_ptr< 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 ( const char *  f_name)
explicit

Definition at line 17 of file ProcessTestSignal.cc.

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

18  :m_in{}
19 {
20 
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 = std::make_unique<RBCLinkBoardGLSignal>( &m_data );
30 
31 }
std::map< int, RBCInput * > m_data
std::unique_ptr< RPCInputSignal > m_lbin
std::ifstream m_in
ProcessTestSignal::~ProcessTestSignal ( )
override

Destructor.

Definition at line 35 of file ProcessTestSignal.cc.

References m_in.

35  {
36 
37  m_in.close();
38 }
std::ifstream m_in

Member Function Documentation

void ProcessTestSignal::builddata ( )
private

Definition at line 83 of file ProcessTestSignal.cc.

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

Referenced by force(), and next().

84 {
85 
86  int _code(0);
87  for(auto& d : m_vecdata)
88  {
89  for(int k=0; k < 6; ++k) {
90 
91  _code = 10000*(d->m_wheel)
92  + 100*d->m_sec1[k]
93  + 1*d->m_sec2[k];
94  RBCInput * _signal = & (d->m_orsignals[k]);
95  _signal->needmapping = true;
96  m_data.insert( std::make_pair( _code , _signal) );
97 
98  }
99  }
100 
101 }
std::map< int, RBCInput * > m_data
std::vector< std::unique_ptr< RPCData > > m_vecdata
int k[5][pyjets_maxn]
bool needmapping
Definition: RBCInput.h:52
void ProcessTestSignal::force ( )
inline

Definition at line 47 of file ProcessTestSignal.h.

References builddata().

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

Definition at line 46 of file ProcessTestSignal.h.

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

Implements ProcessInputSignal.

Definition at line 41 of file ProcessTestSignal.cc.

References groupFilesInBlocks::block, builddata(), m_in, m_vecdata, and reset().

42 {
43 
44  reset();
45 
46  if ( m_in.fail() ) return 0;
47 
48  for(int j=0; j < 5; ++j) {
49 
50  auto& block = m_vecdata.emplace_back();
51  (m_in) >> (*block);
52  }
53 
54  builddata();
55 
56  if ( m_in.eof() ) return 0;
57  return 1;
58 
59 }
std::vector< std::unique_ptr< RPCData > > m_vecdata
std::ifstream m_in
void ProcessTestSignal::reset ( void  )

Definition at line 76 of file ProcessTestSignal.cc.

References m_vecdata.

Referenced by next().

77 {
78 
79  m_vecdata.clear();
80 
81 }
std::vector< std::unique_ptr< RPCData > > m_vecdata
RPCInputSignal* ProcessTestSignal::retrievedata ( )
inlineoverridevirtual

Implements ProcessInputSignal.

Definition at line 42 of file ProcessTestSignal.h.

References m_lbin.

42  {
43  return m_lbin.get();
44  };
std::unique_ptr< RPCInputSignal > m_lbin
void ProcessTestSignal::rewind ( )

Definition at line 70 of file ProcessTestSignal.cc.

References m_in.

Referenced by showfirst().

71 {
72  m_in.clear();
73  m_in.seekg(0,std::ios::beg);
74 }
std::ifstream m_in
void ProcessTestSignal::showfirst ( )

Definition at line 61 of file ProcessTestSignal.cc.

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

62 {
63  rewind();
64  for(auto& d: m_vecdata)
65  std::cout << (*d);
66  rewind();
67 
68 }
std::vector< std::unique_ptr< RPCData > > m_vecdata

Member Data Documentation

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

Definition at line 61 of file ProcessTestSignal.h.

Referenced by builddata(), and ProcessTestSignal().

std::ifstream ProcessTestSignal::m_in
private

Definition at line 55 of file ProcessTestSignal.h.

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

std::unique_ptr<RPCInputSignal> ProcessTestSignal::m_lbin
private

Definition at line 57 of file ProcessTestSignal.h.

Referenced by ProcessTestSignal(), and retrievedata().

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

Definition at line 59 of file ProcessTestSignal.h.

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