CMS 3D CMS Logo

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

#include <TTUConfigurator.h>

Public Member Functions

RBCBoardSpecsgetRbcSpecs ()
 
TTUBoardSpecsgetTtuSpecs ()
 
void process ()
 
 TTUConfigurator (const std::string &)
 
 ~TTUConfigurator ()
 Destructor. More...
 

Public Attributes

bool m_hasConfig
 

Private Member Functions

void addData (RBCBoardSpecs &)
 
void addData (TTUBoardSpecs &)
 

Private Attributes

std::ifstream m_in
 
RBCBoardSpecs m_rbcspecs
 
TTUBoardSpecs m_ttuspecs
 

Detailed Description

This is an auxiliary class to read an ascii or xml configuration file for the RPC Technical Trigger - to by pass reading configuration from database via EventSetup

Author
Andres Felipe Osorio Oliveros
Date
2009-06-02

Definition at line 30 of file TTUConfigurator.h.

Constructor & Destructor Documentation

◆ TTUConfigurator()

TTUConfigurator::TTUConfigurator ( const std::string &  infile)

Definition at line 16 of file TTUConfigurator.cc.

16  : m_in{}, m_rbcspecs{}, m_ttuspecs{} {
17  m_in.open(infile.c_str());
18 
19  if (!m_in.is_open()) {
20  edm::LogError("TTUConfigurator") << "TTUConfigurator cannot open file";
21  m_hasConfig = false;
22  } else {
23  m_hasConfig = true;
24  }
25 }

◆ ~TTUConfigurator()

TTUConfigurator::~TTUConfigurator ( )

Destructor.

Definition at line 29 of file TTUConfigurator.cc.

29 { m_in.close(); }

References m_in.

Member Function Documentation

◆ addData() [1/2]

void TTUConfigurator::addData ( RBCBoardSpecs specs)
private

Definition at line 38 of file TTUConfigurator.cc.

38  {
39  specs.v_boardspecs.reserve(30);
40  for (int i = 0; i < 30; i++) {
41  auto& board = specs.v_boardspecs.emplace_back();
42  m_in >> board;
43  }
44 }

References mps_fire::i, m_in, and HistogramManager_cfi::specs.

Referenced by process().

◆ addData() [2/2]

void TTUConfigurator::addData ( TTUBoardSpecs specs)
private

Definition at line 46 of file TTUConfigurator.cc.

46  {
47  specs.m_boardspecs.reserve(3);
48  for (int i = 0; i < 3; i++) {
49  auto& board = specs.m_boardspecs.emplace_back();
50 
51  m_in >> board;
52  }
53 }

References mps_fire::i, m_in, and HistogramManager_cfi::specs.

◆ getRbcSpecs()

RBCBoardSpecs* TTUConfigurator::getRbcSpecs ( )
inline

Definition at line 36 of file TTUConfigurator.h.

36 { return &m_rbcspecs; };

References m_rbcspecs.

◆ getTtuSpecs()

TTUBoardSpecs* TTUConfigurator::getTtuSpecs ( )
inline

Definition at line 38 of file TTUConfigurator.h.

38 { return &m_ttuspecs; };

References m_ttuspecs.

◆ process()

void TTUConfigurator::process ( )

Definition at line 33 of file TTUConfigurator.cc.

33  {
36 }

References addData(), m_rbcspecs, and m_ttuspecs.

Member Data Documentation

◆ m_hasConfig

bool TTUConfigurator::m_hasConfig

Definition at line 42 of file TTUConfigurator.h.

◆ m_in

std::ifstream TTUConfigurator::m_in
private

Definition at line 46 of file TTUConfigurator.h.

Referenced by addData(), and ~TTUConfigurator().

◆ m_rbcspecs

RBCBoardSpecs TTUConfigurator::m_rbcspecs
private

Definition at line 51 of file TTUConfigurator.h.

Referenced by getRbcSpecs(), and process().

◆ m_ttuspecs

TTUBoardSpecs TTUConfigurator::m_ttuspecs
private

Definition at line 52 of file TTUConfigurator.h.

Referenced by getTtuSpecs(), and process().

TTUConfigurator::addData
void addData(RBCBoardSpecs &)
Definition: TTUConfigurator.cc:38
mps_fire.i
i
Definition: mps_fire.py:428
TTUConfigurator::m_in
std::ifstream m_in
Definition: TTUConfigurator.h:46
HistogramManager_cfi.specs
specs
Definition: HistogramManager_cfi.py:83
TTUConfigurator::m_ttuspecs
TTUBoardSpecs m_ttuspecs
Definition: TTUConfigurator.h:52
TTUConfigurator::m_rbcspecs
RBCBoardSpecs m_rbcspecs
Definition: TTUConfigurator.h:51
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
timingPdfMaker.infile
infile
Definition: timingPdfMaker.py:350
TTUConfigurator::m_hasConfig
bool m_hasConfig
Definition: TTUConfigurator.h:42