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 }
Log< level::Error, false > LogError
TTUBoardSpecs m_ttuspecs
RBCBoardSpecs m_rbcspecs
std::ifstream m_in

◆ ~TTUConfigurator()

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

◆ addData() [1/2]

void TTUConfigurator::addData ( RBCBoardSpecs specs)
private

Definition at line 38 of file TTUConfigurator.cc.

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

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

◆ addData() [2/2]

void TTUConfigurator::addData ( TTUBoardSpecs specs)
private

Definition at line 46 of file TTUConfigurator.cc.

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

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::ifstream m_in

◆ getRbcSpecs()

RBCBoardSpecs* TTUConfigurator::getRbcSpecs ( )
inline

Definition at line 36 of file TTUConfigurator.h.

References m_rbcspecs.

36 { return &m_rbcspecs; };
RBCBoardSpecs m_rbcspecs

◆ getTtuSpecs()

TTUBoardSpecs* TTUConfigurator::getTtuSpecs ( )
inline

Definition at line 38 of file TTUConfigurator.h.

References m_ttuspecs.

38 { return &m_ttuspecs; };
TTUBoardSpecs m_ttuspecs

◆ process()

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

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