CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 ( 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 }
Log< level::Error, false > LogError
TTUBoardSpecs m_ttuspecs
RBCBoardSpecs m_rbcspecs
std::ifstream m_in
TTUConfigurator::~TTUConfigurator ( )

Destructor.

Definition at line 29 of file TTUConfigurator.cc.

References m_in.

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

Member Function Documentation

void TTUConfigurator::addData ( RBCBoardSpecs specs)
private

Definition at line 38 of file TTUConfigurator.cc.

References mps_fire::i, m_in, and RBCBoardSpecs::v_boardspecs.

Referenced by process().

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 }
std::ifstream m_in
std::vector< RBCBoardConfig > v_boardspecs
Definition: RBCBoardSpecs.h:40
void TTUConfigurator::addData ( TTUBoardSpecs specs)
private

Definition at line 46 of file TTUConfigurator.cc.

References mps_fire::i, TTUBoardSpecs::m_boardspecs, and m_in.

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 }
std::vector< TTUBoardConfig > m_boardspecs
Definition: TTUBoardSpecs.h:46
std::ifstream m_in
RBCBoardSpecs* TTUConfigurator::getRbcSpecs ( )
inline

Definition at line 36 of file TTUConfigurator.h.

References m_rbcspecs.

36 { return &m_rbcspecs; };
RBCBoardSpecs m_rbcspecs
TTUBoardSpecs* TTUConfigurator::getTtuSpecs ( )
inline

Definition at line 38 of file TTUConfigurator.h.

References m_ttuspecs.

38 { return &m_ttuspecs; };
TTUBoardSpecs m_ttuspecs
void TTUConfigurator::process ( )

Definition at line 33 of file TTUConfigurator.cc.

References addData(), m_rbcspecs, and m_ttuspecs.

33  {
36 }
TTUBoardSpecs m_ttuspecs
RBCBoardSpecs m_rbcspecs
void addData(RBCBoardSpecs &)

Member Data Documentation

bool TTUConfigurator::m_hasConfig

Definition at line 42 of file TTUConfigurator.h.

std::ifstream TTUConfigurator::m_in
private

Definition at line 46 of file TTUConfigurator.h.

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

RBCBoardSpecs TTUConfigurator::m_rbcspecs
private

Definition at line 51 of file TTUConfigurator.h.

Referenced by getRbcSpecs(), and process().

TTUBoardSpecs TTUConfigurator::m_ttuspecs
private

Definition at line 52 of file TTUConfigurator.h.

Referenced by getTtuSpecs(), and process().