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::ProcessTestSignal ( const char *  f_name)
explicit

Definition at line 16 of file ProcessTestSignal.cc.

16  : m_in{} {
17  m_in.open(f_name);
18 
19  if (!m_in.is_open()) {
20  std::cout << "ProcessTestSignal> cannot open file" << std::endl;
21  } else {
22  std::cout << "ProcessTestSignal> file is now open" << std::endl;
23  }
24 
25  m_lbin = std::make_unique<RBCLinkBoardGLSignal>(&m_data);
26 }
std::map< int, RBCInput * > m_data
std::unique_ptr< RPCInputSignal > m_lbin
std::ifstream m_in

◆ ~ProcessTestSignal()

ProcessTestSignal::~ProcessTestSignal ( )
override

Destructor.

Definition at line 30 of file ProcessTestSignal.cc.

References m_in.

30 { m_in.close(); }
std::ifstream m_in

Member Function Documentation

◆ builddata()

void ProcessTestSignal::builddata ( )
private

Definition at line 65 of file ProcessTestSignal.cc.

References ztail::d, dqmdumpme::k, m_data, m_vecdata, and RBCInput::needmapping.

Referenced by next().

65  {
66  int _code(0);
67  for (auto& d : m_vecdata) {
68  for (int k = 0; k < 6; ++k) {
69  _code = 10000 * (d->m_wheel) + 100 * d->m_sec1[k] + 1 * d->m_sec2[k];
70  RBCInput* _signal = &(d->m_orsignals[k]);
71  _signal->needmapping = true;
72  m_data.insert(std::make_pair(_code, _signal));
73  }
74  }
75 }
std::map< int, RBCInput * > m_data
std::vector< std::unique_ptr< RPCData > > m_vecdata
d
Definition: ztail.py:151
bool needmapping
Definition: RBCInput.h:50

◆ force()

void ProcessTestSignal::force ( )
inline

Definition at line 45 of file ProcessTestSignal.h.

45 {};

◆ mask()

void ProcessTestSignal::mask ( )
inline

Definition at line 44 of file ProcessTestSignal.h.

44 {};

◆ next()

int ProcessTestSignal::next ( void  )
overridevirtual

Implements ProcessInputSignal.

Definition at line 33 of file ProcessTestSignal.cc.

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

33  {
34  reset();
35 
36  if (m_in.fail())
37  return 0;
38 
39  for (int j = 0; j < 5; ++j) {
40  auto& block = m_vecdata.emplace_back();
41  (m_in) >> (*block);
42  }
43 
44  builddata();
45 
46  if (m_in.eof())
47  return 0;
48  return 1;
49 }
std::vector< std::unique_ptr< RPCData > > m_vecdata
std::ifstream m_in

◆ reset()

void ProcessTestSignal::reset ( void  )

Definition at line 63 of file ProcessTestSignal.cc.

References m_vecdata.

Referenced by next().

63 { m_vecdata.clear(); }
std::vector< std::unique_ptr< RPCData > > m_vecdata

◆ retrievedata()

RPCInputSignal* ProcessTestSignal::retrievedata ( )
inlineoverridevirtual

Implements ProcessInputSignal.

Definition at line 42 of file ProcessTestSignal.h.

References m_lbin.

42 { return m_lbin.get(); };
std::unique_ptr< RPCInputSignal > m_lbin

◆ rewind()

void ProcessTestSignal::rewind ( )

Definition at line 58 of file ProcessTestSignal.cc.

References m_in.

Referenced by showfirst().

58  {
59  m_in.clear();
60  m_in.seekg(0, std::ios::beg);
61 }
std::ifstream m_in

◆ showfirst()

void ProcessTestSignal::showfirst ( )

Definition at line 51 of file ProcessTestSignal.cc.

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

51  {
52  rewind();
53  for (auto& d : m_vecdata)
54  std::cout << (*d);
55  rewind();
56 }
std::vector< std::unique_ptr< RPCData > > m_vecdata
d
Definition: ztail.py:151

Member Data Documentation

◆ m_data

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

Definition at line 57 of file ProcessTestSignal.h.

Referenced by builddata().

◆ m_in

std::ifstream ProcessTestSignal::m_in
private

Definition at line 51 of file ProcessTestSignal.h.

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

◆ m_lbin

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

Definition at line 53 of file ProcessTestSignal.h.

Referenced by retrievedata().

◆ m_vecdata

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

Definition at line 55 of file ProcessTestSignal.h.

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