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 }

◆ ~ProcessTestSignal()

ProcessTestSignal::~ProcessTestSignal ( )
override

Destructor.

Definition at line 30 of file ProcessTestSignal.cc.

30 { m_in.close(); }

References m_in.

Member Function Documentation

◆ builddata()

void ProcessTestSignal::builddata ( )
private

Definition at line 65 of file ProcessTestSignal.cc.

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 }

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

Referenced by next().

◆ 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.

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 }

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

◆ reset()

void ProcessTestSignal::reset ( void  )

Definition at line 63 of file ProcessTestSignal.cc.

63 { m_vecdata.clear(); }

References m_vecdata.

Referenced by next().

◆ retrievedata()

RPCInputSignal* ProcessTestSignal::retrievedata ( )
inlineoverridevirtual

Implements ProcessInputSignal.

Definition at line 42 of file ProcessTestSignal.h.

42 { return m_lbin.get(); };

References m_lbin.

◆ rewind()

void ProcessTestSignal::rewind ( )

Definition at line 58 of file ProcessTestSignal.cc.

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

References m_in.

Referenced by showfirst().

◆ showfirst()

void ProcessTestSignal::showfirst ( )

Definition at line 51 of file ProcessTestSignal.cc.

51  {
52  rewind();
53  for (auto& d : m_vecdata)
54  std::cout << (*d);
55  rewind();
56 }

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

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

gather_cfg.cout
cout
Definition: gather_cfg.py:144
ProcessTestSignal::m_data
std::map< int, RBCInput * > m_data
Definition: ProcessTestSignal.h:57
ProcessTestSignal::m_lbin
std::unique_ptr< RPCInputSignal > m_lbin
Definition: ProcessTestSignal.h:53
ProcessTestSignal::m_vecdata
std::vector< std::unique_ptr< RPCData > > m_vecdata
Definition: ProcessTestSignal.h:55
RBCInput::needmapping
bool needmapping
Definition: RBCInput.h:50
dqmdumpme.k
k
Definition: dqmdumpme.py:60
ProcessTestSignal::rewind
void rewind()
Definition: ProcessTestSignal.cc:58
groupFilesInBlocks.block
block
Definition: groupFilesInBlocks.py:150
ProcessTestSignal::reset
void reset()
Definition: ProcessTestSignal.cc:63
ProcessTestSignal::m_in
std::ifstream m_in
Definition: ProcessTestSignal.h:51
RBCInput
Definition: RBCInput.h:22
ztail.d
d
Definition: ztail.py:151
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
ProcessTestSignal::builddata
void builddata()
Definition: ProcessTestSignal.cc:65